aboutsummaryrefslogtreecommitdiff
path: root/src/immediate_extend.v
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2024-05-21 13:50:28 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2024-05-21 13:50:28 +0200
commitcb0be9e2039569ee7d18657e8f675d1f8369b407 (patch)
tree91fa71b3960d1ad5217759371143efbdd833d475 /src/immediate_extend.v
parent98d0dd96611dc2c0e444eaf9410f8adf2924c6b5 (diff)
downloadriscv_cpu-cb0be9e2039569ee7d18657e8f675d1f8369b407.tar.gz
riscv_cpu-cb0be9e2039569ee7d18657e8f675d1f8369b407.zip
restructured project
Diffstat (limited to 'src/immediate_extend.v')
-rw-r--r--src/immediate_extend.v22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/immediate_extend.v b/src/immediate_extend.v
deleted file mode 100644
index 14a9a33..0000000
--- a/src/immediate_extend.v
+++ /dev/null
@@ -1,22 +0,0 @@
-module immediate_extend (
- input [31:0] instr,
- input [2:0] imm_src,
-
- output reg [31:0] imm
-);
-
-`include "include/consts.vh"
-
-always @ (*) begin
- case (imm_src)
- INSTR_FORMAT_I: imm = { {21{instr[31]}}, instr[30:20] }; // I
- INSTR_FORMAT_S: imm = { {21{instr[31]}}, instr[30:25], instr[11:7] }; // S
- INSTR_FORMAT_B: imm = { {20{instr[31]}}, instr[7], instr[30:25], instr[11:8], 1'b0 }; // B
- INSTR_FORMAT_U: imm = { instr[31:12], 12'b0 }; // U
- INSTR_FORMAT_J: imm = { {12{instr[31]}}, instr[19:12], instr[20], instr[30:21], 1'b0 }; // J
- default: imm = 32'b0; // Unknown
- endcase
-end
-
-
-endmodule