use template to create soc model -凯发k8网页登录

main content

use template to create soc model

soc blockset™ model templates provide design patterns and best practices for models intended for simulation, hdl code generation, or soc deployment. models created from any one of soc blockset model templates have their configuration parameters set up for simulation and code generation.

create soc model using soc blockset template

to efficiently model hardware for soc design, create a project by using an soc blockset template.

  1. in the matlab® home tab, select the simulink button. alternatively, at the command line, enter:

    simulink
  2. on the simulink® start page, scroll down to the soc blockset section, which contains links to soc templates for common workflows. select a template and save the project. a project folder opens in your workspace containing:

    • a model with the name soc_*_top.slx – the top-level model for the soc project.

    • referencedmodels – a folder containing the models referenced from the top model. some templates include an fpga model and a processor model. other templates only include one referenced model: an fpga model or a processor model.

    • utilities – a folder containing utility functions or testbench data used by the model.

    to open the top-level model in simulink, on the project shortcuts tab, click open top model.

  3. in each template, navigate to the blocks marked fpga algorithm in the fpga model, or processor algorithm in the processor model. these blocks are highlighted for easy detection. replace the template blocks with your own algorithm model.

    tip

    to easily find the algorithm blocks, follow the annotations throughout the model hierarchy.

  4. to open the soc blockset block library, select the library browser button, then select soc blockset in the left pane. alternatively, at the command line, enter:

    soclib
    this library includes blocks for creating soc models and testbenches.

template structure

the top model in an soc blockset template includes an fpga subsystem, which represents the logic intended to program the fpga. the fpga subsystem includes two simulink model variants:

  • frame-based fpga model – for enhanced simulation performance (not available in the rfsoc template)

  • sample-based fpga model – for cycle accuracy and code generation

the top model also includes a processor subsystem, which represents the software program intended to run on the soc processor. both the fpga and the top subsystems contain blocks marked as fpga algorithm or processor algorithm. replace these algorithms with your own logic. the top model of the template also includes a memory system, with a memory controller and memory channels. these blocks represent the physical memory system on the board. the model often includes a register channel (to enable communication between the processor and fpga), testbench, or i/o blocks.

modify project

modify the fpga model

from the top model, open the fpga model by clicking the arrow at the bottom left of the fpga block:

the fpga model contains two model variants: a frame-based variant and a sample-based variant. double-click the model variant you want to modify. the fpga model typically includes two main subsystems for you to modify:

  • fpga algorithm wrapper – double-click to open the model. the algorithm wrapper contains a green-highlighted subsystem named fpga algorithm. this block has two inputs and one output and is implemented as a multiplier. replace this block with your own fpga algorithm. add inputs and outputs as required.

  • test source wrapper – this block includes a test source and is intended to generate stimulus as an input to the fpga algorithm. modify the test source to your needs, or replace it with an alternative source block. if the input to your fpga algorithm is routed from an i/o block, such as hdmi or sdr, consider using a specific application template.

    note

    not all templates include a test source block in the fpga model.

modify the processor model

the processor model includes a task manager block and a processor wrapper. the template implements the processor algorithm as a "pass through" wire. open the processor algorithm wrapper, and replace the processor algorithm block (highlighted in blue) with your desired algorithm.

modify the register channel

the top model of a template also includes a register channel to communicate between the processor and the fpga model. use the register channel to configure the fpga mode,l or to read and check status registers. the register channel block in the template includes one register. to add additional registers you must modify the register channel block parameters, the fpga algorithm, and the processor algorithm:

  1. add registers to the register channel – double-click the register channel block to open the block mask and add additional registers as needed. adding registers creates additional ports on the register channel block. for additional information, see .

  2. add ports to the processor model – navigate to the processor algorithm wrapper model. to navigate to the processor model, click open processor model on the project shortcuts tab. double-click processor algorithm wrapper to modify it.

    for write registers, add an output port to the module and add logic to drive a value to the added output port. for read registers, add an input port and logic to process the information returned from a read register. from the top model, wire the port to the register channel block.

  3. add ports to the fpga model – navigate to the fpga algorithm wrapper model. to navigate to the fpga/frame based processing model, click open fpga sample model on the project shortcuts tab. double-click fpga algorithm wrapper to modify it.

    for write registers, add an input port to the module and logic to process the information returned from a read register. for read registers, add an output port and logic to drive a value to the added output port.

    for equivalent behavior when using a simulink sample-based variant, repeat this step for the sample-based processing model in the fpga wrapper.

  4. from the top model, wire the new port to the register channel block.

see also

| | |

related topics

    网站地图