data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v
1: b'%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:1: Cannot find include file: constants.vh\n`include "constants.vh" \n         ^~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/188068190/ridecore-src-buggy,data/full_repos/permissive/188068190/constants.vh\n             data/full_repos/permissive/188068190/ridecore-src-buggy,data/full_repos/permissive/188068190/constants.vh.v\n             data/full_repos/permissive/188068190/ridecore-src-buggy,data/full_repos/permissive/188068190/constants.vh.sv\n             constants.vh\n             constants.vh.v\n             constants.vh.sv\n             obj_dir/constants.vh\n             obj_dir/constants.vh.v\n             obj_dir/constants.vh.sv\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:2: Cannot find include file: rv32_opcodes.vh\n`include "rv32_opcodes.vh" \n         ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:6: Define or directive not defined: \'`INSN_LEN\'\n   input wire [`INSN_LEN-1:0]  inst,\n               ^~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:7: Define or directive not defined: \'`DATA_LEN\'\n   output wire [`DATA_LEN-1:0] brimm\n                ^~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:10: Define or directive not defined: \'`DATA_LEN\'\n   wire [`DATA_LEN-1:0]        br_offset = { {20{inst[31]}}, inst[7], \n         ^~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:12: Define or directive not defined: \'`DATA_LEN\'\n   wire [`DATA_LEN-1:0]        jal_offset = { {12{inst[31]}}, inst[19:12], \n         ^~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:14: Define or directive not defined: \'`DATA_LEN\'\n   wire [`DATA_LEN-1:0]        jalr_offset = { {21{inst[31]}}, inst[30:21], 1\'b0 };\n         ^~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:18: Define or directive not defined: \'`RV32_BRANCH\'\n   assign brimm = (opcode == `RV32_BRANCH) ? br_offset :\n                             ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:18: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\n   assign brimm = (opcode == `RV32_BRANCH) ? br_offset :\n                                         ^\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:19: Define or directive not defined: \'`RV32_JAL\'\n    (opcode == `RV32_JAL) ? jal_offset :\n               ^~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:20: Define or directive not defined: \'`RV32_JALR\'\n    (opcode == `RV32_JALR) ? jalr_offset :\n               ^~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/brimm_gen.v:21: Define or directive not defined: \'`DATA_LEN\'\n    `DATA_LEN\'b0;\n    ^~~~~~~~~\n%Error: Exiting due to 12 error(s)\n'
module brimm_gen
  (
   input wire [`INSN_LEN-1:0]  inst,
   output wire [`DATA_LEN-1:0] brimm
   );

   wire [`DATA_LEN-1:0]        br_offset = { {20{inst[31]}}, inst[7], 
					     inst[30:25], inst[11:8], 1'b0 };
   wire [`DATA_LEN-1:0]        jal_offset = { {12{inst[31]}}, inst[19:12], 
					      inst[20], inst[30:25], inst[24:21], 1'b0 };
   wire [`DATA_LEN-1:0]        jalr_offset = { {21{inst[31]}}, inst[30:21], 1'b0 };

   wire [6:0] 		       opcode = inst[6:0];
   
   assign brimm = (opcode == `RV32_BRANCH) ? br_offset :
		  (opcode == `RV32_JAL) ? jal_offset :
		  (opcode == `RV32_JALR) ? jalr_offset :
		  `DATA_LEN'b0;

endmodule
module brimm_gen
  (
   input wire [`INSN_LEN-1:0]  inst,
   output wire [`DATA_LEN-1:0] brimm
   );


   wire [`DATA_LEN-1:0]        br_offset = { {20{inst[31]}}, inst[7], 
					     inst[30:25], inst[11:8], 1'b0 };
   wire [`DATA_LEN-1:0]        jal_offset = { {12{inst[31]}}, inst[19:12], 
					      inst[20], inst[30:25], inst[24:21], 1'b0 };
   wire [`DATA_LEN-1:0]        jalr_offset = { {21{inst[31]}}, inst[30:21], 1'b0 };

   wire [6:0] 		       opcode = inst[6:0];
   
   assign brimm = (opcode == `RV32_BRANCH) ? br_offset :
		  (opcode == `RV32_JAL) ? jal_offset :
		  (opcode == `RV32_JALR) ? jalr_offset :
		  `DATA_LEN'b0;

endmodule