System Generator Software Features
Note - For this example to run correctly, you must change your directory (cd within the MATLAB console window) to this directory before launching the example model.
The files contained in this directory are:
∙black_box.mdl - the Simulink model with an example black box
∙bit_reverse.m - a MATLAB function for reversing bit order
∙bit_reverse.vhd - VHDL code for reversing bit order. This file is the actual black box that must be passed to the Xilinx implementation tools. It imitates the behavior of the MATLAB function.
The example project displays three windows:
∙The
∙The black box (a new Simulink model), and
∙The output simulation scopes.
By running the simulation from the
Figure 4-1: Output of example black box function
Black Box window
The Xilinx Black Box token identifies the top level of your black box.
Open the file bit_reverse.vhd in an editor and view the code. You will
see that the name of the component (bit_reverse) is the same name assigned in the Black Box block parameters dialog box. The
Note - The main:process(DIN)section near the bottom of the VHDL file is where the actual bit reversing functionality takes place.
Using Black Boxes | 129 |