Skip to content

Commit 392edac

Browse files
Add support for "black-box" (ie no-implementation) entities
that are stripped from synth but keep the LSP happy. This is currently targetted at generated IP for which we have no entity until synthesis runs. This allows us to make empty ones and depend on them in the tree, but not export them for synthesis and/or simulation. Also remove an extraneous print.
1 parent fb77d29 commit 392edac

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tools/hdl.bzl

+14
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ vhdl_unit = rule(
207207
),
208208
default=False,
209209
),
210+
"is_black_box": attrs.bool(
211+
doc=(
212+
"Set to true for code that will get dropped from synth and sim, but\
213+
is used for LSP analysis (like generated IP shims)"
214+
),
215+
default=False,
216+
),
210217
"codec_package": attrs.string(
211218
doc=(
212219
"Set to True when you want to generate VUnit codec package\
@@ -252,4 +259,11 @@ def sim_only_model(**kwargs):
252259
# user doesn't have to do so
253260
def third_party(**kwargs):
254261
kwargs.update({"is_third_party": True})
262+
vhdl_unit(**kwargs)
263+
264+
# A helper macro for declaring empty entities in BUCK files
265+
# to keep the LSP happy (no missing entities) but these entities
266+
# are dropped from synthesis and simulation outputs
267+
def black_box(**kwargs):
268+
kwargs.update({"is_black_box": True})
255269
vhdl_unit(**kwargs)

tools/multitool/multitool_cli.py

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def vunit_files():
6666
try:
6767
import vunit
6868
vunit_install_dir = Path(vunit.__file__).parent
69-
print(vunit_install_dir)
7069
except:
7170
print("Error attempting to import vunit module."
7271
" Check tools/requirements.txt and install deps as necessary"

0 commit comments

Comments
 (0)