Apply 'make format'

This commit is contained in:
github action
2022-10-01 14:53:40 +00:00
parent 159cf0429c
commit f1ba6cb517
3 changed files with 80 additions and 44 deletions
+48 -24
View File
@@ -199,8 +199,7 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) {
} else {
ioNames.insert(oldvarp->name());
}
}
else if (v3Global.opt.topIfacesSupported() && oldvarp->isIfaceRef()) {
} else if (v3Global.opt.topIfacesSupported() && oldvarp->isIfaceRef()) {
const AstNodeDType* const subtypep = oldvarp->subDTypep();
if (VN_IS(subtypep, IfaceRefDType)) {
const AstIfaceRefDType* const ifacerefp = VN_AS(subtypep, IfaceRefDType);
@@ -217,10 +216,12 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) {
const AstUnpackArrayDType* const arrp = VN_AS(subtypep, UnpackArrayDType);
const AstNodeDType* const arrsubtypep = arrp->subDTypep();
if (VN_IS(arrsubtypep, IfaceRefDType)) {
const AstIfaceRefDType* const ifacerefp = VN_AS(arrsubtypep, IfaceRefDType);
const AstIfaceRefDType* const ifacerefp
= VN_AS(arrsubtypep, IfaceRefDType);
if (!ifacerefp->cellp()) {
if (ioNames.find(oldvarp->name()) != ioNames.end()) {
// UINFO(8, "Multitop dup interface array found: " << oldvarp << endl);
// UINFO(8, "Multitop dup interface array found: " << oldvarp
// << endl);
dupNames.insert(oldvarp->name());
} else {
ioNames.insert(oldvarp->name());
@@ -285,9 +286,9 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) {
// Skip length and width comp; we know it's a direct assignment
pinp->modVarp(oldvarp);
cellp->addPinsp(pinp);
}
else if (v3Global.opt.topIfacesSupported() && oldvarp->isIfaceRef()) {
// for each interface port on oldmodp instantiate a corresponding interface cell in $root
} else if (v3Global.opt.topIfacesSupported() && oldvarp->isIfaceRef()) {
// for each interface port on oldmodp instantiate a corresponding interface
// cell in $root
const AstNodeDType* const subtypep = oldvarp->subDTypep();
if (VN_IS(subtypep, IfaceRefDType)) {
const AstIfaceRefDType* const ifacerefp = VN_AS(subtypep, IfaceRefDType);
@@ -298,34 +299,44 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) {
name = oldmodp->name() + "__02E" + name;
}
AstCell* ifacecellp = new AstCell{newmodp->fileline(), newmodp->fileline(), name, ifacerefp->ifaceName(), nullptr, nullptr, nullptr};
AstCell* ifacecellp = new AstCell{newmodp->fileline(),
newmodp->fileline(),
name,
ifacerefp->ifaceName(),
nullptr,
nullptr,
nullptr};
ifacecellp->modp(ifacerefp->ifacep());
newmodp->addStmtsp(ifacecellp);
AstIfaceRefDType* const idtypep = new AstIfaceRefDType{newmodp->fileline(), name, ifacerefp->ifaceName()};
AstIfaceRefDType* const idtypep = new AstIfaceRefDType{
newmodp->fileline(), name, ifacerefp->ifaceName()};
idtypep->ifacep(nullptr);
idtypep->dtypep(idtypep);
idtypep->cellp(ifacecellp);
rootp->typeTablep()->addTypesp(idtypep);
AstVar* varp = new AstVar{newmodp->fileline(), VVarType::IFACEREF, name + "__Viftop", idtypep};
AstVar* varp = new AstVar{newmodp->fileline(), VVarType::IFACEREF,
name + "__Viftop", idtypep};
varp->isIfaceParent(true);
ifacecellp->addNextHere(varp);
ifacecellp->hasIfaceVar(true);
AstPin* const pinp = new AstPin{
oldvarp->fileline(), 0, varp->name(),
new AstVarRef{varp->fileline(), varp,
oldvarp->isWritable() ? VAccess::WRITE : VAccess::READ}};
AstPin* const pinp
= new AstPin{oldvarp->fileline(), 0, varp->name(),
new AstVarRef{varp->fileline(), varp,
oldvarp->isWritable() ? VAccess::WRITE
: VAccess::READ}};
pinp->modVarp(oldvarp);
cellp->addPinsp(pinp);
}
}
else if (VN_IS(subtypep, UnpackArrayDType)) {
const AstUnpackArrayDType* const oldarrp = VN_AS(subtypep, UnpackArrayDType);
} else if (VN_IS(subtypep, UnpackArrayDType)) {
const AstUnpackArrayDType* const oldarrp
= VN_AS(subtypep, UnpackArrayDType);
const AstNodeDType* const arrsubtypep = oldarrp->subDTypep();
if (VN_IS(arrsubtypep, IfaceRefDType)) {
const AstIfaceRefDType* const ifacerefp = VN_AS(arrsubtypep, IfaceRefDType);
const AstIfaceRefDType* const ifacerefp
= VN_AS(arrsubtypep, IfaceRefDType);
if (!ifacerefp->cellp()) {
string name = oldvarp->name();
if (dupNames.find(name) != dupNames.end()) {
@@ -333,19 +344,31 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) {
name = oldmodp->name() + "__02E" + name;
}
AstUnpackArrayDType* arraydtypep = VN_AS(oldvarp->dtypep(), UnpackArrayDType);
AstCell* ifacearraycellp = new AstCell{newmodp->fileline(), newmodp->fileline(), name, ifacerefp->ifaceName(), nullptr, nullptr, arraydtypep->rangep()->cloneTree(true)};
AstUnpackArrayDType* arraydtypep
= VN_AS(oldvarp->dtypep(), UnpackArrayDType);
AstCell* ifacearraycellp
= new AstCell{newmodp->fileline(),
newmodp->fileline(),
name,
ifacerefp->ifaceName(),
nullptr,
nullptr,
arraydtypep->rangep()->cloneTree(true)};
ifacearraycellp->modp(ifacerefp->ifacep());
newmodp->addStmtsp(ifacearraycellp);
AstIfaceRefDType* const idtypep = new AstIfaceRefDType{newmodp->fileline(), name, ifacerefp->ifaceName()};
AstIfaceRefDType* const idtypep = new AstIfaceRefDType{
newmodp->fileline(), name, ifacerefp->ifaceName()};
idtypep->ifacep(nullptr);
idtypep->dtypep(idtypep);
idtypep->cellp(ifacearraycellp);
rootp->typeTablep()->addTypesp(idtypep);
AstNodeArrayDType* const arrp = new AstUnpackArrayDType{newmodp->fileline(), idtypep, arraydtypep->rangep()->cloneTree(true)};
AstVar* varp = new AstVar{newmodp->fileline(), VVarType::IFACEREF, name + "__Viftop", arrp};
AstNodeArrayDType* const arrp = new AstUnpackArrayDType{
newmodp->fileline(), idtypep,
arraydtypep->rangep()->cloneTree(true)};
AstVar* varp = new AstVar{newmodp->fileline(), VVarType::IFACEREF,
name + "__Viftop", arrp};
varp->isIfaceParent(true);
ifacearraycellp->addNextHere(varp);
ifacearraycellp->hasIfaceVar(true);
@@ -354,7 +377,8 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) {
AstPin* const pinp = new AstPin{
oldvarp->fileline(), 0, varp->name(),
new AstVarRef{varp->fileline(), varp,
oldvarp->isWritable() ? VAccess::WRITE : VAccess::READ}};
oldvarp->isWritable() ? VAccess::WRITE
: VAccess::READ}};
pinp->modVarp(oldvarp);
cellp->addPinsp(pinp);
}