User guide

System Generator for DSP User Guide www.xilinx.com 5
UG640 (v 12.2) July 23, 2010
EDK Processor Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Integrating a Processor with Custom Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Memory Map Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Hardware Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
The Software Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Writing a Software Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Asynchronous Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Clock Wiring in the Hardware Co-Simulation Flow . . . . . . . . . . . . . . . . . . . . . . . . . . 155
EDK Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Importing an EDK Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Exposing Processor Ports to System Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Exporting a pcore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Designing with Embedded Processors and Microcontrollers . . . . . . . . . . . . . . . . 166
Designing PicoBlaze Microcontroller Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Designing and Exporting MicroBlaze Processor Peripherals . . . . . . . . . . . . . . . . . . . 173
Tutorial Example - Designing and Simulating MicroBlaze Processor Systems . . . . 178
Using XPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Using Platform Studio SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Tutorial Example - Using System Generator and SDK to Co-Debug an Embedded DSP Design
200
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Chapter 3: Using Hardware Co-Simulation
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
M-Code Access to Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Installing Your Hardware Board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Ethernet-Based Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
JTAG-Based Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Third-Party Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Compiling a Model for Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Choosing a Compilation Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Invoking the Code Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Hardware Co-Simulation Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Hardware Co-Simulation Clocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Selecting the Target Clock Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Clocking Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Selecting the Clock Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Board-Specific I/O Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
I/O Ports in Hardware Co-simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Ethernet Hardware Co-Simulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Point-to-Point Ethernet Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Network-Based Ethernet Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Remote JTAG Cable Support in JTAG Co-Simulation . . . . . . . . . . . . . . . . . . . . . . . . . 240
Shared Memory Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Compiling Shared Memories for Hardware Co-Simulation . . . . . . . . . . . . . . . . . . . . 243
Co-Simulating Unprotected Shared Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Co-Simulating Lockable Shared Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Co-Simulating Shared Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Co-Simulating Shared FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249