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.
- First make sure your modified .vhd files are all saved.
- Select “File->Open” and browse to the “data” folder of your modified peripheral. Select the .mpd file and click “Open”.
- In the .mpd file there will be a line saying
OPTION CORE_STATE = ACTIVE. Change the “ACTIVE” to “DEVELOPMENT” and save the file.
- 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”.
- In Windows Explorer, browse to the “pcores” folder of the project where you have a peripheral you want to copy.
- Select and copy the folder of the peripheral you want to copy.
- Paste this folder into the “pcores” folder of the project in which you want to use the peripheral.
- 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.
- Open the project in XPS and select “Project->Rescan User Repositories”.
Now the peripheral should appear in the “IP Catalog” of the project.