Raise ValueError if the number of DQ pads is not a multiple of 8 (fixing #48)
authorJean THOMAS <git0@pub.jeanthomas.me>
Tue, 4 Aug 2020 13:48:24 +0000 (15:48 +0200)
committerJean THOMAS <git0@pub.jeanthomas.me>
Tue, 4 Aug 2020 13:48:24 +0000 (15:48 +0200)
gram/phy/ecp5ddrphy.py

index bdd02dd15629add01e91fc03d745e3a9003c9fba..de4cbdda182fc6e8c8e220435fad77309c49a597 100644 (file)
@@ -85,7 +85,8 @@ class ECP5DDRPHY(Peripheral, Elaboratable):
         self._sys_clk_freq = sys_clk_freq
 
         databits = len(self.pads.dq.io)
-        assert databits % 8 == 0
+        if databits % 8 != 0:
+            raise ValueError("DQ pads should come in a multiple of 8")
 
         # CSR
         bank = self.csr_bank()