[LowerDPI] Fix the incorrect input type checking

LowerDPI checks that improted DPI functions have the same function
signatures over their call sites. This fixes a bug that mistakenly
regards operand types of call op as input types. Call op has clock and
enable operands so operand types are not equal to input types of
DPI functions.
This commit is contained in:
Hideto Ueno 2024-06-17 08:37:20 -07:00
parent 9afdd4d069
commit d1545f4f5a
2 changed files with 9 additions and 1 deletions

View File

@ -97,7 +97,7 @@ LogicalResult LowerDPI::lower() {
// Construct DPI func op.
auto firstDPIDecl = getOrCreateDPIFuncDecl(firstDPICallop);
auto inputTypes = firstDPICallop.getOperandTypes();
auto inputTypes = firstDPICallop.getInputs().getTypes();
auto outputTypes = firstDPICallop.getResultTypes();
ImplicitLocOpBuilder builder(firstDPICallop.getLoc(),

View File

@ -31,4 +31,12 @@ firrtl.circuit "DPI" {
firrtl.matchingconnect %out_0, %0 : !firrtl.uint<8>
firrtl.matchingconnect %out_1, %1 : !firrtl.uint<8>
}
// CHECK-LABEL: firrtl.module @DPISignature
firrtl.module @DPISignature(in %clock: !firrtl.clock, in %enable: !firrtl.uint<1>, in %in_0: !firrtl.uint<8>, in %in_1: !firrtl.uint<8>) attributes {convention = #firrtl<convention scalarized>} {
// CHECK: call @clocked_void
// CHECK: call @clocked_void
firrtl.int.dpi.call "clocked_void"(%in_0, %in_1) clock %clock enable %enable : (!firrtl.uint<8>, !firrtl.uint<8>) -> ()
firrtl.int.dpi.call "clocked_void"(%in_0, %in_1) clock %clock : (!firrtl.uint<8>, !firrtl.uint<8>) -> ()
}
}