forked from HeitorMelo/Risc-v-Pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RegPack.sv
59 lines (56 loc) · 1.3 KB
/
RegPack.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package Pipe_Buf_Reg_PKG;
// Reg A
typedef struct packed {
logic [8:0] Curr_Pc;
logic [31:0] Curr_Instr;
} if_id_reg;
// Reg B
typedef struct packed {
logic ALUSrc;
logic MemtoReg;
logic RegWrite;
logic MemRead;
logic MemWrite;
logic [2:0] ALUOp;
logic Branch;
logic [1: 0] JalType;
logic [8:0] Curr_Pc;
logic [31:0] RD_One;
logic [31:0] RD_Two;
logic [4:0] RS_One;
logic [4:0] RS_Two;
logic [4:0] rd;
logic [31:0] ImmG;
logic [2:0] func3;
logic [6:0] func7;
logic [31:0] Curr_Instr;
} id_ex_reg;
// Reg C
typedef struct packed {
logic RegWrite;
logic MemtoReg;
logic MemRead;
logic MemWrite;
logic [31:0] Pc_Imm;
logic [31:0] Pc_Four;
logic [31:0] Imm_Out;
logic [31:0] Alu_Result;
logic [31:0] RD_Two;
logic [4:0] rd;
logic [2:0] func3;
logic [6:0] func7;
logic [31:0] Curr_Instr;
} ex_mem_reg;
// Reg D
typedef struct packed {
logic RegWrite;
logic MemtoReg;
logic [31:0] Pc_Imm;
logic [31:0] Pc_Four;
logic [31:0] Imm_Out;
logic [31:0] Alu_Result;
logic [31:0] MemReadData;
logic [4:0] rd;
logic [31:0] Curr_Instr;
} mem_wb_reg;
endpackage