2.7.2 Special-purpose behaviors

The behavior names have specific meanings in components. System Generator (SimGen) calls the behaviors implicitly and automatically in certain simulation phases.

behavior init
SimGen calls this behavior implicitly when the simulation starts. The code in this behavior only executes once, to allocate memory and other resources.
behavior reset(int level)

SimGen calls this behavior whenever you reset the simulation. SimGen might call reset multiple times. There is one defined reset level:

MX_RESETLEVEL_HARD
Reset all state variables to their reset values and clear memories.

Do not allocate memory in this behavior because SimGen might invoke it several times.

Caution:

  • All registers are normally reset to the values specified by their reset_value parameters immediately before behavior reset is run.
  • You can use reset_value(UNINITIALIZED) to prevent the register values being overwritten.
behavior loadApplicationFile(const string& filename)

SimGen invokes this behavior whenever you load an application file into a component using a debugger. The implementation of this behavior must load the application file.

behavior terminate
This behavior is the counterpart to behavior init. SimGen calls it when the simulation terminates, to free any memory and resources that behavior init allocated.
behavior setupGlobalSystemAttributes()
Use this behavior to define a parameter export list. This behavior only matters in the top level component.
Non-ConfidentialPDF file icon PDF version101092_0100_04_en
Copyright © 2014–2018 Arm Limited or its affiliates. All rights reserved.