summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorducky2015-12-15 14:01:53 -0800
committerducky2015-12-15 14:01:53 -0800
commit9c2b2173ceecf178734da863751d213ffe5e494c (patch)
tree4df75041329444dccaed9d414ea1edeb7704264b /src
parentea226fd54a1b2c7709eb1759e13ac4a725e1a708 (diff)
Meaningful error when resource copy fails
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/Chisel/testers/TesterDriver.scala5
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)