for i, (phase, sel) in enumerate(zip(self.dfi.phases, self.sel)):
nranks = len(phase.cs_n)
rankbits = log2_int(nranks)
- if hasattr(phase, "reset_n"):
- m.d.comb += phase.reset_n.eq(1)
+ if hasattr(phase, "reset"):
+ m.d.comb += phase.reset.eq(0)
m.d.comb += phase.clk_en.eq(Repl(1, nranks))
if hasattr(phase, "odt"):
# FIXME: add dynamic drive for multi-rank (will be needed for high frequencies)
name="master")
self._control = csr_bank.csr(4, "w") # sel, clk_en, odt, reset
+ self._control.w_data.reset = 0b1000 # reset HI
+
self._phases = []
for n, phase in enumerate(self._inti.phases):
self._phases += [PhaseInjector(CSRPrefixProxy(csr_bank,
- "p{}".format(n)), phase)]
+ "p{}".format(n)),
+ phase)]
+ if hasattr(phase, "reset"):
+ phase.reset.reset = 1
def elaborate(self, platform):
m = Module()
for phase in self._inti.phases]
m.d.comb += [phase.odt[i].eq(self._control.w_data[2])
for phase in self._inti.phases if hasattr(phase, "odt")]
- m.d.comb += [phase.reset_n.eq(self._control.w_data[3])
- for phase in self._inti.phases if hasattr(phase, "reset_n")]
+ m.d.comb += [phase.reset.eq(~self._control.w_data[3])
+ for phase in self._inti.phases if hasattr(phase, "reset")]
return m
("we", 1, DIR_FANOUT),
("clk_en", nranks, DIR_FANOUT),
("odt", nranks, DIR_FANOUT),
- ("reset_n", 1, DIR_FANOUT),
+ ("reset", 1, DIR_FANOUT),
("act", 1, DIR_FANOUT),
# wrdata description
("wrdata", databits, DIR_FANOUT),
# set all logic-inverted x_n signal resets to on at power-up
p.cas.reset = 1
p.ras.reset = 1
+ p.reset.reset = 1
p.cs_n.reset = -1
p.we.reset = 1
p.act.reset = 1
controls = ["ras", "cas", "we", "clk_en", "odt"]
if hasattr(self.pads, "rst"): # this gets renamed later to match dfi
controls.append("rst")
- if hasattr(self.pads, "reset_n"):
- controls.append("reset_n")
if hasattr(self.pads, "cs"):
controls.append("cs")
for name in controls:
pad = getattr(self.pads, name)
# sigh, convention in nmigen_boards is "rst" but in
# dfi.Interface it is "reset"
- dfi2pads = {'rst': 'reset_n', 'cs': 'cs_n'}
+ dfi2pads = {'rst': 'reset', 'cs': 'cs_n'}
name = dfi2pads.get(name, name) # remap if exists
m.d.comb += [
pad.o_clk.eq(ClockSignal("dramsync")),
ddr3 #(
.check_strict_timing(0)
) ram_chip (
- .rst_n(~dram_rst),
+ .rst_n(dram_rst),
.ck(dram_ck),
.ck_n(~dram_ck),
.cke(dram_cke),
def process():
yield from wb_write(csrhost.bus, DFII_CONTROL_ADDR >> 2, (1 << 3), sel=0xF)
yield
- self.assertTrue((yield dut.master.phases[0].reset_n))
+ self.assertTrue((yield dut.master.phases[0].reset))
yield from wb_write(csrhost.bus, DFII_CONTROL_ADDR >> 2, 0, sel=0xF)
yield
- self.assertFalse((yield dut.master.phases[0].reset_n))
+ self.assertFalse((yield dut.master.phases[0].reset))
runSimulation(m, process, "test_dfiinjector.vcd")