Simulink model exported as C code
In the Simulink model flow, to leverage on the automation offered by Huxelerate Utility, it is necessary to export the module from Simulink as C code, including the generation of the HTML report. The report called ‘<component_name>_interface.html’ is in fact used to retrieve information about:
step functions name
step functions periodicity
input/outputs type
etc…
These details are used to generate the SIL wrapper (including a mock RTE) for the compilation, including example CSV files that can be generated to provide specific measures (datasets) to stimulate the execution of the step function.
HPROF generation command for Simulink exported models:
The utility fetches the information regarding the step functions from the HTML report, that is possible to generate during the generation of the source code. In particular, the required HTML file is the one with information about the interfaces, following the name pattern “<module_name>_interface.html”.
python hux-autosar-sil.py generate_hprof \
-is <html_module_interface> \
-I <library_folder_to_include> \
-I <library_folder_2_to_include> \
-c <library_folder_to_include> \
-c <library_folder_2_to_include> \
-v <csv_files> \
--aws \
-z <sil_archive_name> \
-b <aws_bucket_name> \
-ho <hprof_output_file>
The HTML report is specified with the -is flag, while the other flags works as in the Autosar compliant scenario: -c and -I are used to specify source files, -v specifies the input measures and the --aws and -b flags are used for the generation of HPROF on AWS (see `AWS Hprof Generation`_ )
Generate a CSV template for the input stimuli
If you want to provide stimuli for the function to be simulated, you must also submit a csv file organized as in the example below. The -v flag is used to specify a CSV file as input. Each column of the CSV file needs to have the variable name as first entry (header) followed by all the values, one for each timeframe. If the variable name is composite, then its name must be described as <parent variable name>.<child variable name> as reported in the example.
Example file for the analysis of the step function:
rtU.inport1,rtU.inport2
0.0,228.0
0.001,228.0
0.002,228.0
Template generation command:
python hux-autosar-sil.py generate_template \
-is <html_module_interface> \
-I <library_folder_to_include> \
-I <library_folder_2_to_include> \
-c <library_folder_to_include> \
-c <library_folder_2_to_include> \
-o <output_csv_file_name>
The -is flag specifies the filename of the HTML module interface file to process. It is also necessary to specify the include paths and the source files required by the runnable via -I and -c flags. These are needed to let the utility infer the variables and data structures necessary for input stimulation.
The generated <custom_name>.csv is the output.
Note
Generating the template using this command is strongly recommended to avoid possible errors.