Working adder.

This commit is contained in:
Sebastian Bugge 2024-09-27 04:22:10 +02:00
parent 88cab777f9
commit 44ccf12cad
Signed by: kaholaz
GPG key ID: 2EFFEDEE03519691
9 changed files with 214 additions and 42 deletions

View file

@ -15,12 +15,13 @@ class Instruction extends Bundle(){
def funct7 = instruction(31, 25)
def funct6 = instruction(26, 31)
def immediateIType = instruction(31, 20).asSInt
def immediateSType = Cat(instruction(31, 25), instruction(11,7)).asSInt
def immediateBType = Cat(instruction(31), instruction(7), instruction(30, 25), instruction(11, 8), 0.U(1.W)).asSInt
def immediateUType = Cat(instruction(31, 12), 0.U(12.W)).asSInt
def immediateJType = Cat(instruction(31), instruction(19, 12), instruction(20), instruction(30, 25), instruction(24, 21), 0.U(1.W)).asSInt
def immediateZType = instruction(19, 15).zext
def immediateIType = instruction(31, 20).asSInt
def immediateSType = Cat(instruction(31, 25), instruction(11,7)).asSInt
def immediateBType = Cat(instruction(31), instruction(7), instruction(30, 25), instruction(11, 8), 0.U(1.W)).asSInt
def immediateUType = Cat(instruction(31, 12), 0.U(12.W)).asSInt
def immediateJType = Cat(instruction(31), instruction(19, 12), instruction(20), instruction(30, 25), instruction(24, 21), 0.U(1.W)).asSInt
def immediateZType = instruction(19, 15).zext
def immediateShortIType = instruction(24, 20).asSInt
def bubble(): Instruction = {
val bubbled = Wire(new Instruction)
@ -102,6 +103,7 @@ object ImmFormat {
val UTYPE = 3.asUInt(3.W)
val JTYPE = 4.asUInt(3.W)
val SHAMT = 5.asUInt(3.W)
val SHORT_ITYPE = 6.asUInt(3.W)
val DC = 0.asUInt(3.W)
}