Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HW] Move the CombDataFlow op interface from FIRRTL to HW #7195

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 0 additions & 21 deletions include/circt/Dialect/FIRRTL/FIRRTLOpInterfaces.td
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::pair<circt::FieldRef, circt::FieldRef>>",
"computeDataFlow", (ins), [{}], /*defaultImplementation=*/[{
return {};
}]>,
];
}
#endif // CIRCT_DIALECT_FIRRTL_FIRRTLOPINTERFACES_TD
1 change: 1 addition & 0 deletions include/circt/Dialect/HW/HWOpInterfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
22 changes: 22 additions & 0 deletions include/circt/Dialect/HW/HWOpInterfaces.td
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::pair<circt::FieldRef, circt::FieldRef>>",
"computeDataFlow", (ins), [{}], /*defaultImplementation=*/[{
return {};
}]>,
];
}

#endif
2 changes: 1 addition & 1 deletion lib/Dialect/FIRRTL/Transforms/CheckCombLoops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class DiscoverLoops {

walk(module, [&](Operation *op) {
llvm::TypeSwitch<Operation *>(op)
.Case<CombDataFlow>([&](CombDataFlow df) {
.Case<hw::CombDataFlow>([&](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())
Expand Down
Loading