targeting fpga & soc hardware overview
target an fpga or soc device by following the steps that design and deploy your algorithm specifically on hardware. you start with a simulink® model or matlab® function, choose a hardware platform to target, and follow the hardware-software co-design workflow. explore the best ways to partition and deploy your design by iterating through these steps.
choose your target platform. after modeling your design in simulink or as a matlab function, decide what target platform you want to deploy your design to. consider:
which type of device do you want to target: standalone fpga, soc device, or a platform that has a separate fpga and processor?
device type recommended workflow standalone fpga if you are deploying only to an fpga, use only the first part of the hardware-software co-design workflow: prototype and deploy hdl algorithm for fpga. soc device to deploy a model to an soc device, you need to partition the design to contain a hardware portion for the fpga, and an embedded software portion for the processor, referred to as a hardware-software model. the fpga requires a bitstream to alter its physical connections, the hardware part of the model, and the processor requires a new set of instructions in the form of an executable, the software part of the model. simulink real-time™ fpga i/o modules this type of platform refers to a speedgoat® target machine, which acts as a processor, and an fpga io module. you can program both the fpga and processor using the targeting fpga & soc hardware steps. for more information, see . what stage of development are you in: rapid prototyping or production?
for rapid prototyping, save development time by selecting a pre-existing target device that hdl coder™ supports. you can then immediately get started using the hardware-software co-design workflow. see hdl coder supported hardware.
for production, or rapid prototyping with an unsupported device, create a custom hardware platform first, and then follow the hardware-software co-design workflow. see create custom hardware platform.
hardware-software co-design
the hardware-software co-design workflow is broken into two stages:
prototype and deploy hdl algorithm for an fpga
prepare your model for deployment on target hardware. hdl coder generates an ip core and bitstream containing the generated hdl code from your design to deploy to the fpga of your device. you can then run and verify that the ip core is working on your target hardware. this stage can be used to target a standalone fpga device, an soc device, or platform that has a separate fpga and processor.
deploy c algorithm for processor
configure the hardware-software interface by configuring the connection between the fpga and processor generating c code for your processor.
deploy your design that has been partitioned into hardware and embedded software components to run on a platform containing an fpga and an embedded processor, such as an soc device. the design consists of the dut algorithm for which you generate an ip core and a bitstream containing your hdl code, and software components for which you generate embedded code to run on the processor. you use the generated software interface model and ip core that includes hardware interface components, such as axi interfaces, to interface between the hardware and software components.
prototype and deploy hdl algorithm for an fpga
prepare model for deployment
for the model and design of your algorithm to be deployable on your target device, these are the high-level tasks:
partition your design for hardware and software components of your target hardware, if you are using a platform containing a processor and an fpga, such as an soc device. you can partition your design to generate the hardware that targets the fpga and the software that runs on the embedded processor.
map the inputs and outputs of your model to hardware interfaces, such as axi4 interfaces, push buttons, and leds. the generated design can then communicate with the rest of the hardware system when it is deployed. for more information, see target platform interfaces.
for an example on preparing a model for deployment, see .
generate ip core and bitstream
once your design is prepared for deployment, you can use the hdl workflow advisor to:
generate a generic board-independent xilinx® or intel® hdl ip core. the ip core is a shareable and reusable hdl component that implements a specific function, typically an algorithm. an ip core consists of ip core definition files, hdl code generated for your algorithm, a c header file containing the register address map, and the ip core report. for an example, see .
integrate the ip core into a reference design to target standalone fpga boards or soc platforms by using xilinx vivado® ip integrator or intel qsys. the reference design contains elements that the intel or xilinx software requires to deploy your design to the soc platform, except for the custom ip core and embedded software that you generate from the hardware-software model. the reference design acts a platform to build your algorithm on top of and abstracts your hardware platform so you can focus on your algorithm development. once you have completed your algorithm development, hdl coder enables you to package the algorithm as an ip core and fit it into the reference design.
generate a bitstream that contains your ip core for deployment on your target fpga.
for an example on generating an ip core and bitstream, see .
run and verify ip core on target hardware
run and verify the generated bitstream from your ip core design on your target hardware:
prepare your target hardware by connecting it to the host machine. if you are using a platform containing an fpga and processor, such as an soc device, download a linux® image for the processor. for more information, see (hdl coder support package for xilinx zynq platform) for xilinx zynq® platforms or (hdl coder support package for intel soc devices) for intel soc devices.
establish a jtag or ethernet connection from your host machine to the target hardware.
program your target device.
prototype, debug, and verify your design on your target hardware by using one of these prototyping approaches:
fpga i/o. you can use the host interface model or host interface script generated by the hdl workflow advisor to communicate between your host pc, running matlab and simulink, and the generated ip core deployed on your fpga.
axi manager
fpga data capture
fpga-in-the-loop (fil)
software interface model generation, see .
for an example, see .
deploy c algorithm for processor
configure software interface to fpga
to target a complete hardware-software system, hdl workflow advisor generates a software interface model from your original simulink model. the software interface model can be used for deployment to the on-board processor of your target platform. this model contains properly configured device drivers for the processor on-board your soc device or target platform. if you are targeting an soc device, this model is the second model required for the hardware-software design. the first model is the original model with your hdl algorithm to target the on-board fpga. this software interface model targets your processor and communicates between the software deployed to the processor and the generated ip core deployed to the fpga.
for more information, see .
hardware-software deployment
generate c code (requires embedded coder®) from your software interface model and use external mode or processor-in-the-loop (pil) mode to deploy and run your hardware-software model on target hardware. the deployable design for your soc device consists of:
a generated bitstream from your original model containing your hdl ip core.
a software interface model containing configured device drivers to allow communication between your processor and fpga and c code generation for embedded processor.
the deployment of your complete partitioned design into generated c code for the processor, from the software interface model, and a bitstream for the on-board fpga, from your original model containing your ip core, enables you to run your algorithm on board an soc or a simulink real-time target machine that has fpga i/o boards.
for an example, see .
create custom hardware platform
if there are no platforms already available for your hardware, you can define a custom hardware platform to use with the hardware-software codesign workflow. a custom hardware platform creates flexibility to define your hardware system and deploy your design. for example, you can define a custom platform when deploying to production hardware. creating a hardware platform consists of creating a new board definition to describe your hardware and creating one or more new reference designs for your board. you can also create new reference designs for an existing board.
a reference design provides a level of abstraction between your algorithmic ip core and the hardware board, making it easier and more efficient to design an algorithm to deploy on hardware. the reference design acts as the layer between your algorithm and the hardware platform, which you can use to leverage resources within your hardware without having to model these specific hardware resources in your design. you can focus on your algorithm design without implementing low-level details of the hardware. you can also retarget your algorithm to different hardware. for example, you can retarget your algorithm design when you transition from an evaluation board used for prototyping to production hardware.
for more information, see .