-
Notifications
You must be signed in to change notification settings - Fork 64
Multiple projects that share files #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @jhartika
with the following files: -- common.vhd
package common_pkg is
type record_type_common is record
a : integer;
b : std_logic;
end record;
end package; -- top_variant.vhd (Variant 1)
use work.common_pkg.all; -- or `use common.common_pkg.all` ?
entity top is
end entity;
architecture rtl of top is
signal my_record : record_type_common;
begin
-- Implementation
end architecture; -- top_variant.vhd (Variant 2)
use work.common_pkg.all; -- or `use common.common_pkg.all` ?
entity top is
end entity;
architecture rtl of top is
signal my_record : record_type_common;
begin
-- Slightly different implementation
end architecture; Is the only difference between top variant 1 and top variant 2 that they have a different architecture, but share the same entity declaration? Currently, your approach is to have a [libraries]
lib1.files = [
'common/common1.vhd',
'variant1/top_variant.vhd',
]
lib2.files = [
'common/common1.vhd',
'variant2/top_variant.vhd',
] i.e., the
where package measurement_scaling_pkg is
-- different implementations between measurement_scaling_variant1_pkg.vhd and measurement_scaling_variant2_pkg.vhd
end package; In your common file, you then include it like so: use work. measurement_scaling_pkg.all; -- When compiling, the 'right' package will be used. vhdl_ls should offer 'go to definition' for both though
package common_pkg is
end package;
|
Thank you for taking time to answer and understand my issue. Your understanding of the project structure and my approach is roughly correct I found a pattern that solves the inability to exclude the wrong variants without excluding the right variant.
So mostly just the problem 2 is left. Where selecting which of the multiple implementations to navigate to defaults to the one encountered first. Otherwise my issue is solved. |
I have a situation where there are multiple variants that share lot of structure and
use work.file_name_pkg.all
statements (which is partly to blame for the problems, although it makes some things about variant management easier from build system PoV).I am using VSCode with VHDL_LS
Now there are few cases where vhdl_ls does not quite work as I hope it would.
record_type_common1
defined incommon1.vhd
and it is used in bothtop_variant1.vhd
andtop_variant2.vhd
. For "Go to Definition" to work correctly I have to define invhdl_ls.toml
two separate libraries for variant1 and variant2 and putcommon1.vhd
separately to both.This is very cumbersome when there are lot of common files, but at least it works.
Putting variant1 and variant2 files in same library does not work because variant1 and variant2 architectures have same names and then duplicate architecture error prevents navigation from both working.
For this case it would be useful to have ability to list the common files just once and then say that both lib1 and lib2 contain these files
measurement_scaling_variant1_pkg.vhd
andmeasurement_scaling_variant2_pkg.vhd
that both definepackage measurement_scaling_pkg
. Now if somecommon.vhd
file hasuse work.measurement_scaling_pkg.all
statement, then I can only navigate to the version that was defined first in thevhdl_ls.toml
. For this I have not found a workaround.Here I would hope to have ability to select which of the multiple packages with same name I want to navigate to.
For my case it would be useful if I could just define one pattern that excludes all the variant files and then reinclude specific variant files afterwards.
vhdl_ls.toml
files. Currently the parent project can't make use of the information in these. The recursive search of .toml files has already been suggested elsewhere, and that is also something that would alleviate my issues.The text was updated successfully, but these errors were encountered: