-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial VAY draft #4498
base: main
Are you sure you want to change the base?
Initial VAY draft #4498
Conversation
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
How will this work on Windows or WASI? |
We can (probably should anyway) use a different YOSYS_NAMESPACE for vay.
Then one program can link to libyosys and libvay, and first use the former,
then call into to latter.
…On Thu, Jul 18, 2024, 17:36 Catherine ***@***.***> wrote:
In the end we want to have a vay command in yosys, that will exec vay to
replace the yosys process, and automatically saves and restores the state,
including passing open file handles for things like the script being
executed.
How will this work on Windows or WASI?
—
Reply to this email directly, view it on GitHub
<#4498 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOGJGFZZYVWZ4GS6CRO2IO3ZM7OHHAVCNFSM6AAAAABLC2OATOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZWHA3TSNZUGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That could work, though in that case there's no need to have the |
I would expect that a fair amount of cleanup will be necessary for this to work. The execve dance would be quick and easy to implement, as a first proof-of-concept. |
So, this seems like explicitly an alternative to #4461 ("my approach") and we can conceptually compare them to some extent. Take the hot loop in opt_expr. You have a vector of cells, and you iterate over them. Currently: You load the type field. If it's equal to a certain type, you look at the corresponding parameters and connections by looking up their identifiers in dictionaries This PR: You My approach: You load the type field. If it's equal to a certain type, you look at the corresponding parameters and connections by calling non-virtual calls to functions that are conditionall on the cell type. The compiler inlines and const propagates this (I hope) so you get low overhead direct access to the parameters and connections. My approach requires codegen for boilerplate, this PR suggests a yosys restart and passing of live resources, so both bring some codebase complexity. My concern is for the |
This is not true. LLVM uses (Zig also should not be used as an example here more generally, but I'm not going to go too off-topic while explaining why.) |
I think everyone in this thread would benefit from reading how "LLVM-style RTTI" (unrelated to the C++'s built-in RTTI mechanism) actually works, which is documented here. |
From yesterday's discussion on a call: A two binary solution is temporarily desirable because switching fully to VAY will bring a performance hit in unmodified code which calls virtual methods on This approach fits the bill better in that regard than mine, since I expected to keep a vector of tagged unions, which is memory inefficient when those structs are heterogeneous in size, which currently they are, and it would be a lot of work to do the "extra memory" trick to move less hot struct members to a storage external to the struct. Both approaches should be brought into a state where their performance and complexity can be evaluated. This approach counts on future codegen, as does mine. This should allow easy changes later on, partially through replacing member access with method calls. The scope of my approach doesn't currently cover directly using |
This adds the build config variable ENABLE_VIRTUAL_APIS. When enabled, the build will produce a
vay
executable instead of ayosys
executable. (VAY stands for Virtual APIs in Yosys, and is pronounced like "way".)In a "vay" build, cells can be of different types, and the Cell API is providing virtual methods that the individual cell types can override.
The goal is to refactor most of yosys to use the virtual methods instead of accessing Cell members directly, or disable commands that would be hard to refactor. Especially coarse-grain front-end commands like
read_verilog
andproc
would likely not be included in vay, because they represent a large code-base that would potentially be hard to refactor in that way.In the end we want to have a
vay
command inyosys
, that will execvay
to replace the yosys process, and automatically saves and restores the state, including passing open file handles for things like the script being executed. This allows us to switch fromyosys
tovay
when going from coarse-grain to fine-grain synthesis, enabling more efficient representations of fine-grain netlists, at the cost of the overhead of virtual method call dispatch.