Line 58... |
Line 58... |
// Parameters
|
// Parameters
|
|
|
parameter DWIDTH = 32;
|
parameter DWIDTH = 32;
|
parameter AWIDTH = 3;
|
parameter AWIDTH = 3;
|
parameter RAM_DEPTH = (1 << AWIDTH);
|
parameter RAM_DEPTH = (1 << AWIDTH);
|
parameter SYNC_WRITE = 1;
|
|
parameter SYNC_READ = 1;
|
|
parameter REGISTER_READ = 0;
|
parameter REGISTER_READ = 0;
|
parameter EARLY_READ = 0;
|
parameter EARLY_READ = 0;
|
parameter CLOCK_CROSSING = 1;
|
parameter CLOCK_CROSSING = 1;
|
parameter ALMOST_EMPTY_THRESH = 1;
|
parameter ALMOST_EMPTY_THRESH = 1;
|
parameter ALMOST_FULL_THRESH = RAM_DEPTH-2;
|
parameter ALMOST_FULL_THRESH = RAM_DEPTH-2;
|
Line 126... |
Line 124... |
if (MEM_TYPE == `MEM_AUTO_SMALL) begin
|
if (MEM_TYPE == `MEM_AUTO_SMALL) begin
|
|
|
generic_mem_small #(.DWIDTH (DWIDTH),
|
generic_mem_small #(.DWIDTH (DWIDTH),
|
.AWIDTH (AWIDTH),
|
.AWIDTH (AWIDTH),
|
.RAM_DEPTH (RAM_DEPTH),
|
.RAM_DEPTH (RAM_DEPTH),
|
.SYNC_WRITE (SYNC_WRITE),
|
|
.SYNC_READ (SYNC_READ),
|
|
.REGISTER_READ (REGISTER_READ)
|
.REGISTER_READ (REGISTER_READ)
|
)
|
)
|
mem0(.wclk (wclk),
|
mem0(.wclk (wclk),
|
.wrst_n (wrst_n),
|
.wrst_n (wrst_n),
|
.wen (mem_wen),
|
.wen (mem_wen),
|
.waddr (mem_waddr),
|
.waddr (mem_waddr[AWIDTH-1:0]),
|
.wdata (wdata),
|
.wdata (wdata),
|
|
|
.rclk (rclk),
|
.rclk (rclk),
|
.rrst_n (rrst_n),
|
.rrst_n (rrst_n),
|
.ren (mem_ren),
|
.ren (mem_ren),
|
.roen (ren),
|
.roen (ren),
|
.raddr (mem_raddr),
|
.raddr (mem_raddr[AWIDTH-1:0]),
|
.rdata (rdata)
|
.rdata (rdata)
|
);
|
);
|
|
|
end
|
end
|
|
|
if (MEM_TYPE == `MEM_AUTO_MEDIUM) begin
|
if (MEM_TYPE == `MEM_AUTO_MEDIUM) begin
|
|
|
generic_mem_medium #(.DWIDTH (DWIDTH),
|
generic_mem_medium #(.DWIDTH (DWIDTH),
|
.AWIDTH (AWIDTH),
|
.AWIDTH (AWIDTH),
|
.RAM_DEPTH (RAM_DEPTH),
|
.RAM_DEPTH (RAM_DEPTH),
|
.SYNC_WRITE (SYNC_WRITE),
|
|
.SYNC_READ (SYNC_READ),
|
|
.REGISTER_READ (REGISTER_READ)
|
.REGISTER_READ (REGISTER_READ)
|
)
|
)
|
mem0(.wclk (wclk),
|
mem0(.wclk (wclk),
|
.wrst_n (wrst_n),
|
.wrst_n (wrst_n),
|
.wen (mem_wen),
|
.wen (mem_wen),
|
.waddr (mem_waddr),
|
.waddr (mem_waddr[AWIDTH-1:0]),
|
.wdata (wdata),
|
.wdata (wdata),
|
|
|
.rclk (rclk),
|
.rclk (rclk),
|
.rrst_n (rrst_n),
|
.rrst_n (rrst_n),
|
.ren (mem_ren),
|
.ren (mem_ren),
|
.roen (ren),
|
.roen (ren),
|
.raddr (mem_raddr),
|
.raddr (mem_raddr[AWIDTH-1:0]),
|
.rdata (rdata)
|
.rdata (rdata)
|
);
|
);
|
|
|
end
|
end
|
|
|
endgenerate
|
endgenerate
|
|
|
endmodule
|
endmodule
|
|
|
|
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|