aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJim Lawson2018-04-16 16:03:11 -0700
committerGitHub2018-04-16 16:03:11 -0700
commit1b4b17c7fb6d29179e7ff11368f7e387ce1bc179 (patch)
tree73dbafc88ad5bcea67276c330ea68e053bd747ea /src/main
parent78b15081bb1235a3aa07c1817a382444bcbd8f0f (diff)
Cleaning up BlackBoxSourceHelper - use absolute file paths. (#789)
* Cleaning up BlackBoxSourceHelper - use absolute file paths. ```bash make[1]: *** No rule to make target `test_run_dir/examples.AccumBlackBox_PeekPokeTest_Verilator345491158/AccumBlackBox.v', needed by `/Users/john/chisel-testers/test_run_dir/examples.AccumBlackBox_PeekPokeTest_Verilator345491158/VAccumBlackBoxWrapper.h'. Stop. ``` since the path `test_run_dir/examples.AccumBlackBox_PeekPokeTest_Verilator345491158/AccumBlackBox.v` does not exist inside `test_run_dir`. We should either: - strip the targetDir prefix, - prepend a `../` to the path, - use absolute paths I decided to go with the latter since this makes the least assumptions about the actual downstream processing and we already use absolute paths in other parts of this code. * Minor cleanup. - Anonymize make failure comment. - Use common map syntax.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala b/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala
index 07d6e145..1e6fa7ea 100644
--- a/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala
+++ b/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala
@@ -113,7 +113,11 @@ object BlackBoxSourceHelper {
def writeFileList(files: ListSet[File], targetDir: File) {
if (files.nonEmpty) {
- writeTextToFile(files.mkString("\n"), new File(targetDir, fileListName))
+ // We need the absolute path here (or strip targetDir from the file path),
+ // so verilator will create a path to the file that works from the targetDir.
+ // Otherwise, when make tries to determine dependencies based on the *__ver.d file, we end up with errors like:
+ // make[1]: *** No rule to make target `test_run_dir/examples.AccumBlackBox_PeekPokeTest_Verilator345491158/AccumBlackBox.v', needed by `.../chisel-testers/test_run_dir/examples.AccumBlackBox_PeekPokeTest_Verilator345491158/VAccumBlackBoxWrapper.h'. Stop.
+ writeTextToFile(files.map(_.getAbsolutePath).mkString("\n"), new File(targetDir, fileListName))
}
}