data/full_repos/permissive/147790758/tb2_dmux.v
None: at end of input
1: b'%Warning-STMTDLY: data/full_repos/permissive/147790758/tb2_dmux.v:17: Unsupported: Ignoring delay on this delayed statement.\n  #10;\n  ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/147790758/tb2_dmux.v:20: Unsupported: Ignoring delay on this delayed statement.\n  #10;\n  ^\n%Error: data/full_repos/permissive/147790758/tb2_dmux.v:10: Cannot find file containing module: \'dmux\'\ndmux DUT (.pba(button), .sw(datain), .led(actual));\n^~~~\n        ... Looked in:\n             data/full_repos/permissive/147790758,data/full_repos/permissive/147790758/dmux\n             data/full_repos/permissive/147790758,data/full_repos/permissive/147790758/dmux.v\n             data/full_repos/permissive/147790758,data/full_repos/permissive/147790758/dmux.sv\n             dmux\n             dmux.v\n             dmux.sv\n             obj_dir/dmux\n             obj_dir/dmux.v\n             obj_dir/dmux.sv\n%Error: Exiting due to 1 error(s), 2 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module tb2_dmux();
	reg button;
	reg [3:0]datain;
	wire [7:0]actual;
	reg [7:0]expected;
	integer i;
	
dmux DUT (.pba(button), .sw(datain), .led(actual));

initial begin: make_data
	$display("**UNIT TEST STARTED**");
	datain = 4'b0000;
	for (i=0; i<=15; i=i+1) begin
		button = 1'b0; expected = {4'b0000, datain};
		#10;
		check_data(actual, expected);
		button = 1'b1; expected = {datain, 4'b0000};
		#10;
		check_data(actual, expected);
		datain = datain + 1'b1;
	end
	$display("**ALL TESTS PASSED**");
	$stop;
end		
	
	task check_data;
		input [7:0] actual;
		input [7:0] expected;
	begin	
		$display("Now testing with inputs: %b %b, Expected result: %b Actual result: %b", button, datain, expected, actual);
		if (actual != expected) begin
			$display("ERROR: Expected %b, but got %b. Inputs were: %b and %b", expected, actual, button, datain);
			$display("**ERROR: UNIT DOES NOT WORK PROPERLY**");
			$stop;
		end
	end
	endtask
endmodule
module tb2_dmux();

	reg button;
	reg [3:0]datain;
	wire [7:0]actual;
	reg [7:0]expected;
	integer i;
	
dmux DUT (.pba(button), .sw(datain), .led(actual));

initial begin: make_data
	$display("**UNIT TEST STARTED**");
	datain = 4'b0000;
	for (i=0; i<=15; i=i+1) begin
		button = 1'b0; expected = {4'b0000, datain};
		#10;
		check_data(actual, expected);
		button = 1'b1; expected = {datain, 4'b0000};
		#10;
		check_data(actual, expected);
		datain = datain + 1'b1;
	end
	$display("**ALL TESTS PASSED**");
	$stop;
end		
	
	task check_data;
		input [7:0] actual;
		input [7:0] expected;
	begin	
		$display("Now testing with inputs: %b %b, Expected result: %b Actual result: %b", button, datain, expected, actual);
		if (actual != expected) begin
			$display("ERROR: Expected %b, but got %b. Inputs were: %b and %b", expected, actual, button, datain);
			$display("**ERROR: UNIT DOES NOT WORK PROPERLY**");
			$stop;
		end
	end
	endtask
endmodule