chisel2-deprecated icon indicating copy to clipboard operation
chisel2-deprecated copied to clipboard

Should be possible to configure a module without using --configInstance [string]

Open sdtwigg opened this issue 11 years ago • 1 comments

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.

sdtwigg avatar Oct 24 '14 01:10 sdtwigg

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

sdtwigg avatar Oct 24 '14 01:10 sdtwigg