Skip to content

Commit 6914d70

Browse files
authored
Merge pull request #11 from projf/oserdes-async-enhancements
Oserdes async enhancements
2 parents 0e310d2 + 3bf22c9 commit 6914d70

File tree

4 files changed

+41
-14
lines changed

4 files changed

+41
-14
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@ The [demo](hdl/demo) directory includes a demo for each supported interface:
6060

6161
You can find the list of required modules for each demo in a comment at the top of its file. You'll also need suitable constraints, such as those from the Project F [hardware support](https://github.com/projf/hardware-support) repo.
6262

63-
There are also two test cards that the demo modules can use:
63+
There are also three test cards that the demo modules can use:
6464

65-
* **[Test Card](hdl/demo/test_card.v)** - generates a video test card based on provided resolution
66-
* **[Test Card Simple](hdl/demo/test_card_simple.v)** - generates a simple coloured border based on provided resolution
65+
* **[Test Card Simple](hdl/demo/test_card_simple.v)** - simple coloured border (1-bit per colour and two shades of grey)
66+
* **[Test Card Squares](hdl/demo/test_card_squares.v)** - squares and lines of different colours (1-bit per colour)
67+
* **[Test Card Gradient](hdl/demo/test_card_gradient.v)** - colour gradient (8-bit per colour)
6768

6869
You can adjust the demo resolution by changing the parameters for `display_clocks`, `display_timings`, and `test_card` or `test_card_simple`. Comments in the demos provide settings for tested [resolutions](#display-resolution-support).
6970

@@ -122,7 +123,7 @@ The following table shows utilization of the display-controller with the gradien
122123
Artix-7
123124
Interface LUT FF
124125
-----------------------------
125-
DVI on FPGA 278 78
126+
DVI on FPGA 278 86
126127
DVI BML 3-bit 49 32
127128
DVI BML 24-bit TBC TBC
128129
VGA 12-bit 67 32

hdl/demo/test_card_simple.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module test_card_simple #(H_RES=640) (
2525
wire b7 = (i_x >= HW * 7) & (i_x < HW * 8);
2626

2727
// Colour Output
28-
assign o_red = {8{b0 | b1 | b5}} + {1'b0,{7{b6}}} + {2'b0,{6{b7}}};
29-
assign o_green = {8{b1 | b2 | b3}} + {1'b0,{7{b6}}} + {2'b0,{6{b7}}};
30-
assign o_blue = {8{b3 | b4 | b5}} + {1'b0,{7{b6}}} + {2'b0,{6{b7}}};
28+
assign o_red = {8{b0 | b1 | b5}} + {2'b0,{6{b6}}} + {b7, 7'b0};
29+
assign o_green = {8{b1 | b2 | b3}} + {2'b0,{6{b6}}} + {b7, 7'b0};
30+
assign o_blue = {8{b3 | b4 | b5}} + {2'b0,{6{b6}}} + {b7, 7'b0};
3131
endmodule

hdl/serializer_10to1.v

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ module serializer_10to1(
1515

1616
// asynchronous reset
1717
reg rst_oserdes; // oserdes reset (active high)
18-
reg [2:0] rst_shf; // reset shift reg
18+
(* ASYNC_REG = "TRUE" *) reg [1:0] rst_shf; // reset shift reg
19+
20+
initial rst_oserdes = 1'b1; // start of with reset asserted
21+
initial rst_shf = 2'b11; // and reset shift reg populated
1922

2023
always @(posedge i_clk or posedge i_rst)
2124
if (i_rst)
22-
{rst_oserdes, rst_shf} <= 4'b1111;
25+
{rst_oserdes, rst_shf} <= 3'b111;
2326
else
2427
{rst_oserdes, rst_shf} <= {rst_shf, 1'b0};
2528

26-
wire shift1, shift2; // wires between oserdes
29+
// use two OSERDES2 to serialize 10-bit TMDS data
30+
wire shift1, shift2; // wires between oserdes master and slave
2731

2832
OSERDESE2 #(
2933
.DATA_RATE_OQ("DDR"), // DDR, SDR

hdl/test/serializer_10to1_tb.v

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,39 @@ module serializer_10to1_tb();
2626
rst <= 0;
2727
clk_lock <= 0;
2828

29-
#2
30-
rst <= 1; // assert async
29+
#1.5
30+
rst <= 1; // assert reset async
3131

32-
#18
32+
#18.5
3333
rst <= 0;
3434

3535
#20
36-
clk_lock <=1;
36+
clk_lock <= 1;
3737
tmds_data_1 <= 10'b0110100110;
3838
tmds_data_2 <= 10'b1001011001;
3939
tmds_data_3 <= 10'b1100000010;
40+
41+
#100
42+
tmds_data_1 <= 10'b1111111111;
43+
tmds_data_2 <= 10'b1010101010;
44+
tmds_data_3 <= 10'b0000000000;
45+
46+
#2
47+
clk_lock <= 0; // simulate loss of clock lock
48+
49+
#23
50+
clk_lock <= 1;
51+
52+
#125
53+
tmds_data_1 <= 10'b0110100110;
54+
tmds_data_2 <= 10'b1001011001;
55+
tmds_data_3 <= 10'b1100000010;
56+
57+
#101.25
58+
rst <= 1; // assert reset async
59+
60+
#11.5
61+
rst <= 0; // de-assert reset async
4062
end
4163

4264
serializer_10to1 serialize_data_1 (

0 commit comments

Comments
 (0)