Using Vivado over the VLAB
First connect to a VLAB board, as above:
Code Block | ||
---|---|---|
| ||
./vlab.ky -k mykey |
If you are running Vivado on a remote server, ensure that you also run the VLAB scripts on that server (not on your local computer). Now in Vivado click "Open Hardware Manager" in the Flow Navigator in the left-hand column. Then click "Open Target" | "Open New Target" in the Flow Navigator. In the Open wizard click Next, select Remote Server, Next, and use the following settings:
Code Block | ||
---|---|---|
| ||
Hostname: localhost Port: 12345 |
Click Next and the tools should connect and see a Zybo Z7:
Click Next and Finish. You can send bitfiles to the FPGA by selecting Program Device from the Flow Navigator.
The process in SDK is similar. In the bottom left should be a Target Connections panel (Window -> Show View -> Other if it is not visible.) Click Add New Target Connection. Set the name to VLAB
and the host and port as above, and click OK. To use this new connection you need to set your Run Configuration to use it. In the menus select Run -> Run Configurations and for the configuration you are using change the connection to the VLAB
. This will allow you to upload code, bitfiles, and use the debugger all remotely.
Exiting the VLAB
Please close your VLAB connection when you are not using it so that other students can use the board (remember that your exclusive lock on a board will expire ten minutes after connecting anyway.).
The VLAB terminal window is running screen. To close it, press and release Ctrl-a, then press 'k' and confirm with 'y'.
When using a Virtex FPGA board (or anything other than a Zynq), errors following the line "fpga configuration failed. DONE PIN is not HIGH
" when disconnecting are normal, and can be ignored (we will tidy this up one day...).
Connecting through the SSH Gateway
Due to the university's firewall rules, the virtual lab relay server (rts001.cs.york.ac.uk) is only accessible from departmental machines (including student compute servers, staff Linux compute servers, anything on the RTS lab network, and all student lab PCs), or via the IT Services SSH service. Therefore, when off campus or using eduroam, the easiest way to access the VLAB (and other departmental servers) is through the IT Services SSH gateway. You will need to request access to this service before you can use it - see https://www.york.ac.uk/it-services/services/ssh/ for more information.
Once you have been granted access to the SSH gateway, the following SSH rules can be used to connect directly through to the VLAB by adding them to the ~/.ssh/config file on the computer you're connecting from.
Code Block | ||
---|---|---|
| ||
Host ssh.york.ac.uk User YOUR_ITSERVICES_USERNAME Host rts001.cs.york.ac.uk User YOUR_VLAB_USERNAME ProxyCommand ssh -A -T -o Compression=no ssh.york.ac.uk -W %h:%p |
The SSH gateway server also accepts key-based authentication, using the ~/.ssh/authorized_keys
file from your standard university Linux home directory.
Running the Xilinx Tools Remotely
You will need to be able to run the Xilinx tools on your own computer in order to use the VLAB. There are two ways to do this, X forwarding, or installing the tools locally. See Using the Xilinx Tools Remotely for more information.
Local Install
Installing the tools on your machine may seem easiest, but they are very large, around 30GB in total. Download the installer from Xilinx and install. The tools will need to connect to our license server in order to run, which means you will need to be connected to the University VPN.
You also need to tell the Xilinx tools the name of our license server by setting the following environment variable:
XILINXD_LICENSE_FILE=2100@lm.ad.cs.york.ac.uk
On Windows this is done from the Advanced tab of "Advanced system settings" in the "System" panel in Control Panel. On Linux you can enter:
export XILINXD_LICENSE_FILE=2100@lm.ad.cs.york.ac.uk
into a terminal before you run Vivado.
Note |
---|
Note that if you are trying to use the Zybo Z7 board (for EMBS) you also have to install the Digilent board definitions. |
X11 Forwarding
To avoid a large tools install, you can X11-forward the applications from the University teaching server csteach0
back to your machine, then run the Xilinx tools (xps
, xsdk
, vivado_hls
) and they should appear on your desktop. On Linux you can ssh
to csteach0
with the following command:
Code Block | ||||
---|---|---|---|---|
| ||||
ssh -Y username@csteach0.york.ac.uk |
If your connection is slow, you can use additional options with the SSH command, such as enabling compression (-C).
The process on OS X is the same as Linux, but you will need to install XQuartz (or another X server) before running the ssh
command in Terminal.
On Windows this is harder, and requires some software to be installed. First download and install an X server, such as Xming, and an SSH client, such as PuTTY. Ensure the X server it is running, then open PuTTY and choose the following options. For 'Host name (or IP address)' enter csteach0.york.ac.uk, click on 'SSH' then 'X11' and check 'Enable X11 Forwarding'. Then click on 'Session', enter a name in 'Saved Sessions' and click Save. Then click 'Open', log in, and you will be able to run the Xilinx tools in the SSH window that appears, with windows displaying on your local desktop.
Graphical Output over the VLAB
Viewing HDMI output is not natively supported by the VLAB. However, it is possible to use Xilinx's USB debugging interface to download the contents of the video frame buffer straight out of the FPGA and view that. Because USB debugging is rather slow, and the video frame is uncompressed it take take a while (around 16 seconds) to pull an entire video frame. However this might still be useful to get an idea for how your code is progressing.
Note that this script assumes that you are running on Linux because it uses ImageMagick and the Gnome Image Viewer. These can be installed on a Debian-based Linux with the following:
> sudo apt-get install eog imagemagick
You can avoid installing Eye of Gnome by switching the image viewer the script uses. On the "exec eog $filename.png
" line, switch eog
to (for example) gwenview
for KDE or open
for macOS.
The first task is to get the memory address of the video frame you want to view. In the HDMI example code which you are probably working with, two frame buffers are set up with the following code.
Code Block | ||
---|---|---|
| ||
u32 frameBuf[DISPLAY_NUM_FRAMES][MAX_FRAME] __attribute__((aligned(0x20))); // Frame buffers for video data void *pFrames[DISPLAY_NUM_FRAMES]; // Array of pointers to the frame buffers |
This is called multiple buffering and allows the video hardware to be drawing one frame to the screen, whilst the CPU is preparing the next frame. You can get the memory address of a frame by simply printing it out to the console.
Code Block | ||
---|---|---|
| ||
printf("Address of frame: %p\n", pFrames[0]); |
In the HDMI example this will be 0x11ce80
but this is likely to change frequently as you edit your code. Once you have the address of the frame you are interested in, download this script:
View file | ||||
---|---|---|---|---|
|
In XSDK's menus, select Xilinx | XSCT
Console
to view the debugging interface. The XSCT console has the promt xsct%
. Set the target address of frame and then run the script.
Code Block |
---|
xsct% set base 0x11ce80 xsct% source /path/to/videograb.tcl |
This will fetch the frame, convert it to a PNG, and show it in an image viewer. By default the script only grabs every 20th line, but to make it grab the entire frame set the following:
Code Block |
---|
xsct% set stride 1 |