diff options
| author | Chick Markley | 2015-12-15 18:57:58 -0800 |
|---|---|---|
| committer | Chick Markley | 2015-12-15 18:57:58 -0800 |
| commit | efd6a0a04d3616c03d27ce7745f46daaea8c6b90 (patch) | |
| tree | 36e7649a8e6e2e1bd693eee039dda241cea31643 /src/main/scala/Chisel | |
| parent | d29f8d9d0d381e0daff02768b03b624f5fef1551 (diff) | |
| parent | 9c2b2173ceecf178734da863751d213ffe5e494c (diff) | |
Merge pull request #75 from ucb-bar/meaningfulerror
Meaningful error when resource copy fails.
Seems like this is exposing some deeper error with sbt and external libraries/jars. Sometimes this error message makes sometimes the entire JVM and sbt dump with SEG fault, I don't think this is a chisel problem
Diffstat (limited to 'src/main/scala/Chisel')
| -rw-r--r-- | src/main/scala/Chisel/testers/TesterDriver.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/scala/Chisel/testers/TesterDriver.scala b/src/main/scala/Chisel/testers/TesterDriver.scala index 4da5d059..b25b160b 100644 --- a/src/main/scala/Chisel/testers/TesterDriver.scala +++ b/src/main/scala/Chisel/testers/TesterDriver.scala @@ -11,13 +11,16 @@ object TesterDriver extends BackendCompilationUtilities { */ def copyResourceToFile(name: String, file: File) { val in = getClass().getResourceAsStream(name) + if (in == null) { + throw new FileNotFoundException(s"Resource '$name'") + } val out = new FileOutputStream(file) Iterator.continually(in.read).takeWhile(-1 !=).foreach(out.write) out.close() } /** For use with modules that should successfully be elaborated by the - * frontend, and which can be turned into executeables with assertions. */ + * frontend, and which can be turned into executables with assertions. */ def execute(t: () => BasicTester, additionalVResources: Seq[String] = Seq()): Boolean = { // Invoke the chisel compiler to get the circuit's IR val circuit = Driver.elaborate(t) |
