Commit 17e6ac1f authored by Christina Yu's avatar Christina Yu
Browse files

lab6

parent db7f40b2
......@@ -20,7 +20,6 @@ class RegFile:
fmt_reg = lambda i: f"{self.regs[i]:08x}" if self.regs[i] != None else "xxxxxxxx"
print("\t\t".join([f"{regNumToName(i+j).rjust(6)}: {fmt_reg(i+j)}" for j in range(4)]))
"""testbench"""
if __name__=="__main__":
regFile = RegFile()
......
......@@ -160,7 +160,6 @@ class Instruction():
elif self.funct3 == "110":
return "or"
elif self.type == "U":
self.rdb = self.binVal[20:25] #rd reg in binary
self.rd = regNumToName(int(self.rdb, 2)) #rd reg
......@@ -180,7 +179,6 @@ class Instruction():
#self.imm = str(int(self.immb, 2))
return "jal"
elif self.type == "S":
self.rs2b = self.binVal[7:12] #reg rs2 in binary
self.rs2 = regNumToName(int(self.rs2b, 2)) #reg rs2
......@@ -227,7 +225,6 @@ class Instruction():
elif self.funct3 == "111":
return "bgeu"
def __str__(self):
#opcode = self.binVal[25:]
#insType = getType(opcode)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment