-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIRRTL] Support MarkDUTAnnotation on extmodules. (#8001)
In some cases, the "DUT" might be an extmodule from a separate compilation unit, and we still want all the old legacy "is DUT" logic to work. To support this, we need applyDUTAnno to allow the annotation to be applied to an extmodule, and we need extractDUT and its users to work with FModuleLikes instead of FModuleOp. The only other thing that appears to be using this "is DUT" logic is the newer InstanceInfo helper, which already works with igraph::ModuleOpInterfaces and seems to work fine with extmodules as the "DUT".
- Loading branch information
1 parent
50e3f9f
commit 9775df2
Showing
7 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
; RUN: firtool %s -ir-verilog | FileCheck %s | ||
|
||
FIRRTL version 4.1.0 | ||
|
||
; COM: Check that we can even target an extmodule. | ||
circuit Test : %[[ | ||
{ | ||
"class": "sifive.enterprise.firrtl.MarkDUTAnnotation", | ||
"target": "~Test|DUT" | ||
} | ||
]] | ||
; CHECK: hw.hierpath private [[DUT_NLA:@.+]] [@Test::[[DUT_SYM:@.+]]] | ||
public module Test : | ||
input in : UInt<1> | ||
output out : UInt<1> | ||
|
||
; CHECK: hw.instance "dut" sym [[DUT_SYM]] | ||
inst dut of DUT | ||
|
||
connect dut.in, in | ||
connect out, dut.out | ||
|
||
extmodule DUT : | ||
input in : UInt<1> | ||
output out : UInt<1> | ||
|
||
; COM: Check that metadata includes the dutModulePath pointing to Test::dut. | ||
; CHECK: om.class @SiFive_Metadata(%basepath: !om.basepath) -> (dutModulePath | ||
; CHECK-NEXT: om.path_create instance %basepath [[DUT_NLA]] |