-
Notifications
You must be signed in to change notification settings - Fork 435
Description
We are now starting to track global state such as the current simulation time in the model storage. When we allocate storage sub-regions with %y = arc.alloc_storage %x, we still want arc.current_time %x and arc.current_time %y to load the same time variable at the beginning of simulation storage, even if the states the alloc storage op creates a contiguous block of memory for any states hanging off of it, which can be located anywhere within the simulation. Once we start supporting llhd.global_signals, we'll have even more things that appear at the beginning of model storage that any sub-storages still need access to.
To fix this, let's change the lowering of !arc.storage and the associated ops to produce two !llvm.ptrs instead of one: one global pointer that points to the beginning of the model's simulation storage and that isn't affected by sub-storage allocation and projection; and one pointer that is modified by arc.alloc_storage/arc.storage.get to point to subregions of simulation memory.
A bit later we'll also want to make the layout of this state explicit in dedicated struct definition ops, such that we can use such an op to describe the layout of the global model storage, including the time variable and any global signals, too.