[FIRRTL] Update GCT Taps to handle HierPathOp ending in Module (#3303)

This commit updates the GrandCentralTaps to handle HierPathOp ending in modules.
This commit is contained in:
Prithayan Barua 2022-06-10 09:02:52 -07:00 committed by GitHub
parent 1cab6f2f0d
commit c6cc346550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -844,8 +844,17 @@ void GrandCentralTapsPass::runOnOperation() {
for (auto inst : shortestPrefix.getValue())
addSymbol(getInnerRefTo(inst));
if (port.nla) {
for (auto sym : port.nla.namepath())
auto namepath = port.nla.namepath();
Attribute leaf = namepath.getValue().back();
if (!leaf.isa<InnerRefAttr>()) {
if (port.target.hasPort())
leaf = getInnerRefTo(port.target.getOp(), port.target.getPort());
else
leaf = getInnerRefTo(port.target.getOp());
}
for (auto sym : namepath.getValue().drop_back())
addSymbol(sym);
addSymbol(leaf);
} else if (port.target.getOp()) {
if (port.target.hasPort())
addSymbol(

View File

@ -554,3 +554,12 @@ firrtl.circuit "Top" {
firrtl.instance dut @DUT()
}
}
// ---
// The HierpathOps that should be updated to end on a module:
// firrtl.hierpath @nla_1 [@NLAGarbageCollection::@dut, @DUT::@submodule, @Submodule]
// firrtl.hierpath @nla_2 [@NLAGarbageCollection::@dut, @DUT::@submodule, @Submodule]
// firrtl.hierpath @nla_3 [@NLAGarbageCollection::@dut, @DUT::@submodule, @Submodule]
// firrtl.hierpath @nla_1 [@NLAUsedInWiring::@foo, @Foo]
// firrtl.hierpath @nla_2 [@NLAUsedInWiring::@foo, @Foo]
// firrtl.hierpath @nla_0 [@DUT::@submodule_1, @Submodule]
// firrtl.hierpath @nla [@DUT::@submodule_2, @Submodule]