allow chisel to elaborate Modules outside of the ReferenceChip package
This commit is contained in:
parent
dbeadba2dc
commit
5128298e8a
@ -47,7 +47,7 @@ object BuildSettings extends Build {
|
|||||||
val chiselMainObject = chiselMainClass.getDeclaredFields.head.get(null)
|
val chiselMainObject = chiselMainClass.getDeclaredFields.head.get(null)
|
||||||
val chiselMain = chiselMainClass.getMethod("run", classOf[Array[String]], classOf[Function0[_]])
|
val chiselMain = chiselMainClass.getMethod("run", classOf[Array[String]], classOf[Function0[_]])
|
||||||
val chiselArgs = args.drop(numArgs)
|
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()
|
val generator = () => component.newInstance()
|
||||||
chiselMain.invoke(chiselMainObject, Array(chiselArgs.toArray, generator):_*)
|
chiselMain.invoke(chiselMainObject, Array(chiselArgs.toArray, generator):_*)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user