From: William D. Jones Date: Mon, 29 Oct 2018 04:59:13 +0000 (-0400) Subject: cpu/picorv32: Extract picorv32 parameters from Instance constructor to facilitate... X-Git-Tag: 24jan2021_ls180~1524^2~4 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d05fe673a0ea979a24773600616d31895ba0ef56;p=litex.git cpu/picorv32: Extract picorv32 parameters from Instance constructor to facilitate creating variant CPUs. --- diff --git a/litex/soc/cores/cpu/picorv32/core.py b/litex/soc/cores/cpu/picorv32/core.py index 7fe830d6..349cfe10 100644 --- a/litex/soc/cores/cpu/picorv32/core.py +++ b/litex/soc/cores/cpu/picorv32/core.py @@ -29,31 +29,39 @@ class PicoRV32(Module): mem_wstrb = Signal(4) mem_rdata = Signal(32) + # PicoRV32 parameters. To create a new variant, modify this dictionary + # and change the desired parameters. + picorv32_params = { + "p_ENABLE_COUNTERS" : 1, + "p_ENABLE_COUNTERS64" : 1, + # Changing REGS has no effect as on FPGAs, the registers are + # implemented using a register file stored in DPRAM. + "p_ENABLE_REGS_16_31" : 1, + "p_ENABLE_REGS_DUALPORT" : 1, + "p_LATCHED_MEM_RDATA" : 0, + "p_TWO_STAGE_SHIFT" : 1, + "p_TWO_CYCLE_COMPARE" : 0, + "p_TWO_CYCLE_ALU" : 0, + "p_CATCH_MISALIGN" : 1, + "p_CATCH_ILLINSN" : 1, + "p_ENABLE_PCPI" : 0, + "p_ENABLE_MUL" : 1, + "p_ENABLE_DIV" : 1, + "p_ENABLE_FAST_MUL" : 0, + "p_ENABLE_IRQ" : 1, + "p_ENABLE_IRQ_QREGS" : 1, + "p_ENABLE_IRQ_TIMER" : 1, + "p_ENABLE_TRACE" : 0, + "p_MASKED_IRQ" : 0x00000000, + "p_LATCHED_IRQ" : 0xffffffff, + "p_PROGADDR_RESET" : progaddr_reset, + "p_PROGADDR_IRQ" : 0x00000010, + "p_STACKADDR" : 0xffffffff + } + self.specials += Instance("picorv32", # parameters - p_ENABLE_COUNTERS=1, - p_ENABLE_COUNTERS64=1, - p_ENABLE_REGS_16_31=1, - p_ENABLE_REGS_DUALPORT=1, - p_LATCHED_MEM_RDATA=0, - p_TWO_STAGE_SHIFT=1, - p_TWO_CYCLE_COMPARE=0, - p_TWO_CYCLE_ALU=0, - p_CATCH_MISALIGN=1, - p_CATCH_ILLINSN=1, - p_ENABLE_PCPI=0, - p_ENABLE_MUL=1, - p_ENABLE_DIV=1, - p_ENABLE_FAST_MUL=0, - p_ENABLE_IRQ=1, - p_ENABLE_IRQ_QREGS=1, - p_ENABLE_IRQ_TIMER=1, - p_ENABLE_TRACE=0, - p_MASKED_IRQ=0x00000000, - p_LATCHED_IRQ=0xffffffff, - p_PROGADDR_RESET=progaddr_reset, - p_PROGADDR_IRQ=0x00000010, - p_STACKADDR=0xffffffff, + **picorv32_params, # clock / reset i_clk=ClockSignal(),