data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v
1: b'%Warning-STMTDLY: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:25: Unsupported: Ignoring delay on this delayed statement.\n#t clk= ~clk;\n^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:30: syntax error, unexpected \'@\'\n  @(negedge clk);\n  ^\n%Error: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:32: syntax error, unexpected \'@\'\n  @(negedge clk);\n  ^\n%Error: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:39: syntax error, unexpected \'@\'\n   @(negedge clk);\n   ^\n%Error: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:41: syntax error, unexpected \'@\'\n   @(negedge clk);\n   ^\n%Error: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:48: syntax error, unexpected \'@\'\n     @(negedge clk)\n     ^\n%Error: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:58: syntax error, unexpected \'@\'\n    @(negedge clk);\n    ^\n%Error: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:64: syntax error, unexpected \'@\'\n@(negedge clk);\n^\n%Error: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:68: syntax error, unexpected \'@\'\n   @(negedge clk);\n   ^\n%Warning-STMTDLY: data/full_repos/permissive/455210247/TestBench/router_fifo_tb.v:86: Unsupported: Ignoring delay on this delayed statement.\n#10 read;\n^\n%Error: Exiting due to 8 error(s), 2 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module router_fifo_tb();

reg clk,resetn,soft_reset,w_en,r_en,lfd_state;
wire full,empty;
reg [7:0] data_in;
wire [7:0] data_out;
parameter t=10;

router_fifo dut(clk,resetn,soft_reset,w_en,r_en,lfd_state,data_in,full,empty,data_out);

reg [7:0]header,payload_data,parity;
reg [5:0]payload_l;
reg [1:0] d_addr;
integer i;

task initialize;
begin
{clk,soft_reset,w_en,r_en,lfd_state}=0;
resetn=1'b1;
end
endtask

always
begin
#t clk= ~clk;
end

task reset;
begin
  @(negedge clk);
   resetn=1'b0;
  @(negedge clk);
    resetn=1'b1;
  end
endtask

task s_reset;
begin
   @(negedge clk);
      soft_reset=1'b1;
   @(negedge clk);
     soft_reset=1'b0;
end
endtask

task pkt_gen;
begin
     @(negedge clk)
        payload_l=6'd8;
       d_addr=2'b01;
      header={payload_l,d_addr};
     data_in=header;
     lfd_state=1'b1;
     w_en=1'b1;

for(i=0;i<payload_l;i=i+1)
   begin
    @(negedge clk);
    lfd_state=0;
    payload_data={$random}%256;
     data_in=payload_data;
    end

@(negedge clk);
 parity={$random}%256;
   data_in=parity;
   
   @(negedge clk);
   w_en=1'b0;
end

endtask

task read;
begin
r_en=1'b1;
end
endtask

initial
begin
initialize;
reset;
s_reset;
pkt_gen;
#10 read;
end
endmodule
module router_fifo_tb();


reg clk,resetn,soft_reset,w_en,r_en,lfd_state;
wire full,empty;
reg [7:0] data_in;
wire [7:0] data_out;
parameter t=10;

router_fifo dut(clk,resetn,soft_reset,w_en,r_en,lfd_state,data_in,full,empty,data_out);

reg [7:0]header,payload_data,parity;
reg [5:0]payload_l;
reg [1:0] d_addr;
integer i;

task initialize;
begin
{clk,soft_reset,w_en,r_en,lfd_state}=0;
resetn=1'b1;
end
endtask

always
begin
#t clk= ~clk;
end

task reset;
begin
  @(negedge clk);
   resetn=1'b0;
  @(negedge clk);
    resetn=1'b1;
  end
endtask

task s_reset;
begin
   @(negedge clk);
      soft_reset=1'b1;
   @(negedge clk);
     soft_reset=1'b0;
end
endtask

task pkt_gen;
begin
     @(negedge clk)
        payload_l=6'd8;
       d_addr=2'b01;
      header={payload_l,d_addr};
     data_in=header;
     lfd_state=1'b1;
     w_en=1'b1;

for(i=0;i<payload_l;i=i+1)
   begin
    @(negedge clk);
    lfd_state=0;
    payload_data={$random}%256;
     data_in=payload_data;
    end

@(negedge clk);
 parity={$random}%256;
   data_in=parity;
   
   @(negedge clk);
   w_en=1'b0;
end

endtask

task read;
begin
r_en=1'b1;
end
endtask

initial
begin
initialize;
reset;
s_reset;
pkt_gen;
#10 read;
end
endmodule