-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInsP.v
More file actions
32 lines (26 loc) · 670 Bytes
/
InsP.v
File metadata and controls
32 lines (26 loc) · 670 Bytes
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
module InsDecoder
(
input [31:0] Instr,
output [6:0] Opcode,funct7,
output [4:0] rd,rs1,rs2,
output [2:0] funct3
);
reg[6:0] IOP,Ifn7;
reg[4:0] Ird,Irs1,Irs2;
reg[2:0] Ifn3;
always@(Instr)
begin
IOP =Instr[6:0];
Ird =Instr[11:7];
Ifn3=Instr[14:12];
Irs1=Instr[19:15];
Irs2=Instr[24:20];
Ifn7=Instr[31:25];
end
assign Opcode=IOP;
assign rd=Ird;
assign funct3=Ifn3;
assign rs1=Irs1;
assign rs2=Irs2;
assign funct7=Ifn7;
endmodule