fpga-isv (ISV = Interactive Sim Viewer): a config-driven graphical panel viewer for interactive-sim.
Project description
fpga-isv: Interactive Sim Viewer
A cross-platform graphical panel viewer for interactive-sim. It draws a board photo (or a blank panel you mock up), overlays the LEDs and buttons at their pixel positions, and connects that virtual panel to a running HDL simulation: design-driven flags light the LEDs, and clicking a button feeds a control back into the design.
fpga-isv is a pure client of the interactive-sim socket API and knows nothing about HDL or
simulators. Anything that speaks the same newline-delimited-JSON protocol works with it. The
ULX3S board ships as the bundled reference example.
fpga-isv --example ulx3s
How it connects
The viewer listens on a TCP port; the simulation connects to it (set
INTERACTIVE_STREAM=host:port for the sim). This means you can:
- open and close the viewer at any time, and the sim's backend keeps reconnecting;
- stop or restart the simulation while the viewer stays up. On each (re)connect the sim replays its full state (every component plus last values), so the panel repopulates automatically.
fpga-isv --example ulx3s --host 0.0.0.0 --port 7777
# then run a simulation with INTERACTIVE_STREAM=127.0.0.1:7777
Install
Three ways, depending on whether you have Python:
| Method | Command | Needs |
|---|---|---|
| Standalone binary (zero prereqs) | download from Releases | nothing |
| pipx (Python users) | pipx install fpga-isv |
a Python that ships tkinter |
| Homebrew (macOS / Linux) | brew tap DFiantWorks/fpga-isv https://github.com/DFiantWorks/homebrew-fpga-isv && brew install fpga-isv |
Homebrew |
The standalone binary bundles its own Python, Tcl/Tk, and Pillow, so it runs with no
prerequisites. pipx and source installs need a Python with tkinter (stdlib, but a separate OS
package on some Linux distros, e.g. apt install python3-tk); Pillow is pulled in automatically
and is required for JPEG photos and cropped or non-integer-scaled images (PNG/GIF panels work on
stdlib Tk alone).
macOS note: the released binaries are currently unsigned. Launched by another process directly they run fine; launched via Finder/
openfrom a browser-downloaded copy, Gatekeeper blocks them until you clear quarantine: runxattr -dr com.apple.quarantine ./fpga-isv, or right-click then Open once. Homebrew installs strip quarantine, sobrew installavoids the prompt entirely, andpipxhas no binary to quarantine.
Config
A panel is described by one JSON file. All coordinates are in original-image pixels.
image.scale scales the photo/panel and every coordinate together for display, and image.crop
trims a photo to the board. The map stays in original-image pixels, so it is independent of crop
and window size.
A photo panel:
{
"title": "ULX3S",
"image": { "url": "board.png", "crop": [160, 195, 1650, 1010], "scale": 0.72 },
"leds": { "on_color": "#ff5a36", "shape": "rect", "w": 26, "h": 32,
"items": [ { "name": "leds", "bit": 0, "x": 632, "y": 480 }, /* ... */ ] },
"buttons":[ { "name": "btn_pwr", "shape": "circle", "x": 1375, "y": 401, "r": 42, "key": "p" } ]
}
A blank panel mockup (no photo; lay controls out from scratch):
{
"title": "My Panel",
"image": { "width": 1200, "height": 800, "bg": "#101418" },
"leds": { "on_color": "#56d364", "items": [ { "name": "led_err", "bit": 0, "x": 100, "y": 80 } ] },
"buttons":[ { "name": "btn_run", "shape": "rect", "x": 200, "y": 300, "w": 120, "h": 60, "toggle": true } ]
}
image.urlmay be a remote URL (optionally withcache), an absolute path, or a path relative to the config file. Usewidth/height/bginstead ofurlfor a blank panel.- An LED item lights when bit
bitof flagnameis1, so an N-bit bus is N items with different bit indices and a 1-bit flag is one item. - The
ledsgroup'son_color,shape,w/h,r, andactive_stateare defaults; any item can override them (e.g."on_color": "#00ff00") to give individual LED indices their own color, geometry, or polarity. - A button sends
1on press and0on release (momentary);"toggle": trueflips and latches."key"mirrors it to a keyboard key (Tk keysym, e.g.p,space,Up). active_statesets what a high bit (1) means. For an LED it is"on"(default;1lights it) or"off"(active-low;0lights it). For a button it is"pressed"(default; press sends1, release0) or"released"(active-low; press sends0, release1, so the wire idles high until pressed).
Mapping a new photo
Run with --calibrate and click the image: each click prints the original-image pixel coordinate
(and marks it on the canvas), so you can read off the x/y for every LED and button.
fpga-isv --config my_board.json --calibrate
CLI
fpga-isv (--example NAME | --config PATH) [--host 0.0.0.0] [--port 7777] [--refresh] [--calibrate]
fpga-isv --list-examples
fpga-isv --version
Wire protocol
Newline-delimited JSON, one message per line (defined by interactive-sim; every sim to viewer
message carries t, the simulation time in µs):
sim -> viewer {"ev":"reg", "t":1234.5,"name":"btn_run","kind":"ctrl","width":1}
{"ev":"flag", "t":1234.5,"name":"leds","val":42}
{"ev":"time", "t":1234.5}
{"ev":"close","t":1234.5,"name":"btn_run"}
viewer -> sim {"name":"btn_run","val":1}
Develop
pip install -e . pytest
python -m pytest -q # headless protocol/config/geometry tests
python -m fpga_isv --example ulx3s
pyinstaller packaging/fpga_isv.spec # build the standalone binary into dist/
License
MIT (see LICENSE). The bundled ULX3S photo is from the ULX3S project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fpga_isv-0.2.0.tar.gz.
File metadata
- Download URL: fpga_isv-0.2.0.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17b03cc3cb31545fe6c194426ad5831bf24b65bf7f85279558d707f7f753126a
|
|
| MD5 |
41a2e231efafc7150689ce9a747ec564
|
|
| BLAKE2b-256 |
0a94c4547793d6429d472d76b2b3c778957619ae9977b458b8878cdd696cf6ee
|
Provenance
The following attestation bundles were made for fpga_isv-0.2.0.tar.gz:
Publisher:
release.yml on DFiantWorks/interactive-sim-viewer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fpga_isv-0.2.0.tar.gz -
Subject digest:
17b03cc3cb31545fe6c194426ad5831bf24b65bf7f85279558d707f7f753126a - Sigstore transparency entry: 2044452973
- Sigstore integration time:
-
Permalink:
DFiantWorks/interactive-sim-viewer@3d5fba720df6d78170596f58adb24abf972c1473 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/DFiantWorks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3d5fba720df6d78170596f58adb24abf972c1473 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fpga_isv-0.2.0-py3-none-any.whl.
File metadata
- Download URL: fpga_isv-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec4dea73355cc0f91e4436049423900a39944a21096992f4206d5593f3168609
|
|
| MD5 |
40a38f3eb0ebe99c9e4d6e96be0a14e9
|
|
| BLAKE2b-256 |
24bff224acd5593dfe9f6316a764c34ed5d719a36724710528205c2953ab9b22
|
Provenance
The following attestation bundles were made for fpga_isv-0.2.0-py3-none-any.whl:
Publisher:
release.yml on DFiantWorks/interactive-sim-viewer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fpga_isv-0.2.0-py3-none-any.whl -
Subject digest:
ec4dea73355cc0f91e4436049423900a39944a21096992f4206d5593f3168609 - Sigstore transparency entry: 2044452990
- Sigstore integration time:
-
Permalink:
DFiantWorks/interactive-sim-viewer@3d5fba720df6d78170596f58adb24abf972c1473 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/DFiantWorks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3d5fba720df6d78170596f58adb24abf972c1473 -
Trigger Event:
push
-
Statement type: