From 04e9ffa2b2c607880631677654634bc4aa52882a Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Tue, 1 Jun 2021 09:48:02 +1000 Subject: [PATCH] soc/csr: Document simulation side effects of read/write --- litex/soc/interconnect/csr.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/litex/soc/interconnect/csr.py b/litex/soc/interconnect/csr.py index ba4409bea..b9fc46e78 100644 --- a/litex/soc/interconnect/csr.py +++ b/litex/soc/interconnect/csr.py @@ -419,11 +419,16 @@ class CSRStorage(_CompoundCSR): self.sync += self.re.eq(sc.re) def read(self): - """Read method for simulation.""" + """Read method for simulation. + + Side effects: none (asynchronous).""" return (yield self.storage) 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.re.eq(1) if hasattr(self, "fields"):