summaryrefslogtreecommitdiff
path: root/src/main/scala/Chisel/Driver.scala
diff options
context:
space:
mode:
authorJim Lawson2016-06-03 12:38:28 -0700
committerJim Lawson2016-06-03 12:38:28 -0700
commit9dd286b8613beba58e053ed00d15877d3a4b02c9 (patch)
tree6ae9268d8e7e6532e5b8a0f3ad51d6c345623376 /src/main/scala/Chisel/Driver.scala
parent70271cd8c3811cb518e81d1d5eb3ed20cb1e2063 (diff)
parentfd53af8642237998e23456a3fd1648ac84607db0 (diff)
Merge branch 'master' into front_end_dependency
Diffstat (limited to 'src/main/scala/Chisel/Driver.scala')
-rw-r--r--src/main/scala/Chisel/Driver.scala9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/scala/Chisel/Driver.scala b/src/main/scala/Chisel/Driver.scala
index d5952834..02204684 100644
--- a/src/main/scala/Chisel/Driver.scala
+++ b/src/main/scala/Chisel/Driver.scala
@@ -46,17 +46,15 @@ trait BackendCompilationUtilities {
* The Verilator prefix will be V$dutFile, and running this will generate
* C++ sources and headers as well as a makefile to compile them.
*
- * Verilator will automatically locate the top-level module as the one among
- * all the files which are not included elsewhere. If multiple ones exist,
- * the compilation will fail.
- *
* @param dutFile name of the DUT .v without the .v extension
+ * @param name of the top-level module in the design
* @param dir output directory
* @param vSources list of additional Verilog sources to compile
* @param cppHarness C++ testharness to compile/link against
*/
def verilogToCpp(
dutFile: String,
+ topModule: String,
dir: File,
vSources: Seq[File],
cppHarness: File
@@ -70,8 +68,9 @@ trait BackendCompilationUtilities {
"-Wno-STMTDLY",
"--trace",
"-O2",
+ "--top-module", topModule,
"+define+TOP_TYPE=V" + dutFile,
- s"+define+PRINTF_COND=!$dutFile.reset",
+ s"+define+PRINTF_COND=!$topModule.reset",
"-CFLAGS",
s"""-Wno-undefined-bool-conversion -O2 -DTOP_TYPE=V$dutFile -include V$dutFile.h""",
"-Mdir", dir.toString,