Coder Social home page Coder Social logo

xilinx / xilinxvirtualcable Goto Github PK

View Code? Open in Web Editor NEW
210.0 30.0 77.0 96 KB

Xilinx Virtual Cable (XVC) is a TCP/IP-based protocol that acts like a JTAG cable and provides a means to access and debug your FPGA or SoC design without using a physical cable.

C 97.43% Makefile 2.57%

xilinxvirtualcable's Introduction

XilinxVirtualCable

Description: Xilinx Virtual Cable (XVC) is a TCP/IP-based protocol that acts like a JTAG cable and provides a means to access and debug your FPGA or SoC design without using a physical cable.

This capability helps facilitate hardware debug for designs that:

  • Have the FPGA in a hard-to-access location, where a "lab-PC" is not close by
  • Do not have direct access to the FPGA pins – e.g. the JTAG pins are only accessible via a local processor interface
  • Need to efficiently debug Xilinx FPGA or SoC systems deployed in the field to save on costly or impractical travel and reduce the time it takes to debug a remotely located system.

Key Features & Benefits

  • Ability to debug a system over an internal network, or even the internet.
  • Debug via Vivado Logic Analyzer IDE exactly as if directly connected to design via standard JTAG or parallel cable
  • Zynq®-7000 demonstration with Application Note and Reference Designs available in XAPP1251 - Xilinx Virtual Cable Running on Zynq-7000 Using the PetaLinux Tools
  • Extensible to allow for safe, secure connections

Directory layout

├── dpc                          # XVC 1.1 source code for debug through Debug Packet Controller
├── jtag/zynq7000                # XVC 1.0 source code for Zynq-7000 SoC devices
├── jtag/zynqMP                  # XVC 1.0 source code for Zynq-Ultrascale+ SoC devices
├── mem/versal                   # XVC 1.1 source code for Versal SoC devices
└── README.md

XVC 1.0 Protocol

XVC 1.0 Protocol 
Copyright 2015-2021 Xilinx, Inc.  All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Overview

Xilinx Virtual Cable (XVC) is a TCP/IP-based communication protocol that acts like a JTAG cable and provides a means to access and debug your FPGA or SoC design without using a physical cable. In this document are the general details of this XVC 1.0 protocol. For source code examples of this protocol please visit:

https://github.com/Xilinx/XilinxVirtualCable

The XVC protocol is used by a TCP/IP client and server to transfer low level JTAG vectors from a high level application to a device. The client, for instance Xilinx's EDA tools, will connect to an XVC server using standard TCP/IP client/server connection methods. Once connected, the client will issue an XVC message (getinfo:) to the server requesting the server version. After the client validates the protocol version, a new message is sent to the XVC server to set the JTAG tck rate for future shift operations.

The shift message is the main command used between the client and the server to transfer low level JTAG vectors. The client will issue shift operations to determine the JTAG chain composition and then perform various JTAG instructions for instance driving pins or programming a device.

In summary, XVC 1.0 protocol defines a simple JTAG communication method with sufficient capabilities for high level clients, like Xilinx Vivado and SDK tools, to perform complex functions like programming and debug of devices. In this document is a basic description of the protocol. The intent of this document is to provide a blueprint for users of the XVC 1.0 protocol to create their own custom clients and servers.

Protocol

The XVC 1.0 communication protocol consists of the following three messages:

getinfo:
settck:<period in ns>
shift:<num bits><tms vector><tdi vector>

For each message the client is expected to send the message and wait for a response from the server. The server needs to process each message in the order recieved and promptly provide a response. Note that for the XVC 1.0 protocol only one connection is assumed so as to avoid interleaving locking and interleaving issues that may occur with concurrent client communication.

MESSAGE: "getinfo:"

The primary use of "getinfo:" message is to get the XVC server version. The server version provides a client a way of determining the protocol capabilites of the server.

Syntax

Client Sends:

"getinfo:"

Server Returns:

“xvcServer_v1.0:<xvc_vector_len>\n”

Where:

<xvc_vector_len> is the max width of the vector that can be shifted 
                 into the server

MESSAGE: "settck:"

The "settck:" message configures the server TCK period. When sending JTAG vectors the TCK rate may need to be varied to accomodate cable and board signal integrity conditions. This command is used by clients to adjust the TCK rate in order to slow down or speed up the shifting of JTAG vectors.

Syntax:

Client Sends:

"settck:<set period>"

Server Returns:

“<current period>”

Where:

<set period>      is TCK period specified in ns. This value is a little-endian 
                  integer value.
<current period>  is the value set on the server by the settck command. If 
                  the server cannot set the value then it will return the 
                  current value.

MESSAGE: "shift:"

The "shift:" message is used to shift JTAG vectors in and out of a device. The number of bits to shift is specified as the first shift command parameter followed by the TMS and TDI data vectors. The TMS and TDI vectors are sized according to the number of bits to shift, rouneded to the nearest byte. For instance if shifting in 13 bits the byte vectors will be rounded to 2 bytes. Upon completion of the JTAG shift operation the server will return a byte sized vector containing the sampled target TDO value for each shifted TCK clock.

Syntax:

Client Sends:

"shift:<num bits><tms vector><tdi vector>"

Server Returns:

“<tdo vector>”

Where:

<num bits>   : is a integer in little-endian mode. This represents the number 
               of TCK clk toggles needed to shift the vectors out
<tms vector> : is a byte sized vector with all the TMS shift in bits Bit 0 in 
               Byte 0 of this vector is shifted out first. The vector is 
               num_bits and rounds up to the nearest byte.
<tdi vector> : is a byte sized vector with all the TDI shift in bits Bit 0 in 
               Byte 0 of this vector is shifted out first. The vector is 
               num_bits and rounds up to the nearest byte.
<tdo vector> : is a byte sized vector with all the TDO shift out bits Bit 0 in 
               Byte 0 of this vector is shifted out first. The vector is 
               num_bits and rounds up to the nearest byte.

XVC 1.1 Protocol

XVC 1.1 Protocol 
Copyright 2015-2021 Xilinx, Inc.  All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Overview

In addition to XVC 1.0 capabilities, XVC 1.1 supports the "mrd" and "mwr" messages which can be used to read/write debug addresses.

Protocol

The XVC 1.1 communication protocol consists of the following five messages:

getinfo:
mrd:<flags><address><num bytes>
mwr:<flags><address><num bytes><data>
settck:<period in ns>
shift:<num bits><tms vector><tdi vector>

For each message the client is expected to send the message and wait for a response from the server. The server needs to process each message in the order received and promptly provide a response. Note that for the XVC 1.1 protocol only one connection is assumed so as to avoid interleaving locking and interleaving issues that may occur with concurrent client communication.

MESSAGE: "getinfo:"

The primary use of "getinfo:" message is to get the XVC server version. The server version provides a client a way of determining the protocol capabilities of the server.

Syntax

Client Sends:

"getinfo:"

Server Returns:

“xvcServer_v1.1:<xvc_vector_len>\n”

Where:

<xvc_vector_len> is the max width of the vector that can be shifted 
                 into the server

MESSAGE: "mrd:"

The primary use of "mrd:" message is to read an address.

Syntax

Client Sends:

"mrd:<flags><address><num bytes>"

Server Returns:

“<data><status>"

Where:

<flags> ULEB128 bit field for future flag use
<address> ULEB128 starting address for memory read
<num bytes> ULEB128 number of bytes to read
<data> byte vector of data read

MESSAGE: "mwr:"

The primary use of "mwr:" message is to write at an address.

Syntax

Client Sends:

"mwr:<flags><address><num bytes><data>"

Server Returns:

“<status>"

Where:

<flags> ULEB128 bit field for future flag use
<address> ULEB128 starting address for memory write
<num bytes> ULEB128 number of bytes to write
<data> byte vector to write

MESSAGE: "settck:"

Similar to XVC 1.0

MESSAGE: "shift:"

Similar to XVC 1.0

Note

XVC server 1.1 for Versal performs reads and writes (mrd and mwr) as multi-word transactions. On some platforms performing accesses unaligned to 64-bits addresses may throw "Bus Error". In such cases, uncomment ENABLE_SINGLE_WORD_RW definition in xvc_mem.c to perform single word (32-bits) read/write transactions.

xilinxvirtualcable's People

Contributors

adrianh-xlnx avatar gregdaughtry avatar ianboyanzhang avatar kedareswararao avatar livius90 avatar mheimer23 avatar prashant-mehta avatar prshant-mehta avatar qermit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xilinxvirtualcable's Issues

Missing driver for Zynq-7000?

Hi!

I try to following this wiki article about the building and using Xilinx Virtual Cable for Zynq-7000 but it seems to me there are lots of out-dated details in it.

Now, in the current repo, there are no any driver source in zynq7000/XAPP1251/src/. Where can i get the kernel module xvc-driver.ko sources for Zynq-7000 in this repo?

xvcService.c stack smashing detected

hi!
There is a stack overflow problem in the main function in zynq7000/xx/src/xvcService.c. Specifically, dev_file[] is overflowed after being operated by strcat().

XVC driver for ZynqMP fails to compile with Petalinux 2021.2

Hello,

in our Petalinux 2020.2 based project for a Zynq MPSoC we successfully integrated the XVC driver as module. After upgrading to Petalinux 2021.2 the compilation of the driver module now fails.

The error is:

ERROR: xvc-driver-1.0-r0 do_compile: oe_runmake failed
ERROR: xvc-driver-1.0-r0 do_compile: Execution of '/tmp/tmp_petalinux/work/zynqmp_generic-xilinx-linux/xvc-driver/1.0-r0/temp/run.do_compile.206518' failed with exit code 1:
make -C /tmp/tmp_petalinux/work-shared/zynqmp-generic/kernel-source M=/tmp/tmp_petalinux/work/zynqmp_generic-xilinx-linux/xvc-driver/1.0-r0
make[1]: Entering directory '/tmp/tmp_petalinux/work-shared/zynqmp-generic/kernel-source'
make[2]: Entering directory '/tmp/tmp_petalinux/work-shared/zynqmp-generic/kernel-build-artifacts'
CC [M] /tmp/tmp_petalinux/work/zynqmp_generic-xilinx-linux/xvc-driver/1.0-r0/xvc_driver.o
CC [M] /tmp/tmp_petalinux/work/zynqmp_generic-xilinx-linux/xvc-driver/1.0-r0/xvc_driver_base.o
In file included from /tmp/tmp_petalinux/work/zynqmp_generic-xilinx-linux/xvc-driver/1.0-r0/xvc_driver.c:29:
/tmp/tmp_petalinux/work-shared/zynqmp-generic/kernel-source/include/asm-generic/io.h: In function '__pci_ioport_unmap':
/tmp/tmp_petalinux/work-shared/zynqmp-generic/kernel-source/include/asm-generic/io.h:1015:2: error: implicit declaration of function 'iounmap'; did you mean 'vunmap'? [-Werror=implicit-function-declaration]
1015 | iounmap(p);
| ^~~~~~~
| vunmap

According to the kernel source code the function 'iounmap' seems to be defined in 'include/asm-generic/iomap.h' which is only included if the kernel option CONFIG_GENERIC_IOMAP is defined. According to menuconfig this is not enabled in the default kernel configuration of Petalinux 2021.2 and cannot be directly changed.

About JTAG mux or bridge to enable multiple target FPGA connections

Hi, recently I'm on a project to connect multiple Target FPGAs to a Microzed 7010 motherboard. I have successfully implemented One Single daughter board following "XAPP1251 (v1.0) April 30, 2015". However that implementation limit the JTAG signals to only PMOD JA and I want to do some multiplexing work. I have read JTAG SCAN BRIDGE and many other relevant materials but have no idea how to get it work.

My idea is to share TCK, TMS for JA, JB, JC etc and TDI for JA and TDO for the last PMOD that pinned together. Will that work? Thanks.

XVC Server causes freezes to linux when other user application is running

I've implemented the xvc server in our custom project using yocto based on petalinux and vivado 2018.2

The server running in userspace works well with the kernel driver using IOCTL with the vivado hardware manager in version 2018.2

After starting my custom made application the whole linux system freezes, if I try to connect to the xvc server from Vivado hardware manager.

System is a zynq7000 board, linux kernel 4.14, debug_bridge_0 connected at 0x8000000 (AXI_1) which is the only participant on this AXI peripheral. My custom fpga ip-cores are all mapped to AXI_0 or ACP.

Is there any synchronization mechanism required in the kernel to secure access to the AXI peripheral?

I needed to patch some parts of your code to avoid the TCP SYN error ...

diff --git a/src/user/xvcServer.c b/src/user/xvcServer.c
index 29c484e..926ed4b 100644
--- a/xvcServer.c
+++ b/xvcServer.c
@@ -232,6 +232,8 @@ int main(int argc, char **argv) {
     int fd_uio;
     volatile jtag_t* ptr = NULL;
 
+	printf("Using Memory mapping with UIO\n");
+
     fd_uio = open(UIO_PATH, O_RDWR);
     if (fd_uio < 1) {
         fprintf(stderr, "Failed to open uio: %s\n", UIO_PATH);
@@ -247,6 +249,8 @@ int main(int argc, char **argv) {
 #else /* USE_IOCTL */
     int fd_ioctl;
 
+	printf("Using IOCTL with char-device\n");
+
     fd_ioctl = open(CHAR_DEV_PATH, O_RDWR | O_SYNC);
     if (fd_ioctl < 1) {
         fprintf(stderr, "Failed to open xvc ioctl device driver: %s\n", CHAR_DEV_PATH);
@@ -288,7 +292,7 @@ int main(int argc, char **argv) {
         return 1;
     }
 
-    if (listen(s, 0) < 0) {
+    if (listen(s, 5) < 0) {
         perror("listen");
         return 1;
     }

Question: raspberry pi and compatible usb jtag

Does something exist that uses this protocol, to enable a raspberry pi connected to a compatible usb jtag device such that vivado running on a pc can remotely access the fpga connected to the pi in place of vivado not being available to run on a raspberry pi (given it is arm).

Does anything else exists that can do this that already exists (not sure if usbip is reliable enough)?

Can this protocol be used to connect a pi as a remote link to an fpga via usb jtag if someone were to create the server file that translates it to ftdi jtag commands?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.