1
0
mirror of synced 2026-04-24 19:40:49 +00:00

docs: Move fifo localparams into module def

Fix for failing CI.
This commit is contained in:
Krystine Sherwin
2024-03-18 10:02:40 +13:00
parent 3635f911dc
commit bc9cccacf2
3 changed files with 69 additions and 70 deletions

View File

@@ -1,11 +1,10 @@
// address generator/counter
module addr_gen
#( parameter MAX_DATA=256
#( parameter MAX_DATA=256,
localparam AWIDTH = $clog2(MAX_DATA)
) ( input en, clk, rst,
output reg [AWIDTH-1:0] addr
);
localparam AWIDTH = $clog2(MAX_DATA);
initial addr <= 0;
// async reset
@@ -23,14 +22,13 @@ endmodule //addr_gen
// Define our top level fifo entity
module fifo
#( parameter MAX_DATA=256
#( parameter MAX_DATA=256,
localparam AWIDTH = $clog2(MAX_DATA)
) ( input wen, ren, clk, rst,
input [7:0] wdata,
output reg [7:0] rdata,
output reg [AWIDTH:0] count
);
localparam AWIDTH = $clog2(MAX_DATA);
// fifo storage
// sync read before write
wire [AWIDTH-1:0] waddr, raddr;