data/full_repos/permissive/147790758/tb2f_mux.v
1: b'%Warning-STMTDLY: data/full_repos/permissive/147790758/tb2f_mux.v:26: 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%Error: data/full_repos/permissive/147790758/tb2f_mux.v:13: Cannot find file containing module: \'mux\'\nmux DUT (.sw(channels), .pba(button), .led(actual));\n^~~\n        ... Looked in:\n             data/full_repos/permissive/147790758,data/full_repos/permissive/147790758/mux\n             data/full_repos/permissive/147790758,data/full_repos/permissive/147790758/mux.v\n             data/full_repos/permissive/147790758,data/full_repos/permissive/147790758/mux.sv\n             mux\n             mux.v\n             mux.sv\n             obj_dir/mux\n             obj_dir/mux.v\n             obj_dir/mux.sv\n%Error: Exiting due to 1 error(s), 1 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module tb2f_mux();
	
	reg button;
	reg [7:0] channels;
	reg [8:0] easyRead;
	wire [3:0] actual;
	integer i;
	reg [8:0] input_mem [0:7];
	reg [3:0] expected_mem [0:7];
	
mux DUT (.sw(channels), .pba(button), .led(actual));

initial begin: read_dataFile
	$display("**UNIT TEST STARTED**");
	$readmemb("input_mux.dat", input_mem);
	$readmemb("exp_mux.dat", expected_mem);
end

initial begin: test_work
	for (i=0; i<8; i=i+1) begin
		easyRead = input_mem[i];
		button = easyRead[8];
		channels = easyRead[7:0];
		#10;
		$display("Now testing with inputs: %b %b, Expected result: %b Actual result: %b", button, channels, expected_mem[i], actual);
		if (actual != expected_mem [i]) begin
			$display("ERROR: expected %b, but got %b. Inputs were: %b %b", expected_mem[i], actual, button, channels);
			$display("**ERROR: UNIT DOES NOT WORK PROPERLY**");
			$stop;
		end
	end
	$display("**ALL TESTS PASSED**");
	$stop;
end
endmodule
module tb2f_mux();

	
	reg button;
	reg [7:0] channels;
	reg [8:0] easyRead;
	wire [3:0] actual;
	integer i;
	reg [8:0] input_mem [0:7];
	reg [3:0] expected_mem [0:7];
	
mux DUT (.sw(channels), .pba(button), .led(actual));

initial begin: read_dataFile
	$display("**UNIT TEST STARTED**");
	$readmemb("input_mux.dat", input_mem);
	$readmemb("exp_mux.dat", expected_mem);
end

initial begin: test_work
	for (i=0; i<8; i=i+1) begin
		easyRead = input_mem[i];
		button = easyRead[8];
		channels = easyRead[7:0];
		#10;
		$display("Now testing with inputs: %b %b, Expected result: %b Actual result: %b", button, channels, expected_mem[i], actual);
		if (actual != expected_mem [i]) begin
			$display("ERROR: expected %b, but got %b. Inputs were: %b %b", expected_mem[i], actual, button, channels);
			$display("**ERROR: UNIT DOES NOT WORK PROPERLY**");
			$stop;
		end
	end
	$display("**ALL TESTS PASSED**");
	$stop;
end
endmodule