Compare commits

...

2 Commits

Author SHA1 Message Date
Luca 3d91b7e16f fix: divide sys_clk by 2 for dvi_bus_clk 2024-10-19 20:24:40 +02:00
Luca e6676cc995 fix: driver conflicts 2024-10-19 20:23:33 +02:00
2 changed files with 16 additions and 10 deletions

18
dvi.v
View File

@ -80,11 +80,7 @@ module dvi #(
x <= 12'b0; x <= 12'b0;
y <= 11'b0; y <= 11'b0;
if (~reset) begin if (~reset) output_state <= OUTPUT_BLANK;
ck <= 0;
output_state <= OUTPUT_BLANK;
end
end end
OUTPUT_BLANK: begin OUTPUT_BLANK: begin
if (y >= V_ACTIVE_START && y < V_BLANK_START && x == H_ACTIVE_START-1) output_state <= OUTPUT_DATA; if (y >= V_ACTIVE_START && y < V_BLANK_START && x == H_ACTIVE_START-1) output_state <= OUTPUT_DATA;
@ -94,9 +90,6 @@ module dvi #(
y <= y + 1; y <= y + 1;
if (y == V_TOTAL-1) begin if (y == V_TOTAL-1) begin
bus_addr <= BASE_ADDR;
fetch_state <= FETCH_LOW;
y <= 11'b0; y <= 11'b0;
end end
end end
@ -124,7 +117,14 @@ module dvi #(
end end
always @(negedge bus_clk) begin always @(negedge bus_clk) begin
if (output_state != OUTPUT_IDLE) ck <= ~ck; if (output_state == OUTPUT_IDLE) ck <= 0;
else ck <= ~ck;
if (y == 11'b0) begin
bus_addr <= BASE_ADDR;
fetch_state <= FETCH_LOW;
end
if (fetch_en) begin if (fetch_en) begin
data[active_data] <= {12'b0, data[active_data][47:12]}; data[active_data] <= {12'b0, data[active_data][47:12]};

View File

@ -27,10 +27,16 @@ module pixelflut (
end end
end end
reg dvi_bus_clk;
always @(posedge sys_clk) begin
dvi_bus_clk <= ~dvi_bus_clk;
end
wire [15:0] dvi_bus; wire [15:0] dvi_bus;
dvi display ( dvi display (
.bus_clk (sys_clk), .bus_clk (dvi_bus_clk),
.bus_data(dvi_bus), .bus_data(dvi_bus),
.bus_addr(dvi_bus), .bus_addr(dvi_bus),
.reset (1'b0), .reset (1'b0),