generate design using soc builder -凯发k8网页登录

main content

generate design using soc builder

this tutorial shows how to build hardware and software executables for your soc model and execute your application. after you create an soc model using the tool, use the tool to generate an hdl ip, build a bitstream, and program the hardware board.

note

after you create an soc model for a specified reference design board, do not change the target hardware board. even if you change the target board after you create an soc model, the soc builder tool still generates hdl code for the target board for which you have created the model. to change the target hardware board, create a new soc model for a required reference design board by using the soc model creator tool.

set up fpga design software tools

set up your system environment for accessing xilinx® tools from matlab® by using the hdlsetuptoolpath function. this function adds the specified installation folder to the matlab search path. this example assumes that xilinx vivado® is installed in the folder c:\xilinx\vivado\2020.2\bin.

hdlsetuptoolpath('toolname','xilinx vivado', ...
'toolpath','c:\xilinx\vivado\2020.2\bin\vivado.bat')

prepare model for generation

start the soc builder tool. in the simulink® toolstrip, on the system on chip tab, click configure, build & deploy.

prepare your model by selecting a starting point for the build process and then reviewing the model information.

note

if soc builder detects no support package, soc builder prompts you to install the required support package before going to the setup section.

soc builder tool, prepare model for generation

  • select the starting point for the build process. if you are building a model for the first time, select build using fixed reference design. if you have already completed the build process and saved the binaries in a folder, select load existing binaries.

  • if you do not want to build your model using a fixed reference design and want to switch to the regular soc builder tool, click the link provided in the about your selection section. close and then relaunch the soc builder tool. if you want to switch back to the fixed reference design workflow, enter this command at the matlab command prompt, and then relaunch the soc builder tool.

    hdlrestoreparams('mysocmodel_fpga/hdl_ip','targetsetting.m')
    for more information about various soc generation workflows, see .
  • soc builder parses the model and displays the top model, the fpga model, and the processor model (if one exists). review this information for accuracy. if any of the information is incorrect, revise the model, save the model, and then restart the soc builder tool.

  • click next.

select build action

in the select build action section, select one of these build actions for your model and automate the build process.

  • build, load, and run — select this option to generate hdl and c code and to build software executables and an fpga programming file from your model. after building, soc builder loads the generated code to the target hardware board and executes the application.

  • build only — select this option to generate hdl and c code and to build software executables and an fpga programming file from your model. soc builder saves the generated binaries in a folder, and you can continue execution later.

  • build and load for external mode — select this option to build the design and run it in external mode. external mode enables you to tune parameters on the fpga without having to rebuild the fpga design. you can also log data from the fpga and displaying it on the host computer. for more information about external mode, see (simulink coder).

  • automate build process — select this option to build your model with fewer clicks. automating the build process performs these actions.

    • skips these steps: select project folder, review hardware mapping, and review memory map

    • runs these steps: validate, build, and load

    all these steps use the inputs that you provided in the most recent build. if you are running the build process for the first time, soc builder uses default inputs for these steps.

  • advanced build options — select the build type as one of these options.

    • processor and fpga (default) — build the processor and fpga models in your top model.

    • processor only — build only the processor model in your top model.

    • fpga only — build only the fpga model in your top model.

after you specify the build options, click next.

select project folder

  1. specify a path to a project folder by entering the path in the project folder box or by browsing to a folder location. soc builder places all of the generated files, including reports, executables, and the bitstream, in this specified folder.

  2. if you select load existing binaries as the starting point for the build process, specify the project folder location of the previous binaries and reports.

  3. click next.

review hardware mapping

  1. open the tool by clicking view/edit.

  2. view and edit the map of tasks in the soc model to interrupt service routines (isrs) on the hardware board.

    note

    this hardware mapping step of soc builder is visible only if you have an event-driven task defined in the task manager block in your top model.

  3. click next.

review memory map

  1. open the tool by clicking view/edit.

  2. review the base addresses and offsets. edit the offsets if you need to. in this workflow, the memory mapper tool shows the device under test (dut) and its registers.

    memory map of model in soc builder tool

    note

    this memory map step of soc builder is visible only if you have an fpga model in your top model. if your fpga model is set to frame-based modeling, then no fpga model is visible. in this case, you cannot access the memory mapper tool.

  3. click next.

validate model

check the model against the selected board by clicking validate.

build model

to generate a bitstream for your fpga design and a compiled executable for your software, click build.

clicking build opens an external shell and runs third-party tools for synthesis and implementation of the design. the generation time depends on the complexity of your model and your host computer.

connect hardware

review the ipv4 address, ssh port number, and login credentials. edit any of these values if needed. this step is critical if you have more than one board connected to the host computer so that soc builder can identify the correct port connection. verify that the displayed ip address matches the ip address for the board you intend to use.

verify that the board is connected to the host with an ethernet cable, and then click test connection to test the physical connection to the board.

load and run application

note

if your top model includes an fpga model, but no processor model, the load and run button is labeled load instead.

verify that your board is connected to the host computer via an ethernet cable. click load and run. this action loads the generated bitstream to the fpga, programs the processor, and runs the application.

if you select build and load for external mode in the select build action step, this action loads the bitstream to the fpga and opens the model in external mode. you can now choose signals for logging and monitoring or change tunable parameters. to run the application on hardware, in the run on hardware section on the system on chip tab, click monitor and tune. if you already built your design and loaded it onto an fpga, click connect. this action connects your simulink model to the fpga model.

see also

| |

related examples

    more about

      网站地图