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

[Question] Using Hierarchical Structures and Source vs. Library #698

Closed thomas-woehrle closed 1 week ago

thomas-woehrle commented 2 weeks ago

Hi,

I am facing a simple issue, for which I didn't find a sustainable solution even after extensive searching.

I simply want to instantiate one module in another one.

For example in file FloatAdditionTB.v:

...
  FloatingAddition F_Add (
      .A(A),
      .B(B),
      .result(result)
  );
...

Now, the syntax checker (iverilog in my case, setup via Teros) gives an error "Include file FloatingAddition.v not found".

One way to solve this is by adding -I or -y flags with a path to the directory where FloatingAddition can be found. But those paths differ depending on which module is used.

So, is there a solution which Teros offers for this? I would assume that adding libraries and sources as it is explained in the documentation solves this (this approach is also suggested in the discussion here), but I do not even know what libraries and sources are in this context and how one should use them, since the documentation is pretty sparse on that.

I am willing to contribute to the documentation as soon as I know more about how to use TerosHDL properly.

qarlosalberto commented 2 weeks ago

For Verilog and SV TerosHDL only lint the files individually. For that you see those errors.

El vie, 8 nov 2024, 18:10, thomas-woehrle @.***> escribió:

Hi,

I am facing a simple issue, for which I didn't find a sustainable solution even after extensive searching.

I simply want to instantiate one module in another one.

For example in file FloatAdditionTB.v:

... FloatingAddition F_Add ( .A(A), .B(B), .result(result) ); ...

Now, the syntax checker (iverilog in my case, setup via Teros) gives an error "Include file FloatingAddition.v not found".

One way to solve this is by adding -I or -y flags with a path to the directory where FloatingAddition can be found. But those paths differ depending on which module is used.

So, is there a solution which Teros offers for this? I would assume that adding libraries and sources as it is explained in the documentation https://terostechnology.github.io/terosHDLdoc/docs/project_configuration/sources solves this (this approach is also suggested in the discussion here https://github.com/TerosTechnology/vscode-terosHDL/issues/284#issuecomment-1002828615), but I do not even know what libraries and sources are in this context and how one should use them, since the documentation is pretty sparse on that.

I am willing to contribute to the documentation as soon as I know more about how to use TerosHDL properly.

— Reply to this email directly, view it on GitHub https://github.com/TerosTechnology/vscode-terosHDL/issues/698, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNN4RZYI6W4EFCBX5M7IVTZ7TV6RAVCNFSM6AAAAABRN5G7RWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY2DINRTGMYTCNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

thomas-woehrle commented 2 weeks ago

Okay, I see.

And what about other tools like the schematic viewer fe? Because it can not display the circuit, because of this error:

ERROR: Can't open include fileFloatingAddition.v'!`

I assume I have to adjust the YoSys configuration for this?

thomas-woehrle commented 2 weeks ago

And coming back to the other question of my original message: What are sources and libraries and for what can they be used? If there is any existing documentation for this, feel free to refer me to it :)

qarlosalberto commented 2 weeks ago

They can be used for simulations, compilations and VHDL.

There are two schematic viewers: