From 2f3ee5665d1dc7190cce4c61fde28e01dc49679b Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 4 Nov 2016 17:15:50 -0600 Subject: display.v: use the stabilizer for fgctl_q Now when we have a generic stabilizer, use it to stabilize fgctl_q. Signed-off-by: H. Peter Anvin --- display.v | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/display.v b/display.v index 10e4f23..c1ec19d 100644 --- a/display.v +++ b/display.v @@ -97,8 +97,7 @@ module display ( reg prefetch; // True for the prefetch character position // Fine Graphics control - wire [7:0] v_fgctl; // Synchronized version of fg_ctl - reg [7:0] fgctl_q; // Latched version of fg_ctl + wire [7:0] fgctl_q; // Latched version of fg_ctl reg [1:0] fgpixel; // One fg pixel from FIFO // Block graphics data @@ -142,9 +141,10 @@ module display ( synchronize width_sync (.reset(1'b0), .clk(clk), .d(width), .q(v_width)); - // Synchronize fg_ctl input - synchronize #(.width(8)) - fg_ctl_sync (.reset(1'b0), .clk(clk), .d(fg_ctl), .q(v_fgctl)); + // Synchronize fg_ctl input, update during vsync only + synchronize #(.width(8), .stabilize(1)) + fg_ctl_sync (.reset(1'b0), .clk(clk), .enable (~video_y), + .d(fg_ctl), .q(fgctl_q)); // Should we advance the character pixel? // We need to always advance at full speed during prefetch, or @@ -224,10 +224,6 @@ module display ( wire [3:0] fg_argb; - always @(posedge clk) - if ( ~yvideo ) // Only change mode during vertical blank - fgctl_q <= v_fgctl; - always @(posedge clk) if (~x[0]) fgpixel <= fg_data; -- cgit v1.2.3