data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v
1: b'%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.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/tag_generator.v:11: Define or directive not defined: \'`SPECTAG_LEN\'\n       input wire [`SPECTAG_LEN-1:0]  tagregfix,\n                   ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:12: Define or directive not defined: \'`SPECTAG_LEN\'\n       output wire [`SPECTAG_LEN-1:0] sptag1,\n                    ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:13: Define or directive not defined: \'`SPECTAG_LEN\'\n       output wire [`SPECTAG_LEN-1:0] sptag2,\n                    ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:17: Define or directive not defined: \'`SPECTAG_LEN\'\n       output reg [`SPECTAG_LEN-1:0]  tagreg\n                   ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:21: Define or directive not defined: \'`BRDEPTH_LEN\'\n   reg [`BRDEPTH_LEN-1:0]          brdepth;\n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:24: Define or directive not defined: \'`SPECTAG_LEN\'\n     {tagreg[`SPECTAG_LEN-2:0], tagreg[`SPECTAG_LEN-1]}\n             ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:24: Define or directive not defined: \'`SPECTAG_LEN\'\n     {tagreg[`SPECTAG_LEN-2:0], tagreg[`SPECTAG_LEN-1]}\n                                       ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:27: Define or directive not defined: \'`SPECTAG_LEN\'\n     {sptag1[`SPECTAG_LEN-2:0], sptag1[`SPECTAG_LEN-1]}\n             ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:27: Define or directive not defined: \'`SPECTAG_LEN\'\n     {sptag1[`SPECTAG_LEN-2:0], sptag1[`SPECTAG_LEN-1]}\n                                       ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:32: Define or directive not defined: \'`BRANCH_ENT_NUM\'\n     > (`BRANCH_ENT_NUM + prsuccess) ? 1\'b0 : 1\'b1;\n        ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:36: Define or directive not defined: \'`SPECTAG_LEN\'\n  tagreg <= `SPECTAG_LEN\'b1;\n            ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:37: Define or directive not defined: \'`BRDEPTH_LEN\'\n  brdepth <= `BRDEPTH_LEN\'b0;\n             ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/188068190/ridecore-src-buggy/tag_generator.v:42: Define or directive not defined: \'`BRDEPTH_LEN\'\n  brdepth <= prmiss ? `BRDEPTH_LEN\'b0 :\n                      ^~~~~~~~~~~~\n%Error: Exiting due to 14 error(s)\n'
module tag_generator(
		     input wire 		    clk,
		     input wire 		    reset,
		     input wire 		    branchvalid1,
		     input wire 		    branchvalid2,
		     input wire 		    prmiss,
		     input wire 		    prsuccess,
		     input wire 		    enable,
		     input wire [`SPECTAG_LEN-1:0]  tagregfix,
		     output wire [`SPECTAG_LEN-1:0] sptag1,
		     output wire [`SPECTAG_LEN-1:0] sptag2,
		     output wire 		    speculative1,
		     output wire 		    speculative2,
		     output wire 		    attachable,
		     output reg [`SPECTAG_LEN-1:0]  tagreg
		     );


   reg [`BRDEPTH_LEN-1:0] 		       brdepth;
   
   assign sptag1 = (branchvalid1) ? 
		   {tagreg[`SPECTAG_LEN-2:0], tagreg[`SPECTAG_LEN-1]}
		   : tagreg;
   assign sptag2 = (branchvalid2) ? 
		   {sptag1[`SPECTAG_LEN-2:0], sptag1[`SPECTAG_LEN-1]}
		   : sptag1;
   assign speculative1 = (brdepth != 0) ? 1'b1 : 1'b0;
   assign speculative2 = ((brdepth != 0) || branchvalid1) ? 1'b1 : 1'b0;
   assign attachable = (brdepth + branchvalid1 + branchvalid2) 
     > (`BRANCH_ENT_NUM + prsuccess) ? 1'b0 : 1'b1;

   always @ (posedge clk) begin
      if (reset) begin
	 tagreg <= `SPECTAG_LEN'b1;
	 brdepth <= `BRDEPTH_LEN'b0;
      end else begin
	 tagreg <= prmiss ? tagregfix :
		   ~enable ? tagreg : 
		   sptag2;
	 brdepth <= prmiss ? `BRDEPTH_LEN'b0 :
		    ~enable ? brdepth - prsuccess :
		    brdepth + branchvalid1 + branchvalid2 - prsuccess;
      end
   end
   
endmodule
module tag_generator(
		     input wire 		    clk,
		     input wire 		    reset,
		     input wire 		    branchvalid1,
		     input wire 		    branchvalid2,
		     input wire 		    prmiss,
		     input wire 		    prsuccess,
		     input wire 		    enable,
		     input wire [`SPECTAG_LEN-1:0]  tagregfix,
		     output wire [`SPECTAG_LEN-1:0] sptag1,
		     output wire [`SPECTAG_LEN-1:0] sptag2,
		     output wire 		    speculative1,
		     output wire 		    speculative2,
		     output wire 		    attachable,
		     output reg [`SPECTAG_LEN-1:0]  tagreg
		     );



   reg [`BRDEPTH_LEN-1:0] 		       brdepth;
   
   assign sptag1 = (branchvalid1) ? 
		   {tagreg[`SPECTAG_LEN-2:0], tagreg[`SPECTAG_LEN-1]}
		   : tagreg;
   assign sptag2 = (branchvalid2) ? 
		   {sptag1[`SPECTAG_LEN-2:0], sptag1[`SPECTAG_LEN-1]}
		   : sptag1;
   assign speculative1 = (brdepth != 0) ? 1'b1 : 1'b0;
   assign speculative2 = ((brdepth != 0) || branchvalid1) ? 1'b1 : 1'b0;
   assign attachable = (brdepth + branchvalid1 + branchvalid2) 
     > (`BRANCH_ENT_NUM + prsuccess) ? 1'b0 : 1'b1;

   always @ (posedge clk) begin
      if (reset) begin
	 tagreg <= `SPECTAG_LEN'b1;
	 brdepth <= `BRDEPTH_LEN'b0;
      end else begin
	 tagreg <= prmiss ? tagregfix :
		   ~enable ? tagreg : 
		   sptag2;
	 brdepth <= prmiss ? `BRDEPTH_LEN'b0 :
		    ~enable ? brdepth - prsuccess :
		    brdepth + branchvalid1 + branchvalid2 - prsuccess;
      end
   end
   
endmodule