Expose RAM size in gramCore
authorJean THOMAS <git0@pub.jeanthomas.me>
Tue, 9 Jun 2020 09:44:52 +0000 (11:44 +0200)
committerJean THOMAS <git0@pub.jeanthomas.me>
Tue, 9 Jun 2020 09:44:52 +0000 (11:44 +0200)
gram/core/__init__.py

index 8ca06c9b598e75729334d68b7b223a2f73c3ab7f..670fe45c643023f8cb64bee36cec05bf68fdb865 100644 (file)
@@ -38,6 +38,9 @@ class gramCore(Peripheral, Elaboratable):
             clk_freq        = self._clk_freq,
             **self._kwargs)
 
+        # Size in bytes
+        self.size = 2**geom_settings.bankbits * 2**geom_settings.rowbits * 2**geom_settings.colbits
+
         self.crossbar = gramCrossbar(self.controller.interface)
 
         self._bridge  = self.bridge(data_width=32, granularity=8, alignment=2)