Skip to content

process.py: add ABC MemoryProcess with support for spliting based on read times

Mikael Henriksson requested to merge memory-process into master

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.

Screenshot_from_2023-05-12_18-39-19

Related issues

Others

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")

Before:

Screenshot_from_2023-05-12_18-23-58 Screenshot_from_2023-05-12_18-24-02

After:

Screenshot_from_2023-05-12_18-27-30 Screenshot_from_2023-05-12_18-27-35

Edited by Mikael Henriksson

Merge request reports

Loading