Skip to content

Commit

Permalink
[WIP] Update directories and linker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Sep 5, 2024
1 parent 36d2c64 commit eeb8041
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 41 deletions.
1 change: 1 addition & 0 deletions include/circt/Dialect/OM/OMOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def ClassFieldsOp : OMClassFieldsLike<"class.fields", [HasParent<"ClassOp">]> {
}]>
];
let arguments = (ins Variadic<AnyType>:$fields);
// TODO: remove attrs
// ArrayAttr:$fieldNames,
// DictionaryAttr:$fieldIdxs);

Expand Down
38 changes: 8 additions & 30 deletions test/Dialect/FIRRTL/SFCTests/directories.fir
Original file line number Diff line number Diff line change
Expand Up @@ -135,41 +135,23 @@ circuit TestHarness:
; SITEST_NODUT: FILE "testbench.sitest.json"
; SITEST_NODUT-NOT: FILE

; MLIR_OUT: om.class @SitestBlackBoxModulesSchema(%basepath: !om.basepath, %moduleName_in: !om.string) {
; MLIR_OUT: om.class.fields(
; MLIR_OUT: moduleName %moduleName_in : !om.string
; MLIR_OUT: )
; MLIR_OUT: om.class @SitestBlackBoxModulesSchema(%basepath: !om.basepath, %moduleName_in: !om.string) -> (moduleName: !om.string) {
; MLIR_OUT: om.class.fields %moduleName_in : !om.string
; MLIR_OUT: }

; MLIR_OUT: om.class @SitestBlackBoxMetadata(%basepath: !om.basepath)
; MLIR_OUT: om.class @SitestBlackBoxMetadata(%basepath: !om.basepath) -> [[V1:.+]]: !om.class.type<@SitestBlackBoxModulesSchema>, [[V2:.+]]: !om.class.type<@SitestBlackBoxModulesSchema>, [[V3:.+]]: !om.class.type<@SitestBlackBoxModulesSchema>
; MLIR_OUT: %0 = om.constant "Foo_BlackBox" : !om.string
; MLIR_OUT: %1 = om.object @SitestBlackBoxModulesSchema(%basepath, %0) : (!om.basepath, !om.string) -> !om.class.type<@SitestBlackBoxModulesSchema>
; MLIR_OUT: %2 = om.constant "Bar_BlackBox" : !om.string
; MLIR_OUT: %3 = om.object @SitestBlackBoxModulesSchema(%basepath, %2) : (!om.basepath, !om.string) -> !om.class.type<@SitestBlackBoxModulesSchema>
; MLIR_OUT: %4 = om.constant "Baz_BlackBox" : !om.string
; MLIR_OUT: %5 = om.object @SitestBlackBoxModulesSchema(%basepath, %4) : (!om.basepath, !om.string) -> !om.class.type<@SitestBlackBoxModulesSchema>
; MLIR_OUT: om.class.fields(
; MLIR_OUT: [[V1:.+]] %1 : !om.class.type<@SitestBlackBoxModulesSchema>,
; MLIR_OUT: [[V2:.+]] %3 : !om.class.type<@SitestBlackBoxModulesSchema>,
; MLIR_OUT: [[V3:.+]] %5 : !om.class.type<@SitestBlackBoxModulesSchema>
; MLIR_OUT: )
; MLIR_OUT: om.class.fields %1, %3, %5 : !om.class.type<@SitestBlackBoxModulesSchema>, !om.class.type<@SitestBlackBoxModulesSchema>, !om.class.type<@SitestBlackBoxModulesSchema>
; MLIR_OUT: }

; MLIR_OUT: om.class @MemorySchema(%basepath: !om.basepath, %name_in: !om.string, %depth_in: !om.integer, %width_in: !om.integer, %maskBits_in: !om.integer, %readPorts_in: !om.integer, %writePorts_in: !om.integer, %readwritePorts_in: !om.integer, %writeLatency_in: !om.integer, %readLatency_in: !om.integer, %hierarchy_in: !om.list<!om.path>, %inDut_in: i1, %extraPorts_in: !om.list<!om.class.type<@ExtraPortsMemorySchema>>
; MLIR_OUT: om.class.fields(
; MLIR_OUT: name %name_in : !om.string,
; MLIR_OUT: depth %depth_in : !om.integer,
; MLIR_OUT: width %width_in : !om.integer,
; MLIR_OUT: maskBits %maskBits_in : !om.integer,
; MLIR_OUT: readPorts %readPorts_in : !om.integer,
; MLIR_OUT: writePorts %writePorts_in : !om.integer,
; MLIR_OUT: readwritePorts %readwritePorts_in : !om.integer,
; MLIR_OUT: writeLatency %writeLatency_in : !om.integer,
; MLIR_OUT: readLatency %readLatency_in : !om.integer,
; MLIR_OUT: hierarchy %hierarchy_in : !om.list<!om.path>,
; MLIR_OUT: extraPorts %extraPorts_in : !om.list<!om.class.type<@ExtraPortsMemorySchema>>
; MLIR_OUT: )
; MLIR_OUT: om.class @MemoryMetadata(%basepath: !om.basepath)
; MLIR_OUT: om.class @MemorySchema(%basepath: !om.basepath, %name_in: !om.string, %depth_in: !om.integer, %width_in: !om.integer, %maskBits_in: !om.integer, %readPorts_in: !om.integer, %writePorts_in: !om.integer, %readwritePorts_in: !om.integer, %writeLatency_in: !om.integer, %readLatency_in: !om.integer, %hierarchy_in: !om.list<!om.path>, %inDut_in: i1, %extraPorts_in: !om.list<!om.class.type<@ExtraPortsMemorySchema>> -> (name: !om.string, depth: !om.integer, width: !om.integer, maskBits: !om.integer, readPorts: !om.integer, writePorts: !om.integer, readWritePorts: !om.integer, writeLatency: !om.integer, readLatency: !om.integer, hierarchy: !om.list<!om.path>, extraPorts: !om.list<!om.class.type<@ExtraPortsMemorySchema>>)
; MLIR_OUT: om.class.fields %name_in, %depth_in, %width_in, %maskBits_in, %readPorts_in, %writePorts_in, %readwritePorts_in, %writeLatency_in, %readLatency_in, %hierarchy_in, %extraPorts_in : !om.string, !om.integer, !om.integer, !om.integer, !om.integer, !om.integer, !om.integer, !om.integer, !om.integer, !om.list<!om.path>, !om.list<!om.class.type<@ExtraPortsMemorySchema>>
; MLIR_OUT: om.class @MemoryMetadata(%basepath: !om.basepath) -> (foo_m_ext_field:, bar_m_ext_field:, baz_m_ext_field:)
; MLIR_OUT: om.path_create instance %basepath @memNLA
; MLIR_OUT: om.list_create
; MLIR_OUT: om.object @MemorySchema
Expand Down Expand Up @@ -207,11 +189,7 @@ circuit TestHarness:
; MLIR_OUT: om.constant #om.integer<0 : ui32> : !om.integer
; MLIR_OUT: om.constant #om.integer<1 : ui32> : !om.integer
; MLIR_OUT: om.constant #om.integer<1 : ui32> : !om.integer
; MLIR_OUT: om.class.fields(
; MLIR_OUT: foo_m_ext_field
; MLIR_OUT: bar_m_ext_field
; MLIR_OUT: baz_m_ext_field
; MLIR_OUT: )
; MLIR_OUT: om.class.fields %4, %20, %38 : !om.class.type<@MemorySchema>, !om.class.type<@MemorySchema>, ! om.class.type<@MemorySchema>

; SITEST_NODUT: FILE "design.sitest.json"
; SITEST_NODUT-NOT: FILE
Expand Down
4 changes: 2 additions & 2 deletions test/om-linker/Inputs/a.mlir
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module {
om.class @A(%arg: i1) {
om.class.fields()
om.class.fields
}
om.class @Conflict(){
om.class.fields()
om.class.fields
}
}
8 changes: 3 additions & 5 deletions test/om-linker/Inputs/b.mlir
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module {
om.class.extern @A(%arg: i1) {
om.class.extern.fields()
}
om.class.extern @A(%arg: i1) {}
om.class @B(%arg: i2) {
om.class.fields()
om.class.fields
}
om.class @Conflict(){
om.class.fields()
om.class.fields
}
}
8 changes: 4 additions & 4 deletions test/om-linker/link.mlir
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// RUN: om-linker %S/Inputs/a.mlir %S/Inputs/b.mlir %S/Inputs/other.mlir | FileCheck %s
// CHECK: module {
// CHECK-NEXT: om.class @A(%arg: i1) {
// CHECK-NEXT: om.class.fields()
// CHECK-NEXT: om.class.fields
// CHECK-NEXT: }
// CHECK-NEXT: om.class @Conflict_a() {
// CHECK-NEXT: om.class.fields()
// CHECK-NEXT: om.class.fields
// CHECK-NEXT: }
// CHECK-NEXT: om.class @B(%arg: i2) {
// CHECK-NEXT: om.class.fields()
// CHECK-NEXT: om.class.fields
// CHECK-NEXT: }
// CHECK-NEXT: om.class @Conflict_b() {
// CHECK-NEXT: om.class.fields()
// CHECK-NEXT: om.class.fields
// CHECK-NEXT: }
// CHECK-NEXT: }

0 comments on commit eeb8041

Please sign in to comment.