-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
package riscv_pkg; | ||
|
||
import alu_opcodes_pkg::*; | ||
|
||
export alu_opcodes_pkg::*; | ||
import csr_pkg::*; | ||
export csr_pkg::*; | ||
// opcodes | ||
parameter LOAD_OPCODE = 5'b00_000; | ||
parameter MISC_MEM_OPCODE = 5'b00_011; | ||
parameter OP_IMM_OPCODE = 5'b00_100; | ||
parameter AUIPC_OPCODE = 5'b00_101; | ||
parameter STORE_OPCODE = 5'b01_000; | ||
parameter OP_OPCODE = 5'b01_100; | ||
parameter LUI_OPCODE = 5'b01_101; | ||
parameter BRANCH_OPCODE = 5'b11_000; | ||
parameter JALR_OPCODE = 5'b11_001; | ||
parameter JAL_OPCODE = 5'b11_011; | ||
parameter SYSTEM_OPCODE = 5'b11_100; | ||
localparam LOAD_OPCODE = 5'b00_000; | ||
localparam MISC_MEM_OPCODE = 5'b00_011; | ||
localparam OP_IMM_OPCODE = 5'b00_100; | ||
localparam AUIPC_OPCODE = 5'b00_101; | ||
localparam STORE_OPCODE = 5'b01_000; | ||
localparam OP_OPCODE = 5'b01_100; | ||
localparam LUI_OPCODE = 5'b01_101; | ||
localparam BRANCH_OPCODE = 5'b11_000; | ||
localparam JALR_OPCODE = 5'b11_001; | ||
localparam JAL_OPCODE = 5'b11_011; | ||
localparam SYSTEM_OPCODE = 5'b11_100; | ||
|
||
// dmem type load store | ||
parameter LDST_B = 3'b000; | ||
parameter LDST_H = 3'b001; | ||
parameter LDST_W = 3'b010; | ||
parameter LDST_BU = 3'b100; | ||
parameter LDST_HU = 3'b101; | ||
localparam LDST_B = 3'b000; | ||
localparam LDST_H = 3'b001; | ||
localparam LDST_W = 3'b010; | ||
localparam LDST_BU = 3'b100; | ||
localparam LDST_HU = 3'b101; | ||
|
||
// operand a selection | ||
parameter OP_A_RS1 = 2'b00; | ||
parameter OP_A_CURR_PC = 2'b01; | ||
parameter OP_A_ZERO = 2'b10; | ||
localparam OP_A_RS1 = 2'b00; | ||
localparam OP_A_CURR_PC = 2'b01; | ||
localparam OP_A_ZERO = 2'b10; | ||
|
||
// operand b selection | ||
parameter OP_B_RS2 = 3'b000; | ||
parameter OP_B_IMM_I = 3'b001; | ||
parameter OP_B_IMM_U = 3'b010; | ||
parameter OP_B_IMM_S = 3'b011; | ||
parameter OP_B_INCR = 3'b100; | ||
localparam OP_B_RS2 = 3'b000; | ||
localparam OP_B_IMM_I = 3'b001; | ||
localparam OP_B_IMM_U = 3'b010; | ||
localparam OP_B_IMM_S = 3'b011; | ||
localparam OP_B_INCR = 3'b100; | ||
|
||
// writeback source selection | ||
parameter WB_EX_RESULT = 1'b0; | ||
parameter WB_LSU_DATA = 1'b1; | ||
localparam WB_EX_RESULT = 2'd0; | ||
localparam WB_LSU_DATA = 2'd1; | ||
localparam WB_CSR_DATA = 2'd2; | ||
|
||
endpackage | ||
endpackage |