Replies: 1 comment 3 replies
-
I know of some tools using slang as a frontend, but they aren't open source (and there are probably more I don't know about too). It'd be nice if you wanted to build one and make it open source! Yes, slang already does full elaboration. If you have a Compilation object, calling getRoot() will give you the root of the elaborated design tree, which you can walk to figure out anything about the design that you might like. defparams are mostly supported; there are some edge cases not fully handled but if you just use them for basic purposes it should be fine. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Now that slang is able to parse my whole design, I'm looking for more fully compiling, standalone tools, that are using slang, beyond the simple 2 simple examples in
source/util
. I searched for external standalone projects using it, but couldn't find any.Also, I was assuming slang contains an elaboration pass that does the following:
generate
elaborations, etc.I realize there are issues with defparam statements, that requires a solver, but for the time being, I would simply raise an error if we encounter one, as 99% of the designs in the last 20 years are not using it.
It also needs to resolve constant functions (compile it for a VM??)
generate
conditionals and loops, producingThe end result of such a pass would be a new tree of concrete instances that can be more easily queried for actual design parameters.
I've searched the codebase, but I couldn't find any such pass. Am I missing something? Has someone else already wrote such a pass?
I have some ideas for an efficient storage scheme, by adding pointers to arrays of concrete values to relevant tree entries.
In these arrays the elements are stored in sequence but represent all possible instances from all the tree, relying on the instance order created by a deterministic (depth-first?) tree traversing algorithm.
What I still need to work out is how to store "hints" in the tree allowing efficient and simple access to the specific index range within these arrays for any point in the concrete elaborated tree.
Beta Was this translation helpful? Give feedback.
All reactions