Open Nexys for VS Code
Build your Digilent Nexys 2 FPGA designs and load them onto the board without leaving
VS Code. Mistakes in your VHDL and .ucf files are underlined as you save.
Setup
Install the extension. In VS Code, open Extensions
(Ctrl+Shift+X), search for Open Nexys and click
Install. Or install it from the
Marketplace page,
or from a terminal: code --install-extension brun0-v.open-nexys.
No internet access on that computer? Each
release also has the extension
as a .vsix file: Extensions → … menu at the top → Install from VSIX….
Let it download the Open Nexys tool. The first time you use it, it offers to download
the open-nexys command-line tool for you. Say yes. (Already have it? It's found on
your PATH.)
Install a toolchain, if you haven't: the open-source tools, which are the default
(guide), or
Xilinx ISE 14.7
(guide).
Run Open Nexys: Show Toolchain Status from the Command Palette
(Ctrl+Shift+P) to check that everything is found.
Usage
Open the folder with your .vhd and .ucf files (File → Open Folder…).
- Create the project: run Open Nexys: Create Project (nexys.toml). It finds your
files and the top-level entity. (Skip this if the folder already has a
nexys.toml.)
- Check: save any
.vhd or .ucf file. Mistakes appear underlined and in the
Problems panel (Ctrl+Shift+M), on the exact line.
- Build: press Ctrl+Alt+B, the ▶ button at the top of a
.vhd/.ucf file, or the Open Nexys item in the status bar. Progress shows in the
corner; Cancel stops it. Errors from ISE land in the Problems panel too.
- Program: plug in the board and press Ctrl+Alt+P
(or ⚡ in the status bar). Use Open Nexys: Write to Platform Flash to keep the
design on the board after power-off (with the board's MODE jumper on ROM).
You can also right-click a .bit file in the Explorer to program it.
All commands
Open the Command Palette (Ctrl+Shift+P) and type
Open Nexys:
| Command |
|
| Build Bitstream |
Ctrl+Alt+B |
| Check Design |
run the checks without building |
| Program FPGA (USB) |
Ctrl+Alt+P; lost at power-off |
| Write to Platform Flash (USB) |
kept after power-off |
| Make Platform Flash Image (.mcs) |
for other programming tools |
| Generate Clock (DCM)… |
asks for a frequency and writes a clock generator, e.g. 25 MHz for VGA |
| Generate Block RAM / ROM… |
creates a memory, optionally filled from a .coe/.hex/.mem/.bin file |
| Create Project (nexys.toml) |
|
| Select Toolchain (ISE / Open Source) |
|
| Show Toolchain Status |
what's installed and what's missing |
| Download / Update the open-nexys CLI |
|
| Show Build Log |
the full output of the last build |
Ctrl+Shift+B also works: it runs the open-nexys: build task.
For code completion and Go to Definition in VHDL, add a VHDL extension such as
VHDL LS or TerosHDL. They work fine alongside this one.
Settings
| Setting |
Default |
|
openNexys.backend |
project |
open, ise, or whatever nexys.toml says (open source if it says nothing) |
openNexys.isePath |
(empty) |
the ISE folder, if it isn't found automatically |
openNexys.checkOnSave |
true |
run the checks every time you save |
openNexys.cliPath |
(empty) |
where open-nexys is; empty means PATH, then the downloaded copy |
openNexys.programmer |
auto |
openfpgaloader or adept |
openNexys.cable |
(empty) |
openFPGALoader cable, for an external JTAG cable |
openNexys.revealLogOnBuild |
false |
open the build log when a build starts |
Custom tasks
{
"version": "2.0.0",
"tasks": [
{ "type": "open-nexys", "command": "build", "backend": "open", "group": { "kind": "build", "isDefault": true } }
]
}
command is one of build, check, program, program-flash. The problem matchers
$open-nexys, $open-nexys-ise and $open-nexys-ghdl are available for your own tasks.
License
MIT