soc/csr: Document simulation side effects of read/write

This commit is contained in:
Andrew Dennison 2021-06-01 09:48:02 +10:00
parent 467c1b9b88
commit 04e9ffa2b2
1 changed files with 7 additions and 2 deletions

View File

@ -419,11 +419,16 @@ class CSRStorage(_CompoundCSR):
self.sync += self.re.eq(sc.re) self.sync += self.re.eq(sc.re)
def read(self): def read(self):
"""Read method for simulation.""" """Read method for simulation.
Side effects: none (asynchronous)."""
return (yield self.storage) return (yield self.storage)
def write(self, value): def write(self, value):
"""Write method for simulation.""" """Write method for simulation.
Side effects: synchronous advances simulation clk by one tick."""
yield self.storage.eq(value) yield self.storage.eq(value)
yield self.re.eq(1) yield self.re.eq(1)
if hasattr(self, "fields"): if hasattr(self, "fields"):