- Invoke Vitis Model Composer.
- On Windows systems, select .
- On Linux systems, type
model_composerat the command prompt.
- Navigate to the Lab1 folder: \HDL_Library\Lab1.
You can view the directory contents in the MATLAB® Current Folder browser, or type
lsat the command line prompt.
- Open the Lab1_1 design as follows:
- At the MATLAB
command prompt, type
- Double-click Lab1_1.slx in the Current Folder browser.
The Lab1_1 design opens, showing two sine wave sources being added together and passed separately through two low-pass filters. This design highlights that a low-pass filter can be implemented using the Simulink FDATool or Lowpass Filter blocks.
- At the MATLAB command prompt, type
- From your Simulink project worksheet,
select or click the Run
When simulation completes you can see the spectrum for the initial summed waveforms, showing a 1 MHz and 9 MHz component, and the results of both filters showing the attenuation of the 9 MHz signals.
You will now create a version of this same filter using HDL blocks for implementation in an FPGA.
- Click the Library Browser button in
the Simulink toolbar to open the Simulink Library Browser.
When using Model Composer, the Simulink library includes specific blocks for implementing designs in an FPGA. You can find a complete description of the HDL library blocks provided by Model Composer in the Vitis Model Composer Tutorial (UG1498).
- Expand the DSP, then select Digital FIR Filter. menu, select
- Right-click the Digital FIR Filter
block and select Add block to model
You can define the filter coefficients for the Digital FIR Filter block by accessing the block attributes–double-click the Digital FIR Filter block to view these–or, as in this case, they can be defined using the FDATool.
- From FDATool and add it
to the Lab1_1 design.
An FPGA design requires three important aspects to be defined:
- The input ports
- The output ports
- The FPGA technology
The next three steps show how each of these attributes is added to your Simulink design.Important: If you fail to correctly add these components to your design, it cannot be implemented in an FPGA. Subsequent labs will review in detail how these blocks are configured; however, they must be present in all Model Composer HDL designs.
- In the Interfaces menu, select Gateway
In, and add it to the design.
- Similarly, from the same menu, add a Gateway Out block to the design.
- From the Tools menu, under the HDL menu, add the System Generator token used to define the FPGA technology.
- Finally, make a copy of one of the existing Spectrum Analyzer blocks, and rename the instance to Spectrum Analyzer HDL by clicking the instance name label and editing the text.
- Connect the blocks as shown in the following figure. Use the
left-mouse key to make connections between ports and nets.
In this step, you learn the basic operation of Model Composer and how to synthesize a Simulink design into an FPGA.
The next part of the design process is to configure the HDL blocks.