data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v
1: b'%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.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/rrf_freelistmanager.v:11: Define or directive not defined: \'`RRF_SEL\'\n   input wire [`RRF_SEL-1:0]  rrftagfix,\n               ^~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:12: Define or directive not defined: \'`RRF_SEL\'\n   output wire [`RRF_SEL-1:0] rename_dst1,\n                ^~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:13: Define or directive not defined: \'`RRF_SEL\'\n   output wire [`RRF_SEL-1:0] rename_dst2,\n                ^~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:16: Define or directive not defined: \'`RRF_SEL\'\n   output reg [`RRF_SEL:0]    freenum,\n               ^~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:16: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n   output reg [`RRF_SEL:0]    freenum,\n                       ^\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:17: Define or directive not defined: \'`RRF_SEL\'\n   output reg [`RRF_SEL-1:0]  rrfptr,\n               ^~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:18: syntax error, unexpected input, expecting IDENTIFIER or \'=\' or do or final\n   input wire [`RRF_SEL-1:0]  comptr,\n   ^~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:18: Define or directive not defined: \'`RRF_SEL\'\n   input wire [`RRF_SEL-1:0]  comptr,\n               ^~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:19: syntax error, unexpected output, expecting IDENTIFIER or do or final\n   output reg         nextrrfcyc\n   ^~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:24: Define or directive not defined: \'`RRF_SEL\'\n   wire [`RRF_SEL-1:0]        rrfptr_next = rrfptr + reqnum;\n         ^~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:26: syntax error, unexpected assign\n   assign allocatable = (freenum + comnum) < reqnum ? 1\'b0 : 1\'b1;\n   ^~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:32: Define or directive not defined: \'`RRF_NUM\'\n  freenum <= `RRF_NUM;\n             ^~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/rrf_freelistmanager.v:37: Define or directive not defined: \'`RRF_NUM\'\n  freenum <= `RRF_NUM - ({hi, rrftagfix} - {1\'b0, comptr});\n             ^~~~~~~~\n%Error: Exiting due to 14 error(s)\n'
module rrf_freelistmanager
  (
   input wire 		      clk,
   input wire 		      reset,
   input wire 		      invalid1,
   input wire 		      invalid2,
   input wire [1:0] 	      comnum,
   input wire 		      prmiss,
   input wire [`RRF_SEL-1:0]  rrftagfix,
   output wire [`RRF_SEL-1:0] rename_dst1,
   output wire [`RRF_SEL-1:0] rename_dst2,
   output wire 		      allocatable,
   input wire 		      stall_DP,
   output reg [`RRF_SEL:0]    freenum,
   output reg [`RRF_SEL-1:0]  rrfptr,
   input wire [`RRF_SEL-1:0]  comptr,
   output reg 		      nextrrfcyc
   );
   
   wire [1:0] 		      reqnum = {1'b0, ~invalid1} + {1'b0, ~invalid2};
   wire 		      hi = (comptr > rrftagfix) ? 1'b1 : 1'b0;
   wire [`RRF_SEL-1:0] 	      rrfptr_next = rrfptr + reqnum;
   
   assign allocatable = (freenum + comnum) < reqnum ? 1'b0 : 1'b1;
   assign rename_dst1 = rrfptr;
   assign rename_dst2 = rrfptr + (~invalid1 ? 1 : 0);
   
   always @ (posedge clk) begin
      if (reset) begin
	 freenum <= `RRF_NUM;
	 rrfptr <= 0;
	 nextrrfcyc <= 0;
      end else if (prmiss) begin
	 rrfptr <= rrftagfix;
	 freenum <= `RRF_NUM - ({hi, rrftagfix} - {1'b0, comptr});
	 nextrrfcyc <= 0;
      end else if (stall_DP) begin
	 rrfptr <= rrfptr;
	 freenum <= freenum + comnum;
	 nextrrfcyc <= 0;
      end else begin
	 rrfptr <= rrfptr_next;
	 freenum <= freenum + comnum - reqnum;
	 nextrrfcyc <= (rrfptr > rrfptr_next) ? 1'b1 : 1'b0;
      end
   end
endmodule
module rrf_freelistmanager
  (
   input wire 		      clk,
   input wire 		      reset,
   input wire 		      invalid1,
   input wire 		      invalid2,
   input wire [1:0] 	      comnum,
   input wire 		      prmiss,
   input wire [`RRF_SEL-1:0]  rrftagfix,
   output wire [`RRF_SEL-1:0] rename_dst1,
   output wire [`RRF_SEL-1:0] rename_dst2,
   output wire 		      allocatable,
   input wire 		      stall_DP,
   output reg [`RRF_SEL:0]    freenum,
   output reg [`RRF_SEL-1:0]  rrfptr,
   input wire [`RRF_SEL-1:0]  comptr,
   output reg 		      nextrrfcyc
   );

   
   wire [1:0] 		      reqnum = {1'b0, ~invalid1} + {1'b0, ~invalid2};
   wire 		      hi = (comptr > rrftagfix) ? 1'b1 : 1'b0;
   wire [`RRF_SEL-1:0] 	      rrfptr_next = rrfptr + reqnum;
   
   assign allocatable = (freenum + comnum) < reqnum ? 1'b0 : 1'b1;
   assign rename_dst1 = rrfptr;
   assign rename_dst2 = rrfptr + (~invalid1 ? 1 : 0);
   
   always @ (posedge clk) begin
      if (reset) begin
	 freenum <= `RRF_NUM;
	 rrfptr <= 0;
	 nextrrfcyc <= 0;
      end else if (prmiss) begin
	 rrfptr <= rrftagfix;
	 freenum <= `RRF_NUM - ({hi, rrftagfix} - {1'b0, comptr});
	 nextrrfcyc <= 0;
      end else if (stall_DP) begin
	 rrfptr <= rrfptr;
	 freenum <= freenum + comnum;
	 nextrrfcyc <= 0;
      end else begin
	 rrfptr <= rrfptr_next;
	 freenum <= freenum + comnum - reqnum;
	 nextrrfcyc <= (rrfptr > rrfptr_next) ? 1'b1 : 1'b0;
      end
   end
endmodule