chipsalliance / UHDM

Universal Hardware Data Model. A complete modeling of the IEEE SystemVerilog Object Model with VPI Interface, Elaborator, Serialization, Visitor and Listener. Used as a compiled interchange format in between SystemVerilog tools. Compiles on Linux gcc, Windows msys2-gcc & msvc, OsX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a call to release all memory used by UHDM

alaindargelas opened this issue · comments

After UHDM has been translated to the native application data-structure (Yosys,Verilator....), before invoking the application business logic, release UHDM memory which should not be needed anymore at that point.

@kbieganski to test in Yosys when this is ready.

Probably not at this stage of development as we want first the dust to settle and the Yosys to compile all the SystemVerilog.

But then a possible future idea for users of UHDM serialized data: having a generated lightweight API that has the same interface as read/write UHDM, but only providing read-only methods that then just delegates to the underlying Capnproto data ? The capnproto data can be loaded as block into memory (or even memory mmap()-ped on OSes that support that), and released at once.
Since the backing memory is stable, we even can hand out std::string_views to avoid any copying and create expensive temporary objects.

@hzeller, If you feel like it, please open another issue for the idea above.

This issue is closed.
@kbieganski, do call SURELOG::shutdown_compiler function when you are done populating UHDM data into Yosys, prior to invoque Yosys business logic. UHDM will be purged from memory.
You'll also need #2114 from Surelog.