chisel2-deprecated
chisel2-deprecated copied to clipboard
Should be possible to configure a module without using --configInstance [string]
Currently, the only way to sanely inject a configuration object into a design is by appending --configInstance [string of config Instance class]. This is passable but the Class.forName(name) call is generally regarded to be fairly fragile (due to classloader and package name weirdness). It would be much better if the user had an option of constructing a Configuration instance themselves (via new or a factory object) and directly passing that object to ChiselMain. Further, in order to lighten executeUnwrapped (in Driver) a little, the construction of the Configuration object would use that new pathway.
This would permit the writing of better wrappers at the top near main. For example, in reference chip, instead of the user having to remember (and perhaps later update!) the exact names (and packages!) of Configuration objects, main could look at the arguments and construct the Configuration object for you.
As a followup, we probably shouldn't be bothering with splitting the [string] into both a package name and class name as, really, the entire string of packagename.classname is the true class name. also, the abstracting breaks apart if you have, for example, myproject.mysubproject.myconfig