data/full_repos/permissive/444327372/maindec.v
1: b'%Error: data/full_repos/permissive/444327372/maindec.v:22: Cannot find include file: defines.vh\n`include "defines.vh" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/444327372,data/full_repos/permissive/444327372/defines.vh\n             data/full_repos/permissive/444327372,data/full_repos/permissive/444327372/defines.vh.v\n             data/full_repos/permissive/444327372,data/full_repos/permissive/444327372/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/444327372/maindec.v:48: Define or directive not defined: \'`EXE_ANDI\'\n        (op == `EXE_ANDI)  ||\n               ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:48: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\n        (op == `EXE_ANDI)  ||\n                        ^\n%Error: data/full_repos/permissive/444327372/maindec.v:49: Define or directive not defined: \'`EXE_ORI\'\n        (op == `EXE_ORI)   ||\n               ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:50: Define or directive not defined: \'`EXE_XORI\'\n        (op == `EXE_XORI)  ||\n               ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:51: Define or directive not defined: \'`EXE_LUI\'\n        (op == `EXE_LUI)   ||\n               ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:53: Define or directive not defined: \'`EXE_SPECIAL_INST\'\n        (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||\n               ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:53: Define or directive not defined: \'`EXE_MTHI\'\n        (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||\n                                            ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:53: Define or directive not defined: \'`EXE_MTLO\'\n        (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||\n                                                                 ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:53: Define or directive not defined: \'`EXE_MULT\'\n        (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||\n                                                                                      ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:53: Define or directive not defined: \'`EXE_MULTU\'\n        (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||\n                                                                                                           ^~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:53: Define or directive not defined: \'`EXE_DIV\'\n        (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||\n                                                                                                                                 ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:53: Define or directive not defined: \'`EXE_DIVU\'\n        (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||\n                                                                                                                                                     ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:55: Define or directive not defined: \'`EXE_ADDI\'\n        (op == `EXE_ADDI)  ||\n               ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:56: Define or directive not defined: \'`EXE_ADDIU\'\n        (op == `EXE_ADDIU) ||\n               ^~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:58: Define or directive not defined: \'`EXE_SLTI\'\n        (op == `EXE_SLTI)  ||\n               ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:59: Define or directive not defined: \'`EXE_SLTIU\'\n        (op == `EXE_SLTIU) ||\n               ^~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:60: Define or directive not defined: \'`EXE_JAL\'\n        (op == `EXE_JAL)   ||\n               ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:61: Define or directive not defined: \'`EXE_REGIMM_INST\'\n        (op == `EXE_REGIMM_INST && rt == `EXE_BLTZAL) ||\n               ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:61: Define or directive not defined: \'`EXE_BLTZAL\'\n        (op == `EXE_REGIMM_INST && rt == `EXE_BLTZAL) ||\n                                         ^~~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:62: Define or directive not defined: \'`EXE_REGIMM_INST\'\n        (op == `EXE_REGIMM_INST && rt == `EXE_BGEZAL) ||\n               ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:62: Define or directive not defined: \'`EXE_BGEZAL\'\n        (op == `EXE_REGIMM_INST && rt == `EXE_BGEZAL) ||\n                                         ^~~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:64: Define or directive not defined: \'`EXE_LB\'\n        (op == `EXE_LB)    ||\n               ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:65: Define or directive not defined: \'`EXE_LBU\'\n        (op == `EXE_LBU)   ||\n               ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:66: Define or directive not defined: \'`EXE_LH\'\n        (op == `EXE_LH)    ||\n               ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:67: Define or directive not defined: \'`EXE_LHU\'\n        (op == `EXE_LHU)   ||\n               ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:68: Define or directive not defined: \'`EXE_LW\'\n        (op == `EXE_LW)   ||\n               ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:76: Define or directive not defined: \'`EXE_SPECIAL_INST\'\n      (op == `EXE_SPECIAL_INST) ||\n             ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:76: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\n      (op == `EXE_SPECIAL_INST) ||\n                              ^\n%Error: data/full_repos/permissive/444327372/maindec.v:81: Define or directive not defined: \'`EXE_ANDI\'\n      (op == `EXE_ANDI) ||\n             ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:81: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\n      (op == `EXE_ANDI) ||\n                      ^\n%Error: data/full_repos/permissive/444327372/maindec.v:82: Define or directive not defined: \'`EXE_ORI\'\n                   (op == `EXE_ORI)  ||\n                          ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:83: Define or directive not defined: \'`EXE_XORI\'\n                   (op == `EXE_XORI) ||\n                          ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:84: Define or directive not defined: \'`EXE_LUI\'\n      (op == `EXE_LUI)  ||\n             ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:86: Define or directive not defined: \'`EXE_ADDI\'\n      (op == `EXE_ADDI)  ||\n             ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:87: Define or directive not defined: \'`EXE_ADDIU\'\n                   (op == `EXE_ADDIU) ||\n                          ^~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:88: Define or directive not defined: \'`EXE_SLTI\'\n                   (op == `EXE_SLTI)  ||\n                          ^~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:89: Define or directive not defined: \'`EXE_SLTIU\'\n                   (op == `EXE_SLTIU) ||\n                          ^~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:93: Define or directive not defined: \'`EXE_LB\'\n                   (op == `EXE_LB)  ||\n                          ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:94: Define or directive not defined: \'`EXE_LB\'\n                   (op == `EXE_LB)  ||\n                          ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:95: Define or directive not defined: \'`EXE_LBU\'\n                   (op == `EXE_LBU) ||\n                          ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:96: Define or directive not defined: \'`EXE_LH\'\n                   (op == `EXE_LH)  ||\n                          ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:97: Define or directive not defined: \'`EXE_LHU\'\n                   (op == `EXE_LHU) ||\n                          ^~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:98: Define or directive not defined: \'`EXE_LW\'\n                   (op == `EXE_LW)  ||\n                          ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:100: Define or directive not defined: \'`EXE_SB\'\n                   (op == `EXE_SB)  ||\n                          ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:101: Define or directive not defined: \'`EXE_SH\'\n                   (op == `EXE_SH)  ||\n                          ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:102: Define or directive not defined: \'`EXE_SW\'\n                   (op == `EXE_SW)) && ~stallD;\n                          ^~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:107: Define or directive not defined: \'`EXE_SPECIAL_INST\'\n       (op == `EXE_SPECIAL_INST && func == `EXE_MTHI)  ||\n              ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/444327372/maindec.v:107: syntax error, unexpected &&, expecting TYPE-IDENTIFIER\n       (op == `EXE_SPECIAL_INST && func == `EXE_MTHI)  ||\n                                ^~\n%Error: data/full_repos/permissive/444327372/maindec.v:107: Define or directive not defined: \'`EXE_MTHI\'\n       (op == `EXE_SPECIAL_INST && func == `EXE_MTHI)  ||\n                                           ^~~~~~~~~\n%Error: Exiting due to too many errors encountered; --error-limit=50\n'
module maindec(
	input wire stallD,
	input wire[31:0] instr,
	output wire memtoreg,
	output wire memwrite,
	output wire memen,
	output wire branch,alusrc,
	output wire regdst,regwrite,
	output wire jump, jal, jr, bal,
	output wire hi_we,
	output wire lo_we,
	output wire div_valid,
	output wire signed_div
    );

	wire [5:0] op;
	wire [5:0] func;
	wire [4:0] rt;
	assign op = instr[31:26];
	assign rt = instr[20:16];
	assign func = instr[5:0];


	assign regwrite = (

					   (op == `EXE_ANDI)  ||
					   (op == `EXE_ORI)   ||
					   (op == `EXE_XORI)  ||
					   (op == `EXE_LUI)   ||

					   (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||

					   (op == `EXE_ADDI)  ||
					   (op == `EXE_ADDIU) ||

					   (op == `EXE_SLTI)  ||
					   (op == `EXE_SLTIU) ||
					   (op == `EXE_JAL)   ||
					   (op == `EXE_REGIMM_INST && rt == `EXE_BLTZAL) ||
					   (op == `EXE_REGIMM_INST && rt == `EXE_BGEZAL) ||

					   (op == `EXE_LB)    ||
					   (op == `EXE_LBU)   ||
					   (op == `EXE_LH)    ||
					   (op == `EXE_LHU)   ||
					   (op == `EXE_LW)	  ||
					   

					   (op == 6'b111111 && instr[20:16] == 5'b00000 &&func == 6'b000000)
                   ) && ~stallD; 


	assign regdst = (
					 (op == `EXE_SPECIAL_INST) ||
					 (op == 6'b111111 && func == 6'b000000));


	assign alusrc = (
					 (op == `EXE_ANDI) ||
                 	 (op == `EXE_ORI)  ||
                 	 (op == `EXE_XORI) ||
					 (op == `EXE_LUI)  ||

					 (op == `EXE_ADDI)  ||
                 	 (op == `EXE_ADDIU) ||
                 	 (op == `EXE_SLTI)  ||
                 	 (op == `EXE_SLTIU) ||
					


                 	 (op == `EXE_LB)  ||
                 	 (op == `EXE_LB)  ||
                 	 (op == `EXE_LBU) ||
                 	 (op == `EXE_LH)  ||
                 	 (op == `EXE_LHU) ||
                 	 (op == `EXE_LW)  ||

                 	 (op == `EXE_SB)  ||
                 	 (op == `EXE_SH)  ||
                 	 (op == `EXE_SW)) && ~stallD;
	


	assign hi_we =
				   (op == `EXE_SPECIAL_INST && func == `EXE_MTHI)  ||

				   (op == `EXE_SPECIAL_INST && func == `EXE_MULT)  ||
				   (op == `EXE_SPECIAL_INST && func == `EXE_MULTU) ||

				   (op == `EXE_SPECIAL_INST && func == `EXE_DIV)   ||
				   (op == `EXE_SPECIAL_INST && func == `EXE_DIVU);
	

	assign lo_we =
				   (op == `EXE_SPECIAL_INST && func == `EXE_MTLO)  ||

				   (op == `EXE_SPECIAL_INST && func == `EXE_MULT)  ||
				   (op == `EXE_SPECIAL_INST && func == `EXE_MULTU) ||

				   (op == `EXE_SPECIAL_INST && func == `EXE_DIV)   ||
				   (op == `EXE_SPECIAL_INST && func == `EXE_DIVU);




	assign div_valid = (((op == `EXE_SPECIAL_INST && func == `EXE_DIV) || 
						 (op == `EXE_SPECIAL_INST && func == `EXE_DIVU))) && ~stallD;

	assign signed_div = (op == `EXE_SPECIAL_INST && func == `EXE_DIV) && ~stallD;




	assign branch = ((op == `EXE_BEQ)  ||
                 	 (op == `EXE_BNE)  ||
                 	 (op == `EXE_BLEZ) ||
                 	 (op == `EXE_BGTZ) ||
                 	 (op == `EXE_REGIMM_INST && rt == `EXE_BLTZ)   ||
					 (op == `EXE_REGIMM_INST && rt == `EXE_BGEZ)   ||
                 	 (op == `EXE_REGIMM_INST && rt == `EXE_BLTZAL) ||
                 	 (op == `EXE_REGIMM_INST && rt == `EXE_BGEZAL));
	

	assign jump = (op == `EXE_J) ||
               	  (op == `EXE_SPECIAL_INST && func == `EXE_JR);
	

	assign jal = ((op == `EXE_JAL));
	

	assign jr = ((op == `EXE_SPECIAL_INST && func == `EXE_JR) ||
                 (op == `EXE_SPECIAL_INST && func == `EXE_JALR));
	

	assign bal = ((op == `EXE_REGIMM_INST && rt == `EXE_BLTZAL) ||
              	  (op == `EXE_REGIMM_INST && rt == `EXE_BGEZAL));




	assign memwrite = (op == `EXE_SB) || 
					  (op == `EXE_SH) || 
					  (op == `EXE_SW) && ~stallD;


	assign memtoreg = ((op == `EXE_LB)  ||
                   	   (op == `EXE_LBU) ||
                   	   (op == `EXE_LH)  ||
                   	   (op == `EXE_LHU) ||
                   	   (op == `EXE_LW)) && ~stallD;
endmodule
module maindec(
	input wire stallD,
	input wire[31:0] instr,
	output wire memtoreg,
	output wire memwrite,
	output wire memen,
	output wire branch,alusrc,
	output wire regdst,regwrite,
	output wire jump, jal, jr, bal,
	output wire hi_we,
	output wire lo_we,
	output wire div_valid,
	output wire signed_div
    );


	wire [5:0] op;
	wire [5:0] func;
	wire [4:0] rt;
	assign op = instr[31:26];
	assign rt = instr[20:16];
	assign func = instr[5:0];


	assign regwrite = (

					   (op == `EXE_ANDI)  ||
					   (op == `EXE_ORI)   ||
					   (op == `EXE_XORI)  ||
					   (op == `EXE_LUI)   ||

					   (op == `EXE_SPECIAL_INST && func != `EXE_MTHI && func != `EXE_MTLO && func != `EXE_MULT && func != `EXE_MULTU && func != `EXE_DIV && func != `EXE_DIVU) ||

					   (op == `EXE_ADDI)  ||
					   (op == `EXE_ADDIU) ||

					   (op == `EXE_SLTI)  ||
					   (op == `EXE_SLTIU) ||
					   (op == `EXE_JAL)   ||
					   (op == `EXE_REGIMM_INST && rt == `EXE_BLTZAL) ||
					   (op == `EXE_REGIMM_INST && rt == `EXE_BGEZAL) ||

					   (op == `EXE_LB)    ||
					   (op == `EXE_LBU)   ||
					   (op == `EXE_LH)    ||
					   (op == `EXE_LHU)   ||
					   (op == `EXE_LW)	  ||
					   

					   (op == 6'b111111 && instr[20:16] == 5'b00000 &&func == 6'b000000)
                   ) && ~stallD; 


	assign regdst = (
					 (op == `EXE_SPECIAL_INST) ||
					 (op == 6'b111111 && func == 6'b000000));


	assign alusrc = (
					 (op == `EXE_ANDI) ||
                 	 (op == `EXE_ORI)  ||
                 	 (op == `EXE_XORI) ||
					 (op == `EXE_LUI)  ||

					 (op == `EXE_ADDI)  ||
                 	 (op == `EXE_ADDIU) ||
                 	 (op == `EXE_SLTI)  ||
                 	 (op == `EXE_SLTIU) ||
					


                 	 (op == `EXE_LB)  ||
                 	 (op == `EXE_LB)  ||
                 	 (op == `EXE_LBU) ||
                 	 (op == `EXE_LH)  ||
                 	 (op == `EXE_LHU) ||
                 	 (op == `EXE_LW)  ||

                 	 (op == `EXE_SB)  ||
                 	 (op == `EXE_SH)  ||
                 	 (op == `EXE_SW)) && ~stallD;
	


	assign hi_we =
				   (op == `EXE_SPECIAL_INST && func == `EXE_MTHI)  ||

				   (op == `EXE_SPECIAL_INST && func == `EXE_MULT)  ||
				   (op == `EXE_SPECIAL_INST && func == `EXE_MULTU) ||

				   (op == `EXE_SPECIAL_INST && func == `EXE_DIV)   ||
				   (op == `EXE_SPECIAL_INST && func == `EXE_DIVU);
	

	assign lo_we =
				   (op == `EXE_SPECIAL_INST && func == `EXE_MTLO)  ||

				   (op == `EXE_SPECIAL_INST && func == `EXE_MULT)  ||
				   (op == `EXE_SPECIAL_INST && func == `EXE_MULTU) ||

				   (op == `EXE_SPECIAL_INST && func == `EXE_DIV)   ||
				   (op == `EXE_SPECIAL_INST && func == `EXE_DIVU);




	assign div_valid = (((op == `EXE_SPECIAL_INST && func == `EXE_DIV) || 
						 (op == `EXE_SPECIAL_INST && func == `EXE_DIVU))) && ~stallD;

	assign signed_div = (op == `EXE_SPECIAL_INST && func == `EXE_DIV) && ~stallD;




	assign branch = ((op == `EXE_BEQ)  ||
                 	 (op == `EXE_BNE)  ||
                 	 (op == `EXE_BLEZ) ||
                 	 (op == `EXE_BGTZ) ||
                 	 (op == `EXE_REGIMM_INST && rt == `EXE_BLTZ)   ||
					 (op == `EXE_REGIMM_INST && rt == `EXE_BGEZ)   ||
                 	 (op == `EXE_REGIMM_INST && rt == `EXE_BLTZAL) ||
                 	 (op == `EXE_REGIMM_INST && rt == `EXE_BGEZAL));
	

	assign jump = (op == `EXE_J) ||
               	  (op == `EXE_SPECIAL_INST && func == `EXE_JR);
	

	assign jal = ((op == `EXE_JAL));
	

	assign jr = ((op == `EXE_SPECIAL_INST && func == `EXE_JR) ||
                 (op == `EXE_SPECIAL_INST && func == `EXE_JALR));
	

	assign bal = ((op == `EXE_REGIMM_INST && rt == `EXE_BLTZAL) ||
              	  (op == `EXE_REGIMM_INST && rt == `EXE_BGEZAL));




	assign memwrite = (op == `EXE_SB) || 
					  (op == `EXE_SH) || 
					  (op == `EXE_SW) && ~stallD;


	assign memtoreg = ((op == `EXE_LB)  ||
                   	   (op == `EXE_LBU) ||
                   	   (op == `EXE_LH)  ||
                   	   (op == `EXE_LHU) ||
                   	   (op == `EXE_LW)) && ~stallD;
endmodule