When it comes to debugging designs the more visibility and control we have over debugging elements such as ILAs is critical.
When we are working with AMD Versal device such as Versal Prime, Edge or Core we are able to use a new python API called ChipScoPy.
ChipScoPy provides developers with an API which can be used by the developer to communicate with and control the ChipScope IP within a Versal design.
Of course this includes the soft debugging IP such as ILA and VIO which can be instantiated within our designs. It also includes the debug modules which are hardened within the Versal Integrated peripherals and hardware options. This includes DDRMC, IBERT, Sysmon, Noc PerfMon and PCIe.
In this blog we will take a look at how we can get install the ChipScoPy and run one of the provided examples on the VCK190 board. We will look at how we can work with ChipScoPy on a custom TE0950 project which uses the Versal Edge VE2302 device soon.
To install ChipScoPy all we need is python version 3.8 or later, while there is an version of python provided with your Vivado installation. It is preferred to install the latest version of python from python.org.
It is recommended to use an virtual environment for the installation of ChipScoPy, to do this I created a new directory into which I wished to installed the virtual environment and ChipScoPy.
If you are not familiar with virtual environments in Python. A virtual environment is an isolated environment which allows us to manage dependencies and packages for a specific project independently of the system-wide Python installation or other projects. This ensures that each project has its own dependencies, versions, and configurations without conflicts.
We can create and activate a python virtual environment using the commands
python -m venv venv
.\venv\Scripts\activate
With virtual environment activated, the files for which will be stored within the directory just created. We can install ChipScoPy its addons and jupyter notebook.
python -m pip install chipscopy==2024.1.*
python -m pip install chipscopy[core-addons]
python -m pip install chipscopy[jupyter]
Once we have everything we need installed we can use ChipScoPy to download the example applications. This also downloads PDI and LTX files for the VCK190, VMK180, VHK158 and VPK120.
To get the examples we can run the ChipScoPy command
chipscopy-get-examples
With the examples installed we are in a position that we can open jupyter notebook and start looking at the example applications.
Opening jupyter notebook from the same location we used to create the python virtual environment will the different examples available.
I am going to be running the ILA and VIO example, under this directory you will find several notebooks which can be examined.
Before we can use the Jupyter note book we need to start the hardware and chipscope servers we can do this using the commands
hw_server
cs_server
With the Hardware and ChipScope server running, we can open the jupyter notebook and run through the cells.
These cells will import the necessary packages, to work with ChipScoPy, get the HW and CS server information and then download the PDI and LTX to the target board depending upon the identified device.
Once the application is downloaded, the notebook steps through identifying the ILA and VIO cores.
The design I downloaded consists of a up / down counter, VIO which controls the direction of the counter and a ILA which monitors the output.
Using the notebook the VIO is configured to set up the counter, and data is then able to be captured by the ILA and shown in the note book.
Changing the counter direction using the VIO enables the ILA to capture the data when it is decrementing and not incrementing.
Being able to connect and debug remotely via python is very impressive and I think it will be very useful for Versal application developments. We will look at how we can do this for a custom board in a blog soon.
Workshops and Webinars
If you enjoyed the blog why not take a look at the free webinars, workshops and training courses we have created over the years. Highlights include
Upcoming Webinars Timing, RTL Creation, FPGA Math and Mixed Signal
Professional PYNQ Learn how to use PYNQ in your developments
Introduction to Vivado learn how to use AMD Vivado
Ultra96, MiniZed & ZU1 three day course looking at HW, SW and PetaLinux
Arty Z7-20 Class looking at HW, SW and PetaLinux
Mastering MicroBlaze learn how to create MicroBlaze solutions
HLS Hero Workshop learn how to create High Level Synthesis based solutions
Perfecting Petalinux learn how to create and work with PetaLinux OS
Boards
Get an Adiuvo development board
Adiuvo Spartan 7 / RPi 2040 Embedded System Development Board
Adiuvo Spartan 7 Tile - Low Risk way to add a FPGA to your design.
Embedded System Book
Do you want to know more about designing embedded systems from scratch? Check out our book on creating embedded systems. This book will walk you through all the stages of requirements, architecture, component selection, schematics, layout, and FPGA / software design. We designed and manufactured the board at the heart of the book! The schematics and layout are available in Altium here Learn more about the board (see previous blogs on Bring up, DDR validation, USB, Sensors) and view the schematics here.
Comments