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

Unformatted text preview:

University of TorontoECE532 Digital HardwareModule m05: Adding a User-Designed PeripheralVersion for EDK6.3 Jan/13/05As of EDK6.3, there is now a wizard, the Create/Import Peripheral Wizard that can be used to add user-designed peripherals into an EDK repository or an XPS project. If you wish to add a peripheral that will beconnected to the OPB or PLB bus, then this tool should make it much easier. At this point, a key limitationis that it only works for cores written in VHDL. See the Embedded System Tools Reference Manual for moreinformation on this wizard.This module was created before the Create/Import Peripheral Wizard was available. The value of doingthis module is to get an understanding of some of the underlying directory structure of an XPS project andto 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, calledsnoopy that is written using VHDL.• Demonstrate the required structure necessary for interfacing user-designed cores to the Xilinx cores inan XPS project.• Learn about how you would make your own core to attach to the OPB.RequirementsModule 1 Building a base system. Preferably, do Modules 1-4.Preparation1. Review the handout outlining the EDK project structure provided in Module 1. We will be focusingon the pcores subdirectory for this module.2. Look at Module m09, “Integrating a Verilog design into a MicroBlaze System”. Much of the contentis also applicable to creating VHDL cores. Pay particular attention to the section about “Adding thedesign to a MicroBlaze system”.3. If you are unfamiliar with the profiling of code, read the manual page for “gprof”, which is availableon the ugsparcs with the “man” command.BackgroundTo this point, you have only been adding cores from the existing library. If you cannot find a core with therequired 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 hassimilar functionality to the “gprof” utility for profiling that is available in the GNU tools. However, it ismuch more accurate. You may find it useful for your project.Step-by-step1. Copy your working lab1 project into a new directory.1University of TorontoECE532 Digital HardwareModule m05: Adding a User-Designed Peripheral2. 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 foundin m05.zip. Copy: 1) system.c to the code directory of your project; 2) the snoopy v1 00 a directoryinto the pcores directory; and 3) the sst script and example results.txt to the root of the projectdirectory; 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 es-sential for XPS to be able to detect a user’s peripheral. All user cores must be located in the pcoressubdirectory or in a globally specified path to a peripheral repository. User cores can be defined usingeither 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 filelists 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 thesefiles 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 ofthe syntax used to write the data file.The easiest method for including user IP into an EDK project, is to follow an example. When youdevelop your own cores for your project, you can use snoopy as a guide. The cores provided by Xilinxin 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 thereis 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 inreal time. The counters calculate the exact number of clock cycles spent executing contiguous addressranges. The user specifies the number of counters and the lower and upper bounds for each counterbefore synthesis. This information can be used by embedded system designers to determine which, ifany, 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 addto your design. Add the snoopy core and connect it to the slave opb bus. The core requires 0x100 bytesand a 0x100 byte alignment. Since the tools resolve connections to the opb and lmb buses based onthe address of a peripheral, we suggest address range 0xffffff00 to 0xffffffff to guarantee the peripheralresides on the opb.6. For the snoopy core to work, it must be interfaced with the system clock, and the PCEX and valid instrports 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 andvalid 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 editthis file by hand. It is important to remember that this file contains the project description used byXPS to generate your MicroBlaze system. Therefore, it is safest to only edit the mhs file when XPS isnot running.8. You are going to add two lines of code to the MicroBlaze and snoopy module descriptions. Each


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 2 2 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?