Internals: Simplify port connect after instance dearray (#6302)

Pre pull for #6298
This commit is contained in:
Geza Lore 2025-08-18 09:55:54 +01:00 committed by GitHub
parent 25d71a43a5
commit c172cc2ab0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -644,7 +644,10 @@ public:
// Make a new temp wire
// UINFOTREE(9, pinp, "", "in_pin");
V3Inst::checkOutputShort(pinp);
AstNodeExpr* const pinexprp = VN_AS(pinp->exprp(), NodeExpr)->unlinkFrBack();
// Simplify, so stuff like '{a[0], b[0]}[1]' produced during
// instance array expansion are brought to normal 'a[0]'
AstNodeExpr* const pinexprp
= V3Const::constifyEdit(VN_AS(pinp->exprp(), NodeExpr)->unlinkFrBack());
const string newvarname
= (string{pinVarp->isWritable() ? "__Vcellout" : "__Vcellinp"}
// Prevent name conflict if both tri & non-tri add signals