Skip to content

Commit 91cbc68

Browse files
committed
[svsim] Add a common type for Backend Settings
Add a shared super type for Backend Settings. This allows for functions to be written which operate on the type of any backend settings as opposed to having to only work on one. This is building towards a more generic way of describing options to Scalatest simulations. Signed-off-by: Schuyler Eldridge <[email protected]>
1 parent db93161 commit 91cbc68

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

svsim/src/main/scala/Backend.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ object CommonCompilationSettings {
7070
}
7171

7272
trait Backend {
73-
type CompilationSettings
73+
type CompilationSettings <: Backend.Settings
7474
def generateParameters(
7575
outputBinaryName: String,
7676
topModuleName: String,
@@ -94,6 +94,9 @@ trait Backend {
9494

9595
final object Backend {
9696

97+
/** The super type of all backend-specific settings. */
98+
trait Settings extends Product
99+
97100
final case class Parameters(
98101
private[svsim] val compilerPath: String,
99102
private[svsim] val compilerInvocation: Parameters.Invocation,

svsim/src/main/scala/vcs/Backend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object Backend {
6767
licenceExpireWarningTimeout: Option[Int] = None,
6868
archOverride: Option[String] = None,
6969
waitForLicenseIfUnavailable: Boolean = false
70-
)
70+
) extends svsim.Backend.Settings
7171

7272
def initializeFromProcessEnvironment() = {
7373
(sys.env.get("VCS_HOME"), sys.env.get("LM_LICENSE_FILE")) match {

svsim/src/main/scala/verilator/Backend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object Backend {
2121
disabledWarnings: Seq[String] = Seq(),
2222
disableFatalExitOnWarnings: Boolean = false,
2323
enableAllAssertions: Boolean = false
24-
)
24+
) extends svsim.Backend.Settings
2525

2626
def initializeFromProcessEnvironment() = {
2727
val output = mutable.ArrayBuffer.empty[String]

0 commit comments

Comments
 (0)