data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v
1: b'%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.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/mpft.v:5: Define or directive not defined: \'`SPECTAG_LEN\'\n   input wire [`SPECTAG_LEN-1:0] in,\n               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:26: Define or directive not defined: \'`SPECTAG_LEN\'\n   output reg [`SPECTAG_LEN-1:0]  mpft_valid,\n               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:27: Define or directive not defined: \'`SPECTAG_LEN\'\n   input wire [`SPECTAG_LEN-1:0]  value_addr,\n               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:28: Define or directive not defined: \'`SPECTAG_LEN\'\n   output wire [`SPECTAG_LEN-1:0] mpft_value,\n                ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:31: Define or directive not defined: \'`SPECTAG_LEN\'\n   input wire [`SPECTAG_LEN-1:0]  prsuccess_tag,\n               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:32: Define or directive not defined: \'`SPECTAG_LEN\'\n   input wire [`SPECTAG_LEN-1:0]  setspec1_tag,  \n               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:34: Define or directive not defined: \'`SPECTAG_LEN\'\n   input wire [`SPECTAG_LEN-1:0]  setspec2_tag,\n               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:38: Define or directive not defined: \'`SPECTAG_LEN\'\n   reg [`SPECTAG_LEN-1:0]    value0;\n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:39: Define or directive not defined: \'`SPECTAG_LEN\'\n   reg [`SPECTAG_LEN-1:0]    value1;\n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:40: Define or directive not defined: \'`SPECTAG_LEN\'\n   reg [`SPECTAG_LEN-1:0]    value2;\n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:41: Define or directive not defined: \'`SPECTAG_LEN\'\n   reg [`SPECTAG_LEN-1:0]    value3;\n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:42: Define or directive not defined: \'`SPECTAG_LEN\'\n   reg [`SPECTAG_LEN-1:0]    value4;\n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:69: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    wdecdata = mpft_valid | (setspec1_en ? setspec1_tag : 0);\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:71: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value0_wdec =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:79: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value1_wdec =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:87: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value2_wdec =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:95: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value3_wdec =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:103: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value4_wdec =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:111: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value0_wprs =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:113: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value1_wprs =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:115: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value2_wprs =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:117: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value3_wprs =\n         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/mpft.v:119: Define or directive not defined: \'`SPECTAG_LEN\'\n   wire [`SPECTAG_LEN-1:0]    value4_wprs =\n         ^~~~~~~~~~~~\n%Error: Exiting due to 24 error(s)\n'
module miss_prediction_fix_table
  (
   input wire 			  clk,
   input wire 			  reset,
   output reg [`SPECTAG_LEN-1:0]  mpft_valid,
   input wire [`SPECTAG_LEN-1:0]  value_addr,
   output wire [`SPECTAG_LEN-1:0] mpft_value,
   input wire 			  prmiss,
   input wire 			  prsuccess,
   input wire [`SPECTAG_LEN-1:0]  prsuccess_tag,
   input wire [`SPECTAG_LEN-1:0]  setspec1_tag,
   input wire 			  setspec1_en,
   input wire [`SPECTAG_LEN-1:0]  setspec2_tag,
   input wire 			  setspec2_en
   );

   reg [`SPECTAG_LEN-1:0] 	  value0;
   reg [`SPECTAG_LEN-1:0] 	  value1;
   reg [`SPECTAG_LEN-1:0] 	  value2;
   reg [`SPECTAG_LEN-1:0] 	  value3;
   reg [`SPECTAG_LEN-1:0] 	  value4;

   wire [2:0] 			  val_idx;
   
   tag_decoder td(
		  .in(value_addr),
		  .out(val_idx)
		  );
   
   
   assign mpft_value = {
			value4[val_idx],
			value3[val_idx],
			value2[val_idx],
			value1[val_idx],
			value0[val_idx]
			};


   wire [`SPECTAG_LEN-1:0] 	  wdecdata = mpft_valid | (setspec1_en ? setspec1_tag : 0);

   wire [`SPECTAG_LEN-1:0] 	  value0_wdec =
				  (~setspec1_tag[0] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag | 
				    ((setspec1_tag == 5'b00001) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[0] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b00001) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value1_wdec =
				  (~setspec1_tag[1] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag |
				    ((setspec1_tag == 5'b00010) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[1] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b00010) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value2_wdec =
				  (~setspec1_tag[2] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag |
				    ((setspec1_tag == 5'b00100) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[2] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b00100) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value3_wdec =
				  (~setspec1_tag[3] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag |
				    ((setspec1_tag == 5'b01000) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[3] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b01000) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value4_wdec =
				  (~setspec1_tag[4] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag |
				    ((setspec1_tag == 5'b10000) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[4] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b10000) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value0_wprs =
				  (prsuccess_tag[0] ? 5'b0 : ~prsuccess_tag);
   wire [`SPECTAG_LEN-1:0] 	  value1_wprs =
				  (prsuccess_tag[1] ? 5'b0 : ~prsuccess_tag);
   wire [`SPECTAG_LEN-1:0] 	  value2_wprs =
				  (prsuccess_tag[2] ? 5'b0 : ~prsuccess_tag);
   wire [`SPECTAG_LEN-1:0] 	  value3_wprs =
				  (prsuccess_tag[3] ? 5'b0 : ~prsuccess_tag);
   wire [`SPECTAG_LEN-1:0] 	  value4_wprs =
				  (prsuccess_tag[4] ? 5'b0 : ~prsuccess_tag);
   
   always @ (posedge clk) begin
      if (reset | prmiss) begin
	 mpft_valid <= 0;
      end else if (prsuccess) begin
	 mpft_valid <= mpft_valid & ~prsuccess_tag;
      end else begin
	 mpft_valid <= mpft_valid | 
		       (setspec1_en ? setspec1_tag : 0) |
		       (setspec2_en ? setspec2_tag : 0);
      end
   end

   always @ (posedge clk) begin
      if (reset | prmiss) begin
	 value0 <= 0;
	 value1 <= 0;
	 value2 <= 0;
	 value3 <= 0;
	 value4 <= 0;
      end else begin
	 value0 <= prsuccess ? (value0 & value0_wprs) : (value0 | value0_wdec);
	 value1 <= prsuccess ? (value1 & value1_wprs) : (value1 | value1_wdec);
	 value2 <= prsuccess ? (value2 & value2_wprs) : (value2 | value2_wdec);
	 value3 <= prsuccess ? (value3 & value3_wprs) : (value3 | value3_wdec);
	 value4 <= prsuccess ? (value4 & value4_wprs) : (value4 | value4_wdec);
      end
   end
   
endmodule
module miss_prediction_fix_table
  (
   input wire 			  clk,
   input wire 			  reset,
   output reg [`SPECTAG_LEN-1:0]  mpft_valid,
   input wire [`SPECTAG_LEN-1:0]  value_addr,
   output wire [`SPECTAG_LEN-1:0] mpft_value,
   input wire 			  prmiss,
   input wire 			  prsuccess,
   input wire [`SPECTAG_LEN-1:0]  prsuccess_tag,
   input wire [`SPECTAG_LEN-1:0]  setspec1_tag,
   input wire 			  setspec1_en,
   input wire [`SPECTAG_LEN-1:0]  setspec2_tag,
   input wire 			  setspec2_en
   );


   reg [`SPECTAG_LEN-1:0] 	  value0;
   reg [`SPECTAG_LEN-1:0] 	  value1;
   reg [`SPECTAG_LEN-1:0] 	  value2;
   reg [`SPECTAG_LEN-1:0] 	  value3;
   reg [`SPECTAG_LEN-1:0] 	  value4;

   wire [2:0] 			  val_idx;
   
   tag_decoder td(
		  .in(value_addr),
		  .out(val_idx)
		  );
   
   
   assign mpft_value = {
			value4[val_idx],
			value3[val_idx],
			value2[val_idx],
			value1[val_idx],
			value0[val_idx]
			};


   wire [`SPECTAG_LEN-1:0] 	  wdecdata = mpft_valid | (setspec1_en ? setspec1_tag : 0);

   wire [`SPECTAG_LEN-1:0] 	  value0_wdec =
				  (~setspec1_tag[0] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag | 
				    ((setspec1_tag == 5'b00001) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[0] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b00001) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value1_wdec =
				  (~setspec1_tag[1] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag |
				    ((setspec1_tag == 5'b00010) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[1] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b00010) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value2_wdec =
				  (~setspec1_tag[2] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag |
				    ((setspec1_tag == 5'b00100) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[2] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b00100) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value3_wdec =
				  (~setspec1_tag[3] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag |
				    ((setspec1_tag == 5'b01000) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[3] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b01000) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value4_wdec =
				  (~setspec1_tag[4] || ~setspec1_en ? 5'b0 :
				   (setspec1_tag |
				    ((setspec1_tag == 5'b10000) ? mpft_valid : 5'b0))) |
				  (~setspec2_tag[4] || ~setspec2_en ? 5'b0 :
				   (setspec2_tag |
				    ((setspec2_tag == 5'b10000) ? wdecdata : 5'b0)));
   
   wire [`SPECTAG_LEN-1:0] 	  value0_wprs =
				  (prsuccess_tag[0] ? 5'b0 : ~prsuccess_tag);
   wire [`SPECTAG_LEN-1:0] 	  value1_wprs =
				  (prsuccess_tag[1] ? 5'b0 : ~prsuccess_tag);
   wire [`SPECTAG_LEN-1:0] 	  value2_wprs =
				  (prsuccess_tag[2] ? 5'b0 : ~prsuccess_tag);
   wire [`SPECTAG_LEN-1:0] 	  value3_wprs =
				  (prsuccess_tag[3] ? 5'b0 : ~prsuccess_tag);
   wire [`SPECTAG_LEN-1:0] 	  value4_wprs =
				  (prsuccess_tag[4] ? 5'b0 : ~prsuccess_tag);
   
   always @ (posedge clk) begin
      if (reset | prmiss) begin
	 mpft_valid <= 0;
      end else if (prsuccess) begin
	 mpft_valid <= mpft_valid & ~prsuccess_tag;
      end else begin
	 mpft_valid <= mpft_valid | 
		       (setspec1_en ? setspec1_tag : 0) |
		       (setspec2_en ? setspec2_tag : 0);
      end
   end

   always @ (posedge clk) begin
      if (reset | prmiss) begin
	 value0 <= 0;
	 value1 <= 0;
	 value2 <= 0;
	 value3 <= 0;
	 value4 <= 0;
      end else begin
	 value0 <= prsuccess ? (value0 & value0_wprs) : (value0 | value0_wdec);
	 value1 <= prsuccess ? (value1 & value1_wprs) : (value1 | value1_wdec);
	 value2 <= prsuccess ? (value2 & value2_wprs) : (value2 | value2_wdec);
	 value3 <= prsuccess ? (value3 & value3_wprs) : (value3 | value3_wdec);
	 value4 <= prsuccess ? (value4 & value4_wprs) : (value4 | value4_wdec);
      end
   end
   
endmodule