1
0

allow chisel to elaborate Modules outside of the ReferenceChip package

This commit is contained in:
Yunsup Lee 2014-02-05 03:29:23 -08:00
parent dbeadba2dc
commit 5128298e8a

View File

@ -47,7 +47,7 @@ object BuildSettings extends Build {
val chiselMainObject = chiselMainClass.getDeclaredFields.head.get(null)
val chiselMain = chiselMainClass.getMethod("run", classOf[Array[String]], classOf[Function0[_]])
val chiselArgs = args.drop(numArgs)
val component = classLoader.loadClass(packageName+"."+componentName)
val component = classLoader.loadClass((if (!componentName.contains('.')) packageName+"." else "")+componentName)
val generator = () => component.newInstance()
chiselMain.invoke(chiselMainObject, Array(chiselArgs.toArray, generator):_*)
}