process.py: add ABC MemoryProcess with support for spliting based on read times
Compare changes
Files
5- Mikael Henriksson authored
+ 1
− 1
@@ -55,7 +55,7 @@ def memory_based_storage(
This PR adds a new type of process ABC, MemoryProcess
, to which the common code of MemoryVariable
and PlainMemoryVariable
is moved. MemoryProcess
also lets the user split a process in two, based on the multiple read accesses that can exist in a MemoryProcess
.
In the Comparison with folding memory assignment example, the add1.0
memory variable is now split into two memory variables, where the zero lifetime variable add1.0
is moved to direct_interconnect
with split_on_length(length=0)
.
mem_vars = schedule.get_memory_variables()
direct, mem_vars = mem_vars.split_on_length()
for i, mem in enumerate(mem_vars_set):
memory = Memory(mem, memory_type="RAM", entity_name=f"memory{i}")
memory.assign("left_edge")
memory.show_content(title=f"Assigned {memory.entity_name}")
direct.show(title="Direct interconnects")