mirror of https://github.com/llvm/circt.git
[firrtl] Fix bug in sibling layer specialization
Fix a bug in the `SpecializeLayers` pass where sibling layers would not be enabled/disabled correctly if an earlier sibling layer was also enabled/disabled. Fixes #7525. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
This commit is contained in:
parent
27d3965c59
commit
209d9fb80e
|
@ -605,6 +605,7 @@ struct SpecializeLayers {
|
|||
llvm::make_early_inc_range(block->getOps<LayerOp>())) {
|
||||
nestedRefs.push_back(SymbolRefAttr::get(nested));
|
||||
handleLayer(nested, Block::iterator(nested), "");
|
||||
nestedRefs.pop_back();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -617,6 +618,7 @@ struct SpecializeLayers {
|
|||
nestedRefs.push_back(SymbolRefAttr::get(nested));
|
||||
handleLayer(nested, insertionPoint,
|
||||
prefix + layer.getSymName() + "_");
|
||||
nestedRefs.pop_back();
|
||||
}
|
||||
// Erase the now empty layer.
|
||||
layer->erase();
|
||||
|
|
|
@ -115,6 +115,21 @@ firrtl.circuit "LayerDisableInARow" attributes {
|
|||
firrtl.extmodule @LayerDisableInARow()
|
||||
}
|
||||
|
||||
// CHECK: firrtl.circuit "LayerblockEnableNestedChildren"
|
||||
// CHECK-NOT: firrtl.layer
|
||||
firrtl.circuit "LayerblockEnableNestedChildren" attributes {
|
||||
enable_layers = [@A, @A::@B, @A::@C]
|
||||
} {
|
||||
firrtl.layer @A bind {
|
||||
firrtl.layer @B bind {
|
||||
}
|
||||
firrtl.layer @C bind {
|
||||
}
|
||||
}
|
||||
firrtl.module @LayerblockEnableNestedChildren() {
|
||||
}
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// LayerBlock Specialization
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
Loading…
Reference in New Issue