rename nia_out to nia, clarify with variables in main_stage branch
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 17 May 2020 17:45:09 +0000 (18:45 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 17 May 2020 17:45:09 +0000 (18:45 +0100)
src/soc/branch/main_stage.py
src/soc/branch/test/test_pipe_caller.py

index d1dfbbda278686db3615a2409b2f09f16055e68c..99998a1d000899e19fedf10cd606c77a88411375 100644 (file)
@@ -34,7 +34,7 @@ class BranchMainStage(PipeModBase):
         comb = m.d.comb
         op = self.i.ctx.op
         lk = op.lk # see PowerDecode2 as to why this is done
-        nia_out, lr = self.o.nia_out, self.o.lr
+        nia_o, lr_o = self.o.nia, self.o.lr
 
         # obtain relevant instruction fields
         i_fields = self.fields.FormI
@@ -101,16 +101,16 @@ class BranchMainStage(PipeModBase):
 
         ###### output next instruction address #####
 
-        comb += nia_out.data.eq(br_addr)
-        comb += nia_out.ok.eq(br_taken)
+        comb += nia_o.data.eq(br_addr)
+        comb += nia_o.ok.eq(br_taken)
 
         ###### link register - only activate on operations marked as "lk" #####
 
         with m.If(lk):
             # ctx.op.lk is the AND of the insn LK field *and* whether the
             # op is to "listen" to the link field
-            comb += lr.data.eq(self.i.cia + 4)
-            comb += lr.ok.eq(1)
+            comb += lr_o.data.eq(self.i.cia + 4)
+            comb += lr_o.ok.eq(1)
 
         ###### and context #####
         comb += self.o.ctx.eq(self.i.ctx)
index 5f7a3fdd86677cf2dc0b369d0b89097953ae0446..4ace13dd101f752a046cefcf932ce3f7578a3169 100644 (file)
@@ -186,11 +186,11 @@ class TestRunner(FHDLTestCase):
             sim.run()
 
     def assert_outputs(self, branch, dec2, sim, prev_nia):
-        branch_taken = yield branch.n.data_o.nia_out.ok
+        branch_taken = yield branch.n.data_o.nia.ok
         sim_branch_taken = prev_nia != sim.pc.CIA
         self.assertEqual(branch_taken, sim_branch_taken)
         if branch_taken:
-            branch_addr = yield branch.n.data_o.nia_out.data
+            branch_addr = yield branch.n.data_o.nia.data
             self.assertEqual(branch_addr, sim.pc.CIA.value)
 
         lk = yield dec2.e.lk