stop exceptions on empty conf files (#43)

* stop exceptions on empty conf files

* emit empty verilog file | warn users

* put else's on same line as closing bracket
This commit is contained in:
Abraham Gonzalez
2019-03-18 10:15:50 -07:00
committed by Colin Schmidt
parent de94c2376a
commit 817726ff1f
2 changed files with 21 additions and 4 deletions

View File

@@ -839,6 +839,19 @@ object MacroCompiler extends App {
}
case None =>
}
} else {
// Warn user
System.err println "WARNING: Empty *.mems.conf file. No memories generated."
// Emit empty verilog file if no macros found
params.get(Verilog) match {
case Some(verilogFile: String) => {
// Create an empty verilog file
val verilogWriter = new FileWriter(new File(verilogFile))
verilogWriter.close()
}
case None =>
}
}
} catch {
case e: java.util.NoSuchElementException =>