wiki:custom_periphs/add_XBD

Adding *.XBD Compliance to the Peripheral:

Making a peripheral compliant with the WARP *.xbd can prove quite beneficial, especially if the peripheral uses a large number of external FPGA-pins that would otherwise be a daunting task to write into the UCF file by hand every. To make a peripheral XBD compliant, there are two files that must be modified: the *.mpd file and, obviously, the WARP’s *.xbd file.

Modifying the MPD file

Open the peripheral's *.mpd file and add the following line directly after the options section:

IO_INTERFACE IO_IF = <peripheral_name>, IO_TYPE = <any_name_here>

The entry <peripheral_name> should be the name in the of the peripherals directory WITHOUT the version-part (so, for instance, if the peripheral is radio_controller_v1_03_a, IO_IF = radio_controller). See the example *.mpd file from the first section of this guide as an example. Any ports that must be tied to external pins via the UCF, should also have appended to their lines:

, IO_IS = <any name>

Another example from the radio_controller peripheral (see above section again):

PORT radio4_LED = "", DIR = O, VEC = [0:2], IO_IS = radio4_LED

All off the variable names created here, will be used in the *.xbd file. The XBD file is comprised of three sections: The board information, the peripheral instantiations, and the pin-mappings. Because this guide is meant to concentrate on peripheral implementation, it will only lightly cover making modifications to *.xbd file.

More information on the proper formatting for the MPD may be found in:
EDK\doc\psf_rm.pdf

Modifying the XBD file

This guide will only focus on the two necessary steps to basically implementing the peripheral into the XBD file for use in Base System Builder. First, instantiate the peripheral in peripherals instantiation section as follows:

BEGIN IO_INTERFACE
ATTRIBUTE IO_TYPE = <any_name_here> ### <--- same from the peripherals mpd file
ATTRIBUTE INSTANCE = <you can give this field any name for the default instance in XPS>
PORT <anything1> = <anything2>, IO_IS = <IO_IS type defined from the mpd file>[#, if vector]
PORT …
…
PORT …
END

PORT Example:

…
PORT radio4_LD = controller_radio4_LD
PORT radio4_24PA = controller_radio4_24PA
PORT radio4_5PA = controller_radio4_5PA
PORT radio4_ANTSW0 = controller_radio4_ANTSW0, IO_IS = radio4_antsw[0]
PORT radio4_ANTSW1 = controller_radio4_ANTSW1, IO_IS = radio4_antsw[1]
PORT radio4_LED0 = controller_radio4_LED0, IO_IS = radio4_LED[0]
PORT radio4_LED1 = controller_radio4_LED1, IO_IS = radio4_LED[1]
PORT radio4_LED2 = controller_radio4_LED2, IO_IS = radio4_LED[2]
…

Note that only a # is needed if the IO_IS type is vector based. The last section to modify is the UCF-section of the XBD file – to do this, simply add the following in (to any part of the UCF-section):

…
PORT <ANYNAME> =  <anything2 from previous section>, UCF_NET_STRING=(“LOC=XX”)
…

“XX” is a pin constraint location. For a more in depth look, many XBD examples can be found in the
EDK\board\ directory.

More information on the proper formatting for the XBD may be found in:
EDK\doc\psf_rm.pdf


PREV: Creating Peripherals That Require PowerPC Control
| HOME | NEXT: Some Brief Notes Concerning Good Peripheral Design Practice
Last modified 13 years ago Last modified on Jul 12, 2006, 12:05:58 AM