mirror of https://github.com/llvm/circt.git
[NFC][GranCentral] Allow probe outputs from companions
This commit is contained in:
parent
cbe82b9674
commit
3c42434a3e
|
@ -1875,13 +1875,17 @@ void GrandCentralPass::runOnOperation() {
|
|||
goto FModuleOp_error;
|
||||
|
||||
// Companions are only allowed to take inputs.
|
||||
for (unsigned i = 0, n = instance->getNumResults(); i < n; ++i) {
|
||||
if (instance->getPortDirection(i) != Direction::In) {
|
||||
for (auto [i, result] : llvm::enumerate(instance->getResults())) {
|
||||
if (instance->getPortDirection(i) == Direction::In)
|
||||
continue;
|
||||
// Do not allow any outputs in the drop mode.
|
||||
auto ty = result.getType();
|
||||
if (ty.isa<RefType>() && companionMode != CompanionMode::Drop)
|
||||
continue;
|
||||
op.emitOpError()
|
||||
<< "companion instance cannot have output ports";
|
||||
goto FModuleOp_error;
|
||||
}
|
||||
}
|
||||
|
||||
// If no extraction info was provided, exit. Otherwise, setup the
|
||||
// lone instance of the companion to be lowered as a bind.
|
||||
|
|
Loading…
Reference in New Issue