From 35801395a25bc65654520d2170f23e31e8bfbe6b Mon Sep 17 00:00:00 2001 From: Piotr Wegrzyn Date: Thu, 16 Jan 2025 17:38:17 +0100 Subject: [PATCH] Add docstring --- .../func_blocks/fu/lsu/lsu_atomic_wrapper.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/coreblocks/func_blocks/fu/lsu/lsu_atomic_wrapper.py b/coreblocks/func_blocks/fu/lsu/lsu_atomic_wrapper.py index db41ea071..f96294c3f 100644 --- a/coreblocks/func_blocks/fu/lsu/lsu_atomic_wrapper.py +++ b/coreblocks/func_blocks/fu/lsu/lsu_atomic_wrapper.py @@ -14,6 +14,20 @@ class LSUAtomicWrapper(FuncUnit, Elaboratable): + """ + Wrapper for LSU that adds support for atomic operations. + + It provides simplified implementation of atomic operations under assumptions that: + * LSU doesn't reorder memory accesses, like in `LSUDummy` + * There is only one hart + + AMO operations issue two independent accesses (unless there is an exception) to LSU and execute operations + in the internal ALU. + SC are only matched to LR, reservation set size is infinite. + + Behaviour of atomic insturctions on Memory Mapped I/O space is currently undefined. + """ + def __init__(self, gen_params: GenParams, lsu: FuncUnit): self.gen_params = gen_params self.lsu = lsu