Toronto ECE 532 - LAB 4 - Adding the OPB EMAC Peripheral

Unformatted text preview:

University of TorontoECE532 Digital HardwareLAB 4: Adding the OPB EMAC Peripheral 1Version 1.1 1/29/2004 10:48 PMAcknowledgementThis lab is derived from a Xilinx lab given at the University of Toronto EDKworkshop in November 2003. Many thanks to Xilinx for allowing us to use andmodify their material.Goals• Understand the procedure for adding more complex peripherals to an XPSproject.• Use XPS to manually add the OPB 10/100 EMAC peripheral to theMicroBlaze system.• Search through more documentation to see where to find various bits ofinformation and examples.Preparation1. Read through this lab first to get an idea of what you are about to do.2. Find the data sheet for the OPB Ethernet Media Access Controller (EMAC)(v1.00m) and review it. A copy is also posted directly on the course webpage.3. In this lab you will be modifying an example program that can be found in theProcessor IP drivers library for the device. On the lab machines, look inO:\Xilinx\EDK6.1i\sw\XilinxProcessorIPLib\drivers\emac_v1_00_d\examples4. The first step is to copy the previous lab. You can do this in advance bygoing to your ugsparc directory where you can find “lab3”:% cp –r lab3 lab4You should, of course, check to see if you have enough space first! You mayneed to clean up some files, i.e., do some cleaning. If you want to clean lab3,you can also do this from the ugsparcs using the system.make file in the lab3directory. In the lab3 directory type:University of TorontoECE532 Digital HardwareLAB 4: Adding the OPB EMAC Peripheral 2% make –f system.make hwcleanto clean the hardware directory.% make –f system.makewill give you all the options. But, this still does not work!! Why?Try this first:% dos2unix system.make usystem.makeand try the above commands but using usystem.make. What’s going on?Just one of the many kinds of things you have to deal with when working withCAD tools.5. During the lab, you will be working with the example calledxemac_intr_fifo_example.cThis file is also posted on the course web site for you to look at before the lab.You will be asked to modify it so that it will work with your system. You mightwant to try to understand what it does so that you will not have to spend timeduring the lab doing this. You can also do some modifications and adding ofprint statements. Put your file in your ugsparc directory where you canaccess it later. If you did step 3 above, then put it in the code directory of thelab4 project directory.BackgroundAs peripherals become more complex, there are more signals to be brought outof the FPGA and possibly more timing issues, including the need for timingconstraints and Digital Clock Managers (DCM). The DCM is a block in the FPGAthat contains functions like DLLs that can be used to help synchronize internallogic and clocks with external logic and their clocks. You will not have to dealwith them here. In this lab, you will be connecting the FPGA to an externalEthernet chip.University of TorontoECE532 Digital HardwareLAB 4: Adding the OPB EMAC Peripheral 3Ethernet is a widely used peripheral, so it is beneficial to learn how to properlyinclude the OPB EMAC into an XPS project.Outside of the FPGA is the physical layer interface (PHY) that actually connectsto the Ethernet cable on one side, and the FPGA pins on the other side. TheEMAC is the peripheral that is inside the FPGA that connects from the FPGApins to the OPB bus of the MicroBlaze allowing the processor to talk to theEthernet chip.This lab is built on top of the previous week’s lab. It expects a MicroBlazesystem with an interrupt controller and serial Uart device for standard I/O. If youdidn’t successfully add the DIP switch to last week’s lab, you can build onto thesimpler design.Note that at 27MHz, the speed of the OPB bus, the EMAC will only functioncorrectly at 10Mbps.Using XPS Base System Builder1. Copy the XPS project directory of the previous lab and rename the copy to“lab4”. This will be the working project directory for this lab. You may need todelete the implementation directory of the previous lab to free up disk space.Use “clean” under the Tools menu.2. Open the “lab4” project using XPS.3. From the Project menu, select the Add/Edit Cores… (dialog) submenu item.Add the opb_ethernet peripheral to the system. Define the base address ofthe device to be a 16K aligned address following the address of the previousperipheral in the list. Attach the EMAC as a slave to the OPB bus. Note thattwo devices appear. Configure only the sopb (slave) version.When would you attach the EMAC as a master to the OPB bus?The minimum address range of the OPB EMAC core is 16K (0x4000). Thetools require that the base address begin at a 16K aligned address.4. In the Add/Edit Cores… (ports tab) dialog box, add the PHY ports (exceptPHY_rx_en and PHY_rst_n) and the interrupt output port of the EMAC to theUniversity of TorontoECE532 Digital HardwareLAB 4: Adding the OPB EMAC Peripheral 4design so that they can be connected to other signals or pins of the FPGA.Make sure all PHY ports are external such that they are connected to theircorresponding FPGA pins. Later, you will use the board user’s guide orschematic for information on pin assignments for each signal.Note that the net names chosen for each port will need to match the netnames in the system UCF file. The default net names will suffice for the PHYconnections. You’ll change the interrupt name later.5. Add a vector range on the PHY receive and transmit data ports. Determinethe width of the vector from the data sheet. For an n-bit bus, input the rangeof [n-1:0].6. There are two PHY signals connected to the FPGA that do not havecorresponding ports in the EMAC device. These signals are inputs to thePHY and should be tied high (tied to net_vcc) in the design.Click Add Port in the Ports tab to create a system port. Name the portPHY_slew1, make it an output, and connect it to net_vcc in the Add ExternalPort dialog box. Click OK.Do the same for PHY_slew2.7. Make the interrupt output of the EMAC an internal port. We will beconnecting this net to the interrupt input of the interrupt controller device.Rename the net name of the EMAC interrupt output port to emac_intr. Thiscan be done by typing the new name in the Net Name box of the port in thePorts tab.Recall that the interrupt controller can handle a number of interrupt inputrequest lines. The


View Full Document

Toronto ECE 532 - LAB 4 - Adding the OPB EMAC Peripheral

Documents in this Course
Load more
Download LAB 4 - Adding the OPB EMAC 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 LAB 4 - Adding the OPB EMAC 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 LAB 4 - Adding the OPB EMAC 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?