Circuit Fusion
Basic idea: learn a fusion circuit embedding by fusing different modalities: RTL code, function description, netlist graph, RTL AST.
Data
41 RTL designs - 7,166 RTL sub-circuits - generating same function 57,328 sub-circuits (Each with 8 sub-circuits)
summary - coming from GPT4 (prompt input is the verilog code)
code - existing
graph - obtained by code. nodes are operators.
How circuit is divided into sub-circuits?
Training details
Intra-modal learning
- mask circuit graph nodes (operators, e.g., AND, XOR, MUX) and predict the masked nodes
- intra-modal contrastive learning: positive sample - sub-circuits with the same functionality
- Q: How to create same functionality and ensure it is correct? A: using open-source tools, Yosys and ABC
Cross-modal alignment
Multi-modal fusion
- Mask summary modeling
Query: Masked summary embedding (randomly masking parts of high-level summary)
Key, Value: Mix-up of code-graph
Q: why not simply mix-up everything and feed into a transformer (self-attention)
- Summary and mix-embedding matching
Alignment w. Netlist - RTL
What is RAG inference here?
Evaluation: what tasks?
- predicting slack for each individual register (sub-circuit level)
1 | slack calcuation example (thanks deepseek) |
- worst negative slack (WNS) prediction
- total negative slack (TNS) prediction
- power prediction
- area prediction
The four above is circuit level
Q: how to use sub-circuit emebeddings to do circuit level predictions? Concat? If concat, how to handle the number of sub-circuits that changes for each design? A: They add them up. And then concat with some design-level features (what is included in their exp), and then use a regression model.
Q: This compares with SNS v2, but it seems to not publish the code?
Note: in circuit-level tasks, they include design level features, e.g., number of different operator types. We need to figure out what features they use.