Skip to content

Commit

Permalink
after first round of review
Browse files Browse the repository at this point in the history
  • Loading branch information
FilMarini committed Oct 10, 2024
1 parent 6635803 commit 146c7f6
Show file tree
Hide file tree
Showing 69 changed files with 966 additions and 55 deletions.
1 change: 0 additions & 1 deletion ethernet/EthMacCore/ruckus.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source $::env(RUCKUS_PROC_TCL)

# Load Source Code
loadSource -lib surf -dir "$::DIR_PATH/rtl"
loadRuckusTcl "$::DIR_PATH/RoCEv2"

# Load Simulation
loadSource -lib surf -sim_only -dir "$::DIR_PATH/tb"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
assign m_crc_stream_valid = crc_rawBusMaster_fifo_EMPTY_N ;

// submodule crc_crcAxiStream_crcReqBuf
BluespecFifo2 #(.width(32'd290),
FIFO2 #(.width(32'd290),
.guarded(1'd1)) crc_crcAxiStream_crcReqBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcReqBuf_D_IN),
Expand All @@ -699,7 +699,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_crcAxiStream_crcReqBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_accuCrcResBuf
BluespecFifo2 #(.width(32'd72),
FIFO2 #(.width(32'd72),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_accuCrcResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_accuCrcResBuf_D_IN),
Expand Down Expand Up @@ -1359,7 +1359,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.D_OUT_5());

// submodule crc_crcAxiStream_crcRespFifoOut_finalCrcResBuf
BluespecFifo2 #(.width(32'd32),
FIFO2 #(.width(32'd32),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_finalCrcResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_finalCrcResBuf_D_IN),
Expand All @@ -1371,7 +1371,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_finalCrcResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_preProcessResBuf
BluespecFifo2 #(.width(32'd264),
FIFO2 #(.width(32'd264),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_preProcessResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_preProcessResBuf_D_IN),
Expand All @@ -1383,7 +1383,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_preProcessResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_readCrcTabResBuf
BluespecFifo2 #(.width(32'd1032),
FIFO2 #(.width(32'd1032),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_readCrcTabResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_readCrcTabResBuf_D_IN),
Expand All @@ -1395,7 +1395,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_readCrcTabResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_readInterCrcTabResBuf
BluespecFifo2 #(.width(32'd1184),
FIFO2 #(.width(32'd1184),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_readInterCrcTabResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_readInterCrcTabResBuf_D_IN),
Expand All @@ -1407,7 +1407,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_readInterCrcTabResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_reduceCrcResBuf
BluespecFifo2 #(.width(32'd40),
FIFO2 #(.width(32'd40),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_reduceCrcResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_reduceCrcResBuf_D_IN),
Expand All @@ -1419,7 +1419,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_reduceCrcResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_shiftInputResBuf
BluespecFifo2 #(.width(32'd264),
FIFO2 #(.width(32'd264),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_shiftInputResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_shiftInputResBuf_D_IN),
Expand All @@ -1431,7 +1431,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_shiftInputResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_shiftInterCrcResBuf
BluespecFifo2 #(.width(32'd320),
FIFO2 #(.width(32'd320),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_shiftInterCrcResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_shiftInterCrcResBuf_D_IN),
Expand All @@ -1443,7 +1443,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_shiftInterCrcResBuf_EMPTY_N));

// submodule crc_rawAxiStreamSlave_rawBus_fifo
BluespecFifo2 #(.width(32'd290),
FIFO2 #(.width(32'd290),
.guarded(1'd1)) crc_rawAxiStreamSlave_rawBus_fifo(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_rawAxiStreamSlave_rawBus_fifo_D_IN),
Expand All @@ -1455,7 +1455,7 @@ module mkCrcRawAxiStreamCustomRecv(CLK,
.EMPTY_N(crc_rawAxiStreamSlave_rawBus_fifo_EMPTY_N));

// submodule crc_rawBusMaster_fifo
BluespecFifo2 #(.width(32'd32), .guarded(1'd1)) crc_rawBusMaster_fifo(.RST(RST_N),
FIFO2 #(.width(32'd32), .guarded(1'd1)) crc_rawBusMaster_fifo(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_rawBusMaster_fifo_D_IN),
.ENQ(crc_rawBusMaster_fifo_ENQ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
assign m_crc_stream_valid = crc_rawBusMaster_fifo_EMPTY_N ;

// submodule crc_crcAxiStream_crcReqBuf
BluespecFifo2 #(.width(32'd290),
FIFO2 #(.width(32'd290),
.guarded(1'd1)) crc_crcAxiStream_crcReqBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcReqBuf_D_IN),
Expand All @@ -691,7 +691,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_crcAxiStream_crcReqBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_accuCrcResBuf
BluespecFifo2 #(.width(32'd72),
FIFO2 #(.width(32'd72),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_accuCrcResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_accuCrcResBuf_D_IN),
Expand Down Expand Up @@ -1351,7 +1351,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.D_OUT_5());

// submodule crc_crcAxiStream_crcRespFifoOut_finalCrcResBuf
BluespecFifo2 #(.width(32'd32),
FIFO2 #(.width(32'd32),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_finalCrcResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_finalCrcResBuf_D_IN),
Expand All @@ -1363,7 +1363,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_finalCrcResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_preProcessResBuf
BluespecFifo2 #(.width(32'd264),
FIFO2 #(.width(32'd264),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_preProcessResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_preProcessResBuf_D_IN),
Expand All @@ -1375,7 +1375,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_preProcessResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_readCrcTabResBuf
BluespecFifo2 #(.width(32'd1032),
FIFO2 #(.width(32'd1032),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_readCrcTabResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_readCrcTabResBuf_D_IN),
Expand All @@ -1387,7 +1387,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_readCrcTabResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_readInterCrcTabResBuf
BluespecFifo2 #(.width(32'd1184),
FIFO2 #(.width(32'd1184),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_readInterCrcTabResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_readInterCrcTabResBuf_D_IN),
Expand All @@ -1399,7 +1399,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_readInterCrcTabResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_reduceCrcResBuf
BluespecFifo2 #(.width(32'd40),
FIFO2 #(.width(32'd40),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_reduceCrcResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_reduceCrcResBuf_D_IN),
Expand All @@ -1411,7 +1411,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_reduceCrcResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_shiftInputResBuf
BluespecFifo2 #(.width(32'd264),
FIFO2 #(.width(32'd264),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_shiftInputResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_shiftInputResBuf_D_IN),
Expand All @@ -1423,7 +1423,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_shiftInputResBuf_EMPTY_N));

// submodule crc_crcAxiStream_crcRespFifoOut_shiftInterCrcResBuf
BluespecFifo2 #(.width(32'd320),
FIFO2 #(.width(32'd320),
.guarded(1'd1)) crc_crcAxiStream_crcRespFifoOut_shiftInterCrcResBuf(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_crcAxiStream_crcRespFifoOut_shiftInterCrcResBuf_D_IN),
Expand All @@ -1435,7 +1435,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_crcAxiStream_crcRespFifoOut_shiftInterCrcResBuf_EMPTY_N));

// submodule crc_rawAxiStreamSlave_rawBus_fifo
BluespecFifo2 #(.width(32'd290),
FIFO2 #(.width(32'd290),
.guarded(1'd1)) crc_rawAxiStreamSlave_rawBus_fifo(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_rawAxiStreamSlave_rawBus_fifo_D_IN),
Expand All @@ -1447,7 +1447,7 @@ module mkCrcRawAxiStreamCustomSend(CLK,
.EMPTY_N(crc_rawAxiStreamSlave_rawBus_fifo_EMPTY_N));

// submodule crc_rawBusMaster_fifo
BluespecFifo2 #(.width(32'd32), .guarded(1'd1)) crc_rawBusMaster_fifo(.RST(RST_N),
FIFO2 #(.width(32'd32), .guarded(1'd1)) crc_rawBusMaster_fifo(.RST(RST_N),
.CLK(CLK),
.D_IN(crc_rawBusMaster_fifo_D_IN),
.ENQ(crc_rawBusMaster_fifo_ENQ),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
94 changes: 94 additions & 0 deletions ethernet/RoCEv2/blue-lib/BRAM2.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@

`ifdef BSV_ASSIGNMENT_DELAY
`else
`define BSV_ASSIGNMENT_DELAY
`endif

// Dual-Ported BRAM (WRITE FIRST)
module BRAM2(CLKA,
ENA,
WEA,
ADDRA,
DIA,
DOA,
CLKB,
ENB,
WEB,
ADDRB,
DIB,
DOB
);

parameter PIPELINED = 0;
parameter ADDR_WIDTH = 1;
parameter DATA_WIDTH = 1;
parameter MEMSIZE = 1;

input CLKA;
input ENA;
input WEA;
input [ADDR_WIDTH-1:0] ADDRA;
input [DATA_WIDTH-1:0] DIA;
output [DATA_WIDTH-1:0] DOA;

input CLKB;
input ENB;
input WEB;
input [ADDR_WIDTH-1:0] ADDRB;
input [DATA_WIDTH-1:0] DIB;
output [DATA_WIDTH-1:0] DOB;

reg [DATA_WIDTH-1:0] RAM[0:MEMSIZE-1] /* synthesis syn_ramstyle="no_rw_check" */ ;
reg [DATA_WIDTH-1:0] DOA_R;
reg [DATA_WIDTH-1:0] DOB_R;
reg [DATA_WIDTH-1:0] DOA_R2;
reg [DATA_WIDTH-1:0] DOB_R2;

`ifdef BSV_NO_INITIAL_BLOCKS
`else
// synopsys translate_off
integer i;
initial
begin : init_block
for (i = 0; i < MEMSIZE; i = i + 1) begin
RAM[i] = { ((DATA_WIDTH+1)/2) { 2'b10 } };
end
DOA_R = { ((DATA_WIDTH+1)/2) { 2'b10 } };
DOB_R = { ((DATA_WIDTH+1)/2) { 2'b10 } };
DOA_R2 = { ((DATA_WIDTH+1)/2) { 2'b10 } };
DOB_R2 = { ((DATA_WIDTH+1)/2) { 2'b10 } };
end
// synopsys translate_on
`endif // !`ifdef BSV_NO_INITIAL_BLOCKS

always @(posedge CLKA) begin
if (ENA) begin
if (WEA) begin
RAM[ADDRA] <= `BSV_ASSIGNMENT_DELAY DIA;
DOA_R <= `BSV_ASSIGNMENT_DELAY DIA;
end
else begin
DOA_R <= `BSV_ASSIGNMENT_DELAY RAM[ADDRA];
end
end
DOA_R2 <= `BSV_ASSIGNMENT_DELAY DOA_R;
end

always @(posedge CLKB) begin
if (ENB) begin
if (WEB) begin
RAM[ADDRB] <= `BSV_ASSIGNMENT_DELAY DIB;
DOB_R <= `BSV_ASSIGNMENT_DELAY DIB;
end
else begin
DOB_R <= `BSV_ASSIGNMENT_DELAY RAM[ADDRB];
end
end
DOB_R2 <= `BSV_ASSIGNMENT_DELAY DOB_R;
end

// Output drivers
assign DOA = (PIPELINED) ? DOA_R2 : DOA_R;
assign DOB = (PIPELINED) ? DOB_R2 : DOB_R;

endmodule // BRAM2
13 changes: 13 additions & 0 deletions ethernet/RoCEv2/blue-lib/BypassWire.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

module BypassWire(WGET, WVAL);


parameter width = 1;

input [width - 1 : 0] WVAL;

output [width - 1 : 0] WGET;

assign WGET = WVAL;

endmodule
Loading

0 comments on commit 146c7f6

Please sign in to comment.