When I make changes to a peripheral, what is the most efficient way to re-build the project? How can I avoid having to re-build the entire project?

Sometimes we are developing a peripheral and we have to re-build and test it several times over. In this situation, we don’t have to “Clean Hardware” and re-build the entire project from scratch every time. Instead, we can make use of an option in the .mpd file of the peripheral in development.

  1. First make sure your modified .vhd files are all saved.
  2. Select “File->Open” and browse to the “data” folder of your modified peripheral. Select the .mpd file and click “Open”.
  3. In the .mpd file there will be a line saying “OPTION CORE_STATE = ACTIVE”. Change the “ACTIVE” to “DEVELOPMENT” and save the file.
  4. Now select “Project->Rescan User Repositories”.

Now every time that you select “Device Configuration->Download Bitstream”, XPS will check if you have made changes to the peripheral and re-build it into the project if necessary.

There is an exception to the above case and that is if you have modified the ports of your peripheral. In this case, you must use the Peripheral Wizard to Import your peripheral, change the .mpd file and then run “Project->Rescan User Repositories” again. Remember, every time that you run the Peripheral Wizard, it will re-write your .mpd file, so each time you will have to change the “ACTIVE” back to “DEVELOPMENT”. For a more detailed description of the Import process, see the tutorial Create a Peripheral Using the Peripheral Wizard.

How can I copy a peripheral from one project into another?

If you developed a peripheral in one project and you want to use it in another, you just have to copy all the peripheral files and use “Project->Rescan User Repositories”.

  1. In Windows Explorer, browse to the “pcores” folder of the project where you have a peripheral you want to copy.
  2. Select and copy the folder of the peripheral you want to copy.
  3. Paste this folder into the “pcores” folder of the project in which you want to use the peripheral.
  4. Now do the same thing for the “drivers” folder. Note that not all peripherals have drivers, so this folder may not exist for the peripheral you want to copy.
  5. Open the project in XPS and select “Project->Rescan User Repositories”.

Now the peripheral should appear in the “IP Catalog” of the project.

Jeff is passionate about FPGAs, SoCs and high-performance computing, and has been writing the FPGA Developer blog since 2008. As the owner of Opsero, he leads a small team of FPGA all-stars providing start-ups and tech companies with FPGA design capability that they can call on when needed.

Facebook Twitter LinkedIn