data/full_repos/permissive/440792992/hardware/decode_stage.v
1: b'%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:9: Cannot find include file: configure.h\n`include "configure.h" \n         ^~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/440792992/hardware,data/full_repos/permissive/440792992/configure.h\n             data/full_repos/permissive/440792992/hardware,data/full_repos/permissive/440792992/configure.h.v\n             data/full_repos/permissive/440792992/hardware,data/full_repos/permissive/440792992/configure.h.sv\n             configure.h\n             configure.h.v\n             configure.h.sv\n             obj_dir/configure.h\n             obj_dir/configure.h.v\n             obj_dir/configure.h.sv\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:59: Define or directive not defined: \'`I_type\'\n        inst_type    = `I_type;\n                       ^~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:59: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        inst_type    = `I_type;\n                              ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:60: Define or directive not defined: \'`SRC1_RS1\'\n        src1_sel    = `SRC1_RS1;\n                      ^~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:60: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        src1_sel    = `SRC1_RS1;\n                               ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:61: Define or directive not defined: \'`SRC2_IMM\'\n        src2_sel    = `SRC2_IMM;\n                      ^~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:61: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        src2_sel    = `SRC2_IMM;\n                               ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:63: Define or directive not defined: \'`ALU_ADD\'\n        alu_op      = `ALU_ADD;\n                      ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:63: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        alu_op      = `ALU_ADD;\n                              ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:64: Define or directive not defined: \'`RS_ALU\'\n        rs_type     = `RS_ALU;\n                      ^~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:64: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        rs_type     = `RS_ALU;\n                             ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:75: Define or directive not defined: \'`U_type\'\n                inst_type  = `U_type;\n                             ^~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:75: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                inst_type  = `U_type;\n                                    ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:76: Define or directive not defined: \'`SRC1_ZERO\'\n                src1_sel  = `SRC1_ZERO;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:76: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                src1_sel  = `SRC1_ZERO;\n                                      ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:81: Define or directive not defined: \'`U_type\'\n                inst_type  = `U_type;\n                             ^~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:81: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                inst_type  = `U_type;\n                                    ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:82: Define or directive not defined: \'`SRC1_PC\'\n    src1_sel  = `SRC1_PC;   \n                ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:82: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n    src1_sel  = `SRC1_PC;   \n                        ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:87: Define or directive not defined: \'`SRC1_PC\'\n                src1_sel  = `SRC1_PC;\n                            ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:87: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                src1_sel  = `SRC1_PC;\n                                    ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:88: Define or directive not defined: \'`SRC2_FOUR\'\n                src2_sel  = `SRC2_FOUR;    \n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:88: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                src2_sel  = `SRC2_FOUR;    \n                                      ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:89: Define or directive not defined: \'`RS_JAL\'\n                rs_type   = `RS_JAL;\n                            ^~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:89: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                rs_type   = `RS_JAL;\n                                   ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:93: Define or directive not defined: \'`SRC1_PC\'\n                src1_sel  = `SRC1_PC;\n                            ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:93: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                src1_sel  = `SRC1_PC;\n                                    ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:94: Define or directive not defined: \'`SRC2_FOUR\'\n                src2_sel  = `SRC2_FOUR;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:94: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                src2_sel  = `SRC2_FOUR;\n                                      ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:96: Define or directive not defined: \'`RS_JALR\'\n                rs_type   = `RS_JALR;\n                            ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:96: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                rs_type   = `RS_JALR;\n                                    ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:101: Define or directive not defined: \'`SRC2_RS2\'\n                src2_sel  = `SRC2_RS2;\n                            ^~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:101: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                src2_sel  = `SRC2_RS2;\n                                     ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:102: Define or directive not defined: \'`RS_BRANCH\'\n    rs_type   = `RS_BRANCH;\n                ^~~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:102: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n    rs_type   = `RS_BRANCH;\n                          ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:104: Define or directive not defined: \'`ALU_SEQ\'\n                    3\'b000  : alu_op   = `ALU_SEQ;   \n                                         ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:104: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                    3\'b000  : alu_op   = `ALU_SEQ;   \n                                                 ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:105: Define or directive not defined: \'`ALU_SNE\'\n                    3\'b001  : alu_op   = `ALU_SNE;   \n                                         ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:105: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                    3\'b001  : alu_op   = `ALU_SNE;   \n                                                 ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:106: Define or directive not defined: \'`ALU_SLT\'\n                    3\'b100  : alu_op   = `ALU_SLT;   \n                                         ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:106: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                    3\'b100  : alu_op   = `ALU_SLT;   \n                                                 ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:107: Define or directive not defined: \'`ALU_SGE\'\n                    3\'b101  : alu_op   = `ALU_SGE;   \n                                         ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:107: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                    3\'b101  : alu_op   = `ALU_SGE;   \n                                                 ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:108: Define or directive not defined: \'`ALU_SLTU\'\n     3\'b110  : alu_op   = `ALU_SLTU;  \n                          ^~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:108: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n     3\'b110  : alu_op   = `ALU_SLTU;  \n                                   ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:109: Define or directive not defined: \'`ALU_SGEU\'\n                    3\'b111  : alu_op   = `ALU_SGEU;  \n                                         ^~~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:109: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                    3\'b111  : alu_op   = `ALU_SGEU;  \n                                                  ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:116: Define or directive not defined: \'`RS_LDST\'\n                rs_type    = `RS_LDST;\n                             ^~~~~~~~\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:116: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                rs_type    = `RS_LDST;\n                                     ^\n%Error: data/full_repos/permissive/440792992/hardware/decode_stage.v:126: Define or directive not defined: \'`S_type\'\n                inst_type   = `S_type;\n                              ^~~~~~~\n%Error: Exiting due to too many errors encountered; --error-limit=50\n'
module TAG_Generator
(
    input            i_clk,
    input            i_resetn,
	
    input            branch_valid1,
    input            branch_valid2,
    input            predict_miss,
    input            predict_hit,
    input            enable,
    input      [4:0] tag_fix,
	
    output     [4:0] spec_tag1,
    output     [4:0] spec_tag2,
    output           speculative1,
    output           speculative2,
    output           attachable,
    output reg [4:0] reg_tag
);

    reg [4:0] brdepth;
   
    assign spec_tag1 = (branch_valid1) ? 
                       {reg_tag[3:0], reg_tag[4]} : reg_tag;

    assign spec_tag2 = (branch_valid2) ? 
                       {spec_tag1[3:0], spec_tag1[4]} : spec_tag1;

    assign speculative1 = (brdepth != 0) ? 1'b1 : 1'b0;
    assign speculative2 = ((brdepth != 0) || branch_valid1) ? 1'b1 : 1'b0;
    assign attachable   = (brdepth + branch_valid1 + branch_valid2)>(`GSH_PHT_DEPTH + predict_hit) ? 1'b0 : 1'b1;

    always @(posedge i_clk) begin
        if (~i_resetn) begin
            reg_tag <= 5'b00001;
            brdepth <= 5'b00000;
        end else begin
            reg_tag <= predict_miss ? tag_fix : ~enable ? reg_tag : spec_tag2;
            brdepth <= predict_miss ? 5'b0 :
                       ~enable ? brdepth - predict_hit :
                       brdepth + branch_valid1 + branch_valid2 - predict_hit;
        end
    end

endmodule
module TAG_Generator
(
    input            i_clk,
    input            i_resetn,
	
    input            branch_valid1,
    input            branch_valid2,
    input            predict_miss,
    input            predict_hit,
    input            enable,
    input      [4:0] tag_fix,
	
    output     [4:0] spec_tag1,
    output     [4:0] spec_tag2,
    output           speculative1,
    output           speculative2,
    output           attachable,
    output reg [4:0] reg_tag
);


    reg [4:0] brdepth;
   
    assign spec_tag1 = (branch_valid1) ? 
                       {reg_tag[3:0], reg_tag[4]} : reg_tag;

    assign spec_tag2 = (branch_valid2) ? 
                       {spec_tag1[3:0], spec_tag1[4]} : spec_tag1;

    assign speculative1 = (brdepth != 0) ? 1'b1 : 1'b0;
    assign speculative2 = ((brdepth != 0) || branch_valid1) ? 1'b1 : 1'b0;
    assign attachable   = (brdepth + branch_valid1 + branch_valid2)>(`GSH_PHT_DEPTH + predict_hit) ? 1'b0 : 1'b1;

    always @(posedge i_clk) begin
        if (~i_resetn) begin
            reg_tag <= 5'b00001;
            brdepth <= 5'b00000;
        end else begin
            reg_tag <= predict_miss ? tag_fix : ~enable ? reg_tag : spec_tag2;
            brdepth <= predict_miss ? 5'b0 :
                       ~enable ? brdepth - predict_hit :
                       brdepth + branch_valid1 + branch_valid2 - predict_hit;
        end
    end

endmodule