Skip to content

Commit 1eb691b

Browse files
author
Oron Port
committed
allow simulation to have a different executable
1 parent 8ed753f commit 1eb691b

File tree

1 file changed

+5
-3
lines changed
  • lib/src/main/scala/dfhdl/tools/toolsCore

1 file changed

+5
-3
lines changed

lib/src/main/scala/dfhdl/tools/toolsCore/Tool.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import dfhdl.compiler.stages.verilog.VerilogDialect
1313

1414
trait Tool:
1515
val toolName: String
16-
private def runExec: String =
16+
final protected def runExec: String =
1717
val osName: String = sys.props("os.name").toLowerCase
1818
if (osName.contains("windows")) windowsBinExec else binExec
1919
protected def binExec: String
@@ -110,7 +110,8 @@ trait Tool:
110110
final protected def exec[D <: Design](
111111
cmd: String,
112112
prepare: => Unit = (),
113-
loggerOpt: Option[Tool.ProcessLogger] = None
113+
loggerOpt: Option[Tool.ProcessLogger] = None,
114+
runExec: String = this.runExec
114115
)(using CompilerOptions, ToolOptions, MemberGetSet): Unit =
115116
preCheck()
116117
prepare
@@ -211,12 +212,13 @@ trait VHDLLinter extends Linter, VHDLTool:
211212

212213
trait Simulator extends Tool:
213214
val simRunsLint: Boolean = false
215+
protected def simRunExec: String = this.runExec
214216
final def simulate[D <: Design](
215217
cd: CompiledDesign[D]
216218
)(using CompilerOptions, SimulatorOptions): CompiledDesign[D] =
217219
given MemberGetSet = cd.stagedDB.getSet
218220
if (simRunsLint) this.asInstanceOf[Linter].lint(cd)
219-
exec(simulateCmdFlags, simulatePrepare(), simulateLogger)
221+
exec(simulateCmdFlags, simulatePrepare(), simulateLogger, simRunExec)
220222
cd
221223
protected def simulatePrepare()(using CompilerOptions, SimulatorOptions, MemberGetSet): Unit = {}
222224
protected def simulateLogger(using

0 commit comments

Comments
 (0)