Files
Toooba/src_SSITH_P3/Verilog_RTL/module_basicExec.v
rsnikhil 53aacff7c5 Changes to support 'C' extension (compressed instructions). Details follow.
>----------------
Status and outlook:

    For RV64GC, out of 229 standard ISA tests, 202 PASS, 27 FAIL.
    Below is a list of current failures, current diagnoses, and outlook.

    'C' instructions:
        rv64uc-v-rvc

        Diagnosis: error in saved regs during instruction page fault
            when a 32-bit instruction straddles a page boundary and
            the second 16-bits encounters a page fault.

            Note: the corresponding rv64uc-p-rvc passes, containing
            the same set of tests except for the virtual-memory
            aspect, so we expect this test to pass once this issue is
            fixed.

        Outlook: Target date for fix: 2019-Apr-09 (today)

    System instructions:
        rv64mi-p-access
        rv64mi-p-csr
        rv64si-p-dirty
        rv64mi-p-illegal

        Diagnosis: we do not have accurate diagnoses yet, although
            some symptoms look similar to what we saw with earlier
            processors (these test various corner-cases of system
            instructions).

        Outlook: Target date for fix: 2019-Apr-15

    'F' and 'D' instructions
        rv64uf-p-fadd        rv64uf-v-fadd
        rv64uf-p-fcmp        rv64uf-v-fcmp
        rv64uf-p-fdiv        rv64uf-v-fdiv
        rv64uf-p-fmin        rv64uf-v-fmin

        rv64ud-p-fadd        rv64ud-v-fadd
        rv64ud-p-fcmp        rv64ud-v-fcmp
        rv64ud-p-fdiv        rv64ud-v-fdiv
        rv64ud-p-fmadd       rv64ud-v-fmadd
        rv64ud-p-fmin        rv64ud-v-fmin
        rv64ud-p-ldst        rv64ud-v-ldst
        rv64ud-p-move        rv64ud-v-move

        Diagnosis: These seem to be simulation-only errors. Simulation
            uses some quick-and-dirty floating-point "model" modules
            written by the MIT authors, which are not accurate.  All
            the errors seem to be regarding incomplete treatment of
            NaNs in the models.  These errors should not happen in
            FPGA since those use Xilinx IP modules instead.  MIT has
            been booting Linux with the Xilinx IP modules, lending
            more confidence in the FPGA version.

            The actual number of root-cause failures is likely to be
            smaller than the list.  For example, the 'fadd' test has
            four variants: {uf/ud} x {-p-/-v-}; they all likely need a
            comon fix.

        Outlook: Target date: 2019-Apr-30
            [Lower priority, since FPGA versions should be ok even now.]

>----------------
Detailed comments on file changes

New files:
    Doc/micro2018.pdf
        MIT's paper on RISCY-OOO at IEEE Micro
    src_Core/CPU/CPU_Decode_C.bsv
        Function to expand 'C' instrs to 32-bit counterparts, taken from Piccolo/Flute

Modified files:
    src_Core/CPU/Core.bsv
        Added rob_getOrig_Inst method

    src_Core/RISCY_OOO/procs/RV64G_OOO/AluExePipeline.bsv
        Added 'orig_inst' stuff, $displays

    src_Core/RISCY_OOO/procs/RV64G_OOO/CommitStage.bsv
        Mostly verbosity stuff, including printing out brief instruction trace similar to Piccolo/Flute.

    src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv
        Major changes for 'C', including call to Decode_C function from Piccolo/Flute
        Pass orig_inst to downpipe.

    src_Core/RISCY_OOO/procs/RV64G_OOO/RenameStage.bsv
        Added 'orig_inst', input from FetchStage and passed on to ROB
        Tweaked PC+4 check to accommodate 'C' instructions.

    src_Core/RISCY_OOO/procs/lib/BrPred.bsv
        Fixed 'decodeBrPred' to accommodate 'C' instructions

    src_Core/RISCY_OOO/procs/lib/Exec.bsv
        Fixed 'brAddrCalc', 'getControlFlow', 'basicExec' to acommodate 'C' instructions

    src_Core/RISCY_OOO/procs/lib/MemLoader.bsv
        Switched off 'verbose' by default

    src_Core/RISCY_OOO/procs/lib/ProcTypes.bsv
        Added 'C' to MISA, 'getExtensionBits'

    src_Core/RISCY_OOO/procs/lib/ReorderBuffer.bsv
        Added 'orig_inst' register to basic cell, and methods to set/access.

    src_Core/RISCY_OOO/procs/lib/Types.bsv
        Added typedefs for 'C' instructions
>----------------
2019-04-09 13:50:16 -04:00

142 lines
4.3 KiB
Verilog

//
// Generated by Bluespec Compiler, version 2018.10.beta1 (build e1df8052c, 2018-10-17)
//
//
//
//
// Ports:
// Name I/O size props
// basicExec O 322
// basicExec_dInst I 72
// basicExec_rVal1 I 64
// basicExec_rVal2 I 64
// basicExec_pc I 64
// basicExec_ppc I 64
// basicExec_orig_inst I 32
//
// Combinational paths from inputs to outputs:
// (basicExec_dInst,
// basicExec_rVal1,
// basicExec_rVal2,
// basicExec_pc,
// basicExec_ppc,
// basicExec_orig_inst) -> basicExec
//
//
`ifdef BSV_ASSIGNMENT_DELAY
`else
`define BSV_ASSIGNMENT_DELAY
`endif
`ifdef BSV_POSITIVE_RESET
`define BSV_RESET_VALUE 1'b1
`define BSV_RESET_EDGE posedge
`else
`define BSV_RESET_VALUE 1'b0
`define BSV_RESET_EDGE negedge
`endif
module module_basicExec(basicExec_dInst,
basicExec_rVal1,
basicExec_rVal2,
basicExec_pc,
basicExec_ppc,
basicExec_orig_inst,
basicExec);
// value method basicExec
input [71 : 0] basicExec_dInst;
input [63 : 0] basicExec_rVal1;
input [63 : 0] basicExec_rVal2;
input [63 : 0] basicExec_pc;
input [63 : 0] basicExec_ppc;
input [31 : 0] basicExec_orig_inst;
output [321 : 0] basicExec;
// signals for module outputs
wire [321 : 0] basicExec;
// remaining internal signals
reg [63 : 0] x__h24, x__h302;
wire [193 : 0] IF_basicExec_dInst_BITS_71_TO_67_EQ_4_1_OR_bas_ETC___d46;
wire [63 : 0] SEXT_basicExec_dInst_BITS_31_TO_0_6___d17,
aluVal2__h34,
alu_result__h36,
basicExec_pc_PLUS_IF_basicExec_orig_inst_BITS__ETC___d13,
cf_nextPc__h333,
fallthrough_incr__h41;
wire [31 : 0] basicExec_dInst_BITS_31_TO_0__q1;
wire aluBr___d40;
// value method basicExec
assign basicExec =
{ x__h24,
alu_result__h36,
IF_basicExec_dInst_BITS_71_TO_67_EQ_4_1_OR_bas_ETC___d46 } ;
// remaining internal signals
module_alu instance_alu_1(.alu_a(basicExec_rVal1),
.alu_b(aluVal2__h34),
.alu_func((basicExec_dInst[66:64] == 3'd0) ?
basicExec_dInst[50:46] :
5'd0),
.alu(alu_result__h36));
module_aluBr instance_aluBr_0(.aluBr_a(basicExec_rVal1),
.aluBr_b(basicExec_rVal2),
.aluBr_brFunc((basicExec_dInst[66:64] ==
3'd1) ?
basicExec_dInst[48:46] :
3'd7),
.aluBr(aluBr___d40));
module_brAddrCalc instance_brAddrCalc_2(.brAddrCalc_pc(basicExec_pc),
.brAddrCalc_val(basicExec_rVal1),
.brAddrCalc_iType(basicExec_dInst[71:67]),
.brAddrCalc_imm(SEXT_basicExec_dInst_BITS_31_TO_0_6___d17),
.brAddrCalc_taken(aluBr___d40),
.brAddrCalc_orig_inst(basicExec_orig_inst),
.brAddrCalc(cf_nextPc__h333));
assign IF_basicExec_dInst_BITS_71_TO_67_EQ_4_1_OR_bas_ETC___d46 =
{ x__h302,
basicExec_pc,
cf_nextPc__h333,
aluBr___d40,
cf_nextPc__h333 != basicExec_ppc } ;
assign SEXT_basicExec_dInst_BITS_31_TO_0_6___d17 =
{ {32{basicExec_dInst_BITS_31_TO_0__q1[31]}},
basicExec_dInst_BITS_31_TO_0__q1 } ;
assign aluVal2__h34 =
basicExec_dInst[32] ?
SEXT_basicExec_dInst_BITS_31_TO_0_6___d17 :
basicExec_rVal2 ;
assign basicExec_dInst_BITS_31_TO_0__q1 = basicExec_dInst[31:0] ;
assign basicExec_pc_PLUS_IF_basicExec_orig_inst_BITS__ETC___d13 =
basicExec_pc + fallthrough_incr__h41 ;
assign fallthrough_incr__h41 =
(basicExec_orig_inst[1:0] == 2'b11) ? 64'd4 : 64'd2 ;
always@(basicExec_dInst or cf_nextPc__h333 or alu_result__h36)
begin
case (basicExec_dInst[71:67])
5'd2, 5'd4, 5'd5, 5'd6, 5'd7: x__h302 = alu_result__h36;
default: x__h302 = cf_nextPc__h333;
endcase
end
always@(basicExec_dInst or
alu_result__h36 or
basicExec_rVal2 or
basicExec_pc_PLUS_IF_basicExec_orig_inst_BITS__ETC___d13 or
basicExec_pc or
SEXT_basicExec_dInst_BITS_31_TO_0_6___d17 or basicExec_rVal1)
begin
case (basicExec_dInst[71:67])
5'd2, 5'd5, 5'd7: x__h24 = basicExec_rVal2;
5'd8, 5'd9:
x__h24 = basicExec_pc_PLUS_IF_basicExec_orig_inst_BITS__ETC___d13;
5'd11:
x__h24 = basicExec_pc + SEXT_basicExec_dInst_BITS_31_TO_0_6___d17;
5'd13: x__h24 = basicExec_rVal1;
default: x__h24 = alu_result__h36;
endcase
end
endmodule // module_basicExec