restore naming convention "cs_r" on DFI Interface
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 25 Feb 2022 18:31:02 +0000 (18:31 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 25 Feb 2022 18:31:02 +0000 (18:31 +0000)
gram/core/multiplexer.py
gram/dfii.py
gram/phy/dfi.py
gram/phy/fakephy.py

index 458c301aeeda998edff5685e1301452fbaffe0d5..69d9fb4fc627803f481f5232c0cb1a488e3f1668 100644 (file)
@@ -157,7 +157,7 @@ class _Steerer(Elaboratable):
                 return cmd.valid & cmd.ready & getattr(cmd, attr)
 
         for i, (phase, sel) in enumerate(zip(self.dfi.phases, self.sel)):
-            nranks = len(phase.cs)
+            nranks = len(phase.cs_n)
             rankbits = log2_int(nranks)
             if hasattr(phase, "reset_n"):
                 m.d.comb += phase.reset_n.eq(1)
@@ -171,15 +171,15 @@ class _Steerer(Elaboratable):
                 m.d.comb += rank_decoder.i.eq((Array(cmd.ba[-rankbits:] for cmd in self.commands)[sel]))
                 if i == 0:  # Select all ranks on refresh.
                     with m.If(sel == STEER_REFRESH):
-                        m.d.sync += phase.cs.eq(1)
+                        m.d.sync += phase.cs_n.eq(0)
                     with m.Else():
-                        m.d.sync += phase.cs.eq(rank_decoder.o)
+                        m.d.sync += phase.cs_n.eq(rank_decoder.o)
                 else:
-                    m.d.sync += phase.cs.eq(rank_decoder.o)
+                    m.d.sync += phase.cs_n.eq(rank_decoder.o)
                 m.d.sync += phase.bank.eq(Array(cmd.ba[:-rankbits] for cmd in self.commands)[sel])
             else:
                 m.d.sync += [
-                    phase.cs.eq(1),
+                    phase.cs_n.eq(0),
                     phase.bank.eq(Array(cmd.ba for cmd in self.commands)[sel]),
                 ]
 
index f9d4de528b5df3b4c3a56fcd309a170569cd13ad..8b5537f9739f9ce53ef60b31c9926f7515fab75f 100644 (file)
@@ -36,14 +36,15 @@ class PhaseInjector(Elaboratable):
 
         with m.If(self._command_issue.w_stb):
             m.d.comb += [
-                self._phase.cs.eq(Repl(value=self._command.w_data[0], count=len(self._phase.cs))),
+                self._phase.cs_n.eq(Repl(value=~self._command.w_data[0],
+                                       count=len(self._phase.cs_n))),
                 self._phase.we.eq(self._command.w_data[1]),
                 self._phase.cas.eq(self._command.w_data[2]),
                 self._phase.ras.eq(self._command.w_data[3]),
             ]
         with m.Else():
             m.d.comb += [
-                self._phase.cs.eq(Repl(value=0, count=len(self._phase.cs))),
+                self._phase.cs_n.eq(Repl(value=1, count=len(self._phase.cs_n))),
                 self._phase.we.eq(0),
                 self._phase.cas.eq(0),
                 self._phase.ras.eq(0),
index 91c4799b36b7f565ae5168bdbe412a8cd6c873ea..d76b764e9f39cccd3de6b11fc8d297c982312a3c 100644 (file)
@@ -13,7 +13,7 @@ def phase_description(addressbits, bankbits, nranks, databits):
         ("address", addressbits, DIR_FANOUT),
         ("bank", bankbits, DIR_FANOUT),
         ("cas", 1, DIR_FANOUT),
-        ("cs", nranks, DIR_FANOUT),
+        ("cs_n", nranks, DIR_FANOUT),
         ("ras", 1, DIR_FANOUT),
         ("we", 1, DIR_FANOUT),
         ("clk_en", nranks, DIR_FANOUT),
index 6a409c44de586e754bebaca4dd79dfa74505d1ac..5feb583642d9851d7b1873a10ea76ea330d39fc2 100644 (file)
@@ -178,13 +178,13 @@ class DFIPhaseModel(Elaboratable):
     def elaborate(self, platform):
         m = Module()
 
-        with m.If(self.phase.cs & self.phase.ras & ~self.phase.cas):
+        with m.If(~self.phase.cs_n & self.phase.ras & ~self.phase.cas):
             m.d.comb += [
                 self.activate.eq(~self.phase.we),
                 self.precharge.eq(self.phase.we),
             ]
 
-        with m.If(self.phase.cs & ~self.phase.ras & self.phase.cas):
+        with m.If(~self.phase.cs_n  & ~self.phase.ras & self.phase.cas):
             m.d.comb += [
                 self.write.eq(self.phase.we),
                 self.read.eq(~self.phase.we),
@@ -340,7 +340,8 @@ class DFITimingsChecker(Elaboratable):
             ps = Signal().like(cnt)
             m.d.comb += ps.eq((cnt + np)*int(self.timings["tCK"]))
             state = Signal(4)
-            m.d.comb += state.eq(Cat(phase.we, phase.cas, phase.ras, phase.cs))
+            m.d.comb += state.eq(Cat(phase.we, phase.cas, phase.ras,
+                                     phase.cs_n))
             all_banks = Signal()
 
             m.d.comb += all_banks.eq(