summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2011-11-10 03:10:20 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2014-02-11 02:07:50 (GMT)
commitfd68e979a0ae2430c20b5014a5616c9c2768e945 (patch)
treee108242c98d816f5d2138e90ffb9395b8d5b24af
parent2f61f743f83613e35ef8692ca30213bf74f62246 (diff)
downloadabc8000-fd68e979a0ae2430c20b5014a5616c9c2768e945.zip
abc8000-fd68e979a0ae2430c20b5014a5616c9c2768e945.tar.gz
abc8000-fd68e979a0ae2430c20b5014a5616c9c2768e945.tar.bz2
abc8000-fd68e979a0ae2430c20b5014a5616c9c2768e945.tar.xz
display: make vdu_ack combinatorial
Make vdu_ack combinatorial, so the memory unit observes data being consumed when it happens and not a pixel later.
-rw-r--r--display.v11
1 files changed, 3 insertions, 8 deletions
diff --git a/display.v b/display.v
index efad8d7..18422e8 100644
--- a/display.v
+++ b/display.v
@@ -117,9 +117,6 @@ module display (
assign vblank_n = ~vblank_q;
// Handshaking with memory controller
- reg vdu_ack_q;
-
- assign vdu_ack = vdu_ack_q;
assign vdu_a = rowaddr[25:4];
assign vdu_cnt = ( ctl_mode == 2'b00 ) ? 7'd11 :
( ctl_mode == 2'b01 ) ? 7'd21 :
@@ -245,6 +242,9 @@ module display (
5'b011_11: advance = (xctr[3:0] > { 3'b111, ~rowaddr[3] });
endcase // casex( { yblank, xblank, &xctr[9:4], ctl_mode } )
+ // This signal is true when consuming data from vdu_d
+ assign vdu_ack = advance & ~|pixelcnt;
+
always @(negedge rst_n or posedge clk)
if (~rst_n)
begin
@@ -255,19 +255,14 @@ module display (
rowaddr <= 22'hxxxxxx;
pixeldata <= 16'hxxxx;
pixelcnt <= 4'd0;
-
- vdu_ack_q <= 1'b0;
end // if (~rst_n)
else
begin
- vdu_ack_q <= 1'b0;
-
if ( advance )
begin
if ( ~|pixelcnt )
begin
pixeldata <= vdu_d;
- vdu_ack_q <= 1'b1;
case (ctl_mode)
2'b00: pixelcnt <= 4'd15;
2'b01: pixelcnt <= 4'd7;