TerosTechnology / vscode-terosHDL

VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
https://terostechnology.github.io/terosHDLdoc/
GNU General Public License v3.0
559 stars 45 forks source link

[BUG] "Show netlist" schematic generation failed when using Yosys + GHDL(module) configuration #381

Open kevingoh opened 1 year ago

kevingoh commented 1 year ago

Describe the bug When trying to generate schematic of my designs in VHDL, which are synthesised successfully using GHDL, it failed when trying to generate schematic with the Yosys command generated. The error was asserted by GHDL plugin module because the TOP module isn't specified in the Yosys command generated by the tool.

Sample of the command generated by terosHDL:

yosys -m ghdl -p "ghdl --std=08 -fsynopsys top.vhd -e; proc; opt; write_json teroshdl_yosys_output.json; stat",

The TOP entity in top.vhd is supposedly specified after the -e switch in the command. The top.vhd was selected as as the top in the tool.

To Reproduce By selecting "show the netlist" with Yosys + GHDL(module) configuration on top module written with VHDL.

Code N/A

Please complete the following information:

Screenshots If applicable, add screenshots to help explain your problem. Screenshot 2023-03-10 at 10 40 22

Additional context N/A

qarlosalberto commented 1 year ago

What should be the correct command?

bit0fun commented 1 year ago

Not sure if this was ever updated, but it appears from the GHDL plugin that the format should be :

Alternatively, it is possible to analyze, elaborate and synthesize VHDL sources at once, instead of calling GHDL and Yosys in two steps. In this example: yosys $MODULE -p 'ghdl leds.vhdl spin1.vhdl -e leds; synth_ice40 -json leds.json'

With the mention of $MODULE being the following:

NOTE: if GHDL is built as a module, set MODULE to '-m ghdl' or '-m path/to/ghdl.so', otherwise, unset it.

It appears that currently, the module part is omitted.

bit0fun commented 1 year ago

My best guess as to what is happening, is that src/features/schematic.ts:201 is not being set properly, as src/features/schematic.ts:214 appears to select the right thing for the plugin variable and then go on to be used on line 228

Though I may be mistaken if this is indeed a bug that is resolved or not, as I only appear to be running v2.0.2 as opposed to the latest available on GitHub. VSCode only appears to have v2.0.2 as the latest

qarlosalberto commented 1 year ago

I will take a look. Currently I'm working in the version 3.x but fixing bugs on 2.x

El lun., 27 mar. 2023 18:40, Dylan @.***> escribió:

My best guess as to what is happening, is that src/features/schematic.ts:201 https://github.com/TerosTechnology/vscode-terosHDL/blob/main/src/features/schematic.ts#L201 is not being set properly, as src/features/schematic.ts:214 https://github.com/TerosTechnology/vscode-terosHDL/blob/main/src/features/schematic.ts#L214 appears to select the right thing for the plugin variable and then go on to be used on line 228 https://github.com/TerosTechnology/vscode-terosHDL/blob/main/src/features/schematic.ts#L228

Though I may be mistaken if this is indeed a bug that is resolved or not, as I only appear to be running v2.0.2 as opposed to the latest available on GitHub. VSCode only appears to have v2.0.2 as the latest

— Reply to this email directly, view it on GitHub https://github.com/TerosTechnology/vscode-terosHDL/issues/381#issuecomment-1485467768, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNN4R6O2ZKEPZA33F2RMN3W6G7JVANCNFSM6AAAAAAVWG6ST4 . You are receiving this because you commented.Message ID: @.***>

bit0fun commented 1 year ago

It looks like it is mainly due to the open-vsx.org repo being old, so I can't confirm newer versions than v2.0.2 Appreciate looking into it

qarlosalberto commented 1 year ago

I have updated the version in open-vsx