diff --git a/code/datapath.py b/code/datapath.py index d84cc5f..b1801cb 100644 --- a/code/datapath.py +++ b/code/datapath.py @@ -189,20 +189,22 @@ def dataPath(): PCB = PCA RD1B = RD1 RD2B = RD2 - rs1B = insnA[12:17] - rs2B = insnA[7:12] - rdB = insnA[20:25] + rs1B = BintoUInt(insnA[12:17]) + rs2B = BintoUInt(insnA[7:12]) + rdB = BintoUInt(insnA[20:25]) ImmGB = ImmG funct3B = insnA[17:20] funct7B = insnA[0:7] insnB = insnA nPC, insn = IF(BrPC, Brflush, stall, PC, IM) + if Brflush == '1': PCA = 4 insnA = '0' * 32 else: PCA = nPC insnA = insn + if insn == 32 * '0': break diff --git a/code/top(wating_to_filling).py b/code/top(wating_to_filling).py index 641e6f9..c0fc773 100644 --- a/code/top(wating_to_filling).py +++ b/code/top(wating_to_filling).py @@ -1 +1,4 @@ -from datapath import * \ No newline at end of file +from datapath import * + +if __name__ == '__main__': + dataPath() \ No newline at end of file