-
Notifications
You must be signed in to change notification settings - Fork 14
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
Import netlistsvg ELK json #26
Comments
But I think it could be better to just load yosys input directly. |
Loading the Yosys json directly would also work. Just wanted to see how easy it'd be to import the netlistsvg elk json. I wonder if it'd be possible to take an elk json generated for d3-hwsch and translate it to work with the netlistsvg renderer, so that netlistsvg could be used as a "front end" for this as well... I think yosys json would be the best way forward with this idea. |
Actually the format should be same (but there is a difference in elkjs version, the 0.7.1 and 0.7.2 had some issues that's why I did not update yet.)
From what I see:
Also I would be super happy if we can merge netlistsvg and d3-hwschematic somehow, but I do not have the authority to convince anyone to do it or at least agree with it. |
Ah I did not know about this. What issues are there and what version do you recommend? To be honest, when I updated the version, I didn't change how the elk json was generated, just checked to make sure everything still operated correctly, so it should be the same as what it was for 0.3.1 (what I think it was before updating).
I don't have the authority to do that either. At a minimum though, I think just providing that interoperability between them, maybe with some compatibility scripts like the one you were writing earlier, would be good enough for now for anyone wanting that functionality. /cc @nturley |
Currently I do not know latest version and in this case it means that the latest version is probably best.
Problem with compatibility scripts is that that someone has to maintain them. It does not seems like big deal but there is always some sort of problem and if you are not familiar with latest update in other project, it is hard. That is why I was mentioning that project merge or that we need someone who updates them once some breaking change appears. With potential merge there is one significant problem. We are using d3-hwschematic to visualize code on system/HLS level, but netlistsvg/yosys focuses on gate/operator level which means that they do not need the features this project have and thus we are some sort of outsiders for them. |
May I ask whether this project supports the direct import of the netlist JSON file output by yosys at present? According to the previous conversation, I did not get a clear answer. If so, do you have relevant operation instructions? |
Sadly no, this project does not accept yosys JSON format, it would be simple to support it however I do not have the luxury of time to do it, but I can help if someone decides to implement it. |
I will try this work and will contact you if there is any progress or difficulty. Finally, thank you for your contribution. |
@Bestduan I hired some student to work on this, https://github.com/sv12359/d3-hwschematic, It is nearly complete we now working on split/concatenation nodes which require a special care.
We are currently using
|
First of all, thank you for your team's contribution. I am indeed a user of yosys. My previous work was to render the netlist generated by yosys in vscode, which will have more practical engineering significance.This is a preview of the relevant features I work on: After the synthesis of yosys, there are some relatively fixed cells. I think it is better to use the corresponding icon for fixed cells. The svg below is a little work I made on top of this: You can use it directly, or make a better icon with it. In the end, the work I have done is not complete. For more detailed information, please refer to the doc of yosys. You can find a detailed description of the fixed cells included with yosys in Chapter 5 of the documentation. |
I think you can try |
for example module test(a, b, y);
input [15:0] a, b;
output [15:0] y;
wire [7:0] ah = a[15:8], al = a[7:0];
wire [7:0] bh = b[15:8], bl = b[7:0];
wire [7:0] th = ah + bh, tl = al + bl;
wire [15:0] t = {th, tl}, k = t ^ 16'hcd;
assign y = { k[7:0], k[15:8] };
endmodule and [email protected] script read_verilog splice.v
hierarchy -check; opt
copy test gold
cd test
splice
# show
cd ..
write_json out.json you can find |
Hi! Do you plant to continue with this? I would like to use it in TerosHDL :) |
@qarlosalberto yes, 2 years at least and most likely even after if there is no better alternative. I am currently building VSCode extension for it. |
Nice!!
El vie., 24 mar. 2023 0:48, Nic30 ***@***.***> escribió:
… @qarlosalberto <https://github.com/qarlosalberto> yes, 2 years at least
and most likely even after if there is no better alternative. I am
currently building VSCode extension
<https://github.com/Nic30/vscode-extension-digitalcircuitanalysis> for it.
—
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNN4R5E7Y4NLKAFNSTK2BLW5TOOFANCNFSM5FJUKSNA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Internally, netlistsvg generates a JSON object very similar to the ELK JSON used by this project. For example, using one of the Fomu blink examples, this is generated by netlistsvg:
And this is the corresponding ELK JSON before being handed off to ELK for rendering into an SVG:
Trying to import this directly, I had to change
layoutOptions
toproperties
and add emptyhwMeta
for the different nodes, but still came up with errors. I'm also not that familiar with this format so you may be able to see something I can't.What I'm thinking about is if it'd be possible to add an option to netlistsvg to export this ELK JSON, and then have d3-hwschematic import it, maybe with minor modifications. The variable
kgraph
here is where this JSON/object is generated/stored. This way, d3-hwschematic could generate diagrams for VHDL/Verilog, and netlistsvg could have a new "frontend".The text was updated successfully, but these errors were encountered: