mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-30 02:32:53 +08:00
Updating broken fifo (wip)
This commit is contained in:
parent
69a0dd2d3d
commit
5744252f91
@ -33,21 +33,7 @@ module oh_fifo_async
|
||||
output [N-1:0] rd_dout, // output data (next cycle)
|
||||
input rd_en, // read fifo
|
||||
output rd_empty, // fifo is empty
|
||||
output [AW-1:0] rd_count, // pessimistic report of entries from rd side
|
||||
// BIST interface
|
||||
input bist_en, // bist enable
|
||||
input bist_we, // write enable global signal
|
||||
input [N-1:0] bist_wem, // write enable vector
|
||||
input [AW-1:0] bist_addr, // address
|
||||
input [N-1:0] bist_din, // data input
|
||||
input [N-1:0] bist_dout, // data input
|
||||
// Power/repair (hard macro only)
|
||||
input shutdown, // shutdown signal
|
||||
input vss, // ground signal
|
||||
input vdd, // memory array power
|
||||
input vddio, // periphery/io power
|
||||
input [7:0] memconfig, // generic memory config
|
||||
input [7:0] memrepair // repair vector
|
||||
output [AW-1:0] rd_count // pessimistic report of entries from rd side
|
||||
);
|
||||
|
||||
//local wires
|
||||
@ -57,7 +43,6 @@ module oh_fifo_async
|
||||
wire [AW:0] wr_addr_gray_sync;
|
||||
wire [AW:0] rd_addr_gray;
|
||||
wire [AW:0] rd_addr_gray_sync;
|
||||
wire [AW:0] rd_addr_sync;
|
||||
wire fifo_write;
|
||||
wire rd_nreset;
|
||||
wire wr_nreset;
|
||||
@ -100,14 +85,10 @@ module oh_fifo_async
|
||||
else if(rd_en)
|
||||
rd_addr[AW:0] <= rd_addr[AW:0] + 'd1;
|
||||
|
||||
//############################################
|
||||
//# Synchronizaztion logic for async FIFO
|
||||
//############################################
|
||||
//###########################
|
||||
//# WRITE --> READ SYNC
|
||||
//###########################
|
||||
|
||||
//###########################
|
||||
//# WRITE --> READ
|
||||
//###########################
|
||||
// convert to gray code (only one bit can toggle)
|
||||
oh_bin2gray #(.N(AW+1))
|
||||
wr_bin2gray (.out (wr_addr_gray[AW:0]),
|
||||
.in (wr_addr[AW:0]));
|
||||
@ -121,7 +102,7 @@ module oh_fifo_async
|
||||
.din (wr_addr_gray[AW:0]));
|
||||
|
||||
//###########################
|
||||
//# READ ---> WRITE
|
||||
//# READ ---> WRITE SYNC
|
||||
//###########################
|
||||
|
||||
oh_bin2gray #(.N(AW+1))
|
||||
@ -144,8 +125,8 @@ module oh_fifo_async
|
||||
assign rd_empty = (rd_addr_gray[AW:0] == wr_addr_gray_sync[AW:0]);
|
||||
|
||||
// fifo full
|
||||
assign wr_full = (wr_addr[AW-1:0] == rd_addr_sync[AW-1:0]) &
|
||||
(wr_addr[AW] != rd_addr_sync[AW]);
|
||||
assign wr_full = (wr_addr_gray[AW-1:0] == rd_addr_gray_sync[AW-1:0]) &
|
||||
(wr_addr_gray[AW] != rd_addr_gray_sync[AW]);
|
||||
|
||||
//###########################
|
||||
//# Memory Array
|
||||
@ -158,6 +139,17 @@ module oh_fifo_async
|
||||
.SHAPE(SHAPE))
|
||||
oh_dpram(.wr_wem ({(N){1'b1}}),
|
||||
.wr_en (fifo_write),
|
||||
.memconfig (8'b0),
|
||||
.memrepair (8'b0),
|
||||
.shutdown (1'b0),
|
||||
.vddio (1'b1),
|
||||
.vdd (1'b0),
|
||||
.vss (1'b0),
|
||||
.bist_en (1'b0),
|
||||
.bist_we (1'b0),
|
||||
.bist_wem ({(N){1'b0}}),
|
||||
.bist_addr ({(AW){1'b0}}),
|
||||
.bist_din ({(N){1'b0}}),
|
||||
/*AUTOINST*/
|
||||
// Outputs
|
||||
.rd_dout (rd_dout[N-1:0]),
|
||||
@ -167,17 +159,6 @@ module oh_fifo_async
|
||||
.wr_din (wr_din[N-1:0]),
|
||||
.rd_clk (rd_clk),
|
||||
.rd_en (rd_en),
|
||||
.rd_addr (rd_addr[AW-1:0]),
|
||||
.bist_en (bist_en),
|
||||
.bist_we (bist_we),
|
||||
.bist_wem (bist_wem[N-1:0]),
|
||||
.bist_addr (bist_addr[AW-1:0]),
|
||||
.bist_din (bist_din[N-1:0]),
|
||||
.shutdown (shutdown),
|
||||
.vss (vss),
|
||||
.vdd (vdd),
|
||||
.vddio (vddio),
|
||||
.memconfig (memconfig[7:0]),
|
||||
.memrepair (memrepair[7:0]));
|
||||
.rd_addr (rd_addr[AW-1:0]));
|
||||
|
||||
endmodule // oh_fifo_async
|
||||
|
@ -57,25 +57,12 @@ module oh_fifo_cdc
|
||||
|
||||
// parametric async fifo
|
||||
oh_fifo_async #(.TARGET(TARGET),
|
||||
.N(N),
|
||||
.DEPTH(DEPTH))
|
||||
oh_fifo_async (
|
||||
.rd_clk (clk_out),
|
||||
.DEPTH(DEPTH),
|
||||
.N(N))
|
||||
oh_fifo_async (.rd_clk (clk_out),
|
||||
.rd_dout (packet_out[N-1:0]),
|
||||
.wr_clk (clk_in),
|
||||
.wr_din (packet_in[N-1:0]),
|
||||
.memconfig (8'b0),
|
||||
.memrepair (8'b0),
|
||||
.shutdown (1'b0),
|
||||
.vddio (1'b1),
|
||||
.vdd (1'b0),
|
||||
.vss (1'b0),
|
||||
.bist_en (1'b0),
|
||||
.bist_we (1'b0),
|
||||
.bist_wem ({(N){1'b0}}),
|
||||
.bist_addr ({(AW){1'b0}}),
|
||||
.bist_din ({(N){1'b0}}),
|
||||
.bist_dout (),
|
||||
.wr_count (),
|
||||
.rd_count (),
|
||||
.rd_empty (empty),
|
||||
|
Loading…
x
Reference in New Issue
Block a user