Documentation

Trace Model Objects to Generated Code

  1. Open the model and make sure that it is configured for an ERT target.

  2. In the Configuration Parameters dialog box, theCode Generation>Report>Create code generation reportparameter is selected by default. When selected, the parameter enables and selects theOpen report automaticallyandCode-to-modelparameters.

  3. SelectModel-to-code. This parameter:

  4. Build or generate code for the model. An HTML code generation report is displayed.

  5. In the model window, right-click a model object. To select multiple blocks, holdShiftand right-click additional blocks.

  6. From the context menu, selectC/C++ Code>Navigate to C/C++ Code. In the HTML code generation report, you see the first instance of highlighted code that is generated for the model object. In the left pane of the report, numbers that appear to the right of generated file names indicate the total number of highlighted lines in each file. The following figure shows the result of tracing theUnit Delayblock in modelrtwdemo_hyperlinks.

    At the top of the code window, use the navigation bar to move forward and backward through multiple instances of highlighted lines. Use the navigation sidebar to go directly to a line of code.

If you close and reopen a model, theNavigate to Codecontext menu option might not be available because Embedded Coder®cannot find a build folder for your model in the current working folder. Do one of the following:

  • Reset the current working folder to the parent folder of the existing build folder.

  • SelectModel-to-codeand rebuild the model. Rebuilding the model regenerates the build folder into the current working folder.

  • ClickConfigure. In the Model-to-code navigation dialog box,reload the existing trace information.

See Also

|

Was this topic helpful?