---
# System prepended metadata

title: Report about Xilinx Virtual Cable (XVC) on Pynq-z2 board
tags: [TechReport, DeWei, xvc-zybo]

---

# Report about Xilinx Virtual Cable (XVC) on Pynq-z2 board

## 1 Architecture

```graphviz
digraph G {
  labelloc = "t";
	newrank = true;
  compound = true
	
	subgraph cluster_pynq_z2_board {
		label = "PYNQ-Z2 Board";
		
		DDR [ label = "DDR3\n512GByte", shape=Msquare ];
		sd_drive [ label = "SD-Card\ndrive", shape=Msquare ];
		eth_phy [ label = "Eth-PHY\nchip", shape=Msquare ];
		subgraph cluster_zynq7000 {
			label = "zynq7000 Soc";
			rankdir = TB;

			subgraph cluster_PS {
				label = "Processor system \n (PS)";
				node [ style = filled, color = white ];
				color = lightgrey;
				style = filled;
				rankdir = TB;
				//rank = same;

				arm_axi_if [ label = "AXI \n Interface" ];
				arm_proc [ label = "ARM \n  Processor" ];
				arm_mio [ label = "MIO" ];

				arm_axi_if -> arm_proc [ dir = both ];
				arm_proc -> arm_mio [ dir = both ];

			}

			subgraph cluster_PL {
				label = "Programming Logic \n (PL)";
				node [ style = filled ];
				color = blue;
				rankdir = TB;
				//rank = same;

				jtag_axi_if [ label = "JTAG-AXI \n Interface" ];
				jtag_axi_proc [ label = "JTAG \n Proc" ];

				jtag_axi_if -> jtag_axi_proc [ dir = both ];
			}

			jtag_axi_if -> arm_axi_if [ dir = both ];

			{ rank = same; arm_axi_if;  jtag_axi_if; }

			}

			DDR -> arm_proc [ dir = both ];
			jtag_axi_proc -> jtag_io_port [ dir = both ];
			arm_mio -> eth_phy [ dir = both ];
			eth_phy -> RJ45_port [ dir = both ];
			sd_drive -> arm_mio [ dir = both ];
	
	}
	
	jtag_io_port [ label = "JTAG-IO-Prot\n(GPIO port)" ];
  RJ45_port [ label = "RJ45 port" ];
	
	{ rank = same; eth_phy;  jtag_io_port; }
  { rank = same; DDR;  arm_proc; }
	{ rank = same; sd_drive;  arm_mio; jtag_axi_proc;}
	
} 
```

## 2 Software (Working on PS)

```graphviz

digraph G {
  labelloc = "t";
  label = "Main flow of XVC-Server"
  
  subgraph cluster_init_socket {
    label = "init socket (Ethernet port)"
    node [ style = filled, color = gray ]
    
    fd_socket [ label = "fd_socket" ]
    socket [ label = "socket()" ]
    setsockopt [ label = "set\nsockopt()" ]
    bind [ label = "bind()" ]
    listen [ label = "listen()" ]
    
    socket -> setsockopt -> bind -> listen
    { rank = same fd_socket -> socket }
  }  
  
  subgraph cluster_init_jtag_mem {
    label = "init uio (JTAG port)"
    node [ style = filled, color = gray ]
    
    fd_jtag [ label = "fd_JTAG" ]
    uio_fd [ label = "open()\n/dev/uio0" ]
    mmap [ label = "mem\nmapping()" ]
    
    uio_fd -> mmap
    { rank = same; fd_jtag -> uio_fd; }
  }
  
}

```