From 9e47bbb499484ae92be6c3c9d96f4df0f73ddcd6 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 4 Dec 2008 06:12:51 +0000 Subject: speed up the diagnostic signals, they were causing timing problems git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10101 221aa14e-8319-0410-a670-987f0aec2ac5 --- control_lib/longfifo.v | 46 +++++++++++++++++++++++++++++++++++++--------- control_lib/shortfifo.v | 32 ++++++++++++++++++++++++++++---- 2 files changed, 65 insertions(+), 13 deletions(-) (limited to 'control_lib') diff --git a/control_lib/longfifo.v b/control_lib/longfifo.v index c73cc76f8..bf3338e0b 100644 --- a/control_lib/longfifo.v +++ b/control_lib/longfifo.v @@ -15,8 +15,8 @@ module longfifo input clear, output full, output empty, - output [15:0] space, - output [15:0] occupied); + output reg [15:0] space, + output reg [15:0] occupied); // Read side states localparam EMPTY = 0; @@ -26,12 +26,6 @@ module longfifo reg [SIZE-1:0] wr_addr, rd_addr; reg [1:0] read_state; - wire [SIZE-1:0] fullness = wr_addr - rd_addr; // Approximate, for simulation only - assign occupied = {{16-SIZE{1'b0}},fullness}; - - wire [SIZE-1:0] free_space = rd_addr - wr_addr - 2; // Approximate, for SERDES flow control - assign space = {{16-SIZE{1'b0}},free_space}; - reg empty_reg, full_reg; always @(posedge clk) if(rst) @@ -43,7 +37,7 @@ module longfifo ram_2port #(.DWIDTH(WIDTH),.AWIDTH(SIZE)) ram (.clka(clk), - .ena(1), + .ena(1'b1), .wea(write), .addra(wr_addr), .dia(datain), @@ -118,5 +112,39 @@ module longfifo // assign full = ((rd_addr - 1) == wr_addr); assign full = full_reg; + + ////////////////////////////////////////////// + // space and occupied are for diagnostics only + // not guaranteed exact + + localparam NUMLINES = (1<