Commit ac41ffe3 authored by Khoi Lam's avatar Khoi Lam 💬
Browse files

Latest

parent 3eb775e3
......@@ -98,11 +98,12 @@ def run_cpu(imem, dmem, symbols, debug):
mem_em = control[instr.instr_name].mem_em
result = alu(op1_mux(op1_sel), op2_mux(op2_sel), alu_fun)
#result = sextend(0xffffffff & as_twos_comp(alu(op1_mux(op1_sel), op2_mux(op2_sel), alu_fun)))
sextend_res = sextend(result)
if debug:
print("ALURes = " + str(result))
print("Sextended_ALURes = " + str(sextend_res))
print("ALU_fun = " + str(alu_fun))
print("ALU_fun = " + str(alu_fun))
......@@ -130,7 +131,7 @@ def run_cpu(imem, dmem, symbols, debug):
PC.clock(pc_val + 4)
rd_value = my_reg.read(int(instr.rd, 2))
print('rd: ' + str(rd_value) + ' rs1: ' + str(rs1_value) + ' rs2: ' + str(rs2_value))
print(' rd_val: ' + str(rd_value) + ' rs1_val: ' + format(rs1_value, "x") + ' rs2_val: ' + format(rs2_value, "x") )
......
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