From 65fd6521be8da42dc73d64985e3ebd9a33e3e357 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 26 Feb 2022 14:09:27 +0000 Subject: [PATCH] use dict for lookup of DFI to pads names add ras.reset=1 --- gram/phy/dfi.py | 1 + gram/phy/ecp5ddrphy.py | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gram/phy/dfi.py b/gram/phy/dfi.py index 814ad1b..8f76c6d 100644 --- a/gram/phy/dfi.py +++ b/gram/phy/dfi.py @@ -45,6 +45,7 @@ class Interface: self.phases += [p] # set all logic-inverted x_n signal resets to on at power-up p.cas.reset = 1 + p.ras.reset = 1 p.cs_n.reset = -1 p.we.reset = 1 p.act.reset = 1 diff --git a/gram/phy/ecp5ddrphy.py b/gram/phy/ecp5ddrphy.py index c644edd..ce13c99 100644 --- a/gram/phy/ecp5ddrphy.py +++ b/gram/phy/ecp5ddrphy.py @@ -251,11 +251,8 @@ class ECP5DDRPHY(Peripheral, Elaboratable): pad = getattr(self.pads, name) # sigh, convention in nmigen_boards is "rst" but in # dfi.Interface it is "reset" - if name == 'rst': - name = 'reset_n' - # sigh same for cs - if name == 'cs': - name = 'cs_n' + dfi2pads = {'rst': 'reset_n', 'cs': 'cs_n'} + name = dfi2pads.get(name, name) # remap if exists m.d.comb += [ pad.o_clk.eq(ClockSignal("dramsync")), pad.o_fclk.eq(ClockSignal("sync2x")), -- 2.30.2