MikePopoloski / slang

SystemVerilog compiler and language services
MIT License
546 stars 114 forks source link

Add caching of identical instance bodies #949

Open MikePopoloski opened 1 month ago

MikePopoloski commented 1 month ago

Support caching instance bodies and skipping over identical copies when elaborating, to save time. Expose this functionality so that downstream consumers of the AST can easily do the same.

Note that the tricky detail here is figuring out how to handle hierarchical references into and out of the cached instances.

yanggeorge commented 2 weeks ago

It is better that elabarated AST only keeps one instance of those identical instances, then visiting the AST will be faster.