labview-fpga-hdl-tools 2.0.0.dev7__tar.gz → 2.0.0.dev9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/PKG-INFO +14 -3
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/README.md +13 -2
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/gen_labview_target_plugin.py +43 -4
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/install_dependencies.py +41 -3
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/pyproject.toml +1 -1
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/LICENSE +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/.gitignore +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/__init__.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/__main__.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/check_syntax.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/command_config.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/command_hooks.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/common.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/compile_modelsim_lib.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/compile_project.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/create_lvbitx.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/create_modelsim_project.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/create_vivado_project.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/generate_vhdl.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/get_window_netlist.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/install_labview_target_plugin.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/launch_modelsim.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/launch_vivado.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/migrate_clip.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/nihdlsettings_default.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/process_constraints.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/reporting.py +0 -0
- {labview_fpga_hdl_tools-2.0.0.dev7 → labview_fpga_hdl_tools-2.0.0.dev9}/labview_fpga_hdl_tools/sim_modelsim.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: labview-fpga-hdl-tools
|
|
3
|
-
Version: 2.0.0.
|
|
3
|
+
Version: 2.0.0.dev9
|
|
4
4
|
Summary: LabVIEW FPGA HDL Tools
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Salvador Santolucito
|
|
@@ -21,11 +21,17 @@ Description-Content-Type: text/markdown
|
|
|
21
21
|
|
|
22
22
|
# LabVIEW FPGA HDL Tools
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Command-line tools (`nihdl`) for building customized FPGA designs
|
|
25
25
|
for use with the ni/flexrio repository. They move, generate, and process the
|
|
26
26
|
files needed to take a top-level HDL design to a LabVIEW FPGA bitfile through
|
|
27
27
|
either of two compile flows (see below).
|
|
28
28
|
|
|
29
|
+
> **Customizing a FlexRIO board? Start at [flexrio-custom](https://github.com/ni/flexrio-custom), not here.**
|
|
30
|
+
> That repo is the front door — supported devices, machine setup, and the step-by-step
|
|
31
|
+
> exercises. **This page is the tool reference** for the `nihdl` toolchain (commands,
|
|
32
|
+
> settings, and the concepts behind them); use it to look things up while following the
|
|
33
|
+
> flexrio-custom workflows.
|
|
34
|
+
|
|
29
35
|
## The two compile flows
|
|
30
36
|
|
|
31
37
|
`nihdl` supports two ways to turn a top-level HDL design into a LabVIEW FPGA
|
|
@@ -128,7 +134,12 @@ step-by-step status with warnings and errors also shown inline; the end summary
|
|
|
128
134
|
still appears, so verbose is additive to the default. See the
|
|
129
135
|
[Command Reference](docs/CommandReference.md#output-and-verbosity) for details.
|
|
130
136
|
|
|
131
|
-
## Quickstart: the Vivado compile flow
|
|
137
|
+
## Quickstart: the Vivado compile flow (tool-only)
|
|
138
|
+
|
|
139
|
+
> **Using `flexrio-custom`?** Follow its
|
|
140
|
+
> [Getting Started exercises](https://github.com/ni/flexrio-custom/blob/main/docs/GettingStarted.md)
|
|
141
|
+
> instead — they are the canonical command sequence for that repo. This quickstart is for
|
|
142
|
+
> driving `nihdl` standalone (installed via `pip`, outside a flexrio-custom checkout).
|
|
132
143
|
|
|
133
144
|
Run these from your target folder (the one with `nihdlsettings.py`), with the
|
|
134
145
|
Python environment active (run `nisetup` once per terminal — see
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# LabVIEW FPGA HDL Tools
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command-line tools (`nihdl`) for building customized FPGA designs
|
|
4
4
|
for use with the ni/flexrio repository. They move, generate, and process the
|
|
5
5
|
files needed to take a top-level HDL design to a LabVIEW FPGA bitfile through
|
|
6
6
|
either of two compile flows (see below).
|
|
7
7
|
|
|
8
|
+
> **Customizing a FlexRIO board? Start at [flexrio-custom](https://github.com/ni/flexrio-custom), not here.**
|
|
9
|
+
> That repo is the front door — supported devices, machine setup, and the step-by-step
|
|
10
|
+
> exercises. **This page is the tool reference** for the `nihdl` toolchain (commands,
|
|
11
|
+
> settings, and the concepts behind them); use it to look things up while following the
|
|
12
|
+
> flexrio-custom workflows.
|
|
13
|
+
|
|
8
14
|
## The two compile flows
|
|
9
15
|
|
|
10
16
|
`nihdl` supports two ways to turn a top-level HDL design into a LabVIEW FPGA
|
|
@@ -107,7 +113,12 @@ step-by-step status with warnings and errors also shown inline; the end summary
|
|
|
107
113
|
still appears, so verbose is additive to the default. See the
|
|
108
114
|
[Command Reference](docs/CommandReference.md#output-and-verbosity) for details.
|
|
109
115
|
|
|
110
|
-
## Quickstart: the Vivado compile flow
|
|
116
|
+
## Quickstart: the Vivado compile flow (tool-only)
|
|
117
|
+
|
|
118
|
+
> **Using `flexrio-custom`?** Follow its
|
|
119
|
+
> [Getting Started exercises](https://github.com/ni/flexrio-custom/blob/main/docs/GettingStarted.md)
|
|
120
|
+
> instead — they are the canonical command sequence for that repo. This quickstart is for
|
|
121
|
+
> driving `nihdl` standalone (installed via `pip`, outside a flexrio-custom checkout).
|
|
111
122
|
|
|
112
123
|
Run these from your target folder (the one with `nihdlsettings.py`), with the
|
|
113
124
|
Python environment active (run `nisetup` once per terminal — see
|
|
@@ -227,6 +227,26 @@ def _create_clocklist_structure():
|
|
|
227
227
|
return clock_list_top
|
|
228
228
|
|
|
229
229
|
|
|
230
|
+
def _normalize_clock_domain_name(clock_domain_name):
|
|
231
|
+
"""Return the canonical LabVIEW clock-domain name used in generated XML.
|
|
232
|
+
|
|
233
|
+
LabVIEW FPGA resource and clock names use dot-separated paths. CSV LVName
|
|
234
|
+
values use backslashes for hierarchy, so any hierarchical clock-domain
|
|
235
|
+
reference must be normalized before it is written to XML or compared to a
|
|
236
|
+
clock row defined elsewhere in the CSV.
|
|
237
|
+
"""
|
|
238
|
+
return clock_domain_name.strip().replace("\\", ".")
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def _collect_defined_input_clock_domains(rows):
|
|
242
|
+
"""Collect canonical clock-domain names defined by input clock rows."""
|
|
243
|
+
return {
|
|
244
|
+
_normalize_clock_domain_name(row["LVName"])
|
|
245
|
+
for row in rows
|
|
246
|
+
if row["SignalType"].lower() == "clock" and row["Direction"].lower() == "input"
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
|
|
230
250
|
def _generate_xml_from_csv(csv_path, boardio_output_path, clock_output_path):
|
|
231
251
|
"""Generate boardio XML and clock XML files from CSV data.
|
|
232
252
|
|
|
@@ -254,9 +274,10 @@ def _generate_xml_from_csv(csv_path, boardio_output_path, clock_output_path):
|
|
|
254
274
|
|
|
255
275
|
with open(csv_path, "r", newline="", encoding="utf-8") as csvfile:
|
|
256
276
|
reader = csv.DictReader(csvfile)
|
|
277
|
+
rows = list(reader)
|
|
278
|
+
defined_input_clock_domains = _collect_defined_input_clock_domains(rows)
|
|
257
279
|
|
|
258
|
-
for row in
|
|
259
|
-
row_count += 1
|
|
280
|
+
for row_count, row in enumerate(rows, start=1):
|
|
260
281
|
lv_name = row["LVName"]
|
|
261
282
|
hdl_name = row["HDLName"]
|
|
262
283
|
direction = row["Direction"]
|
|
@@ -266,6 +287,11 @@ def _generate_xml_from_csv(csv_path, boardio_output_path, clock_output_path):
|
|
|
266
287
|
zero_sync_regs = row["ZeroSyncRegs"]
|
|
267
288
|
output_readback = row["OutputReadback"]
|
|
268
289
|
required_clock_domain = row["RequiredClockDomain"]
|
|
290
|
+
normalized_required_clock_domain = (
|
|
291
|
+
_normalize_clock_domain_name(required_clock_domain)
|
|
292
|
+
if required_clock_domain
|
|
293
|
+
else ""
|
|
294
|
+
)
|
|
269
295
|
|
|
270
296
|
# Replace the '\' in the names with '.' to create a dot-separated hierarchy
|
|
271
297
|
# that is used to make a resource folder hierarchy in the BoardIO XML. The
|
|
@@ -317,9 +343,22 @@ def _generate_xml_from_csv(csv_path, boardio_output_path, clock_output_path):
|
|
|
317
343
|
)
|
|
318
344
|
ET.SubElement(io_resource, "VHDLName").text = hdl_name
|
|
319
345
|
|
|
320
|
-
if
|
|
346
|
+
if normalized_required_clock_domain:
|
|
347
|
+
if (
|
|
348
|
+
normalized_required_clock_domain not in defined_input_clock_domains
|
|
349
|
+
and ("." in required_clock_domain or "\\" in required_clock_domain)
|
|
350
|
+
):
|
|
351
|
+
valid_clock_domains = ", ".join(sorted(defined_input_clock_domains))
|
|
352
|
+
error = (
|
|
353
|
+
f"Row {row_count}: RequiredClockDomain='"
|
|
354
|
+
f"{required_clock_domain}' for signal '{lv_name}' does not match "
|
|
355
|
+
f"any input clock LVName defined in this CSV after the '\\' to '.' "
|
|
356
|
+
f"name conversion. Use one of: {valid_clock_domains}"
|
|
357
|
+
)
|
|
358
|
+
validation_errors.append(error)
|
|
359
|
+
|
|
321
360
|
ET.SubElement(io_resource, "RequiredClockDomain").text = (
|
|
322
|
-
|
|
361
|
+
normalized_required_clock_domain
|
|
323
362
|
)
|
|
324
363
|
|
|
325
364
|
if use_in_scl:
|
|
@@ -80,6 +80,36 @@ def _get_commit_hash(repo_path):
|
|
|
80
80
|
return None
|
|
81
81
|
|
|
82
82
|
|
|
83
|
+
def _get_installed_version(repo_name, repo_path, deps_dir):
|
|
84
|
+
"""Return the currently installed version of a cloned dependency, or None.
|
|
85
|
+
|
|
86
|
+
Prefers the version recorded in the ``.dep-info`` marker file, falling back
|
|
87
|
+
to ``git describe`` for repos cloned before markers were introduced.
|
|
88
|
+
"""
|
|
89
|
+
for marker in sorted(deps_dir.glob(f"{repo_name}-*{_DEP_INFO_SUFFIX}")):
|
|
90
|
+
try:
|
|
91
|
+
for line in marker.read_text(encoding="utf-8").splitlines():
|
|
92
|
+
if line.startswith("Version:"):
|
|
93
|
+
return line.split(":", 1)[1].strip()
|
|
94
|
+
except OSError:
|
|
95
|
+
continue
|
|
96
|
+
|
|
97
|
+
try:
|
|
98
|
+
result = subprocess.run(
|
|
99
|
+
["git", "-C", str(repo_path), "describe", "--tags", "--always"],
|
|
100
|
+
capture_output=True,
|
|
101
|
+
text=True,
|
|
102
|
+
check=True,
|
|
103
|
+
)
|
|
104
|
+
described = result.stdout.strip()
|
|
105
|
+
if described:
|
|
106
|
+
return _normalize_tag(described)
|
|
107
|
+
except (subprocess.CalledProcessError, OSError):
|
|
108
|
+
pass
|
|
109
|
+
|
|
110
|
+
return None
|
|
111
|
+
|
|
112
|
+
|
|
83
113
|
def _write_dep_marker(repo, repo_name, tag, requested, repo_url, repo_path, deps_dir):
|
|
84
114
|
"""Write a version marker file next to a cloned dependency.
|
|
85
115
|
|
|
@@ -354,14 +384,22 @@ def _clone_repo_at_tag(repo, tag_or_spec, base_dir, delete_allowed=False, allow_
|
|
|
354
384
|
|
|
355
385
|
# Check if already exists and prompt user
|
|
356
386
|
if repo_path.exists():
|
|
357
|
-
|
|
387
|
+
installed_version = _get_installed_version(repo_name, repo_path, base_dir)
|
|
388
|
+
present_desc = (
|
|
389
|
+
f"{repo_name} version {installed_version}" if installed_version else repo_name
|
|
390
|
+
)
|
|
391
|
+
reporter.detail(f" [INFO] {present_desc} already present at {repo_path}")
|
|
358
392
|
|
|
359
393
|
if delete_allowed:
|
|
360
394
|
response = "y"
|
|
361
395
|
reporter.detail(f" Auto-deleting and re-cloning (--delete flag set)")
|
|
362
396
|
else:
|
|
363
397
|
try:
|
|
364
|
-
response =
|
|
398
|
+
response = (
|
|
399
|
+
input(f" {present_desc} already present. Delete and re-clone? (y/N): ")
|
|
400
|
+
.strip()
|
|
401
|
+
.lower()
|
|
402
|
+
)
|
|
365
403
|
except EOFError:
|
|
366
404
|
# Non-interactive/CI run: there is no stdin to prompt on. Default
|
|
367
405
|
# to the safe "keep existing clone" choice instead of crashing;
|
|
@@ -397,7 +435,7 @@ def _clone_repo_at_tag(repo, tag_or_spec, base_dir, delete_allowed=False, allow_
|
|
|
397
435
|
text=True,
|
|
398
436
|
check=True,
|
|
399
437
|
)
|
|
400
|
-
reporter.success(f" [OK]
|
|
438
|
+
reporter.success(f" [OK] Installed {repo_name} version {_normalize_tag(tag)}")
|
|
401
439
|
_write_dep_marker(repo, repo_name, tag, tag_or_spec, repo_url, repo_path, base_dir)
|
|
402
440
|
return True
|
|
403
441
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|