edaa-org / pyEDAA.ProjectModel

An abstract model of EDA tool projects.
https://edaa-org.github.io/pyEDAA.ProjectModel
Other
10 stars 1 forks source link

Verilog include file is missing #50

Open RasmusGOlsen opened 1 year ago

RasmusGOlsen commented 1 year ago

There should be a way to specify if the VerilogSourceFile or SystemVerilogSource file is an included file. I suggest this can be a property in the class or a new class.

Paebbels commented 1 year ago

I'm not into Verilog so much. I know there are sources (*.v/*.sv) and headers (*.vh/*.svh).

Are include files further files?

I would model it so:

E.g. the latter could be used in a VHDL context if a utils.pkg.vhdl is added. It's an ordinary VHDL source file, but it contains a package, thus the file name. It could be marked with a key-value pair and multiple package files could be identified by a filtered search checking key-value pairs.

RasmusGOlsen commented 1 year ago

Typically you would give the Verilog include files the .vh / .svh file extension to easily distinguish them from regular Verilog files. A Verilog include file is not compiled by itself. The Verilog preprocessor will do text substitution, i.e. copy/paste the included file content into the Verilog files that include them. Some tools don't specify the included file at all, but instead, specify directories for the Verilog precompiler to search for included files. I think Verilog is inspired by the C language which also operates with a precompiler and include files.

RasmusGOlsen commented 11 months ago

I think I would prefer it's a boolean attribute to the VerilogSourceFile and SystemVerilogSourceFile classes since the file extension is not the determining factor.

Paebbels commented 10 months ago

Latest changes are on dev branch.