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
568 stars 46 forks source link

Neither icarus nor Modelsim can handle `include` directive #284

Open dzx-dzx opened 2 years ago

dzx-dzx commented 2 years ago

Describe the bug While attempting to compile my testbench... with icarus:

Include file ./alu.v not found
error: Unable to find the root module "alu_tb" in the Verilog source.
     : Perhaps ``-s alu_tb'' is incorrect?
1 error(s) during elaboration.

with Modelsim:

Cannot find `include file "./alu.v" in directories:
#     C:/modeltech64_10.2c/ovm-2.1.2/../verilog_src/ovm-2.1.2/src, C:/modeltech64_10.2c/uvm-1.1d/../verilog_src/uvm-1.1d/src
# ** Error: C:/modeltech64_10.2c/win64/vlog failed.
# Executing ONERROR command at macro ./edalize_build_rtl.tcl line 3
make: *** [Makefile:42: work] Error 1

Code Code to reproduce the error.

`timescale 1ns/1ns
`include "./alu.v"

Please complete the following information:

qarlosalberto commented 2 years ago

Can you share your files?

dzx-dzx commented 2 years ago

alu.txt alu_tb.txt

All in the same folder. Should I also attach the .yml file?

dzx-dzx commented 2 years ago

Is there anything else I shall provide?

qarlosalberto commented 2 years ago

Does it work if you provide the full path?

El dom., 26 dic. 2021 4:54, dzx-dzx @.***> escribió:

Is there anything else I shall provide?

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

dzx-dzx commented 2 years ago

Does it work if you provide the full path? El dom., 26 dic. 2021 4:54, dzx-dzx @.> escribió: Is there anything else I shall provide? — Reply to this email directly, view it on GitHub <#284 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNN4RY6OBRJFCQVT3TKDV3US2GWXANCNFSM5KX26IQA . You are receiving this because you commented.Message ID: @.>

That would be successful.

dzx-dzx commented 2 years ago

Actually, does terosHDL simply not welcome the use of include? Few example projects have it.

qarlosalberto commented 2 years ago

I need to check it.

El dom., 26 dic. 2021 17:01, dzx-dzx @.***> escribió:

Actually, does terosHDL simply not welcome the use of include? Few example projects have it.

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

dzx-dzx commented 2 years ago

This might be helpful: Both files are placed inside a folder that is not the directory vscode opens.

qarlosalberto commented 2 years ago

I have done a test with your files. You don't need to use "include" directive. You need to add both files to TerosHDL project manager:

image

The other solution is only add to the project manager the file "alu_tb.v" and to add the full path in the include directive:

image

dzx-dzx commented 2 years ago

But...Using full path would render it impossible for publishing. Does that mean I simply can't use include?

qarlosalberto commented 2 years ago

Yes, for now it isn't possible.

mtrx93 commented 1 year ago

Hello. Had same problem, there are at least two workarounds for icarus:

  1. "-grelative-include" in "Additional arguments directly passed to linter."

  2. "-I/absolute/path/to/project/" in same place, which allows to use includes relative to project directory (but suitable only for one project)

trexxet commented 9 months ago

If you don't use include, then the linter goes mad about the unknown module type. If you use include, then the Icarus just won't build it.

Overall, the idea of using a fixed build directory for all projects is just terrible and causes such bugs.

ecstrema commented 1 month ago

Same here: cannot use the include directive at all. I want to integrate TerosHDL into an existing codebase, and so I can't remove all the include directives and add the files to the project.

Overall, I wish Teros HDL worked with projects not created with it. I'd love to use it if it was incrementally adoptable/pluggable.