-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support VHDL and mixed language designs #65
Comments
@umarcor This would be great to add! |
I have a very basic version of this up and running using GHDL on a branch here. Basically what it does now is checks to see if the file is VHDL, and if it is, converts it to Verilog, and then continues through the rest of the normal process with the Verilog file instead. Here's an example of what the test page I added looks like: GHDL / ghdl-yosys-plugin should also be added to conda / the conda env file. I also don't believe YoWASP supports ghdl-yosys-plugin, and so you'd have to use full-fledged Yosys for generation with VHDL. I could be wrong about this though. Constructive criticism welcome! |
@daniellimws -- Look at this! It is super awesome! |
It is! Congrats @nobodywasishere! In https://github.com/buildthedocs/docker we have some dockerfiles for having container images for documentation purposes. Those are used in GHDL, VUnit, btd, rodrigomelo9/FOSS-for-FPGAs, etc. We might add one image with Sphinx on top of
|
@umarcor - We have been using conda here too. |
@nobodywasishere nice! Are you going to make a pull request for this soon? |
@daniellimws Of course! I just wanted to sit on it for a few days to make sure I did it correctly and didn't miss anything. I've just reworked it a little bit and added more documentation to it. |
Alright, so I'm reevaluating my approach in #72 as I believe there could be a better solution. The current approach is translating VHDL into Verilog and pass that along through the same pipeline; however that doesn't cover mixed HDL designs. As I understand it now, mixed HDL designs only matter when There are two possible solutions I can think of right now:
.. hdl-diagram:: path/to/top/file.vhdl
:include: path/to/sub/file.il, path/to/other/file.v
:type: netlistsvg
:module: top
:flatten:
.. hdl-diagram:: path/to/top/file.vhdl
:include: path/to/sub/folder/
:type: netlistsvg
:module: top
:flatten: It may be that implementing both is the best solution for flexibility. This is the Yosys command that takes multiple source files and produce a json (suitable for netlistsvg). The GHDL commands would be left out if there weren't any VHDL files included. yosys -p 'ghdl {VHDL_files} -e; prep -top {top_name} -flatten; write_json {out.json}' {Verilog/RTLIL_files} I've tested including both Verilog and RTLIL files into a VHDL top file using this command and it worked, so I believe it's the way forward. Some thoughts:
@mithro @umarcor @daniellimws Please let me know your thoughts or if I've missed something. |
@nobodywasishere, this repo is in SymbiFlow's organisation, which is lead by @mithro. One of his mottos is "publish fast and improve later; publish even before you think you are ready". Naturally, applying common sense. What I mean is: if #72 works, you can go ahead and ask it to be merged. No need to wait until the "ideal" solution is ready. That will allow some users to benefit from drawing VHDL designs (and provide feedback), while we solve the slightly more complex mixed HDL case. Of course, this is a very friendly comment, not a request.
I would go with:
Where As you see, my suggestion is to remove the
This is why I proposed fields Two important notes:
Apart from having it as a global default, I would support optionally specifying it per diagram. It needs to be the same for all the sources in one diagram, tho. GHDL does not support mixing stds yet.
I suggest picking https://github.com/im-tomu/fomu-workshop/tree/master/mixed-hdl/blink and removing the hard core instantiations. That is, remove the RGB driver and the clock buffer. You will be left with a top level that instantiates a counter. You have four combinations there.
Why does a comma separated list of strings lead to issues?
For GHDL, it does (should) not. There might be some corner cases with the language, but for most designs the order should be guessed automatically. I believe it's the same with Yosys (Verilog). |
Using GHDL as a frontend for Yosys allows synthesising VHDL, Verilog and/or mixed language designs. See https://im-tomu.github.io/fomu-workshop/mixed-hdl.html. It'd be interesting to test whether this extension supports those cases, and to enhance it otherwise.
The text was updated successfully, but these errors were encountered: