From: Michael Nolan Date: Fri, 15 May 2020 18:51:00 +0000 (-0400) Subject: Add ability to specify initial CR state X-Git-Tag: div_pipeline~1181 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce551dc62cbedf0c3cc4fa13d163162b4736df4b;p=soc.git Add ability to specify initial CR state --- diff --git a/src/soc/branch/main_stage.py b/src/soc/branch/main_stage.py index 607cd6bd..9bb4b2b5 100644 --- a/src/soc/branch/main_stage.py +++ b/src/soc/branch/main_stage.py @@ -55,6 +55,20 @@ class BranchMainStage(PipeModBase): with m.Else(): comb += branch_addr.eq(branch_imm_addr + self.i.cia) + + # handle conditional branches (BO and BI are same for BC and + # BCREG) + b_fields = self.fields.instrs['B'] + bo = Signal(b_fields['BO'][0:-1].shape()) + comb += bo.eq(b_fields['BO'][0:-1]) + bi = Signal(b_fields['BI'][0:-1].shape()) + comb += bi.eq(b_fields['BI'][0:-1]) + + cr_bit = Signal(reset_less=True) + comb += cr_bit.eq((self.i.cr & (1<