data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv
1: b"%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:4: syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER or STRING\nimport fifo_types::*;\n       ^~~~~~~~~~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:24: syntax error, unexpected '@', expecting ';'\ndefault clocking tb_clk @(negedge itf.clk); endclocking\n                        ^\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:27: syntax error, unexpected <=, expecting IDENTIFIER\n    itf.reset_n <= 1'b0;\n                ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:29: syntax error, unexpected <=, expecting IDENTIFIER\n    itf.reset_n <= 1'b1;\n                ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:34: syntax error, unexpected '(', expecting IDENTIFIER\n    itf.tb_report_dut_error(err);\n                            ^~~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:41: syntax error, unexpected <=, expecting IDENTIFIER\n itf.valid_i <= 1'b1;\n             ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:43: syntax error, unexpected int, expecting IDENTIFIER or genvar\n for(int i = 0; i < cap_p; ++i) begin\n     ^~~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:55: syntax error, unexpected <=, expecting IDENTIFIER\n    itf.yumi <= 1'b1;\n             ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:56: syntax error, unexpected int, expecting IDENTIFIER or genvar\n        for(int i = 0; i < cap_p; ++i) begin\n            ^~~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:71: syntax error, unexpected int, expecting IDENTIFIER or genvar\n for(int i = 0; i < cap_p; ++i) begin\n     ^~~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:73: syntax error, unexpected <=, expecting IDENTIFIER\n  itf.data_i <= i + 1'b1;\n             ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:74: syntax error, unexpected <=, expecting IDENTIFIER\n  itf.yumi <= 1'b0;\n           ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:76: syntax error, unexpected <=, expecting IDENTIFIER\n  itf.yumi <= 1'b1;\n           ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:81: syntax error, unexpected <=, expecting IDENTIFIER\n itf.valid_i <= 1'b0;\n             ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:82: syntax error, unexpected <=, expecting IDENTIFIER\n itf.yumi <= 1'b0;\n          ^~\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:107: syntax error, unexpected '(', expecting IDENTIFIER\n    itf.finish();\n               ^\n%Error: data/full_repos/permissive/444559342/mp1/fifo/hvl/testbench.sv:109: syntax error, unexpected end\nend\n^~~\n%Error: Cannot continue\n"
module testbench(fifo_itf itf);

fifo_synch_1r1w dut (
    .clk_i     ( itf.clk     ),
    .reset_n_i ( itf.reset_n ),


    .data_i    ( itf.data_i  ),
    .valid_i   ( itf.valid_i ),
    .ready_o   ( itf.rdy     ),


    .valid_o   ( itf.valid_o ),
    .data_o    ( itf.data_o  ),
    .yumi_i    ( itf.yumi    )
);


default clocking tb_clk @(negedge itf.clk); endclocking

task reset();
    itf.reset_n <= 1'b0;
    ##(10);
    itf.reset_n <= 1'b1;
    ##(1);
endtask : reset

function automatic void report_error(error_e err); 
    itf.tb_report_dut_error(err);
endfunction : report_error



task enqueue();

	itf.valid_i <= 1'b1;
	
	for(int i = 0; i < cap_p; ++i) begin
		itf.data_i <= i;
		@(tb_clk);
	end
	
	itf.valid_i <= 1'b0;

endtask : enqueue

task dequeue();

	if(itf.valid_o) begin
		  itf.yumi <= 1'b1;
        for(int i = 0; i < cap_p; ++i) begin
            assert (itf.data_o == i)
                else begin
                    $error ("%0d: %0t: %s error detected", `__LINE__, $time, INCORRECT_DATA_O_ON_YUMI_I);
                    report_error (INCORRECT_DATA_O_ON_YUMI_I);
                end
				@(tb_clk);
        end
		  itf.yumi <= 1'b0;
	end

endtask : dequeue

task simultaneously();

	for(int i = 0; i < cap_p; ++i) begin
		itf.valid_i <= 1'b1;
		itf.data_i <= i + 1'b1;
		itf.yumi <= 1'b0;
		@(tb_clk);
		itf.yumi <= 1'b1;
		@(tb_clk);
	end
	
	@(tb_clk);
	itf.valid_i <= 1'b0;
	itf.yumi <= 1'b0;

endtask : simultaneously


initial begin
    reset();


	 
	 assert (itf.rdy)
	  else begin
		 $error ("%0d: %0t: %s error detected", `__LINE__, $time, RESET_DOES_NOT_CAUSE_READY_O);
		 report_error (RESET_DOES_NOT_CAUSE_READY_O);
	  end
	 
	 enqueue();
	 
	 dequeue();
	 
	 simultaneously();




    itf.finish();
    $error("TB: Illegal Exit ocurred");
end

endmodule
module testbench(fifo_itf itf);


fifo_synch_1r1w dut (
    .clk_i     ( itf.clk     ),
    .reset_n_i ( itf.reset_n ),


    .data_i    ( itf.data_i  ),
    .valid_i   ( itf.valid_i ),
    .ready_o   ( itf.rdy     ),


    .valid_o   ( itf.valid_o ),
    .data_o    ( itf.data_o  ),
    .yumi_i    ( itf.yumi    )
);


default clocking tb_clk @(negedge itf.clk); endclocking

task reset();
    itf.reset_n <= 1'b0;
    ##(10);
    itf.reset_n <= 1'b1;
    ##(1);
endtask : reset

function automatic void report_error(error_e err); 
    itf.tb_report_dut_error(err);
endfunction : report_error



task enqueue();

	itf.valid_i <= 1'b1;
	
	for(int i = 0; i < cap_p; ++i) begin
		itf.data_i <= i;
		@(tb_clk);
	end
	
	itf.valid_i <= 1'b0;

endtask : enqueue

task dequeue();

	if(itf.valid_o) begin
		  itf.yumi <= 1'b1;
        for(int i = 0; i < cap_p; ++i) begin
            assert (itf.data_o == i)
                else begin
                    $error ("%0d: %0t: %s error detected", `__LINE__, $time, INCORRECT_DATA_O_ON_YUMI_I);
                    report_error (INCORRECT_DATA_O_ON_YUMI_I);
                end
				@(tb_clk);
        end
		  itf.yumi <= 1'b0;
	end

endtask : dequeue

task simultaneously();

	for(int i = 0; i < cap_p; ++i) begin
		itf.valid_i <= 1'b1;
		itf.data_i <= i + 1'b1;
		itf.yumi <= 1'b0;
		@(tb_clk);
		itf.yumi <= 1'b1;
		@(tb_clk);
	end
	
	@(tb_clk);
	itf.valid_i <= 1'b0;
	itf.yumi <= 1'b0;

endtask : simultaneously


initial begin
    reset();


	 
	 assert (itf.rdy)
	  else begin
		 $error ("%0d: %0t: %s error detected", `__LINE__, $time, RESET_DOES_NOT_CAUSE_READY_O);
		 report_error (RESET_DOES_NOT_CAUSE_READY_O);
	  end
	 
	 enqueue();
	 
	 dequeue();
	 
	 simultaneously();




    itf.finish();
    $error("TB: Illegal Exit ocurred");
end

endmodule