-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SV] Add feature flags to new SVExtractTestCode features. (#4094)
These new additions are both fairly significant departures from past behavior, so add an ability to disable them. They remain enabled by default. The new flags are plumbed out to firtool flags so they can be disabled from firtool, and a test is added that this behavior can be controlled from firtool.
- Loading branch information
1 parent
9ec9654
commit 8358725
Showing
5 changed files
with
92 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
; RUN: firtool %s -extract-test-code | FileCheck %s | ||
; RUN: firtool %s -extract-test-code -etc-disable-instance-extraction | FileCheck %s --check-prefix=DISABLEINSTANCE | ||
; RUN: firtool %s -extract-test-code -etc-disable-module-inlining | FileCheck %s --check-prefix=DISABLEMODULE | ||
|
||
circuit Top: | ||
module Foo: | ||
input a : UInt<1> | ||
output b : UInt<1> | ||
b <= a | ||
|
||
; Ensure foo is extracted by default. | ||
; CHECK-LABEL: module InstanceExtracted_assert( | ||
; CHECK: Foo foo | ||
|
||
; Ensure foo is not extracted when disabled. | ||
; DISABLEINSTANCE-LABEL: module InstanceExtracted( | ||
; DISABLEINSTANCE: Foo foo | ||
|
||
module InstanceExtracted: | ||
input clock : Clock | ||
input cond : UInt<1> | ||
output out : UInt<1> | ||
|
||
wire b : UInt<1> | ||
inst foo of Foo | ||
foo.a <= cond | ||
b <= foo.b | ||
|
||
assert(clock, cond, b, "Some assertion") | ||
|
||
out <= cond | ||
|
||
; Ensure InputOnly is inlined by default. | ||
; CHECK-NOT: module InputOnly( | ||
|
||
; Ensure InputOnly is not inlined when disabled. | ||
; DISABLEMODULE-LABEL: module InputOnly( | ||
|
||
module InputOnly: | ||
input clock : Clock | ||
input cond : UInt<1> | ||
assert(clock, cond, cond, "Some assertion") | ||
|
||
module Top: | ||
input clock : Clock | ||
input cond : UInt<1> | ||
output out : UInt<1> | ||
|
||
inst instance_extracted of InstanceExtracted | ||
instance_extracted.clock <= clock | ||
instance_extracted.cond <= cond | ||
out <= instance_extracted.out | ||
|
||
inst input_only of InputOnly | ||
input_only.clock <= clock | ||
input_only.cond <= cond | ||
|
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