DOC PREVIEW
Toronto ECE 532 - Module m05 - Adding a User-Designed Peripheral

This preview shows page 1 out of 4 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

University of Toronto ECE532 Digital Hardware Module m05 Adding a User Designed Peripheral Version for EDK6 3 Jan 13 05 As of EDK6 3 there is now a wizard the Create Import Peripheral Wizard that can be used to add userdesigned peripherals into an EDK repository or an XPS project If you wish to add a peripheral that will be connected to the OPB or PLB bus then this tool should make it much easier At this point a key limitation is that it only works for cores written in VHDL See the Embedded System Tools Reference Manual for more information on this wizard This module was created before the Create Import Peripheral Wizard was available The value of doing this module is to get an understanding of some of the underlying directory structure of an XPS project and to see how to handle a peripheral that might not exactly fit the model of a typical peripheral In this case the core to be added also has a connection directly to the processor not just to the bus Goals Add a user designed peripheral to a basic MicroBlaze system You will be provided with a core called snoopy that is written using VHDL Demonstrate the required structure necessary for interfacing user designed cores to the Xilinx cores in an XPS project Learn about how you would make your own core to attach to the OPB Requirements Module 1 Building a base system Preferably do Modules 1 4 Preparation 1 Review the handout outlining the EDK project structure provided in Module 1 We will be focusing on the pcores subdirectory for this module 2 Look at Module m09 Integrating a Verilog design into a MicroBlaze System Much of the content is also applicable to creating VHDL cores Pay particular attention to the section about Adding the design to a MicroBlaze system 3 If you are unfamiliar with the profiling of code read the manual page for gprof which is available on the ugsparcs with the man command Background To this point you have only been adding cores from the existing library If you cannot find a core with the required functionality you will have to add your own This lab adds a simple core that can be used to profile the code running on a MicroBlaze This has similar functionality to the gprof utility for profiling that is available in the GNU tools However it is much more accurate You may find it useful for your project Step by step 1 Copy your working lab1 project into a new directory 1 University of Toronto ECE532 Digital Hardware Module m05 Adding a User Designed Peripheral 2 Add a pcores subdirectory to your new project directory Using an ssh window login to your ugsparc account The files you will need for this lab can be found in m05 zip Copy 1 system c to the code directory of your project 2 the snoopy v1 00 a directory into the pcores directory and 3 the sst script and example results txt to the root of the project directory 4 the OPBInterfaceModule directories to a directory where you can refer to them later Note You may find the cp r command useful As well the mv command can also be used to move directories 3 Take time to look through the directory structure of the snoopy core The naming structure is essential for XPS to be able to detect a user s peripheral All user cores must be located in the pcores subdirectory or in a globally specified path to a peripheral repository User cores can be defined using either VHDL or Verilog but any one core cannot have a mix of HDLs Along with the hdl files used to implement the core the user must also include data files a pao file Peripheral Analyze Order and an mpd file Microprocessor Peripheral Description The pao file lists the order in which files in your design should be synthesized to resolve component architectures The mpd file describes the external interface of the core to a system For more information on these files and their structure go to the Embedded System Tools Guide Notice that the version numbers in the core name and the version numbers in the data file names differ The version in the core name is the core s version The version in the data file names is the version of the syntax used to write the data file The easiest method for including user IP into an EDK project is to follow an example When you develop your own cores for your project you can use snoopy as a guide The cores provided by Xilinx in the INSTALL DIR hw XilinxProcessorIPLib pcores directory may also be used as a reference You are also encouraged to look around through the directories in the EDK installation because there is a lot of source code available that might help you or guide you with your own designs 4 The snoopy core is a snooping profiler that is able to profile software running on a softcore processor in real time The counters calculate the exact number of clock cycles spent executing contiguous address ranges The user specifies the number of counters and the lower and upper bounds for each counter before synthesis This information can be used by embedded system designers to determine which if any sections of the software should be moved to hardware to achieve the required design specifications 5 Open the Add Edit cores menu The snoopy core should appear in the list of peripherals you can add to your design Add the snoopy core and connect it to the slave opb bus The core requires 0x100 bytes and a 0x100 byte alignment Since the tools resolve connections to the opb and lmb buses based on the address of a peripheral we suggest address range 0xffffff00 to 0xffffffff to guarantee the peripheral resides on the opb 6 For the snoopy core to work it must be interfaced with the system clock and the PC EX and valid instr ports on the Microblaze core Connect the clock from the snoopy core OPB Clk to the system clock Don t forget to check the net name and the scope under the Ports tab Unfortunately the PC EX and valid instr ports on the snoopy core are not visible through the Add Edit core interface Therefore they will have to be added manually to the hardware description 7 Close the XPS GUI Go to your project directory and open the system mhs file You are going to edit this file by hand It is important to remember that this file contains the project description used by XPS to generate your MicroBlaze system Therefore it is safest to only edit the mhs file when XPS is not running 8 You are going to add two lines of code to the MicroBlaze and snoopy module descriptions Each module description begins with a BEGIN module type Look for the MicroBlaze core and the snoopy core and add the following two


View Full Document

Toronto ECE 532 - Module m05 - Adding a User-Designed Peripheral

Documents in this Course
Load more
Download Module m05 - Adding a User-Designed Peripheral
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Module m05 - Adding a User-Designed Peripheral and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Module m05 - Adding a User-Designed Peripheral and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?