diff --git a/include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.h b/include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.h index 2cb39e406dbf..7d9a19868c25 100644 --- a/include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.h +++ b/include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.h @@ -19,7 +19,6 @@ #include "circt/Dialect/HW/HWAttributes.h" #include "circt/Dialect/HW/HWOpInterfaces.h" #include "circt/Dialect/HW/InnerSymbolTable.h" -#include "circt/Support/FieldRef.h" #include "mlir/IR/Attributes.h" #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/OpDefinition.h" diff --git a/include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.td b/include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.td index f738ebffdfd1..ad30dfe43343 100644 --- a/include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.td +++ b/include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.td @@ -522,25 +522,4 @@ def Forceable : OpInterface<"Forceable"> { return detail::verifyForceableOp(cast<::circt::firrtl::Forceable>($_op)); }]; } - -def CombDataflow : OpInterface<"CombDataFlow"> { - let cppNamespace = "circt::firrtl"; - let description = [{ - This interface is used for specifying the combinational dataflow that exists - in the results and operands of an operation. - Any operation that doesn't implement this interface is assumed to have a - combinational dependence from each operand to each result. - }]; - let methods = [ - InterfaceMethod<"Get the combinational dataflow relations between the" - "operands and the results. This returns a pair of fieldrefs. The first" - "element is the destination and the second is the source of the dependence." - "The default implementation returns an empty list, which implies that the" - "operation is not combinational.", - "SmallVector>", - "computeDataFlow", (ins), [{}], /*defaultImplementation=*/[{ - return {}; - }]>, - ]; -} #endif // CIRCT_DIALECT_FIRRTL_FIRRTLOPINTERFACES_TD diff --git a/include/circt/Dialect/HW/HWOpInterfaces.h b/include/circt/Dialect/HW/HWOpInterfaces.h index 60841e4ba5ff..78b550761342 100644 --- a/include/circt/Dialect/HW/HWOpInterfaces.h +++ b/include/circt/Dialect/HW/HWOpInterfaces.h @@ -17,6 +17,7 @@ #include "circt/Dialect/HW/HWInstanceImplementation.h" #include "circt/Dialect/HW/HWTypes.h" #include "circt/Dialect/HW/InnerSymbolTable.h" +#include "circt/Support/FieldRef.h" #include "circt/Support/InstanceGraphInterface.h" #include "circt/Support/LLVM.h" #include "mlir/IR/OpDefinition.h" diff --git a/include/circt/Dialect/HW/HWOpInterfaces.td b/include/circt/Dialect/HW/HWOpInterfaces.td index 865be5e50680..f70113e58ebd 100644 --- a/include/circt/Dialect/HW/HWOpInterfaces.td +++ b/include/circt/Dialect/HW/HWOpInterfaces.td @@ -547,4 +547,26 @@ def InnerRefUserOpInterface : OpInterface<"InnerRefUserOpInterface"> { ]; } +def CombDataflow : OpInterface<"CombDataFlow"> { + let cppNamespace = "circt::hw"; + let description = [{ + This interface is used for specifying the combinational dataflow that exists + in the results and operands of an operation. + Any operation that doesn't implement this interface is assumed to have a + combinational dependence from each operand to each result. + }]; + let methods = [ + InterfaceMethod<"Get the combinational dataflow relations between the" + "operands and the results. This returns a pair of ground type fieldrefs." + "The first element is the destination and the second is the source of" + "the dependence." + "The default implementation returns an empty list, which implies that the" + "operation is not combinational.", + "SmallVector>", + "computeDataFlow", (ins), [{}], /*defaultImplementation=*/[{ + return {}; + }]>, + ]; +} + #endif diff --git a/lib/Dialect/FIRRTL/Transforms/CheckCombLoops.cpp b/lib/Dialect/FIRRTL/Transforms/CheckCombLoops.cpp index 31a52cdf32e9..048356e5b426 100644 --- a/lib/Dialect/FIRRTL/Transforms/CheckCombLoops.cpp +++ b/lib/Dialect/FIRRTL/Transforms/CheckCombLoops.cpp @@ -95,7 +95,7 @@ class DiscoverLoops { walk(module, [&](Operation *op) { llvm::TypeSwitch(op) - .Case([&](CombDataFlow df) { + .Case([&](hw::CombDataFlow df) { // computeDataFlow returns a pair of FieldRefs, first element is the // destination and the second is the source. for (auto &dep : df.computeDataFlow())