chipsalliance / chipsalliance/Surelog

Track (and expose) bindings post elaboration

Open
#2,847 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
475
Forks
90
Avg merge
1h 39m
Merged PRs (30d)
37

Description

Elaborated tree is generated from the non-elaborated version but the source of each model in the elaborated tree has no link back to the source from which it was generated. At the moment, post elaboration, all these bindings are forgotten. Can these bindings be tracked and exposed via some API (preferably within the model hierarchy itself). This would a pointer in the elaborated tree pointing back to something in the non-elaborated tree.

Reasoning -
* Consolidating typespec(s) i.e. unique-fy isn't possible with just using `BaseClass::Compare` because of reduction logic during elaboration. Typespec's (like logic_typespec/range) can be modified during elaboration and do not compare equal.
* When listening to the entire design, there's no way to identify _easily_ whether a particular model has been dealt with or not. For instance, I would like to deal with say parameters only once but parameters appear in multiple callbacks and can also get imported into modules. Knowing the original source will help eliminating redundancy.
* This will also help in cases like module arrays getting unrolled as part of elaboration.

I could build the mapping again as part of the listener implementation but that would just be redundant and error-prone (because no guarantees that Surelog and any other client would come up with the same logic).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how the non-elaborated tree produces the elaborated tree and how models are represented in the model hierarchy. Define an API for retaining each elaborated model's source binding, then verify that it supports listener callbacks, parameter deduplication, and module-array unrolling without clients rebuilding the mapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.