From: Luke Kenneth Casson Leighton Date: Sun, 17 May 2020 17:41:55 +0000 (+0100) Subject: add convenience name to branch main stage and branch output data X-Git-Tag: div_pipeline~1102 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8ae6e5a7d161e0d7e917bf9a40a1d6a287c2be24;p=soc.git add convenience name to branch main stage and branch output data --- diff --git a/src/soc/branch/main_stage.py b/src/soc/branch/main_stage.py index 7fde08b0..d1dfbbda 100644 --- a/src/soc/branch/main_stage.py +++ b/src/soc/branch/main_stage.py @@ -71,8 +71,8 @@ class BranchMainStage(PipeModBase): # Yes, the CTR only counts 32 bits ctr = Signal(64, reset_less=True) comb += ctr.eq(self.i.ctr - 1) - comb += self.o.spr.data.eq(ctr) - comb += self.o.spr.ok.eq(1) + comb += self.o.ctr.data.eq(ctr) + comb += self.o.ctr.ok.eq(1) ctr_zero_bo1 = Signal(reset_less=True) # BO[1] == (ctr==0) comb += ctr_zero_bo1.eq(BO[1] ^ ctr.any()) with m.If(BO[3:5] == 0b00): diff --git a/src/soc/branch/pipe_data.py b/src/soc/branch/pipe_data.py index 7cd250dd..2ca8a847 100644 --- a/src/soc/branch/pipe_data.py +++ b/src/soc/branch/pipe_data.py @@ -75,6 +75,9 @@ class BranchOutputData(IntegerData): self.spr = Data(64, name="spr") self.nia_out = Data(64, name="nia_out") + # convenience variables. + self.ctr = self.spr + def __iter__(self): yield from super().__iter__() yield from self.lr