summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJim Lawson2018-08-29 10:34:04 -0700
committerGitHub2018-08-29 10:34:04 -0700
commit7da0d5f8704b25a94e25cd9638c77695ae081d7f (patch)
treedc4a4a22afd6ebee4c133fbad8f2451e3c36ea01 /src/main
parent52daa373e7c6601b7461e8bf400b8957080ca110 (diff)
Inhibit aggressive resource file name mangling. (#884)
* Inhibit aggressive resource file name mangling. This addresses #883. * Use common method to write resources to a directory to keep file names consistent.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/scala/chisel3/testers/TesterDriver.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/scala/chisel3/testers/TesterDriver.scala b/src/main/scala/chisel3/testers/TesterDriver.scala
index e4bdda0b..df26e3c3 100644
--- a/src/main/scala/chisel3/testers/TesterDriver.scala
+++ b/src/main/scala/chisel3/testers/TesterDriver.scala
@@ -7,6 +7,7 @@ import java.io._
import chisel3.experimental.RunFirrtlTransform
import firrtl.{Driver => _, _}
+import firrtl.transforms.BlackBoxSourceHelper.writeResourceToDirectory
object TesterDriver extends BackendCompilationUtilities {
@@ -31,11 +32,12 @@ object TesterDriver extends BackendCompilationUtilities {
// Copy CPP harness and other Verilog sources from resources into files
val cppHarness = new File(path, "top.cpp")
copyResourceToFile("/chisel3/top.cpp", cppHarness)
+ // NOTE: firrtl.Driver.execute() may end up copying these same resources in its BlackBoxSourceHelper code.
+ // As long as the same names are used for the output files, and we avoid including duplicate files
+ // in BackendCompilationUtilities.verilogToCpp(), we should be okay.
+ // To that end, we use the same method to write the resource to the target directory.
val additionalVFiles = additionalVResources.map((name: String) => {
- val mangledResourceName = name.replace("/", "_")
- val out = new File(path, mangledResourceName)
- copyResourceToFile(name, out)
- out
+ writeResourceToDirectory(name, path)
})
// Compile firrtl