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
542 stars 45 forks source link

Schematic viewer with GHDL/Yosys cannot find work lib #659

Open atticlabsdesign opened 2 weeks ago

atticlabsdesign commented 2 weeks ago

I am using VHDL and when I try and use the schematic viewer it works fine with entities in their own file but when i create an instance of a entity in another file GHDL fails to find the work lib. This is only a problem for me as it relates to the yosys schematic viewer, I can successfully run test benches with GHDL no problem. I have tried specifying the work directory with an absolute path in the schematic viewer settings (in the arguments passed to GHDL box) and it still fails.

yosys error (without any settings being messed with below)

2024-09-13 21:13:32.592 [info] 
 /----------------------------------------------------------------------------\
 |  yosys -- Yosys Open SYnthesis Suite                                       |
 |  Copyright (C) 2012 - 2024  Claire Xenia Wolf <claire@yosyshq.com>         |
 |  Distributed under an ISC-like license, type "license" to see terms        |
 \----------------------------------------------------------------------------/
 Yosys 0.38+141 (git sha1 078b876f5, clang++ 14.0.0-1ubuntu1.1 -fPIC -Os)

-- Running command `ghdl --std=08 -fsynopsys  --work=work /home/attic_labs/Documents/HDL_PROJ/SCC/Manchester_Encoder_tb.vhd  --work=work -e Manchester_Encoder_tb; hierarchy -top Manchester_Encoder_tb; proc; ; write_json /home/attic_labs/.teroshdl_leKKC; stat' --

1. Executing GHDL.

2024-09-13 21:13:32.603 [info] /home/attic_labs/Documents/HDL_PROJ/SCC/Manchester_Encoder_tb.vhd:23:41: unit "manchester_encoder" not found in library "work"
  Manchester_Encoder_inst : entity work.Manchester_Encoder
                                        ^

2024-09-13 21:13:32.603 [info] ERROR: vhdl import failed.

2024-09-13 21:13:32.605 [error] Yosys failed.

See Attached Files for code and settings

-TerosHDL: v6.0.3 (pre-release)

Screenshots If applicable, add screenshots to help explain your problem. Share the code as text, not as a screenshots!

Teros HDL bug report.zip

atticlabsdesign commented 2 weeks ago

I realize that the config file shows I passed an absolute path to the regular test bench GHDL command, don't worry I realized this was wrong and really did try it in the schematic viewer version and it didnt work, i just forgot to remove that before copying the files

qarlosalberto commented 1 week ago

Make sure that you aren't using a file with whitespaces in the path. And that your code is synthesizable. For example your testbench will fail because the code is'nt synthesizable.