Commit d2df30ff authored by Jens Korinth's avatar Jens Korinth
Browse files

Use args to ModuleBuilder to filter builds

* args can contain names of modules, only those are built
* names are case-insensitive
* no args builds all modules
* added uniqueness check for module names
parent 47415f44
......@@ -15,7 +15,10 @@ abstract class ModuleBuilder(packagingDir: String = "packaging") {
val modules: List[(() => Module, CoreDefinition)]
def main(args: Array[String]) {
modules foreach { m =>
assert ((modules map (_._2.name.toLowerCase)).toSet.size == modules.length, "module names must be unique")
val fm = modules filter (m => args.length == 0 || args.map(_.toLowerCase).contains(m._2.name.toLowerCase))
assert (fm.length > 0, "no matching cores found for: " + args.mkString(", "))
fm foreach { m =>
chiselMain(chiselArgs ++ Array("--targetDir", m._2.root), m._1)
val json = "%s/%s.json".format(m._2.root, m._2.name)
m._2.write(json)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment