Added granuality assert (for now)
authorAndrey Miroshnikov <andrey@technepisteme.xyz>
Tue, 24 May 2022 21:01:54 +0000 (22:01 +0100)
committerAndrey Miroshnikov <andrey@technepisteme.xyz>
Tue, 24 May 2022 21:01:54 +0000 (22:01 +0100)
src/spec/simple_gpio.py

index f8e1f20f00d0577426b09aaf2ee17cca4caffbd3..ae699a88a9cf95abc8f13bfffb048532329835b3 100644 (file)
@@ -63,6 +63,10 @@ class SimpleGPIO(Elaboratable):
             temp.append(Record(name=name, layout=gpio_layout))
         self.gpio_ports = Array(temp)
 
+        self.granuality = (len(self.bus.dat_w) // len(self.bus.sel))
+        print("Granuality: %d" % self.granuality)
+        assert self.granuality == 8, "Only byte granuality is supported atm!"
+
     def elaborate(self, platform):
         m = Module()
         comb, sync = m.d.comb, m.d.sync