data/full_repos/permissive/418819021/lab-05/test_rcall.vh
1: b'%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:5: Cannot find include file: defines.vh\n`include "defines.vh" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/418819021/lab-05,data/full_repos/permissive/418819021/defines.vh\n             data/full_repos/permissive/418819021/lab-05,data/full_repos/permissive/418819021/defines.vh.v\n             data/full_repos/permissive/418819021/lab-05,data/full_repos/permissive/418819021/defines.vh.sv\n             defines.vh\n             defines.vh.v\n             defines.vh.sv\n             obj_dir/defines.vh\n             obj_dir/defines.vh.v\n             obj_dir/defines.vh.sv\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:13: Define or directive not defined: \'`STAGE_IF\'\n   `STAGE_IF: begin\n   ^~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:13: syntax error, unexpected \':\', expecting endcase\n   `STAGE_IF: begin\n            ^\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:16: Define or directive not defined: \'`STAGE_ID\'\n   `STAGE_ID:\n   ^~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:17: syntax error, unexpected if, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n    if(!(uut.control.opcode_type == `TYPE_RCALL)) begin \n    ^~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:17: Define or directive not defined: \'`TYPE_RCALL\'\n    if(!(uut.control.opcode_type == `TYPE_RCALL)) begin \n                                    ^~~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:18: Define or directive not defined: \'`TYPE_RCALL\'\n     $display("RCALL FUNCTION - ID: FAILED opcode_type -> %d vs %d", `TYPE_RCALL, uut.control.opcode_type);\n                                                                     ^~~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:21: syntax error, unexpected else\n    else if(!uut.control.opcode_group[`GROUP_TWO_CYCLE_MEM]) begin \n    ^~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:21: Define or directive not defined: \'`GROUP_TWO_CYCLE_MEM\'\n    else if(!uut.control.opcode_group[`GROUP_TWO_CYCLE_MEM]) begin \n                                      ^~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:24: syntax error, unexpected end\n    end \n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:25: Define or directive not defined: \'`GROUP_STACK\'\n    else if (!uut.control.opcode_group[`GROUP_STACK]) begin \n                                       ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:28: syntax error, unexpected end\n    end  \n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:29: Define or directive not defined: \'`GROUP_CONTROL_FLOW\'\n    else if (!uut.control.opcode_group[`GROUP_CONTROL_FLOW]) begin \n                                       ^~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:32: syntax error, unexpected end\n    end  \n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:33: Define or directive not defined: \'`GROUP_STORE_INDIRECT\'\n    else if (!uut.control.opcode_group[`GROUP_STORE_INDIRECT]) begin \n                                       ^~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:36: syntax error, unexpected end\n    end\n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:42: Define or directive not defined: \'`STAGE_EX\'\n   `STAGE_EX:\n   ^~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:46: syntax error, unexpected end\n    end\n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:51: Define or directive not defined: \'`STAGE_MEM\'\n   `STAGE_MEM:\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:56: syntax error, unexpected end\n    end\n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:57: Define or directive not defined: \'`CONTROL_STACK_POSTDEC\'\n    else if(!uut.control.signals[`CONTROL_STACK_POSTDEC]) begin \n                                 ^~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:60: syntax error, unexpected end\n    end \n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:66: syntax error, unexpected end\n    end \n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:72: syntax error, unexpected end\n    end \n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:76: syntax error, unexpected end\n    end\n    ^~~\n%Error: data/full_repos/permissive/418819021/lab-05/test_rcall.vh:77: Define or directive not defined: \'`STAGE_WB\'\n   `STAGE_WB: begin\n   ^~~~~~~~~\n%Error: Cannot continue\n'
function TEST_RCALL;
	input integer value;
	input integer saved_pc;
	input integer next_pc;
	
	begin
		case (uut.pipeline_stage)
			`STAGE_IF: begin
				TEST_RCALL = 1'b1;
			end
			`STAGE_ID:
				if(!(uut.control.opcode_type == `TYPE_RCALL)) begin 
					$display("RCALL FUNCTION - ID: FAILED opcode_type -> %d vs %d", `TYPE_RCALL, uut.control.opcode_type);
					TEST_RCALL = 1'bx;
				end 
				else if(!uut.control.opcode_group[`GROUP_TWO_CYCLE_MEM]) begin 
					$display("RCALL FUNCTION - ID: FAILED RCALL should be in GROUP_TWO_CYCLE_MEM");
					TEST_RCALL = 1'bx;
				end 
				else if (!uut.control.opcode_group[`GROUP_STACK]) begin 
					$display("RCALL FUNCTION - ID: FAILED RCALL should be in GROUP_STACK");
					TEST_RCALL = 1'bx;
				end  
				else if (!uut.control.opcode_group[`GROUP_CONTROL_FLOW]) begin 
					$display("RCALL FUNCTION - ID: FAILED RCALL should be in GROUP_CONTROL_FLOW");
					TEST_RCALL = 1'bx;
				end  
				else if (!uut.control.opcode_group[`GROUP_STORE_INDIRECT]) begin 
					$display("RCALL FUNCTION - ID: FAILED RCALL should be in GROUP_STORE_INDIRECT");
					TEST_RCALL = 1'bx;
				end
				else begin

					TEST_RCALL = 1'b1;
				end
				
			`STAGE_EX:
				if (!(uut.control.saved_pc === saved_pc)) begin
					$display("RCALL FUNCTION - EX: FAILED saved_pc => %d vs %d", saved_pc, uut.control.saved_pc);
					TEST_RCALL = 1'bx;
				end
				else begin
					TEST_RCALL = 1'b1;
				end 
				
			`STAGE_MEM:
				if(!(uut.control.next_program_counter == next_pc)
					&& uut.control.cycle_count == 0) begin
					$display("RCALL FUNCTION - EX2: FAILED: next_program_counter => %d vs %d", next_pc, uut.control.next_program_counter);
					TEST_RCALL = 1'bx;
				end
				else if(!uut.control.signals[`CONTROL_STACK_POSTDEC]) begin 
					$display("RCALL FUNCTION - MEM: FAILED signal CONTROL_STACK_POSTDEC should be active");
					TEST_RCALL = 1'bx;
				end 

				else if (uut.control.cycle_count == 0 &&
							!(uut.control.data_to_store === 6)) begin
					$display("RCALL FUNCTION - MEM, cycle_count 0: FAILED 6 vs %d", uut.control.data_to_store);
					TEST_RCALL = 1'bx;
				end 

				else if ((uut.control.cycle_count == 1) &&
							!(uut.control.data_to_store === 0)) begin
					$display("RCALL FUNCTION - MEM, cycle_count 1: FAILED 0 vs %d", uut.control.data_to_store);
					TEST_RCALL = 1'bx;
				end 
				else begin
					$display("RCALL LABEL - MEM: OK");
					TEST_RCALL = 1'b1;
				end
			`STAGE_WB: begin
				TEST_RCALL = 1'b1;
			 end
		endcase
	end 
endfunction
function TEST_RCALL;

	input integer value;
	input integer saved_pc;
	input integer next_pc;
	
	begin
		case (uut.pipeline_stage)
			`STAGE_IF: begin
				TEST_RCALL = 1'b1;
			end
			`STAGE_ID:
				if(!(uut.control.opcode_type == `TYPE_RCALL)) begin 
					$display("RCALL FUNCTION - ID: FAILED opcode_type -> %d vs %d", `TYPE_RCALL, uut.control.opcode_type);
					TEST_RCALL = 1'bx;
				end 
				else if(!uut.control.opcode_group[`GROUP_TWO_CYCLE_MEM]) begin 
					$display("RCALL FUNCTION - ID: FAILED RCALL should be in GROUP_TWO_CYCLE_MEM");
					TEST_RCALL = 1'bx;
				end 
				else if (!uut.control.opcode_group[`GROUP_STACK]) begin 
					$display("RCALL FUNCTION - ID: FAILED RCALL should be in GROUP_STACK");
					TEST_RCALL = 1'bx;
				end  
				else if (!uut.control.opcode_group[`GROUP_CONTROL_FLOW]) begin 
					$display("RCALL FUNCTION - ID: FAILED RCALL should be in GROUP_CONTROL_FLOW");
					TEST_RCALL = 1'bx;
				end  
				else if (!uut.control.opcode_group[`GROUP_STORE_INDIRECT]) begin 
					$display("RCALL FUNCTION - ID: FAILED RCALL should be in GROUP_STORE_INDIRECT");
					TEST_RCALL = 1'bx;
				end
				else begin

					TEST_RCALL = 1'b1;
				end
				
			`STAGE_EX:
				if (!(uut.control.saved_pc === saved_pc)) begin
					$display("RCALL FUNCTION - EX: FAILED saved_pc => %d vs %d", saved_pc, uut.control.saved_pc);
					TEST_RCALL = 1'bx;
				end
				else begin
					TEST_RCALL = 1'b1;
				end 
				
			`STAGE_MEM:
				if(!(uut.control.next_program_counter == next_pc)
					&& uut.control.cycle_count == 0) begin
					$display("RCALL FUNCTION - EX2: FAILED: next_program_counter => %d vs %d", next_pc, uut.control.next_program_counter);
					TEST_RCALL = 1'bx;
				end
				else if(!uut.control.signals[`CONTROL_STACK_POSTDEC]) begin 
					$display("RCALL FUNCTION - MEM: FAILED signal CONTROL_STACK_POSTDEC should be active");
					TEST_RCALL = 1'bx;
				end 

				else if (uut.control.cycle_count == 0 &&
							!(uut.control.data_to_store === 6)) begin
					$display("RCALL FUNCTION - MEM, cycle_count 0: FAILED 6 vs %d", uut.control.data_to_store);
					TEST_RCALL = 1'bx;
				end 

				else if ((uut.control.cycle_count == 1) &&
							!(uut.control.data_to_store === 0)) begin
					$display("RCALL FUNCTION - MEM, cycle_count 1: FAILED 0 vs %d", uut.control.data_to_store);
					TEST_RCALL = 1'bx;
				end 
				else begin
					$display("RCALL LABEL - MEM: OK");
					TEST_RCALL = 1'b1;
				end
			`STAGE_WB: begin
				TEST_RCALL = 1'b1;
			 end
		endcase
	end 
endfunction