bank/description/CSRStorage: set reset property of storage for use in test benches
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 2 May 2013 09:49:23 +0000 (11:49 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 2 May 2013 09:49:23 +0000 (11:49 +0200)
migen/bank/description.py

index 7cc2caa1e06855044628542e80a610eb4ccb6578..2369579c53d3de2c025820a2bf0558083ebc2125 100644 (file)
@@ -51,7 +51,7 @@ class CSRStorage(_CompoundCSR):
                _CompoundCSR.__init__(self, size, name)
                self.alignment_bits = alignment_bits
                self.storage_full = Signal(self.size, reset=reset)
-               self.storage = Signal(self.size - self.alignment_bits)
+               self.storage = Signal(self.size - self.alignment_bits, reset=reset >> alignment_bits)
                self.comb += self.storage.eq(self.storage_full[self.alignment_bits:])
                self.atomic_write = atomic_write
                if write_from_dev: