Skip to content

Commit

Permalink
bench: c4 CSV TB
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Jan 5, 2024
1 parent 6f11459 commit abeda8b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions benchmarks/fpga-debugging/axis-async-fifo-c4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module axis_async_fifo #
reg [ADDR_WIDTH:0] wr_ptr = {ADDR_WIDTH+1{1'b0}};
reg [ADDR_WIDTH:0] wr_ptr_next;
reg [ADDR_WIDTH:0] wr_ptr_gray = {ADDR_WIDTH+1{1'b0}};
reg [ADDR_WIDTH:0] rd_ptr = {ADDR_WIDTH+1{1'b0}}
reg [ADDR_WIDTH:0] rd_ptr = {ADDR_WIDTH+1{1'b0}};
reg [ADDR_WIDTH:0] rd_ptr_next;
reg [ADDR_WIDTH:0] rd_ptr_gray = {ADDR_WIDTH+1{1'b0}};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module axis_async_fifo #
reg [ADDR_WIDTH:0] wr_ptr = {ADDR_WIDTH+1{1'b0}};
reg [ADDR_WIDTH:0] wr_ptr_next;
reg [ADDR_WIDTH:0] wr_ptr_gray = {ADDR_WIDTH+1{1'b0}};
reg [ADDR_WIDTH:0] rd_ptr = {ADDR_WIDTH+1{1'b0}}
reg [ADDR_WIDTH:0] rd_ptr = {ADDR_WIDTH+1{1'b0}};
reg [ADDR_WIDTH:0] rd_ptr_next;
reg [ADDR_WIDTH:0] rd_ptr_gray = {ADDR_WIDTH+1{1'b0}};

Expand Down Expand Up @@ -102,7 +102,6 @@ wire read = (output_axis_tready | ~output_axis_tvalid_reg) & ~empty;

assign {output_axis_tlast, output_axis_tuser, output_axis_tdata} = data_out_reg;

// FIX: assign input_axis_tready = ~full & ~input_rst_sync3;
assign input_axis_tready = ~full;
assign output_axis_tvalid = output_axis_tvalid_reg;

Expand Down
11 changes: 11 additions & 0 deletions benchmarks/fpga-debugging/axis-async-fifo-c4/tb.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
async_rst, input_axis_tdata, input_axis_tvalid, input_axis_tready, input_axis_tlast, input_axis_tuser, output_axis_tdata, output_axis_tvalid, output_axis_tready, output_axis_tlast, output_axis_tuser
1, 0,0,0,0,0, 0,0,0,0,0
0, 1,0,0,0,0, 0,0,1,0,0
0, 1,1,1,1,0, 0,0,1,0,0
0, 2,1,x,1,0, 0,0,1,0,0
0, 2,1,0,1,0, 0,0,1,0,0
0, 2,1,1,1,0, 0,0,1,0,0
0, 3,1,1,1,0, 0,0,1,0,0
0, 4,1,1,1,0, 0,0,1,0,0
0, 5,1,1,1,0, 0,0,1,0,0
0, 6,1,1,1,0, 1,1,1,1,0
21 changes: 21 additions & 0 deletions benchmarks/fpga-debugging/axis-async-fifo-c4/tb.v
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ wire output_axis_tvalid;
wire output_axis_tlast;
wire output_axis_tuser;

integer f;
// dump I/O
initial begin
f = $fopen("output.txt");
$fwrite(f, "async_rst, input_axis_tdata, input_axis_tvalid, input_axis_tready, input_axis_tlast, input_axis_tuser, output_axis_tdata, output_axis_tvalid, output_axis_tready, output_axis_tlast, output_axis_tuser\n");
forever begin
@(posedge clk);
$fwrite(f, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",async_rst, input_axis_tdata, input_axis_tvalid, input_axis_tready, input_axis_tlast, input_axis_tuser, output_axis_tdata, output_axis_tvalid, output_axis_tready, output_axis_tlast, output_axis_tuser);
end
end


initial begin

async_rst = 1'b1;
Expand Down Expand Up @@ -126,4 +138,13 @@ UUT (
.output_axis_tuser(output_axis_tuser)
);


`ifdef DUMP_TRACE // used for our OSDD calculations
initial begin
$dumpfile("dump.vcd");
$dumpvars(0, UUT);
end
`endif // DUMP_TRACE


endmodule

0 comments on commit abeda8b

Please sign in to comment.