rtw.connectivity.Config
Define connectivity implementation that comprises builder, launcher, and communicator components
Description
Thertw.connectivity.Config
class specifies the actions required for running a processor-in-the-loop (PIL) simulation.
Creation
Description
rtw.connectivity.Config(componentArgs, builder, launcher, communicator)
creates anrtw.connectivity.Config
object with these arguments:
componentArgs
–rtw.connectivity.ComponentArgs
objectbuilder
–rtw.connectivity.Builder
object, for example,rtw.connectivity.MakefileBuilder
object.launcher
–rtw.connectivity.Launcher
objectcommunicator
–rtw.connectivity.Communicator
, for example,rtw.connectivity
.RtIOStreamHostCommunicator
object.
To define a connectivity implementation:
Create a subclass of
rtw.connectivity.Config
that creates instances of your connectivity component classes:rtw.connectivity.MakefileBuilder
rtw.connectivity.Launcher
rtw.connectivity.RtIOStreamHostCommunicator
Define the constructor for your subclass:
function this = myConfig(componentArgs)
When the software creates an instance of your subclass of
rtw.connectivity.Config
, it provides an instance of thertw.connectivity.ComponentArgs
class as the only constructor argument. If you want to test your subclass ofrtw.connectivity.Config
manually, you can create anrtw.connectivity.ComponentArgs
object to pass as a constructor argument.After instantiating the builder, launcher and communicator objects in your subclass, call the constructor of the superclass
rtw.connectivity.Config
to define your complete target connectivity configuration. For example:this@rtw.connectivity.Config(componentArgs,... builder, launcher, communicator);
Optionally, for execution-time profiling, use the
setTimer
method to register your hardware timer. For example, if you specified thetimer in a code replacement table, insert the following line:this.setTimer('myCrlTable')
myCrlTable
代码替换表的名称,must be in a location on the MATLAB®search path.You can also estimate and remove instrumentation overheads from execution-time measurements. For example:
this.activateOverheadFiltering(true); this.runOverheadBenchmark(true); this.setOverheadBenchmarkSteps(50);
Optionally, for stack usage profiling, use the
setStackDriver
method to specify a driver implementation that obtains stack usage data from the target hardware. For example, if you usecoder.profile.StackDriver
to create the objectstackUsageDriver
, insert the following line:this.setStackDriver(stackUsageDriver)
Register your subclass name, for example,myPIL.ConnectivityConfig
by using the classrtw.connectivity.ConfigRegistry
. The PIL infrastructure instantiates your subclass as required. ThertwTargetInfo.m
file (for MATLAB) orsl_customization.m
mechanism (for Simulink®) specifies a suitable connectivity configuration for use with a particular PIL component (and its configuration set). The subclass can also perform additional validation on construction. For example, you can use the component path returned by thegetComponentPath
method of thecomponentArgs
constructor argument to query and validate parameters associated with the PIL component under test.
Examples
Usingrtw.connectivity.Config
in PIL Connectivity
为例,展示了如何使用这个对象n setting up PIL connectivity, see:
Version History
See Also
rtw.connectivity.MakefileBuilder
|rtw.connectivity.Launcher
|rtw.connectivity.RtIOStreamHostCommunicator
|rtw.connectivity.ComponentArgs
Topics
- Create PIL Target Connectivity Configuration for MATLAB
- Create PIL Target Connectivity Configuration for Simulink
- Specify Hardware Timer
- Specify Hardware Timer
- Remove Instrumentation Overheads from Execution Time Measurements
- Implement Driver to Obtain Stack Usage Data During PIL Simulation
- Implement Driver to Obtain Stack Usage Data During PIL Execution
- SIL and PIL Limitations