Raise exception if no native port is present (fixing #48)
authorJean THOMAS <git0@pub.jeanthomas.me>
Tue, 4 Aug 2020 13:27:40 +0000 (15:27 +0200)
committerJean THOMAS <git0@pub.jeanthomas.me>
Tue, 4 Aug 2020 13:27:40 +0000 (15:27 +0200)
gram/core/crossbar.py

index 642a8e2ad90a30999dcd069cc7db0383f4987984..ae29a12178c3244821d2514822f615d4a1a055c2 100644 (file)
@@ -106,7 +106,8 @@ class gramCrossbar(Elaboratable):
 
         controller = self.controller
         nmasters = len(self.masters)
-        assert nmasters > 0
+        if nmasters < 1:
+            raise ValueError("No frontend instantiated")
 
         # Address mapping --------------------------------------------------------------------------
         cba_shifts = {"ROW_BANK_COL": controller.settings.geom.colbits - controller.address_align}