Add wasm tacle-bench targets
This commit is contained in:
BIN
targets/wasm-tacle/app/powerwindow/generated/default/powerwindow.wasm
Executable file
BIN
targets/wasm-tacle/app/powerwindow/generated/default/powerwindow.wasm
Executable file
Binary file not shown.
2868
targets/wasm-tacle/app/powerwindow/generated/default/powerwindow.wat
Normal file
2868
targets/wasm-tacle/app/powerwindow/generated/default/powerwindow.wat
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,782 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: powerwindow implement the powerwindow that can be seen in cars
|
||||
nowadays. The window can be controlled by either driver or passenger. When an
|
||||
object is detected between the window frame and the glass during the raising
|
||||
of the glass, the glass will lower down for some distance. This benchmark
|
||||
contains 4 tasks which includes the driver side powerwindow, front passenger
|
||||
side powerwindow, back-left passenger side powerwindow, back-right passenger
|
||||
side powerwindow. These 4 tasks can be easily adjusted to execute in
|
||||
sequential order parallel on single or muti core.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
* 2023-12-07: Added loop bounds
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_DRV.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_controlexclusion.h" /* Control Model's header file */
|
||||
#include "powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_powerwindow_control.h" /* PW passenger control Model's header file */
|
||||
#include "powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
// Wasm loop bounds
|
||||
|
||||
__attribute__((import_module("__pragma"), import_name("loopbound"))) extern void
|
||||
__pragma_loopbound(unsigned int min_bound, unsigned int max_bound);
|
||||
|
||||
void powerwindow_Booleaninputarray_initialize(powerwindow_boolean_T *,
|
||||
powerwindow_boolean_T *);
|
||||
void powerwindow_Uint8inputarray_initialize(powerwindow_uint8_T *,
|
||||
powerwindow_uint8_T *);
|
||||
void powerwindow_init();
|
||||
__attribute__((noinline)) __attribute__((export_name("entrypoint"))) void
|
||||
powerwindow_main();
|
||||
int powerwindow_return();
|
||||
__attribute__((noinline)) __attribute__((export_name("main"))) int main(void);
|
||||
|
||||
// DRV
|
||||
void powerwindow_init_DRV(int);
|
||||
void powerwindow_input_initialize_DRV(void);
|
||||
void powerwindow_initialize_DRV(void);
|
||||
void powerwindow_return_DRV(void);
|
||||
void powerwindow_DRV_main(void);
|
||||
|
||||
// PSG_Front
|
||||
void powerwindow_init_PSG_Front(int);
|
||||
void powerwindow_input_initialize_PSG_Front(void);
|
||||
void powerwindow_initialize_PSG_Front(void);
|
||||
void powerwindow_return_PSG_Front(void);
|
||||
void powerwindow_PSG_Front_main(void);
|
||||
|
||||
// PSG_BackL
|
||||
void powerwindow_init_PSG_BackL(int);
|
||||
void powerwindow_input_initialize_PSG_BackL(void);
|
||||
void powerwindow_initialize_PSG_BackL(void);
|
||||
void powerwindow_return_PSG_BackL(void);
|
||||
void powerwindow_PSG_BackL_main(void);
|
||||
|
||||
// PSG_BackR
|
||||
void powerwindow_init_PSG_BackR(int);
|
||||
void powerwindow_input_initialize_PSG_BackR(void);
|
||||
void powerwindow_initialize_PSG_BackR(void);
|
||||
void powerwindow_return_PSG_BackR(void);
|
||||
void powerwindow_PSG_BackR_main(void);
|
||||
|
||||
/*
|
||||
Declaration of global variables
|
||||
*/
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
|
||||
extern powerwindow_ExternalInputs_powerwindow_PW_C powerwindow_PW_Control_DRV_U;
|
||||
extern powerwindow_ExternalOutputs_powerwindow_PW_ powerwindow_PW_Control_DRV_Y;
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_U;
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_U;
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_U;
|
||||
|
||||
powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_Front_U_Up_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_Front_U_Down_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_BackL_U_Up_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_BackL_U_Down_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_BackR_U_Up_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_BackR_U_Down_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_DRV
|
||||
[powerwindow_input_length];
|
||||
powerwindow_uint8_T powerwindow_powerwindow_control_U_currentsense_Input_DRV
|
||||
[powerwindow_input_length];
|
||||
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_Front_U_Up_Input_Front_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_Front_U_Down_Input_Front_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_BackL_U_Up_Input_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_BackR_U_Up_Input_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_BackR_U_Down_Input_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_DRV_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_uint8_T
|
||||
powerwindow_powerwindow_control_U_currentsense_DRV_Array
|
||||
[powerwindow_input_length];
|
||||
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Up_DRV_Input_Front
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. */
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Down_DRV_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_Front_U_Up_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_Front_U_Down_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_uint8_T powerwindow_powerwindow_control_U_currentsense_Input_Front
|
||||
[powerwindow_input_length];
|
||||
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_Front_U_Up_Front_Array
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the
|
||||
signal is high when the button is not
|
||||
pressed. */
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_Front_U_Down_Front_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Front_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_uint8_T
|
||||
powerwindow_powerwindow_control_U_currentsense_Front_Array
|
||||
[powerwindow_input_length];
|
||||
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Up_DRV_Input_BackL
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. */
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Down_DRV_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_BackL_U_Up_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_BackL_U_Down_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_uint8_T powerwindow_powerwindow_control_U_currentsense_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_BackL_U_Up_BackL_Array
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the
|
||||
signal is high when the button is not
|
||||
pressed. */
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_BackL_U_Down_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_uint8_T
|
||||
powerwindow_powerwindow_control_U_currentsense_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Up_DRV_Input_BackR
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. */
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Down_DRV_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_BackR_U_Up_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_BackR_U_Down_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_uint8_T powerwindow_powerwindow_control_U_currentsense_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_BackR_U_Up_BackR_Array
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the
|
||||
signal is high when the button is not
|
||||
pressed. */
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_BackR_U_Down_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_uint8_T
|
||||
powerwindow_powerwindow_control_U_currentsense_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
|
||||
int powerwindow_main_inputcyclecounter;
|
||||
|
||||
/*
|
||||
Initialization- and return-value-related functions
|
||||
*/
|
||||
void
|
||||
powerwindow_init_DRV(int i) {
|
||||
powerwindow_PW_Control_DRV_U.In1 =
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_DRV
|
||||
[i]; /* The when the window reaches the end of the range, the
|
||||
endofdetectionrange changes to 0. */
|
||||
powerwindow_PW_Control_DRV_U.In3 =
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_DRV
|
||||
[i]; /* When the currentsense is higher than 92 (based on
|
||||
experiments), one object is stuck between the window and the
|
||||
frame. Pinch is set to True.*/
|
||||
|
||||
powerwindow_PW_Control_DRV_U.In2 =
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_DRV_U.In4 =
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
|
||||
powerwindow_PW_Control_DRV_U.In5 =
|
||||
powerwindow_debounce_Driver_Front_U_Up_Input_Front
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_DRV_U.In6 =
|
||||
powerwindow_debounce_Driver_Front_U_Down_Input_Front
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
|
||||
powerwindow_PW_Control_DRV_U.In9 =
|
||||
powerwindow_debounce_Driver_BackL_U_Up_Input_BackL
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_DRV_U.In10 =
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
|
||||
powerwindow_PW_Control_DRV_U.In7 =
|
||||
powerwindow_debounce_Driver_BackR_U_Up_Input_BackR
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_DRV_U.In8 =
|
||||
powerwindow_debounce_Driver_BackR_U_Down_Input_BackR
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_init_PSG_Front(int i) {
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_U.Up_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out6; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_PSG_Front_U.Down_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out7; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lower the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_U.Up_PSG_Front =
|
||||
powerwindow_debounce_passenger_Front_U_Up_Input_Front[i];
|
||||
powerwindow_PW_Control_PSG_Front_U.Down_PSG_Front =
|
||||
powerwindow_debounce_passenger_Front_U_Down_Input_Front
|
||||
[i]; /* '<Root>/Down'. Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. Change to 0 to lower
|
||||
the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_U.endofdetectionrange =
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_Front
|
||||
[i]; /* The when the window reaches the end of the range, the
|
||||
endofdetectionrange changes to 0. */
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_U.currentsense =
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_Front
|
||||
[i]; /* When the currentsense is higher than 92 (based on
|
||||
experiments), one object is stuck between the window and the
|
||||
frame. Pinch is set to True.*/
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_init_PSG_BackL(int i) {
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_U.Up_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out10; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_PSG_BackL_U.Down_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out11; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lower the window.
|
||||
*/
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_U.Up_PSG_BackL =
|
||||
powerwindow_debounce_passenger_BackL_U_Up_Input_BackL[i];
|
||||
powerwindow_PW_Control_PSG_BackL_U.Down_PSG_BackL =
|
||||
powerwindow_debounce_passenger_BackL_U_Down_Input_BackL
|
||||
[i]; /* '<Root>/Down'. Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. Change to 0 to lower
|
||||
the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_U.endofdetectionrange =
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackL
|
||||
[i]; /* The when the window reaches the end of the range, the
|
||||
endofdetectionrange changes to 0. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_U.currentsense =
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_BackL
|
||||
[i]; /* When the currentsense is higher than 92 (based on
|
||||
experiments), one object is stuck between the window and the
|
||||
frame. Pinch is set to True.*/
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_init_PSG_BackR(int i) {
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_U.Up_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out8; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_PSG_BackR_U.Down_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out9; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lower the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_U.Up_PSG_BackR =
|
||||
powerwindow_debounce_passenger_BackR_U_Up_Input_BackR[i];
|
||||
powerwindow_PW_Control_PSG_BackR_U.Down_PSG_BackR =
|
||||
powerwindow_debounce_passenger_BackR_U_Down_Input_BackR
|
||||
[i]; /* '<Root>/Down'. Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. Change to 0 to lower
|
||||
the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_U.endofdetectionrange =
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackR
|
||||
[i]; /* The when the window reaches the end of the range, the
|
||||
endofdetectionrange changes to 0. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_U.currentsense =
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_BackR
|
||||
[i]; /* When the currentsense is higher than 92 (based on
|
||||
experiments), one object is stuck between the window and the
|
||||
frame. Pinch is set to True.*/
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_input_initialize_DRV(void) {
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV,
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV,
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_Front_U_Up_Input_Front,
|
||||
powerwindow_debounce_Driver_Front_U_Up_Input_Front_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_Front_U_Down_Input_Front,
|
||||
powerwindow_debounce_Driver_Front_U_Down_Input_Front_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_BackL_U_Up_Input_BackL,
|
||||
powerwindow_debounce_Driver_BackL_U_Up_Input_BackL_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL,
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL,
|
||||
powerwindow_debounce_Driver_BackR_U_Up_Input_BackR_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_BackR_U_Down_Input_BackR,
|
||||
powerwindow_debounce_Driver_BackR_U_Down_Input_BackR_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_DRV,
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_DRV_Array);
|
||||
powerwindow_Uint8inputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_currentsense_DRV_Array,
|
||||
powerwindow_powerwindow_control_U_currentsense_DRV_Array);
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_input_initialize_PSG_Front(void) {
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_Front_U_Up_Input_Front,
|
||||
powerwindow_debounce_passenger_Front_U_Up_Front_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_Front_U_Down_Input_Front,
|
||||
powerwindow_debounce_passenger_Front_U_Down_Front_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_Front,
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Front_Array);
|
||||
|
||||
powerwindow_Uint8inputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_Front,
|
||||
powerwindow_powerwindow_control_U_currentsense_Front_Array);
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_input_initialize_PSG_BackL(void) {
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_BackL_U_Up_Input_BackL,
|
||||
powerwindow_debounce_passenger_BackL_U_Up_BackL_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_BackL_U_Down_Input_BackL,
|
||||
powerwindow_debounce_passenger_BackL_U_Down_BackL_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackL,
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_BackL_Array);
|
||||
|
||||
powerwindow_Uint8inputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_BackL,
|
||||
powerwindow_powerwindow_control_U_currentsense_BackL_Array);
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_input_initialize_PSG_BackR(void) {
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_BackR_U_Up_Input_BackR,
|
||||
powerwindow_debounce_passenger_BackR_U_Up_BackR_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_BackR_U_Down_Input_BackR,
|
||||
powerwindow_debounce_passenger_BackR_U_Down_BackR_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackR,
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_BackR_Array);
|
||||
|
||||
powerwindow_Uint8inputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_BackR,
|
||||
powerwindow_powerwindow_control_U_currentsense_BackR_Array);
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_Booleaninputarray_initialize(powerwindow_boolean_T *arrayA,
|
||||
powerwindow_boolean_T *arrayB) {
|
||||
|
||||
register int i;
|
||||
__pragma_loopbound(977, 977);
|
||||
for (i = 0; i < powerwindow_input_length; i++)
|
||||
arrayA[i] = arrayB[i];
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_Uint8inputarray_initialize(powerwindow_uint8_T *arrayA,
|
||||
powerwindow_uint8_T *arrayB) {
|
||||
|
||||
register int i;
|
||||
__pragma_loopbound(977, 977);
|
||||
for (i = 0; i < powerwindow_input_length; i++)
|
||||
arrayA[i] = arrayB[i];
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_initialize_DRV(void) {
|
||||
/* Initialize model */
|
||||
powerwindow_PW_Control_DRV_initialize();
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_initialize_PSG_Front(void) {
|
||||
/* Initialize model */
|
||||
powerwindow_PW_Control_PSG_Front_initialize();
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_initialize_PSG_BackL(void) {
|
||||
/* Initialize model */
|
||||
powerwindow_PW_Control_PSG_BackL_initialize();
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_initialize_PSG_BackR(void) {
|
||||
/* Initialize model */
|
||||
powerwindow_PW_Control_PSG_BackR_initialize();
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_return_DRV(void) {
|
||||
/* Terminate model */
|
||||
powerwindow_PW_Control_DRV_terminate();
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_return_PSG_Front(void) {
|
||||
/* Terminate model */
|
||||
powerwindow_PW_Control_PSG_Front_terminate();
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_return_PSG_BackL(void) {
|
||||
/* Terminate model */
|
||||
powerwindow_PW_Control_PSG_BackL_terminate();
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_return_PSG_BackR(void) {
|
||||
/* Terminate model */
|
||||
powerwindow_PW_Control_PSG_BackR_terminate();
|
||||
}
|
||||
|
||||
/*
|
||||
Main functions
|
||||
*/
|
||||
|
||||
/*
|
||||
Associating powerwindow_main with a real-time clock or interrupt service
|
||||
routine is what makes the generated code "real-time". The function
|
||||
powerwindow_main is always associated with the base rate of the model.
|
||||
Subrates are managed by the base rate from inside the generated code.
|
||||
Enabling/disabling interrupts and floating point context switches are target
|
||||
specific. This example code indicates where these should take place relative
|
||||
to executing the generated code step function. Overrun behavior should be
|
||||
tailored to your application needs. This example simply sets an error status
|
||||
in the real-time model and returns from powerwindow_main.
|
||||
*/
|
||||
|
||||
void
|
||||
powerwindow_DRV_main(void) {
|
||||
|
||||
static powerwindow_boolean_T OverrunFlag = 0;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
powerwindow_PW_DRV_rtmSetErrorStatus(powerwindow_PW_Control_DRV_M,
|
||||
"Overrun"); //////////
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
powerwindow_PW_Control_DRV_main();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
/*
|
||||
The example "main" function illustrates what is required by your
|
||||
application code to initialize, execute, and terminate the generated code.
|
||||
Attaching powerwindow_main to a real-time clock is target specific. This
|
||||
example illustates how you do this relative to initializing the model.
|
||||
*/
|
||||
|
||||
void
|
||||
powerwindow_PSG_Front_main(void) {
|
||||
|
||||
static powerwindow_boolean_T OverrunFlag = 0;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
powerwindow_PW_PSG_Front_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_Front_M, "Overrun");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_main();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_PSG_BackL_main(void) {
|
||||
|
||||
static powerwindow_boolean_T OverrunFlag = 0;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
powerwindow_PW_PSG_BackL_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_BackL_M, "Overrun");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_main();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_PSG_BackR_main(void) {
|
||||
|
||||
static powerwindow_boolean_T OverrunFlag = 0;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
powerwindow_PW_PSG_BackR_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_BackR_M, "Overrun");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_main();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
void
|
||||
powerwindow_init(void) {
|
||||
powerwindow_initialize_DRV();
|
||||
powerwindow_initialize_PSG_Front();
|
||||
powerwindow_initialize_PSG_BackL();
|
||||
powerwindow_initialize_PSG_BackR();
|
||||
powerwindow_main_inputcyclecounter = 0;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) __attribute__((export_name("entrypoint"))) void
|
||||
powerwindow_main(void) {
|
||||
/* Attach powerwindow_main to a timer or interrupt service routine with
|
||||
period 0.005 seconds (the model's base sample time) here. The
|
||||
call syntax for powerwindow_main is
|
||||
|
||||
powerwindow_main();
|
||||
*/
|
||||
// Task 1: Driver side window
|
||||
|
||||
powerwindow_input_initialize_DRV();
|
||||
powerwindow_input_initialize_PSG_Front();
|
||||
powerwindow_input_initialize_PSG_BackL();
|
||||
powerwindow_input_initialize_PSG_BackR();
|
||||
|
||||
__pragma_loopbound(977, 977);
|
||||
while (powerwindow_main_inputcyclecounter < powerwindow_input_length) {
|
||||
|
||||
powerwindow_init_DRV(powerwindow_main_inputcyclecounter);
|
||||
powerwindow_DRV_main();
|
||||
|
||||
// Task 2: Front passenger side window
|
||||
|
||||
powerwindow_init_PSG_Front(powerwindow_main_inputcyclecounter);
|
||||
powerwindow_PSG_Front_main();
|
||||
|
||||
// Task 3: Back left passenger side window
|
||||
|
||||
powerwindow_init_PSG_BackL(powerwindow_main_inputcyclecounter);
|
||||
powerwindow_PSG_BackL_main();
|
||||
|
||||
// Task 4: Back right passenger side window
|
||||
|
||||
powerwindow_init_PSG_BackR(powerwindow_main_inputcyclecounter);
|
||||
powerwindow_PSG_BackR_main();
|
||||
|
||||
powerwindow_main_inputcyclecounter++;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
powerwindow_return(void) {
|
||||
powerwindow_return_DRV();
|
||||
powerwindow_return_PSG_Front();
|
||||
powerwindow_return_PSG_BackL();
|
||||
powerwindow_return_PSG_BackR();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) __attribute__((export_name("main"))) int
|
||||
main(void) {
|
||||
powerwindow_init();
|
||||
powerwindow_main();
|
||||
return powerwindow_return();
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,23 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((viod *) 0)
|
||||
#endif
|
||||
@ -0,0 +1,328 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_DRV.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: PW_Control_DRV realizes the functionality of driver side
|
||||
powerwindow. It connects the 3 smaller modules together.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_powerwindow_control.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_DRV.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_DRV_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
void powerwindow_PW_Control_DRV_initialize(void);
|
||||
void powerwindow_PW_Control_DRV_terminate(void);
|
||||
void powerwindow_PW_Control_DRV_main(void);
|
||||
|
||||
/* Block states (auto storage) */
|
||||
powerwindow_D_Work_powerwindow_PW_Control_D powerwindow_PW_Control_DR_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
powerwindow_ExternalInputs_powerwindow_PW_C powerwindow_PW_Control_DRV_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
powerwindow_ExternalOutputs_powerwindow_PW_ powerwindow_PW_Control_DRV_Y;
|
||||
|
||||
/* Real-time model */
|
||||
powerwindow_RT_MODEL_PW_Control_DRV powerwindow_PW_Control_DRV_M_;
|
||||
powerwindow_RT_MODEL_PW_Control_DRV *const powerwindow_PW_Control_DRV_M =
|
||||
&powerwindow_PW_Control_DRV_M_;
|
||||
|
||||
/* Model step function */
|
||||
void
|
||||
powerwindow_PW_Control_DRV_main(void) {
|
||||
/* local block i/o variables */
|
||||
powerwindow_boolean_T rtb_Debounce_Up_DRV;
|
||||
powerwindow_boolean_T rtb_Debounce_Down_DRV;
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In2, &rtb_Debounce_Up_DRV,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Down_DRV' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In4, &rtb_Debounce_Down_DRV,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In9, &powerwindow_PW_Control_DRV_Y.Out10,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In10, &powerwindow_PW_Control_DRV_Y.Out11,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In5, &powerwindow_PW_Control_DRV_Y.Out6,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In6, &powerwindow_PW_Control_DRV_Y.Out7,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In7, &powerwindow_PW_Control_DRV_Y.Out8,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In8, &powerwindow_PW_Control_DRV_Y.Out9,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* ModelReference: '<S1>/PW_DRV' */
|
||||
powerwindow_powerwindow_control_main(
|
||||
&rtb_Debounce_Up_DRV, &rtb_Debounce_Down_DRV,
|
||||
&powerwindow_PW_Control_DRV_U.In1, &powerwindow_PW_Control_DRV_U.In3,
|
||||
&powerwindow_PW_Control_DRV_Y.Out1, &powerwindow_PW_Control_DRV_Y.Out2,
|
||||
&powerwindow_PW_Control_DRV_Y.Out3, &powerwindow_PW_Control_DRV_Y.Out4,
|
||||
&powerwindow_PW_Control_DRV_Y.Out5,
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtzce));
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void
|
||||
powerwindow_PW_Control_DRV_initialize(void) {
|
||||
/* Registration code */
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_DR_DWork, 0,
|
||||
sizeof(powerwindow_D_Work_powerwindow_PW_Control_D));
|
||||
|
||||
/* external inputs */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_DRV_U, 0,
|
||||
sizeof(powerwindow_ExternalInputs_powerwindow_PW_C));
|
||||
|
||||
/* external outputs */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_DRV_Y, 0,
|
||||
sizeof(powerwindow_ExternalOutputs_powerwindow_PW_));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/Debounce_Down_DRV'
|
||||
*/
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/PW_DRV' */
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtzce));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Down_DRV' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S1>/PW_DRV' */
|
||||
powerwindow_powerwindow_control_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Down_DRV' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S1>/PW_DRV' */
|
||||
powerwindow_powerwindow_control_Init(
|
||||
&powerwindow_PW_Control_DRV_Y.Out1, &powerwindow_PW_Control_DRV_Y.Out2,
|
||||
&powerwindow_PW_Control_DRV_Y.Out3, &powerwindow_PW_Control_DRV_Y.Out4,
|
||||
&powerwindow_PW_Control_DRV_Y.Out5,
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtdw));
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
void
|
||||
powerwindow_PW_Control_DRV_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,154 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_DRV.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_DRV.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_powerwindow_PW_Control_DRV_h_
|
||||
#define powerwindow_RTW_HEADER_powerwindow_PW_Control_DRV_h_
|
||||
#ifndef powerwindow_PW_Control_DRV_COMMON_INCLUDES_
|
||||
#define powerwindow_PW_Control_DRV_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* powerwindow_PW_Control_DRV_COMMON_INCLUDES_ */
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_PW_Control_DRV_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Child system includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_PW_DRV_rtmGetErrorStatus
|
||||
#define powerwindow_PW_DRV_rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_DRV_rtmSetErrorStatus
|
||||
#define powerwindow_PW_DRV_rtmSetErrorStatus(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_DRV_rtmGetErrorStatusPointer
|
||||
#define powerwindow_PW_DRV_rtmGetErrorStatusPointer(rtm) \
|
||||
((const powerwindow_char_T **) (&((rtm)->errorStatus)))
|
||||
#endif
|
||||
|
||||
/* Block states (auto storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_DRV_DWORK1; /* '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_DRV_DWORK1; /* '<S2>/Debounce_Down_DRV' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_PSG_BackL_DWORK1; /* '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_PSG_BackL_DWORK1; /* '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_PSG_Front_DWORK1; /* '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_PSG_Front_DWORK1; /* '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_PSG_BackR_DWORK1; /* '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_PSG_BackR_DWORK1; /* '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_rtMdlrefDWork_PowerWindow_contr
|
||||
PW_DRV_DWORK1; /* '<S1>/PW_DRV' */
|
||||
} powerwindow_D_Work_powerwindow_PW_Control_D;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T In1; /* '<Root>/In1' */
|
||||
powerwindow_boolean_T In2; /* '<Root>/In2' */
|
||||
powerwindow_uint8_T In3; /* '<Root>/In3' */
|
||||
powerwindow_boolean_T In4; /* '<Root>/In4' */
|
||||
powerwindow_boolean_T In5; /* '<Root>/In5' */
|
||||
powerwindow_boolean_T In6; /* '<Root>/In6' */
|
||||
powerwindow_boolean_T In7; /* '<Root>/In7' */
|
||||
powerwindow_boolean_T In8; /* '<Root>/In8' */
|
||||
powerwindow_boolean_T In9; /* '<Root>/In9' */
|
||||
powerwindow_boolean_T In10; /* '<Root>/In10' */
|
||||
} powerwindow_ExternalInputs_powerwindow_PW_C;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Out1; /* '<Root>/Out1' */
|
||||
powerwindow_boolean_T Out2; /* '<Root>/Out2' */
|
||||
powerwindow_boolean_T Out3; /* '<Root>/Out3' */
|
||||
powerwindow_boolean_T Out4; /* '<Root>/Out4' */
|
||||
powerwindow_boolean_T Out5; /* '<Root>/Out5' */
|
||||
powerwindow_boolean_T Out6; /* '<Root>/Out6' */
|
||||
powerwindow_boolean_T Out7; /* '<Root>/Out7' */
|
||||
powerwindow_boolean_T Out8; /* '<Root>/Out8' */
|
||||
powerwindow_boolean_T Out9; /* '<Root>/Out9' */
|
||||
powerwindow_boolean_T Out10; /* '<Root>/Out10' */
|
||||
powerwindow_boolean_T Out11; /* '<Root>/Out11' */
|
||||
} powerwindow_ExternalOutputs_powerwindow_PW_;
|
||||
|
||||
struct powerwindow_tag_RTM_PW_Control_DRV {
|
||||
const powerwindow_char_T *volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block states (auto storage) */
|
||||
extern powerwindow_D_Work_powerwindow_PW_Control_D
|
||||
powerwindow_PW_Control_DR_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
extern powerwindow_ExternalInputs_powerwindow_PW_C powerwindow_PW_Control_DRV_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
extern powerwindow_ExternalOutputs_powerwindow_PW_ powerwindow_PW_Control_DRV_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
void powerwindow_PW_Control_DRV_initialize(void);
|
||||
void powerwindow_PW_Control_DRV_main(void);
|
||||
void powerwindow_PW_Control_DRV_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern powerwindow_RT_MODEL_PW_Control_DRV *const powerwindow_PW_Control_DRV_M;
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Note that this particular code originates from a subsystem build,
|
||||
and has its own system numbers different from the parent model.
|
||||
Refer to the system hierarchy for this subsystem below, and use the
|
||||
MATLAB hilite_system command to trace the generated code back
|
||||
to the parent model. For example,
|
||||
|
||||
hilite_system('PowerWindow/powerwindow_PW_Control_DRV') - opens subsystem
|
||||
PowerWindow/powerwindow_PW_Control_DRV
|
||||
hilite_system('PowerWindow/powerwindow_PW_Control_DRV/Kp') - opens and
|
||||
selects block Kp
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow'
|
||||
'<S1>' : 'PowerWindow/powerwindow_PW_Control_DRV'
|
||||
'<S2>' : 'PowerWindow/powerwindow_PW_Control_DRV/Debounce_DRV'
|
||||
*/
|
||||
#endif /* RTW_HEADER_powerwindow_PW_Control_DRV_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_DRV_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_DRV_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_powerwindow_PW_Control_DRV_private_h_
|
||||
#define powerwindow_RTW_HEADER_powerwindow_PW_Control_DRV_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_powerwindow_PW_Control_DRV_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_DRV_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_DRV_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_DRV_types_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_DRV_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PW_Control_DRV
|
||||
powerwindow_RT_MODEL_PW_Control_DRV;
|
||||
|
||||
#endif /* RTW_HEADER_PW_Control_DRV_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,192 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackL.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: PW_Control_DRV realizes the functionality of back-left passenger
|
||||
side powerwindow. It connects the 3 smaller modules together.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_powerwindow_control.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
void powerwindow_PW_Control_PSG_BackL_initialize(void);
|
||||
void powerwindow_PW_Control_PSG_BackL_terminate(void);
|
||||
void powerwindow_PW_Control_PSG_BackL_main(void);
|
||||
|
||||
/* Block states (auto storage) */
|
||||
powerwindow_D_Work_PW_Control_PSG_BackL powerwindow_PW_Control_PSG_BackL_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
powerwindow_ExternalInputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
powerwindow_ExternalOutputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_Y;
|
||||
|
||||
/* Real-time model */
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackL powerwindow_PW_Control_PSG_BackL_M_;
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackL *const
|
||||
powerwindow_PW_Control_PSG_BackL_M = &powerwindow_PW_Control_PSG_BackL_M_;
|
||||
|
||||
/* Model step function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_BackL_main(void) {
|
||||
/* local block i/o variables */
|
||||
powerwindow_boolean_T rtb_debounce_Up;
|
||||
powerwindow_boolean_T rtb_debounce_Down;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_BackL_o1;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_BackL_o2;
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_BackL_U.Up_PSG_BackL, &rtb_debounce_Up,
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_BackL_U.Down_PSG_BackL, &rtb_debounce_Down,
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S1>/ControlEx_PSG_BackL' */
|
||||
powerwindow_controlexclusion_main(
|
||||
&powerwindow_PW_Control_PSG_BackL_U.Up_DRV,
|
||||
&powerwindow_PW_Control_PSG_BackL_U.Down_DRV, &rtb_debounce_Up,
|
||||
&rtb_debounce_Down, &powerwindow_rtb_ControlEx_PSG_BackL_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_BackL_o2);
|
||||
|
||||
/* ModelReference: '<S1>/PW_PSG_BackL' */
|
||||
powerwindow_powerwindow_control_main(
|
||||
&powerwindow_rtb_ControlEx_PSG_BackL_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_BackL_o2,
|
||||
&powerwindow_PW_Control_PSG_BackL_U.endofdetectionrange,
|
||||
&powerwindow_PW_Control_PSG_BackL_U.currentsense,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtzce));
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_BackL_initialize(void) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_PW_PSG_BackL_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_BackL_M, (NULL));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_PSG_BackL_DWork, 0,
|
||||
sizeof(powerwindow_D_Work_PW_Control_PSG_BackL));
|
||||
|
||||
/* external inputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_BackL_U, 0,
|
||||
sizeof(powerwindow_ExternalInputs_PW_Control_PSG_BackL));
|
||||
|
||||
/* external outputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_BackL_Y, 0,
|
||||
sizeof(powerwindow_ExternalOutputs_PW_Control_PSG_BackL));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/ControlEx_PSG_BackL'
|
||||
*/
|
||||
powerwindow_controlexclusion_initialize();
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackL_M),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackL_M),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/PW_PSG_BackL' */
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackL_M),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtzce));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S1>/PW_PSG_BackL' */
|
||||
powerwindow_powerwindow_control_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S1>/PW_PSG_BackL' */
|
||||
powerwindow_powerwindow_control_Init(
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw));
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_BackL_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,139 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackL.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackL_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackL_h_
|
||||
#ifndef powerwindow_PW_Control_PSG_BackL_COMMON_INCLUDES_
|
||||
#define powerwindow_PW_Control_PSG_BackL_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* powerwindow_PW_Control_PSG_BackL_COMMON_INCLUDES_*/
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Child system includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_controlexclusion.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_PW_PSG_BackL_BackL_rtmGetErrorStatus
|
||||
#define powerwindow_PW_PSG_BackL_rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_BackL_rtmSetErrorStatus
|
||||
#define powerwindow_PW_PSG_BackL_rtmSetErrorStatus(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer
|
||||
#define powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(rtm) \
|
||||
((const powerwindow_char_T **) (&((rtm)->errorStatus)))
|
||||
#endif
|
||||
|
||||
/* Block states (auto storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_DWORK1; /* '<S2>/Debounce_Up' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_DWORK1; /* '<S2>/Debounce_Down' */
|
||||
powerwindow_rtMdlrefDWork_PowerWindow_contr
|
||||
PW_PSG_BackL_DWORK1; /* '<S1>/PW_PSG_BackL' */
|
||||
} powerwindow_D_Work_PW_Control_PSG_BackL;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Up_DRV; /* '<Root>/Up_DRV' */
|
||||
powerwindow_boolean_T Down_DRV; /* '<Root>/Down_DRV' */
|
||||
powerwindow_boolean_T
|
||||
endofdetectionrange; /* '<Root>/end of detection range' */
|
||||
powerwindow_uint8_T currentsense; /* '<Root>/current sense' */
|
||||
powerwindow_boolean_T Up_PSG_BackL; /* '<Root>/Up_PSG_BackL' */
|
||||
powerwindow_boolean_T Down_PSG_BackL; /* '<Root>/Down_PSG_BackL' */
|
||||
} powerwindow_ExternalInputs_PW_Control_PSG_BackL;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T window_up; /* '<Root>/window_up' */
|
||||
powerwindow_boolean_T window_down; /* '<Root>/window_down' */
|
||||
powerwindow_boolean_T overcurrent; /* '<Root>/overcurrent' */
|
||||
powerwindow_boolean_T pinch; /* '<Root>/pinch' */
|
||||
powerwindow_boolean_T wake; /* '<Root>/wake' */
|
||||
} powerwindow_ExternalOutputs_PW_Control_PSG_BackL;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_PW_Control_PSG_BackL {
|
||||
const powerwindow_char_T *volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block states (auto storage) */
|
||||
extern powerwindow_D_Work_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
extern powerwindow_ExternalOutputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
void powerwindow_PW_Control_PSG_BackL_initialize(void);
|
||||
void powerwindow_PW_Control_PSG_BackL_main(void);
|
||||
void powerwindow_PW_Control_PSG_BackL_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern powerwindow_RT_MODEL_PW_Control_PSG_BackL
|
||||
*const powerwindow_PW_Control_PSG_BackL_M;
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Note that this particular code originates from a subsystem build,
|
||||
and has its own system numbers different from the parent model.
|
||||
Refer to the system hierarchy for this subsystem below, and use the
|
||||
MATLAB hilite_system command to trace the generated code back
|
||||
to the parent model. For example,
|
||||
|
||||
hilite_system('PowerWindow/PW_Control_PSG_BackL') - opens subsystem
|
||||
PowerWindow/PW_Control_PSG_BackL
|
||||
hilite_system('PowerWindow/PW_Control_PSG_BackL/Kp') - opens and selects
|
||||
block Kp
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow'
|
||||
'<S1>' : 'PowerWindow/PW_Control_PSG_BackL'
|
||||
'<S2>' : 'PowerWindow/PW_Control_PSG_BackL/Debounce_PSG_BackL'
|
||||
*/
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackL_h_*/
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackL_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackL_private_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackL_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackL_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackL_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackL_types_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackL_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PW_Control_PSG_BackL
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackL;
|
||||
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackL_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,192 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackR.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: PW_Control_DRV realizes the functionality of back-right passenger
|
||||
side powerwindow. It connects the 3 smaller modules together.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_PW_Control_PSG_BackR.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
void powerwindow_PW_Control_PSG_BackR_initialize(void);
|
||||
void powerwindow_PW_Control_PSG_BackR_terminate(void);
|
||||
void powerwindow_PW_Control_PSG_BackR_main(void);
|
||||
|
||||
/* Block states (auto storage) */
|
||||
powerwindow_D_Work_PW_Control_PSG_BackR powerwindow_PW_Control_PSG_BackR_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
powerwindow_ExternalInputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
powerwindow_ExternalOutputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_Y;
|
||||
|
||||
/* Real-time model */
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackR powerwindow_PW_Control_PSG_BackR_M_;
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackR *const
|
||||
powerwindow_PW_Control_PSG_BackR_M = &powerwindow_PW_Control_PSG_BackR_M_;
|
||||
|
||||
/* Model step function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_BackR_main(void) {
|
||||
/* local block i/o variables */
|
||||
powerwindow_boolean_T rtb_debounce_Up;
|
||||
powerwindow_boolean_T rtb_debounce_Down;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_BackR_o1;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_BackR_o2;
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_BackR_U.Up_PSG_BackR, &rtb_debounce_Up,
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_BackR_U.Down_PSG_BackR, &rtb_debounce_Down,
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S1>/ControlEx_PSG_BackR' */
|
||||
powerwindow_controlexclusion_main(
|
||||
&powerwindow_PW_Control_PSG_BackR_U.Up_DRV,
|
||||
&powerwindow_PW_Control_PSG_BackR_U.Down_DRV, &rtb_debounce_Up,
|
||||
&rtb_debounce_Down, &powerwindow_rtb_ControlEx_PSG_BackR_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_BackR_o2);
|
||||
|
||||
/* ModelReference: '<S1>/PW_PSG_BackR' */
|
||||
powerwindow_powerwindow_control_main(
|
||||
&powerwindow_rtb_ControlEx_PSG_BackR_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_BackR_o2,
|
||||
&powerwindow_PW_Control_PSG_BackR_U.endofdetectionrange,
|
||||
&powerwindow_PW_Control_PSG_BackR_U.currentsense,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtzce));
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_BackR_initialize(void) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_PW_PSG_BackR_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_BackR_M, (NULL));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_PSG_BackR_DWork, 0,
|
||||
sizeof(powerwindow_D_Work_PW_Control_PSG_BackR));
|
||||
|
||||
/* external inputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_BackR_U, 0,
|
||||
sizeof(powerwindow_ExternalInputs_PW_Control_PSG_BackR));
|
||||
|
||||
/* external outputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_BackR_Y, 0,
|
||||
sizeof(powerwindow_ExternalOutputs_PW_Control_PSG_BackR));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/ControlEx_PSG_BackR'
|
||||
*/
|
||||
powerwindow_controlexclusion_initialize();
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackR_M),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackR_M),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/PW_PSG_BackR' */
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackR_M),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtzce));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S1>/PW_PSG_BackR' */
|
||||
powerwindow_powerwindow_control_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S1>/PW_PSG_BackR' */
|
||||
powerwindow_powerwindow_control_Init(
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtdw));
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_BackR_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,139 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackR.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackR_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackR_h_
|
||||
#ifndef powerwindow_PW_Control_PSG_BackR_COMMON_INCLUDES_
|
||||
#define powerwindow_PW_Control_PSG_BackR_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* powerwindow_PW_Control_PSG_BackR_COMMON_INCLUDES_*/
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Child system includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_controlexclusion.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_PW_PSG_BackR_rtmGetErrorStatus
|
||||
#define powerwindow_PW_PSG_BackR_rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_BackR_rtmSetErrorStatus
|
||||
#define powerwindow_PW_PSG_BackR_rtmSetErrorStatus(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer
|
||||
#define powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer(rtm) \
|
||||
((const powerwindow_char_T **) (&((rtm)->errorStatus)))
|
||||
#endif
|
||||
|
||||
/* Block states (auto storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_DWORK1; /* '<S2>/Debounce_Up' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_DWORK1; /* '<S2>/Debounce_Down' */
|
||||
powerwindow_rtMdlrefDWork_PowerWindow_contr
|
||||
PW_PSG_BackR_DWORK1; /* '<S1>/PW_PSG_BackR' */
|
||||
} powerwindow_D_Work_PW_Control_PSG_BackR;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Up_DRV; /* '<Root>/Up_DRV' */
|
||||
powerwindow_boolean_T Down_DRV; /* '<Root>/Down_DRV' */
|
||||
powerwindow_boolean_T
|
||||
endofdetectionrange; /* '<Root>/end of detection range' */
|
||||
powerwindow_uint8_T currentsense; /* '<Root>/current sense' */
|
||||
powerwindow_boolean_T Up_PSG_BackR; /* '<Root>/Up_PSG_BackR' */
|
||||
powerwindow_boolean_T Down_PSG_BackR; /* '<Root>/Down_PSG_BackR' */
|
||||
} powerwindow_ExternalInputs_PW_Control_PSG_BackR;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T window_up; /* '<Root>/window_up' */
|
||||
powerwindow_boolean_T window_down; /* '<Root>/window_down' */
|
||||
powerwindow_boolean_T overcurrent; /* '<Root>/overcurrent' */
|
||||
powerwindow_boolean_T pinch; /* '<Root>/pinch' */
|
||||
powerwindow_boolean_T wake; /* '<Root>/wake' */
|
||||
} powerwindow_ExternalOutputs_PW_Control_PSG_BackR;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_PW_Control_PSG_BackR {
|
||||
const powerwindow_char_T *volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block states (auto storage) */
|
||||
extern powerwindow_D_Work_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
extern powerwindow_ExternalOutputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
void powerwindow_PW_Control_PSG_BackR_initialize(void);
|
||||
void powerwindow_PW_Control_PSG_BackR_main(void);
|
||||
void powerwindow_PW_Control_PSG_BackR_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern powerwindow_RT_MODEL_PW_Control_PSG_BackR
|
||||
*const powerwindow_PW_Control_PSG_BackR_M;
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Note that this particular code originates from a subsystem build,
|
||||
and has its own system numbers different from the parent model.
|
||||
Refer to the system hierarchy for this subsystem below, and use the
|
||||
MATLAB hilite_system command to trace the generated code back
|
||||
to the parent model. For example,
|
||||
|
||||
hilite_system('PowerWindow/PW_Control_PSG_BackR') - opens subsystem
|
||||
PowerWindow/PW_Control_PSG_BackR
|
||||
hilite_system('PowerWindow/PW_Control_PSG_BackR/Kp') - opens and selects
|
||||
block Kp
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow'
|
||||
'<S1>' : 'PowerWindow/PW_Control_PSG_BackR'
|
||||
'<S2>' : 'PowerWindow/PW_Control_PSG_BackR/Debounce_PSG'
|
||||
*/
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_h_*/
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackR_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackR_private_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackR_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackR_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackR_tyoes.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackR_types_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackR_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PW_Control_PSG_BackR
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackR;
|
||||
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackR_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,198 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_Front.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: PW_Control_DRV realizes the functionality of front passenger side
|
||||
powerwindow. It connects the 3 smaller modules together.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_powerwindow_control.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
void powerwindow_PW_Control_PSG_Front_initialize(void);
|
||||
void powerwindow_PW_Control_PSG_Front_terminate(void);
|
||||
void powerwindow_PW_Control_PSG_Front_main(void);
|
||||
|
||||
/* Block states (auto storage) */
|
||||
powerwindow_D_Work_PW_Control_PSG_Front powerwindow_PW_Control_PSG_Front_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
powerwindow_ExternalInputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
powerwindow_ExternalOutputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_Y;
|
||||
|
||||
/* Real-time model */
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_Front powerwindow_PW_Control_PSG_Front_M_;
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_Front *const
|
||||
powerwindow_PW_Control_PSG_Front_M = &powerwindow_PW_Control_PSG_Front_M_;
|
||||
|
||||
/* Model step function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_Front_main(void) {
|
||||
/* local block i/o variables */
|
||||
powerwindow_boolean_T rtb_debounce_Up;
|
||||
powerwindow_boolean_T rtb_debounce_Down;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_Front_Front_o1;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_Front_Front_o2;
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_Front_U.Up_PSG_Front, &rtb_debounce_Up,
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_Front_U.Down_PSG_Front, &rtb_debounce_Down,
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S1>/ControlEx_PSG_Front_Front' */
|
||||
powerwindow_controlexclusion_main(
|
||||
&powerwindow_PW_Control_PSG_Front_U.Up_DRV,
|
||||
&powerwindow_PW_Control_PSG_Front_U.Down_DRV, &rtb_debounce_Up,
|
||||
&rtb_debounce_Down, &powerwindow_rtb_ControlEx_PSG_Front_Front_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_Front_Front_o2);
|
||||
|
||||
/* ModelReference: '<S1>/PW_PSG_Front_Front' */
|
||||
powerwindow_powerwindow_control_main(
|
||||
&powerwindow_rtb_ControlEx_PSG_Front_Front_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_Front_Front_o2,
|
||||
&powerwindow_PW_Control_PSG_Front_U.endofdetectionrange,
|
||||
&powerwindow_PW_Control_PSG_Front_U.currentsense,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtzce));
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_Front_initialize(void) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_PW_PSG_Front_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_Front_M, (NULL));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_PSG_Front_DWork, 0,
|
||||
sizeof(powerwindow_D_Work_PW_Control_PSG_Front));
|
||||
|
||||
/* external inputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_Front_U, 0,
|
||||
sizeof(powerwindow_ExternalInputs_PW_Control_PSG_Front));
|
||||
|
||||
/* external outputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_Front_Y, 0,
|
||||
sizeof(powerwindow_ExternalOutputs_PW_Control_PSG_Front));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S1>/ControlEx_PSG_Front_Front' */
|
||||
powerwindow_controlexclusion_initialize();
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_Front_M),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_Front_M),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/PW_PSG_Front_Front'
|
||||
*/
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_Front_M),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S1>/PW_PSG_Front_Front' */
|
||||
powerwindow_powerwindow_control_Start(&(
|
||||
powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S1>/PW_PSG_Front_Front' */
|
||||
powerwindow_powerwindow_control_Init(
|
||||
&powerwindow_PW_Control_PSG_Front_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtdw));
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
void
|
||||
powerwindow_PW_Control_PSG_Front_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,139 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_Front.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_Front_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_Front_h_
|
||||
#ifndef powerwindow_PW_Control_PSG_Front_COMMON_INCLUDES_
|
||||
#define powerwindow_PW_Control_PSG_Front_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* powerwindow_PW_Control_PSG_Front_COMMON_INCLUDES_*/
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Child system includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_controlexclusion.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_PW_PSG_Front_rtmGetErrorStatus
|
||||
#define powerwindow_PW_PSG_Front_rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_Front_rtmSetErrorStatus
|
||||
#define powerwindow_PW_PSG_Front_rtmSetErrorStatus(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer
|
||||
#define powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer(rtm) \
|
||||
((const powerwindow_char_T **) (&((rtm)->errorStatus)))
|
||||
#endif
|
||||
|
||||
/* Block states (auto storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_DWORK1; /* '<S2>/Debounce_Up' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_DWORK1; /* '<S2>/Debounce_Down' */
|
||||
powerwindow_rtMdlrefDWork_PowerWindow_contr
|
||||
PW_PSG_Front_Front_DWORK1; /* '<S1>/PW_PSG_Front_Front' */
|
||||
} powerwindow_D_Work_PW_Control_PSG_Front;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Up_DRV; /* '<Root>/Up_DRV' */
|
||||
powerwindow_boolean_T Down_DRV; /* '<Root>/Down_DRV' */
|
||||
powerwindow_boolean_T
|
||||
endofdetectionrange; /* '<Root>/end of detection range' */
|
||||
powerwindow_uint8_T currentsense; /* '<Root>/current sense' */
|
||||
powerwindow_boolean_T Up_PSG_Front; /* '<Root>/Up_PSG_Front' */
|
||||
powerwindow_boolean_T Down_PSG_Front; /* '<Root>/Down_PSG_Front' */
|
||||
} powerwindow_ExternalInputs_PW_Control_PSG_Front;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T window_up; /* '<Root>/window_up' */
|
||||
powerwindow_boolean_T window_down; /* '<Root>/window_down' */
|
||||
powerwindow_boolean_T overcurrent; /* '<Root>/overcurrent' */
|
||||
powerwindow_boolean_T pinch; /* '<Root>/pinch' */
|
||||
powerwindow_boolean_T wake; /* '<Root>/wake' */
|
||||
} powerwindow_ExternalOutputs_PW_Control_PSG_Front;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_PW_Control_PSG_Front {
|
||||
const powerwindow_char_T *volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block states (auto storage) */
|
||||
extern powerwindow_D_Work_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
extern powerwindow_ExternalOutputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
void powerwindow_PW_Control_PSG_Front_initialize(void);
|
||||
void powerwindow_PW_Control_PSG_Front_main(void);
|
||||
void powerwindow_PW_Control_PSG_Front_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern powerwindow_RT_MODEL_PW_Control_PSG_Front
|
||||
*const powerwindow_PW_Control_PSG_Front_M;
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Note that this particular code originates from a subsystem build,
|
||||
and has its own system numbers different from the parent model.
|
||||
Refer to the system hierarchy for this subsystem below, and use the
|
||||
MATLAB hilite_system command to trace the generated code back
|
||||
to the parent model. For example,
|
||||
|
||||
hilite_system('PowerWindow/PW_Control_PSG_Front') - opens subsystem
|
||||
PowerWindow/PW_Control_PSG_Front
|
||||
hilite_system('PowerWindow/PW_Control_PSG_Front/Kp') - opens and selects
|
||||
block Kp
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow'
|
||||
'<S1>' : 'PowerWindow/PW_Control_PSG_Front'
|
||||
'<S2>' : 'PowerWindow/PW_Control_PSG_Front/Debounce_PSG_Front_Front'
|
||||
*/
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_Front_h_*/
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_Front_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_Front_private_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_Front_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_Front_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_Front_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_Front_types_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_Front_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PW_Control_PSG_Front
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_Front;
|
||||
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_Front_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_const_params.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: the lookup table for stateflow chart in
|
||||
powerwindow_powerwindow_control
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_const_params.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
extern const powerwindow_boolean_T powerwindow_rtCP_pooled_6bUUQf1tASYw[12];
|
||||
const powerwindow_boolean_T powerwindow_rtCP_pooled_6bUUQf1tASYw[12] = {
|
||||
1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0};
|
||||
@ -0,0 +1,89 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_controlexclusion
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: powerwindow_controlexclusion is one functionality of the power
|
||||
window benchmark. It takes the input signal from the driver and the passenger
|
||||
to determine the final control signal.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_controlexclusion.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_controlexclusion.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_controlexclusion_private.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
void powerwindow_controlexclusion_initialize(void);
|
||||
void powerwindow_controlexclusion_terminate(void);
|
||||
void
|
||||
powerwindow_controlexclusion_main(const powerwindow_boolean_T *rtu_Up_DRV,
|
||||
const powerwindow_boolean_T *rtu_Down_DRV,
|
||||
const powerwindow_boolean_T *rtu_Up_PSG,
|
||||
const powerwindow_boolean_T *rtu_Down_PSG,
|
||||
powerwindow_boolean_T *rty_Up,
|
||||
powerwindow_boolean_T *rty_Down);
|
||||
|
||||
/* Model initialize function */
|
||||
void
|
||||
powerwindow_controlexclusion_initialize(void) {
|
||||
/* (no initialization code required) */
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
void
|
||||
powerwindow_controlexclusion_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
Algorithm core functions
|
||||
*/
|
||||
|
||||
/* Output and update for referenced model: 'ControlExclusion' */
|
||||
void
|
||||
powerwindow_controlexclusion_main(const powerwindow_boolean_T *rtu_Up_DRV,
|
||||
const powerwindow_boolean_T *rtu_Down_DRV,
|
||||
const powerwindow_boolean_T *rtu_Up_PSG,
|
||||
const powerwindow_boolean_T *rtu_Down_PSG,
|
||||
powerwindow_boolean_T *rty_Up,
|
||||
powerwindow_boolean_T *rty_Down) {
|
||||
/* Logic: '<S2>/Logical Operator11' incorporates:
|
||||
Logic: '<S2>/Logical Operator2'
|
||||
Logic: '<S2>/Logical Operator3'
|
||||
Logic: '<S2>/Logical Operator5'
|
||||
Logic: '<S2>/Logical Operator6'
|
||||
Logic: '<S2>/Logical Operator7'
|
||||
*/
|
||||
*rty_Up = !(((!*rtu_Up_DRV) && (*rtu_Down_DRV)) ||
|
||||
((*rtu_Down_DRV) && (!*rtu_Up_PSG) && (*rtu_Down_PSG)));
|
||||
|
||||
/* Logic: '<S2>/Logical Operator12' incorporates:
|
||||
Logic: '<S2>/Logical Operator1'
|
||||
Logic: '<S2>/Logical Operator10'
|
||||
Logic: '<S2>/Logical Operator4'
|
||||
Logic: '<S2>/Logical Operator8'
|
||||
Logic: '<S2>/Logical Operator9'
|
||||
*/
|
||||
*rty_Down = !(((*rtu_Up_DRV) && (!*rtu_Down_DRV)) ||
|
||||
((*rtu_Up_DRV) && (*rtu_Up_PSG) && (!*rtu_Down_PSG)));
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,77 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_controlexclusion.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_controlexclusion.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_controlexclusion_h_
|
||||
#define powerwindow_RTW_HEADER_controlexclusion_h_
|
||||
#ifndef powerwindow_controlexclusion_COMMON_INCLUDES_
|
||||
#define powerwindow_controlexclusion_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#endif /* powerwindow_controlexclusion_COMMON_INCLUDES_ */
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_controlexclusion_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* user code (top of header file) */
|
||||
|
||||
/* Model reference registration function */
|
||||
|
||||
void powerwindow_controlexclusion_initialize(void);
|
||||
void powerwindow_controlexclusion_terminate(void);
|
||||
void
|
||||
powerwindow_controlexclusion_main(const powerwindow_boolean_T *rtu_Up_DRV,
|
||||
const powerwindow_boolean_T *rtu_Down_DRV,
|
||||
const powerwindow_boolean_T *rtu_Up_PSG,
|
||||
const powerwindow_boolean_T *rtu_Down_PSG,
|
||||
powerwindow_boolean_T *rty_Up,
|
||||
powerwindow_boolean_T *rty_Down);
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Use the MATLAB hilite_system command to trace the generated code back
|
||||
to the model. For example,
|
||||
|
||||
hilite_system('<S3>') - opens system 3
|
||||
hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'ControlExclusion'
|
||||
'<S1>' : 'ControlExclusion/Control_Clock_TicToc'
|
||||
'<S2>' : 'ControlExclusion/Control_Clock_TicToc/ControlEx_PSG'
|
||||
'<S3>' : 'ControlExclusion/Control_Clock_TicToc/Tic'
|
||||
'<S4>' : 'powerwindow_controlexclusion_main/Control_Clock_TicToc/Toc'
|
||||
'<S5>' : 'ControlExclusion/Control_Clock_TicToc/Tic/Tic_T'
|
||||
'<S6>' : 'ControlExclusion/Control_Clock_TicToc/Toc/Toc_T'
|
||||
*/
|
||||
#endif /* RTW_HEADER_ControlExclusion_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_controlexclusion_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_controlexclusion_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_controlexclusion_private_h_
|
||||
#define powerwindow_RTW_HEADER_controlexclusion_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_controlexclusion_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_controlexclusion_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_controlexclusion_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_controlexclusion_types_h_
|
||||
#define powerwindow_RTW_HEADER_controlexclusion_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
#endif /* powerwindow_RTW_HEADER_controlexclusion_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,228 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_debounce.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: powerwindow_debounce_main is used to powerwindow_debounce_main the
|
||||
push-down button of the power window. In order to input a manual switch signal
|
||||
into a digital circuit, debouncing is necessary so that a single press does
|
||||
not appear like multiple presses. Without debouncing, pressing the button once
|
||||
may cause unpredictable results. powerwindow_debounce_main.c defines all the
|
||||
functions that will be used in debounce_PSG_Front which is a part of the Power
|
||||
window.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_debounce.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_debounce_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/* Named constants for Chart: '<Root>/Chart' */
|
||||
#define debounce_IN_debounce ((powerwindow_uint8_T) 1U)
|
||||
#define debounce_IN_NO_ACTIVE_CHILD ((powerwindow_uint8_T) 0U)
|
||||
#define debounce_IN_Off ((powerwindow_uint8_T) 2U)
|
||||
#define debounce_IN_Off_h ((powerwindow_uint8_T) 1U)
|
||||
#define debounce_IN_On ((powerwindow_uint8_T) 3U)
|
||||
#define debounce_IN_On_b ((powerwindow_uint8_T) 2U)
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
void powerwindow_debounce_Init(powerwindow_rtB_debounce_T *,
|
||||
powerwindow_rtDW_debounce_T *);
|
||||
void powerwindow_debounce_Start(powerwindow_rtDW_debounce_T *);
|
||||
void powerwindow_debounce_initialize(const powerwindow_char_T **,
|
||||
powerwindow_RT_MODEL_debounce_T *const,
|
||||
powerwindow_rtB_debounce_T *,
|
||||
powerwindow_rtDW_debounce_T *,
|
||||
powerwindow_rtZCE_debounce_T *);
|
||||
void powerwindow_debounce_main(const powerwindow_boolean_T *,
|
||||
powerwindow_boolean_T *,
|
||||
powerwindow_rtB_debounce_T *,
|
||||
powerwindow_rtDW_debounce_T *,
|
||||
powerwindow_rtZCE_debounce_T *);
|
||||
|
||||
/*
|
||||
Initialization- and return-value-related functions
|
||||
*/
|
||||
|
||||
/* Initial conditions for referenced model: 'powerwindow_debounce_main' */
|
||||
void
|
||||
powerwindow_debounce_Init(powerwindow_rtB_debounce_T *localB,
|
||||
powerwindow_rtDW_debounce_T *localDW) {
|
||||
/* InitializeConditions for Chart: '<Root>/Chart' */
|
||||
localDW->is_debounce = debounce_IN_NO_ACTIVE_CHILD;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
localDW->is_active_c3_debounce = 0U;
|
||||
localDW->is_c3_debounce = debounce_IN_NO_ACTIVE_CHILD;
|
||||
localB->Q = false;
|
||||
}
|
||||
|
||||
/* Start for referenced model: 'powerwindow_debounce_main' */
|
||||
void
|
||||
powerwindow_debounce_Start(powerwindow_rtDW_debounce_T *localDW) {
|
||||
/* Start for DiscretePulseGenerator: '<Root>/period of 10ms' */
|
||||
localDW->clockTickCounter = 0L;
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void
|
||||
powerwindow_debounce_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_debounce_T *const debounce_M,
|
||||
powerwindow_rtB_debounce_T *localB, powerwindow_rtDW_debounce_T *localDW,
|
||||
powerwindow_rtZCE_debounce_T *localZCE) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_rtmSetErrorStatusPointer(debounce_M, rt_errorStatus);
|
||||
|
||||
/* block I/O */
|
||||
(void) wcclib_memset(((void *) localB), 0,
|
||||
sizeof(powerwindow_rtB_debounce_T));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) localDW, 0,
|
||||
sizeof(powerwindow_rtDW_debounce_T));
|
||||
localZCE->Chart_Trig_ZCE = powerwindow_POS_ZCSIG;
|
||||
}
|
||||
|
||||
/*
|
||||
Algorithm core functions
|
||||
*/
|
||||
|
||||
/* Output and update for referenced model: 'powerwindow_debounce_main' */
|
||||
void
|
||||
powerwindow_debounce_main(const powerwindow_boolean_T *rtu_Switch,
|
||||
powerwindow_boolean_T *rty_debounced_Switch,
|
||||
powerwindow_rtB_debounce_T *localB,
|
||||
powerwindow_rtDW_debounce_T *localDW,
|
||||
powerwindow_rtZCE_debounce_T *localZCE) {
|
||||
powerwindow_int16_T rtb_periodof10ms;
|
||||
|
||||
/* DiscretePulseGenerator: '<Root>/period of 10ms' */
|
||||
rtb_periodof10ms =
|
||||
(localDW->clockTickCounter < 1L) && (localDW->clockTickCounter >= 0L)
|
||||
? 1
|
||||
: 0;
|
||||
if (localDW->clockTickCounter >= 1L)
|
||||
localDW->clockTickCounter = 0L;
|
||||
|
||||
else
|
||||
localDW->clockTickCounter++;
|
||||
|
||||
/* End of DiscretePulseGenerator: '<Root>/period of 10ms' */
|
||||
|
||||
/* Chart: '<Root>/Chart' incorporates:
|
||||
TriggerPort: '<S1>/ticks'
|
||||
*/
|
||||
/* DataTypeConversion: '<Root>/Data Type Conversion' */
|
||||
if ((rtb_periodof10ms != 0) &&
|
||||
(localZCE->Chart_Trig_ZCE != powerwindow_POS_ZCSIG)) {
|
||||
/* Gateway: Chart */
|
||||
if (localDW->temporalCounter_i1 < 7U)
|
||||
localDW->temporalCounter_i1++;
|
||||
|
||||
/* Event: '<S1>:13' */
|
||||
/* During: Chart */
|
||||
if (localDW->is_active_c3_debounce == 0U) {
|
||||
/* Entry: Chart */
|
||||
localDW->is_active_c3_debounce = 1U;
|
||||
|
||||
/* Entry Internal: Chart */
|
||||
/* Transition: '<S1>:9' */
|
||||
localDW->is_c3_debounce = debounce_IN_Off;
|
||||
|
||||
/* Entry 'Off': '<S1>:1' */
|
||||
localB->Q = true;
|
||||
} else {
|
||||
switch (localDW->is_c3_debounce) {
|
||||
case debounce_IN_debounce:
|
||||
/* During 'powerwindow_debounce_main': '<S1>:6' */
|
||||
if (localDW->is_debounce == debounce_IN_Off_h) {
|
||||
/* During 'Off': '<S1>:8' */
|
||||
if ((powerwindow_int16_T) *rtu_Switch < 1) {
|
||||
/* Transition: '<S1>:12' */
|
||||
localDW->is_debounce = debounce_IN_On_b;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
} else {
|
||||
if (localDW->temporalCounter_i1 >= 3) {
|
||||
/* Transition: '<S1>:16' */
|
||||
localDW->is_debounce = debounce_IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_c3_debounce = debounce_IN_Off;
|
||||
|
||||
/* Entry 'Off': '<S1>:1' */
|
||||
localB->Q = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* During 'On': '<S1>:7' */
|
||||
if ((powerwindow_int16_T) *rtu_Switch > 0) {
|
||||
/* Transition: '<S1>:11' */
|
||||
localDW->is_debounce = debounce_IN_Off_h;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
} else {
|
||||
if (localDW->temporalCounter_i1 >= 3) {
|
||||
/* Transition: '<S1>:14' */
|
||||
localDW->is_debounce = debounce_IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_c3_debounce = debounce_IN_On;
|
||||
|
||||
/* Entry 'On': '<S1>:5' */
|
||||
localB->Q = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case debounce_IN_Off:
|
||||
/* During 'Off': '<S1>:1' */
|
||||
if ((powerwindow_int16_T) *rtu_Switch < 1) {
|
||||
/* Transition: '<S1>:10' */
|
||||
localDW->is_c3_debounce = debounce_IN_debounce;
|
||||
localDW->is_debounce = debounce_IN_On_b;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'On': '<S1>:5' */
|
||||
if ((powerwindow_int16_T) *rtu_Switch > 0) {
|
||||
/* Transition: '<S1>:15' */
|
||||
localDW->is_c3_debounce = debounce_IN_debounce;
|
||||
localDW->is_debounce = debounce_IN_Off_h;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
localZCE->Chart_Trig_ZCE =
|
||||
(powerwindow_uint8_T) (rtb_periodof10ms != 0
|
||||
? (powerwindow_int16_T) powerwindow_POS_ZCSIG
|
||||
: (powerwindow_int16_T)
|
||||
powerwindow_ZERO_ZCSIG);
|
||||
|
||||
/* End of DataTypeConversion: '<Root>/Data Type Conversion' */
|
||||
|
||||
/* DataTypeConversion: '<Root>/Data Type Conversion2' */
|
||||
*rty_debounced_Switch = localB->Q;
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,102 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_debounce.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_debounce.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_debounce_h_
|
||||
#define powerwindow_RTW_HEADER_debounce_h_
|
||||
#ifndef powerwindow_debounce_COMMON_INCLUDES_
|
||||
#define powerwindow_debounce_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* debounce_COMMON_INCLUDES_ */
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Block signals for model 'powerwindow_debounce_main' */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Q; /* '<Root>/Chart' */
|
||||
} powerwindow_rtB_debounce_T;
|
||||
|
||||
/* Block states (auto storage) for model 'powerwindow_debounce_main' */
|
||||
typedef struct {
|
||||
powerwindow_int32_T clockTickCounter; /* '<Root>/period of 10ms' */
|
||||
powerwindow_uint8_T is_active_c3_debounce; /* '<Root>/Chart' */
|
||||
powerwindow_uint8_T is_c3_debounce; /* '<Root>/Chart' */
|
||||
powerwindow_uint8_T is_debounce; /* '<Root>/Chart' */
|
||||
powerwindow_uint8_T temporalCounter_i1; /* '<Root>/Chart' */
|
||||
} powerwindow_rtDW_debounce_T;
|
||||
|
||||
/* Zero-crossing (trigger) state for model 'powerwindow_debounce_main' */
|
||||
typedef struct {
|
||||
ZCSigState Chart_Trig_ZCE; /* '<Root>/Chart' */
|
||||
} powerwindow_rtZCE_debounce_T;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_debounce_T {
|
||||
const powerwindow_char_T **errorStatus;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
powerwindow_rtB_debounce_T rtb;
|
||||
powerwindow_rtDW_debounce_T rtdw;
|
||||
powerwindow_RT_MODEL_debounce_T rtm;
|
||||
powerwindow_rtZCE_debounce_T rtzce;
|
||||
} powerwindow_rtMdlrefDWork_debounce_T;
|
||||
|
||||
/* Model reference registration function */
|
||||
void powerwindow_debounce_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_debounce_T *const debounce_M,
|
||||
powerwindow_rtB_debounce_T *localB, powerwindow_rtDW_debounce_T *localDW,
|
||||
powerwindow_rtZCE_debounce_T *localZCE);
|
||||
void powerwindow_debounce_Init(powerwindow_rtB_debounce_T *localB,
|
||||
powerwindow_rtDW_debounce_T *localDW);
|
||||
void powerwindow_debounce_Start(powerwindow_rtDW_debounce_T *localDW);
|
||||
void powerwindow_debounce_main(const powerwindow_boolean_T *rtu_Switch,
|
||||
powerwindow_boolean_T *rty_debounced_Switch,
|
||||
powerwindow_rtB_debounce_T *localB,
|
||||
powerwindow_rtDW_debounce_T *localDW,
|
||||
powerwindow_rtZCE_debounce_T *localZCE);
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Use the MATLAB hilite_system command to trace the generated code back
|
||||
to the model. For example,
|
||||
|
||||
hilite_system('<S3>') - opens system 3
|
||||
hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'powerwindow_debounce_main'
|
||||
'<S1>' : 'powerwindow_debounce_main/Chart'
|
||||
*/
|
||||
#endif /* RTW_HEADER_debounce_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,49 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_debounce_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_debounce_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_debounce_private_h_
|
||||
#define powerwindow_RTW_HEADER_debounce_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_rtmGetErrorStatus
|
||||
#define powerwindow_rtmGetErrorStatus(rtm) (*((rtm)->errorStatus))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_rtmSetErrorStatus
|
||||
#define powerwindow_rtmSetErrorStatus(rtm, val) (*((rtm)->errorStatus) = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_rtmGetErrorStatusPointer
|
||||
#define powerwindow_rtmGetErrorStatusPointer(rtm) (rtm)->errorStatus
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_rtmSetErrorStatusPointer
|
||||
#define powerwindow_rtmSetErrorStatusPointer(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
#endif /* RTW_HEADER_debounce_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,33 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_debounce_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_debounce_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_debounce_types_h_
|
||||
#define powerwindow_RTW_HEADER_debounce_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_debounce_T powerwindow_RT_MODEL_debounce_T;
|
||||
|
||||
#endif /* RTW_HEADER_debounce_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,52 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_model_reference_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_model_reference_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow___MODEL_REFERENCE_TYPES_H__
|
||||
#define powerwindow___MODEL_REFERENCE_TYPES_H__
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#ifndef powerwindow___MODEL_REFERENCE_TYPES__
|
||||
#define powerwindow___MODEL_REFERENCE_TYPES__
|
||||
|
||||
/*===========================================================================*
|
||||
Model reference type definitions
|
||||
===========================================================================*/
|
||||
/*
|
||||
This structure is used by model reference to
|
||||
communicate timing information through the hierarchy.
|
||||
*/
|
||||
typedef struct powerwindow__rtTimingBridge_tag powerwindow_rtTimingBridge;
|
||||
struct powerwindow__rtTimingBridge_tag {
|
||||
powerwindow_uint32_T nTasks;
|
||||
powerwindow_uint32_T **clockTick;
|
||||
powerwindow_uint32_T **clockTickH;
|
||||
powerwindow_uint32_T *taskCounter;
|
||||
powerwindow_real_T **taskTime;
|
||||
powerwindow_boolean_T **rateTransition;
|
||||
powerwindow_boolean_T *firstInitCond;
|
||||
};
|
||||
|
||||
#endif /* __MODEL_REFERENCE_TYPES__ */
|
||||
#endif /* __MODEL_REFERENCE_TYPES_H__ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,591 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_powerwindow_control.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: powerwindow_control is the main functionality of the power window
|
||||
benchmark. It contains 3 states: System, EndReached and Pinch, which are used
|
||||
to controll the position of the glass, if the window is fully closed and
|
||||
sensing pinch force to realize the powerwindow function.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_powerwindow_control.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_powerwindow_control_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/* Named constants for Chart: '<S2>/stateflow control model' */
|
||||
#define powerwindow_powerwindow__IN_NO_ACTIVE_CHILD ((powerwindow_uint8_T) 0U)
|
||||
#define powerwindow_powerwindow_contr_IN_EndReached ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_contr_IN_SensePinch ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_AutoDown ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_control_IN_AutoUp ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_control_IN_Down ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_Down_d ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_control_IN_InitDown ((powerwindow_uint8_T) 3U)
|
||||
#define powerwindow_powerwindow_control_IN_InitUp ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_Neutral ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_Pinch ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_SenseEnd ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_control_IN_Start ((powerwindow_uint8_T) 3U)
|
||||
#define powerwindow_powerwindow_control_IN_System ((powerwindow_uint8_T) 3U)
|
||||
#define powerwindow_powerwindow_control_IN_Up ((powerwindow_uint8_T) 3U)
|
||||
|
||||
/* Forward declaration for local functions */
|
||||
|
||||
void powerwindow_powerwindow_control_Start(
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
|
||||
void powerwindow_powerwindow_control_Init(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
|
||||
void powerwindow_powerwindow_control_Start(
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
|
||||
void powerwindow_powerwindow_control_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_PowerWindow_control *const PowerWindow_control_M,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE);
|
||||
|
||||
void powerwindow_powerwindow_control_main(
|
||||
const powerwindow_boolean_T *rtu_up, const powerwindow_boolean_T *rtu_down,
|
||||
const powerwindow_boolean_T *rtu_endofdetectionrange,
|
||||
const powerwindow_uint8_T *rtu_currentsense,
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE);
|
||||
|
||||
void powerwindow_powerwindow_con_broadcast_ticks(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
|
||||
/* Function for Chart: '<S2>/stateflow control model' */
|
||||
void
|
||||
powerwindow_powerwindow_con_broadcast_ticks(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW) {
|
||||
/* Event: '<S3>:30' */
|
||||
/* During: PW_PSG/PWExternalClock/stateflow control model */
|
||||
if (localDW->is_active_c2_PowerWindow_contro == 0U) {
|
||||
/* Entry: PW_PSG/PWExternalClock/stateflow control model */
|
||||
localDW->is_active_c2_PowerWindow_contro = 1U;
|
||||
|
||||
/* Entry Internal: PW_PSG/PWExternalClock/stateflow control model */
|
||||
/* Transition: '<S3>:102' */
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_control_IN_System;
|
||||
|
||||
/* Entry Internal 'System': '<S3>:94' */
|
||||
localDW->is_active_Logic = 1U;
|
||||
|
||||
/* Entry Internal 'Logic': '<S3>:95' */
|
||||
/* Transition: '<S3>:82' */
|
||||
localDW->is_Logic = powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
localDW->is_active_Sensing = 1U;
|
||||
|
||||
/* Entry Internal 'Sensing': '<S3>:96' */
|
||||
/* Transition: '<S3>:153' */
|
||||
localDW->is_Sensing = powerwindow_powerwindow_control_IN_Start;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Start': '<S3>:170' */
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
} else {
|
||||
switch (localDW->is_c2_PowerWindow_control) {
|
||||
case powerwindow_powerwindow_contr_IN_EndReached:
|
||||
/* During 'EndReached': '<S3>:97' */
|
||||
if (localDW->temporalCounter_i1 >= 10) {
|
||||
/* Transition: '<S3>:101' */
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_control_IN_System;
|
||||
|
||||
/* Entry Internal 'System': '<S3>:94' */
|
||||
localDW->is_active_Logic = 1U;
|
||||
|
||||
/* Entry Internal 'Logic': '<S3>:95' */
|
||||
/* Transition: '<S3>:82' */
|
||||
localDW->is_Logic = powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
localDW->is_active_Sensing = 1U;
|
||||
|
||||
/* Entry Internal 'Sensing': '<S3>:96' */
|
||||
/* Transition: '<S3>:153' */
|
||||
localDW->is_Sensing = powerwindow_powerwindow_control_IN_Start;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Start': '<S3>:170' */
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_control_IN_Pinch:
|
||||
/* During 'Pinch': '<S3>:152' */
|
||||
if (localDW->temporalCounter_i1 >= 40) {
|
||||
/* Transition: '<S3>:157' */
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_control_IN_System;
|
||||
|
||||
/* Entry Internal 'System': '<S3>:94' */
|
||||
localDW->is_active_Logic = 1U;
|
||||
|
||||
/* Entry Internal 'Logic': '<S3>:95' */
|
||||
/* Transition: '<S3>:82' */
|
||||
localDW->is_Logic = powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
localDW->is_active_Sensing = 1U;
|
||||
|
||||
/* Entry Internal 'Sensing': '<S3>:96' */
|
||||
/* Transition: '<S3>:153' */
|
||||
localDW->is_Sensing = powerwindow_powerwindow_control_IN_Start;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Start': '<S3>:170' */
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* During 'System': '<S3>:94' */
|
||||
if (*rty_pinch == 1) {
|
||||
/* Transition: '<S3>:155' */
|
||||
/* Exit Internal 'System': '<S3>:94' */
|
||||
/* Exit Internal 'Sensing': '<S3>:96' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_active_Sensing = 0U;
|
||||
|
||||
/* Exit Internal 'Logic': '<S3>:95' */
|
||||
/* Exit Internal 'Down': '<S3>:18' */
|
||||
localDW->is_Down = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
|
||||
/* Exit Internal 'Up': '<S3>:17' */
|
||||
localDW->is_Up = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_active_Logic = 0U;
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_control_IN_Pinch;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
|
||||
/* Entry 'Pinch': '<S3>:152' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = true;
|
||||
} else if (*rty_overcurrent == 1) {
|
||||
/* Transition: '<S3>:100' */
|
||||
/* Exit Internal 'System': '<S3>:94' */
|
||||
/* Exit Internal 'Sensing': '<S3>:96' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_active_Sensing = 0U;
|
||||
|
||||
/* Exit Internal 'Logic': '<S3>:95' */
|
||||
/* Exit Internal 'Down': '<S3>:18' */
|
||||
localDW->is_Down = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
|
||||
/* Exit Internal 'Up': '<S3>:17' */
|
||||
localDW->is_Up = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_active_Logic = 0U;
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_contr_IN_EndReached;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
|
||||
/* Entry 'EndReached': '<S3>:97' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
} else {
|
||||
/* During 'Logic': '<S3>:95' */
|
||||
switch (localDW->is_Logic) {
|
||||
case powerwindow_powerwindow_control_IN_Down_d:
|
||||
/* During 'Down': '<S3>:18' */
|
||||
if (localB->map[1]) {
|
||||
/* Transition: '<S3>:169' */
|
||||
/* Exit Internal 'Down': '<S3>:18' */
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Up;
|
||||
|
||||
/* Entry 'Up': '<S3>:17' */
|
||||
*rty_window_up = true;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = true;
|
||||
localDW->is_Up = powerwindow_powerwindow_control_IN_Up;
|
||||
} else {
|
||||
switch (localDW->is_Down) {
|
||||
case powerwindow_powerwindow_control_IN_AutoDown:
|
||||
/* During 'AutoDown': '<S3>:111' */
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_control_IN_Down:
|
||||
/* During 'Down': '<S3>:110' */
|
||||
if (localB->map[0]) {
|
||||
/* Transition: '<S3>:26' */
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'InitDown': '<S3>:109' */
|
||||
if (localDW->temporalCounter_i1 >= 20) {
|
||||
/* Transition: '<S3>:119' */
|
||||
if (localB->map[0]) {
|
||||
/* Transition: '<S3>:120' */
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow_control_IN_AutoDown;
|
||||
} else {
|
||||
if (localB->map[2]) {
|
||||
/* Transition: '<S3>:121' */
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow_control_IN_Down;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_control_IN_Neutral:
|
||||
/* During 'Neutral': '<S3>:16' */
|
||||
if (localB->map[1]) {
|
||||
/* Transition: '<S3>:24' */
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Up;
|
||||
|
||||
/* Entry 'Up': '<S3>:17' */
|
||||
*rty_window_up = true;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = true;
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow_control_IN_InitUp;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
} else {
|
||||
if (localB->map[2]) {
|
||||
/* Transition: '<S3>:25' */
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Down_d;
|
||||
|
||||
/* Entry 'Down': '<S3>:18' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = true;
|
||||
*rty_wake = true;
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow_control_IN_InitDown;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'Up': '<S3>:17' */
|
||||
if (localB->map[2]) {
|
||||
/* Transition: '<S3>:166' */
|
||||
/* Exit Internal 'Up': '<S3>:17' */
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Down_d;
|
||||
|
||||
/* Entry 'Down': '<S3>:18' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = true;
|
||||
*rty_wake = true;
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow_control_IN_Down;
|
||||
} else {
|
||||
switch (localDW->is_Up) {
|
||||
case powerwindow_powerwindow_control_IN_AutoUp:
|
||||
/* During 'AutoUp': '<S3>:108' */
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_control_IN_InitUp:
|
||||
/* During 'InitUp': '<S3>:106' */
|
||||
if (localDW->temporalCounter_i1 >= 20) {
|
||||
/* Transition: '<S3>:115' */
|
||||
if (localB->map[0]) {
|
||||
/* Transition: '<S3>:118' */
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow_control_IN_AutoUp;
|
||||
} else {
|
||||
if (localB->map[1]) {
|
||||
/* Transition: '<S3>:117' */
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow_control_IN_Up;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'Up': '<S3>:107' */
|
||||
if (localB->map[0]) {
|
||||
/* Transition: '<S3>:23' */
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* During 'Sensing': '<S3>:96' */
|
||||
switch (localDW->is_Sensing) {
|
||||
case powerwindow_powerwindow_control_IN_SenseEnd:
|
||||
/* During 'SenseEnd': '<S3>:147' */
|
||||
if ((localB->LogicalOperator == 0) &&
|
||||
(*rty_window_up == 1)) {
|
||||
/* Transition: '<S3>:173' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow_control_IN_Start;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
|
||||
/* Entry 'Start': '<S3>:170' */
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
} else
|
||||
*rty_overcurrent = (localB->RateTransition1 > 184);
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_contr_IN_SensePinch:
|
||||
/* During 'SensePinch': '<S3>:148' */
|
||||
if ((localB->LogicalOperator == 1) ||
|
||||
(*rty_window_down == 1)) {
|
||||
/* Transition: '<S3>:150' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow_control_IN_SenseEnd;
|
||||
} else
|
||||
*rty_pinch = (localB->RateTransition1 > 92);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'Start': '<S3>:170' */
|
||||
if (localDW->temporalCounter_i2 >= 6) {
|
||||
/* Transition: '<S3>:171' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow_contr_IN_SensePinch;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Initial conditions for referenced model: 'powerwindow_powerwindow_control' */
|
||||
void
|
||||
powerwindow_powerwindow_control_Init(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW) {
|
||||
/* InitializeConditions for Chart: '<S2>/stateflow control model' */
|
||||
localDW->is_active_Logic = 0U;
|
||||
localDW->is_Logic = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Down = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Up = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
localDW->is_active_Sensing = 0U;
|
||||
localDW->is_Sensing = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
localDW->is_active_c2_PowerWindow_contro = 0U;
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
*rty_wake = false;
|
||||
}
|
||||
|
||||
/* Start for referenced model: 'powerwindow_powerwindow_control' */
|
||||
void
|
||||
powerwindow_powerwindow_control_Start(
|
||||
powerwindow_rtDW_PowerWindow_control *localDW) {
|
||||
/* Start for DiscretePulseGenerator: '<S2>/period of 50ms' */
|
||||
localDW->clockTickCounter = 0L;
|
||||
}
|
||||
|
||||
/* Output and update for referenced model: 'powerwindow_powerwindow_control' */
|
||||
void
|
||||
powerwindow_powerwindow_control_main(
|
||||
const powerwindow_boolean_T *rtu_up, const powerwindow_boolean_T *rtu_down,
|
||||
const powerwindow_boolean_T *rtu_endofdetectionrange,
|
||||
const powerwindow_uint8_T *rtu_currentsense,
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE) {
|
||||
powerwindow_int16_T rowIdx;
|
||||
powerwindow_int16_T rtb_periodof50ms;
|
||||
|
||||
/* DiscretePulseGenerator: '<S2>/period of 50ms' */
|
||||
rtb_periodof50ms =
|
||||
(localDW->clockTickCounter < 5L) && (localDW->clockTickCounter >= 0L)
|
||||
? 1
|
||||
: 0;
|
||||
if (localDW->clockTickCounter >= 9L)
|
||||
localDW->clockTickCounter = 0L;
|
||||
|
||||
else
|
||||
localDW->clockTickCounter++;
|
||||
|
||||
/* End of DiscretePulseGenerator: '<S2>/period of 50ms' */
|
||||
|
||||
/* Logic: '<S2>/Logical Operator' */
|
||||
localB->LogicalOperator = !*rtu_endofdetectionrange;
|
||||
|
||||
/* RateTransition: '<S2>/Rate Transition1' */
|
||||
localB->RateTransition1 = *rtu_currentsense;
|
||||
|
||||
/* CombinatorialLogic: '<S2>/map' */
|
||||
rowIdx = (powerwindow_int16_T) (((powerwindow_uint16_T) *rtu_up << 1) +
|
||||
*rtu_down);
|
||||
localB->map[0U] = rtCP_map_table[(powerwindow_uint16_T) rowIdx];
|
||||
localB->map[1U] = rtCP_map_table[rowIdx + 4U];
|
||||
localB->map[2U] = rtCP_map_table[rowIdx + 8U];
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* DataTypeConversion: '<S2>/Data Type Conversion' */
|
||||
if (((rtb_periodof50ms != 0) !=
|
||||
(localZCE->stateflowcontrolmodel_Trig_ZCE == powerwindow_POS_ZCSIG)) &&
|
||||
(localZCE->stateflowcontrolmodel_Trig_ZCE !=
|
||||
powerwindow_UNINITIALIZED_ZCSIG)) {
|
||||
/* Gateway: PW_PSG/PWExternalClock/stateflow control model */
|
||||
if (localDW->temporalCounter_i1 < 63U)
|
||||
localDW->temporalCounter_i1++;
|
||||
|
||||
if (localDW->temporalCounter_i2 < 7U)
|
||||
localDW->temporalCounter_i2++;
|
||||
|
||||
powerwindow_powerwindow_con_broadcast_ticks(
|
||||
rty_window_up, rty_window_down, rty_overcurrent, rty_pinch,
|
||||
rty_wake, localB, localDW);
|
||||
}
|
||||
|
||||
localZCE->stateflowcontrolmodel_Trig_ZCE =
|
||||
(powerwindow_uint8_T) (rtb_periodof50ms != 0
|
||||
? (powerwindow_int16_T) powerwindow_POS_ZCSIG
|
||||
: (powerwindow_int16_T)
|
||||
powerwindow_ZERO_ZCSIG);
|
||||
|
||||
/* End of DataTypeConversion: '<S2>/Data Type Conversion' */
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_PowerWindow_control *const PowerWindow_control_M,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_powerwindow_control_rtmSetErrorStatusPointer(
|
||||
PowerWindow_control_M, rt_errorStatus);
|
||||
|
||||
/* block I/O */
|
||||
(void) wcclib_memset(((void *) localB), 0,
|
||||
sizeof(powerwindow_rtB_PowerWindow_control));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) localDW, 0,
|
||||
sizeof(powerwindow_rtDW_PowerWindow_control));
|
||||
localZCE->stateflowcontrolmodel_Trig_ZCE = powerwindow_UNINITIALIZED_ZCSIG;
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,136 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_powerwindow_control.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_powerwindow_control.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PowerWindow_control_h_
|
||||
#define powerwindow_RTW_HEADER_PowerWindow_control_h_
|
||||
#ifndef powerwindow_powerWindow_control_COMMON_INCLUDES_
|
||||
#define powerwindow_powerWindow_control_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#endif /* PowerWindow_control_COMMON_INCLUDES_ */
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control_private.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* user code (top of header file) */
|
||||
|
||||
/* Block signals for model 'PowerWindow_control' */
|
||||
typedef struct {
|
||||
powerwindow_uint8_T RateTransition1; /* '<S2>/Rate Transition1' */
|
||||
powerwindow_boolean_T LogicalOperator; /* '<S2>/Logical Operator' */
|
||||
powerwindow_boolean_T map[3]; /* '<S2>/map' */
|
||||
} powerwindow_rtB_PowerWindow_control;
|
||||
|
||||
/* Block states (auto storage) for model 'PowerWindow_control' */
|
||||
typedef struct {
|
||||
powerwindow_int32_T clockTickCounter; /* '<S2>/period of 50ms' */
|
||||
powerwindow_uint8_T
|
||||
is_active_c2_PowerWindow_contro; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T
|
||||
is_c2_PowerWindow_control; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_Up; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_Down; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_Logic; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_active_Logic; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_Sensing; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_active_Sensing; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T temporalCounter_i1; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T temporalCounter_i2; /* '<S2>/stateflow control model' */
|
||||
} powerwindow_rtDW_PowerWindow_control;
|
||||
|
||||
/* Zero-crossing (trigger) state for model 'PowerWindow_control' */
|
||||
typedef struct {
|
||||
ZCSigState
|
||||
stateflowcontrolmodel_Trig_ZCE; /* '<S2>/stateflow control model' */
|
||||
} powerwindow_rtZCE_PowerWindow_control;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_PowerWindow_control {
|
||||
const powerwindow_char_T **errorStatus;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
powerwindow_rtB_PowerWindow_control rtb;
|
||||
powerwindow_rtDW_PowerWindow_control rtdw;
|
||||
powerwindow_RT_MODEL_PowerWindow_control rtm;
|
||||
powerwindow_rtZCE_PowerWindow_control rtzce;
|
||||
} powerwindow_rtMdlrefDWork_PowerWindow_contr;
|
||||
|
||||
/* Model reference registration function */
|
||||
void powerwindow_powerwindow_control_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_PowerWindow_control *const PowerWindow_control_M,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE);
|
||||
void powerwindow_powerwindow_control_Init(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
void powerwindow_powerwindow_control_Start(
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
void powerwindow_powerwindow_control_main(
|
||||
const powerwindow_boolean_T *rtu_up, const powerwindow_boolean_T *rtu_down,
|
||||
const powerwindow_boolean_T *rtu_endofdetectionrange,
|
||||
const powerwindow_uint8_T *rtu_currentsense,
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE);
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Use the MATLAB hilite_system command to trace the generated code back
|
||||
to the model. For example,
|
||||
|
||||
hilite_system('<S3>') - opens system 3
|
||||
hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow_control'
|
||||
'<S1>' : 'PowerWindow_control/PW_PSG'
|
||||
'<S2>' : 'PowerWindow_control/PW_PSG/PW_PSG'
|
||||
'<S3>' : 'PowerWindow_control/PW_PSG/Tic'
|
||||
'<S4>' : 'PowerWindow_control/PW_PSG/Toc'
|
||||
'<S5>' : 'PowerWindow_control/PW_PSG/PW_PSG/stateflow control model'
|
||||
'<S6>' : 'PowerWindow_control/PW_PSG/Tic/Tic_T'
|
||||
'<S7>' : 'PowerWindow_control/PW_PSG/Toc/Toc_T'
|
||||
*/
|
||||
#endif /* powerwindow_RTW_HEADER_PowerWindow_control_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,59 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_powerwindow_control_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_powerwindow_control_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PowerWindow_control_private_h_
|
||||
#define powerwindow_RTW_HEADER_PowerWindow_control_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_powerwindow_control_rtmGetErrorStatus
|
||||
#define powerwindow_powerwindow_control_rtmGetErrorStatus(rtm) \
|
||||
(*((rtm)->errorStatus))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_powerwindow_control_rtmSetErrorStatus
|
||||
#define powerwindow_powerwindow_control_rtmSetErrorStatus(rtm, val) \
|
||||
(*((rtm)->errorStatus) = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_powerwindow_control_rtmGetErrorStatusPointer
|
||||
#define powerwindow_powerwindow_control_rtmGetErrorStatusPointer(rtm) \
|
||||
(rtm)->errorStatus
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_powerwindow_control_rtmSetErrorStatusPointer
|
||||
#define powerwindow_powerwindow_control_rtmSetErrorStatusPointer(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
extern const powerwindow_boolean_T powerwindow_rtCP_pooled_6bUUQf1tASYw[12];
|
||||
|
||||
#define rtCP_map_table \
|
||||
powerwindow_rtCP_pooled_6bUUQf1tASYw /* Computed Parameter: map_table \
|
||||
Referenced by: '<S2>/map' \
|
||||
*/
|
||||
#endif /* RTW_HEADER_PowerWindow_control_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_powerwindow_control_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_powerwindow_control_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_powerwindow_control_types_h_
|
||||
#define powerwindow_RTW_HEADER_powerwindow_control_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PowerWindow_control
|
||||
powerwindow_RT_MODEL_PowerWindow_control;
|
||||
|
||||
#endif /* RTW_HEADER_powerwindow_control_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,127 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_rtw_continuous.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_rtw_continuous.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow___RTW_CONTINUOUS_H__
|
||||
#define powerwindow___RTW_CONTINUOUS_H__
|
||||
|
||||
// #include "../powerwindow_HeaderFiles/powerwindow_tmwtypes.h"
|
||||
|
||||
/* For models registering MassMatrix */
|
||||
typedef enum {
|
||||
SS_MATRIX_NONE,
|
||||
SS_MATRIX_CONSTANT,
|
||||
SS_MATRIX_TIMEDEP,
|
||||
SS_MATRIX_STATEDEP
|
||||
} powerwindow_ssMatrixType;
|
||||
|
||||
typedef enum {
|
||||
SOLVER_MODE_AUTO, /* only occurs in
|
||||
mdlInitializeSizes/mdlInitializeSampleTimes */
|
||||
SOLVER_MODE_SINGLETASKING,
|
||||
SOLVER_MODE_MULTITASKING
|
||||
} powerwindow_SolverMode;
|
||||
|
||||
typedef enum { MINOR_TIME_STEP, MAJOR_TIME_STEP } powerwindow_SimTimeStep;
|
||||
|
||||
/* =============================================================================
|
||||
Model methods object
|
||||
=============================================================================
|
||||
*/
|
||||
typedef void (*powerwindow_rtMdlInitializeSizesFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlInitializeSampleTimesFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlStartFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlOutputsFcn)(void *rtModel,
|
||||
powerwindow_int_T tid);
|
||||
typedef void (*powerwindow_rtMdlUpdateFcn)(void *rtModel,
|
||||
powerwindow_int_T tid);
|
||||
typedef void (*powerwindow_rtMdlDerivativesFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlProjectionFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlMassMatrixFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlForcingFunctionFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlTerminateFcn)(void *rtModel);
|
||||
#ifdef RT_MALLOC
|
||||
typedef real_T (*rtMdlDiscreteEventsFcn)(
|
||||
void *pModel, powerwindow_int_T rtmNumSampTimes, void *rtmTimingData,
|
||||
powerwindow_int_T *rtmSampleHitPtr,
|
||||
powerwindow_int_T *rtmPerTaskSampleHits);
|
||||
#endif
|
||||
|
||||
typedef struct powerwindow__RTWRTModelMethodsInfo_tag {
|
||||
void *rtModelPtr;
|
||||
powerwindow_rtMdlInitializeSizesFcn rtmInitSizesFcn;
|
||||
powerwindow_rtMdlInitializeSampleTimesFcn rtmInitSampTimesFcn;
|
||||
powerwindow_rtMdlStartFcn rtmStartFcn;
|
||||
powerwindow_rtMdlOutputsFcn rtmOutputsFcn;
|
||||
powerwindow_rtMdlUpdateFcn rtmUpdateFcn;
|
||||
powerwindow_rtMdlDerivativesFcn rtmDervisFcn;
|
||||
powerwindow_rtMdlProjectionFcn rtmProjectionFcn;
|
||||
powerwindow_rtMdlMassMatrixFcn rtmMassMatrixFcn;
|
||||
powerwindow_rtMdlForcingFunctionFcn rtmForcingFunctionFcn;
|
||||
powerwindow_rtMdlTerminateFcn rtmTerminateFcn;
|
||||
#ifdef RT_MALLOC
|
||||
rtMdlDiscreteEventsFcn rtmDiscreteEventsFcn;
|
||||
#endif
|
||||
} powerwindow_RTWRTModelMethodsInfo;
|
||||
|
||||
#define rtmiSetRTModelPtr(M, rtmp) ((M).rtModelPtr = (rtmp))
|
||||
#define rtmiGetRTModelPtr(M) (M).rtModelPtr
|
||||
|
||||
#define rtmiSetInitSizesFcn(M, fp) \
|
||||
((M).rtmInitSizesFcn = ((powerwindow_rtMdlInitializeSizesFcn) (fp)))
|
||||
#define rtmiSetInitSampTimesFcn(M, fp) \
|
||||
((M).rtmInitSampTimesFcn = \
|
||||
((powerwindow_rtMdlInitializeSampleTimesFcn) (fp)))
|
||||
#define rtmiSetStartFcn(M, fp) \
|
||||
((M).rtmStartFcn = ((powerwindow_rtMdlStartFcn) (fp)))
|
||||
#define rtmiSetOutputsFcn(M, fp) \
|
||||
((M).rtmOutputsFcn = ((powerwindow_rtMdlOutputsFcn) (fp)))
|
||||
#define rtmiSetUpdateFcn(M, fp) \
|
||||
((M).rtmUpdateFcn = ((powerwindow_rtMdlUpdateFcn) (fp)))
|
||||
#define rtmiSetDervisFcn(M, fp) \
|
||||
((M).rtmDervisFcn = ((powerwindow_rtMdlDerivativesFcn) (fp)))
|
||||
#define rtmiSetProjectionFcn(M, fp) \
|
||||
((M).rtmProjectionFcn = ((powerwindow_rtMdlProjectionFcn) (fp)))
|
||||
#define rtmiSetMassMatrixFcn(M, fp) \
|
||||
((M).rtmMassMatrixFcn = ((powerwindow_rtMdlMassMatrixFcn) (fp)))
|
||||
#define rtmiSetForcingFunctionFcn(M, fp) \
|
||||
((M).rtmForcingFunctionFcn = ((powerwindow_rtMdlForcingFunctionFcn) (fp)))
|
||||
#define rtmiSetTerminateFcn(M, fp) \
|
||||
((M).rtmTerminateFcn = ((powerwindow_rtMdlTerminateFcn) (fp)))
|
||||
#ifdef RT_MALLOC
|
||||
#define rtmiSetDiscreteEventsFcn(M, fp) \
|
||||
((M).rtmDiscreteEventsFcn = ((rtMdlDiscreteEventsFcn) (fp)))
|
||||
#endif
|
||||
|
||||
#define rtmiInitializeSizes(M) ((*(M).rtmInitSizesFcn)((M).rtModelPtr))
|
||||
#define rtmiInitializeSampleTimes(M) \
|
||||
((*(M).rtmInitSampTimesFcn)((M).rtModelPtr))
|
||||
#define rtmiStart(M) ((*(M).rtmStartFcn)((M).rtModelPtr))
|
||||
#define rtmiOutputs(M, tid) ((*(M).rtmOutputsFcn)((M).rtModelPtr, tid))
|
||||
#define rtmiUpdate(M, tid) ((*(M).rtmUpdateFcn)((M).rtModelPtr, tid))
|
||||
#define rtmiDerivatives(M) ((*(M).rtmDervisFcn)((M).rtModelPtr))
|
||||
#define rtmiProjection(M) ((*(M).rtmProjectionFcn)((M).rtModelPtr))
|
||||
#define rtmiMassMatrix(M) ((*(M).rtmMassMatrixFcn)((M).rtModelPtr))
|
||||
#define rtmiForcingFunction(M) ((*(M).rtmForcingFunctionFcn)((M).rtModelPtr))
|
||||
#define rtmiTerminate(M) ((*(M).rtmTerminateFcn)((M).rtModelPtr))
|
||||
#ifdef RT_MALLOC
|
||||
#define rtmiDiscreteEvents(M, x1, x2, x3, x4) \
|
||||
((*(M).rtmDiscreteEventsFcn)((M).rtModelPtr, (x1), (x2), (x3), (x4)))
|
||||
#endif
|
||||
#endif /* __RTW_CONTINUOUS_H__ */
|
||||
@ -0,0 +1,255 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_rtw_solver.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_rtw_solver.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow___RTW_SOLVER_H__
|
||||
#define powerwindow___RTW_SOLVER_H__
|
||||
|
||||
/* =============================================================================
|
||||
Solver object
|
||||
=============================================================================
|
||||
*/
|
||||
#ifndef NO_FLOATS /* ERT integer-only */
|
||||
/*
|
||||
Enum for solver tolerance
|
||||
*/
|
||||
typedef enum {
|
||||
SL_SOLVER_TOLERANCE_AUTO = 0, /* Set Automatically by Solver */
|
||||
SL_SOLVER_TOLERANCE_LOCAL = 1, /* Set Locally, e.g., by Blocks */
|
||||
SL_SOLVER_TOLERANCE_GLOBAL = 2, /* Set Globally, e.g., by Block Diagram */
|
||||
SL_SOLVER_TOLERANCE_UNDEFINED = 255 /* Signal uninitialized */
|
||||
} powerwindow_SL_SolverToleranceControlFlag_T;
|
||||
|
||||
/*
|
||||
Enum for jacobian method control
|
||||
*/
|
||||
typedef enum {
|
||||
SL_JM_BD_AUTO = 0,
|
||||
SL_JM_BD_SPARSE_PERTURBATION,
|
||||
SL_JM_BD_FULL_PERTURBATION,
|
||||
SL_JM_BD_SPARSE_ANALYTICAL,
|
||||
SL_JM_BD_FULL_ANALYTICAL
|
||||
} powerwindow_slJmBdControl;
|
||||
|
||||
typedef struct _ssSolverInfo_tag {
|
||||
void *rtModelPtr;
|
||||
|
||||
const char *solverName;
|
||||
powerwindow_boolean_T isVariableStepSolver;
|
||||
powerwindow_boolean_T solverNeedsReset;
|
||||
|
||||
powerwindow_time_T solverStopTime;
|
||||
powerwindow_time_T *stepSizePtr;
|
||||
powerwindow_time_T minStepSize;
|
||||
powerwindow_time_T maxStepSize;
|
||||
powerwindow_time_T fixedStepSize;
|
||||
|
||||
powerwindow_int_T solverShapePreserveControl;
|
||||
powerwindow_int_T solverMaxConsecutiveMinStep;
|
||||
powerwindow_int_T maxNumMinSteps;
|
||||
powerwindow_int_T solverMaxOrder;
|
||||
powerwindow_real_T solverConsecutiveZCsStepRelTol;
|
||||
powerwindow_int_T solverMaxConsecutiveZCs;
|
||||
|
||||
powerwindow_int_T solverExtrapolationOrder;
|
||||
powerwindow_int_T solverNumberNewtonIterations;
|
||||
|
||||
powerwindow_int_T solverRefineFactor;
|
||||
powerwindow_real_T solverRelTol;
|
||||
powerwindow_real_T unused_real_T_1;
|
||||
|
||||
powerwindow_real_T **dXPtr;
|
||||
powerwindow_time_T **tPtr;
|
||||
|
||||
powerwindow_int_T *numContStatesPtr;
|
||||
powerwindow_real_T **contStatesPtr;
|
||||
|
||||
powerwindow_real_T *zcSignalVector;
|
||||
powerwindow_uint8_T *zcEventsVector;
|
||||
powerwindow_uint8_T *zcSignalAttrib;
|
||||
powerwindow_int_T zcSignalVectorLength;
|
||||
powerwindow_uint8_T *reserved;
|
||||
|
||||
powerwindow_boolean_T foundContZcEvents;
|
||||
powerwindow_boolean_T isAtLeftPostOfContZcEvent;
|
||||
powerwindow_boolean_T isAtRightPostOfContZcEvent;
|
||||
powerwindow_boolean_T adaptiveZcDetection;
|
||||
|
||||
powerwindow_int_T numZcSignals;
|
||||
|
||||
powerwindow_boolean_T stateProjection;
|
||||
powerwindow_boolean_T robustResetMethod; /* user's preference */
|
||||
powerwindow_boolean_T updateJacobianAtReset; /* S-Fcn request (sticky) */
|
||||
powerwindow_boolean_T consistencyChecking;
|
||||
|
||||
powerwindow_int_T massMatrixNzMax;
|
||||
powerwindow_int_T *massMatrixIr;
|
||||
powerwindow_int_T *massMatrixJc;
|
||||
powerwindow_real_T *massMatrixPr;
|
||||
|
||||
const powerwindow_char_T **errStatusPtr;
|
||||
|
||||
powerwindow_real_T zcThreshold;
|
||||
powerwindow_int_T zeroCrossAlgorithm;
|
||||
powerwindow_int_T consecutiveZCsError;
|
||||
|
||||
powerwindow_boolean_T isComputingJacobian;
|
||||
powerwindow_slJmBdControl solverJacobianMethodControl;
|
||||
powerwindow_int_T ignoredZcDiagnostic;
|
||||
powerwindow_int_T maskedZcDiagnostic;
|
||||
powerwindow_boolean_T isOutputMethodComputed;
|
||||
} ssSolverInfo;
|
||||
|
||||
/* Support old name RTWSolverInfo */
|
||||
typedef ssSolverInfo RTWSolverInfo;
|
||||
|
||||
#define rtsiSetRTModelPtr(S, rtmp) ((S)->rtModelPtr = (rtmp))
|
||||
#define rtsiGetRTModelPtr(S) (S)->rtModelPtr
|
||||
|
||||
#define rtsiSetSimTimeStepPtr(S, stp) ((S)->simTimeStepPtr = (stp))
|
||||
#define rtsiGetSimTimeStepPtr(S) ((S)->simTimeStepPtr)
|
||||
#define rtsiGetSimTimeStep(S) *((S)->simTimeStepPtr)
|
||||
#define rtsiSetSimTimeStep(S, st) (*((S)->simTimeStepPtr) = (st))
|
||||
|
||||
#define rtsiSetSolverData(S, sd) ((S)->solverData = (sd))
|
||||
#define rtsiGetSolverData(S) (S)->solverData
|
||||
|
||||
#define rtsiSetSolverName(S, sn) ((S)->solverName = (sn))
|
||||
#define rtsiGetSolverName(S) (S)->solverName
|
||||
|
||||
#define rtsiSetVariableStepSolver(S, vs) ((S)->isVariableStepSolver = (vs))
|
||||
#define rtsiIsVariableStepSolver(S) (S)->isVariableStepSolver
|
||||
|
||||
#define rtsiSetSolverNeedsReset(S, sn) ((S)->solverNeedsReset = (sn))
|
||||
#define rtsiGetSolverNeedsReset(S) (S)->solverNeedsReset
|
||||
|
||||
#define rtsiSetBlkStateChange(S, sn) ((S)->blkStateChange = (sn))
|
||||
#define rtsiGetBlkStateChange(S) (S)->blkStateChange
|
||||
|
||||
#define rtsiSetSolverMode(S, sm) ((S)->solverMode = (sm))
|
||||
#define rtsiGetSolverMode(S) (S)->solverMode
|
||||
|
||||
#define rtsiSetSolverStopTime(S, st) ((S)->solverStopTime = (st))
|
||||
#define rtsiGetSolverStopTime(S) (S)->solverStopTime
|
||||
|
||||
#define rtsiSetStepSizePtr(S, ssp) ((S)->stepSizePtr = (ssp))
|
||||
#define rtsiSetStepSize(S, ss) (*((S)->stepSizePtr) = (ss))
|
||||
#define rtsiGetStepSize(S) *((S)->stepSizePtr)
|
||||
|
||||
#define rtsiSetMinStepSize(S, ss) (((S)->minStepSize = (ss)))
|
||||
#define rtsiGetMinStepSize(S) (S)->minStepSize
|
||||
|
||||
#define rtsiSetMaxStepSize(S, ss) ((S)->maxStepSize = (ss))
|
||||
#define rtsiGetMaxStepSize(S) (S)->maxStepSize
|
||||
|
||||
#define rtsiSetFixedStepSize(S, ss) ((S)->fixedStepSize = (ss))
|
||||
#define rtsiGetFixedStepSize(S) (S)->fixedStepSize
|
||||
|
||||
#define rtsiSetMaxNumMinSteps(S, mns) ((S)->maxNumMinSteps = (mns))
|
||||
#define rtsiGetMaxNumMinSteps(S) (S)->maxNumMinSteps
|
||||
|
||||
#define rtsiSetSolverMaxOrder(S, smo) ((S)->solverMaxOrder = (smo))
|
||||
#define rtsiGetSolverMaxOrder(S) (S)->solverMaxOrder
|
||||
|
||||
#define rtsiSetSolverJacobianMethodControl(S, smcm) \
|
||||
(ssGetSolverInfo(S)->solverJacobianMethodControl = (smcm))
|
||||
#define rtsiGetSolverJacobianMethodControl(S) \
|
||||
ssGetSolverInfo(S)->solverJacobianMethodControl
|
||||
|
||||
#define rtsiSetSolverShapePreserveControl(S, smcm) \
|
||||
(ssGetSolverInfo(S)->solverShapePreserveControl = (smcm))
|
||||
#define rtsiGetSolverShapePreserveControl(S) \
|
||||
ssGetSolverInfo(S)->solverShapePreserveControl
|
||||
|
||||
#define rtsiSetSolverConsecutiveZCsStepRelTol(S, scr) \
|
||||
(ssGetSolverInfo(S)->solverConsecutiveZCsStepRelTol = (scr))
|
||||
#define rtsiGetSolverConsecutiveZCsStepRelTol(S) \
|
||||
ssGetSolverInfo(S)->solverConsecutiveZCsStepRelTol
|
||||
|
||||
#define rtsiSetSolverMaxConsecutiveZCs(S, smcz) \
|
||||
(ssGetSolverInfo(S)->solverMaxConsecutiveZCs = (smcz))
|
||||
#define rtsiGetSolverMaxConsecutiveZCs(S) \
|
||||
ssGetSolverInfo(S)->solverMaxConsecutiveZCs
|
||||
|
||||
#define rtsiSetSolverMaxConsecutiveMinStep(S, smcm) \
|
||||
(ssGetSolverInfo(S)->solverMaxConsecutiveMinStep = (smcm))
|
||||
#define rtsiGetSolverMaxConsecutiveMinStep(S) \
|
||||
ssGetSolverInfo(S)->solverMaxConsecutiveMinStep
|
||||
|
||||
#define rtsiSetSolverExtrapolationOrder(S, seo) \
|
||||
((S)->solverExtrapolationOrder = (seo))
|
||||
#define rtsiGetSolverExtrapolationOrder(S) (S)->solverExtrapolationOrder
|
||||
|
||||
#define rtsiSetSolverNumberNewtonIterations(S, nni) \
|
||||
((S)->solverNumberNewtonIterations = (nni))
|
||||
#define rtsiGetSolverNumberNewtonIterations(S) (S)->solverNumberNewtonIterations
|
||||
|
||||
#define rtsiSetSolverRefineFactor(S, smo) ((S)->solverRefineFactor = (smo))
|
||||
#define rtsiGetSolverRefineFactor(S) (S)->solverRefineFactor
|
||||
|
||||
#define rtsiSetSolverRelTol(S, smo) ((S)->solverRelTol = (smo))
|
||||
#define rtsiGetSolverRelTol(S) (S)->solverRelTol
|
||||
|
||||
#define rtsiSetSolverMassMatrixType(S, type) ((S)->massMatrixType = (type))
|
||||
#define rtsiGetSolverMassMatrixType(S) (S)->massMatrixType
|
||||
|
||||
#define rtsiSetSolverMassMatrixNzMax(S, nzMax) ((S)->massMatrixNzMax = (nzMax))
|
||||
#define rtsiGetSolverMassMatrixNzMax(S) (S)->massMatrixNzMax
|
||||
|
||||
#define rtsiSetSolverMassMatrixIr(S, ir) ((S)->massMatrixIr = (ir))
|
||||
#define rtsiGetSolverMassMatrixIr(S) (S)->massMatrixIr
|
||||
|
||||
#define rtsiSetSolverMassMatrixJc(S, jc) ((S)->massMatrixJc = (jc))
|
||||
#define rtsiGetSolverMassMatrixJc(S) (S)->massMatrixJc
|
||||
|
||||
#define rtsiSetSolverMassMatrixPr(S, pr) ((S)->massMatrixPr = (pr))
|
||||
#define rtsiGetSolverMassMatrixPr(S) (S)->massMatrixPr
|
||||
|
||||
#define rtsiSetdXPtr(S, dxp) ((S)->dXPtr = (dxp))
|
||||
#define rtsiSetdX(S, dx) (*((S)->dXPtr) = (dx))
|
||||
#define rtsiGetdX(S) *((S)->dXPtr)
|
||||
|
||||
#define rtsiSetTPtr(S, tp) ((S)->tPtr = (tp))
|
||||
#define rtsiSetT(S, t) ((*((S)->tPtr))[0] = (t))
|
||||
#define rtsiGetT(S) (*((S)->tPtr))[0]
|
||||
|
||||
#define rtsiSetContStatesPtr(S, cp) ((S)->contStatesPtr = (cp))
|
||||
#define rtsiGetContStates(S) *((S)->contStatesPtr)
|
||||
|
||||
#define rtsiSetNumContStatesPtr(S, cp) ((S)->numContStatesPtr = (cp))
|
||||
#define rtsiGetNumContStates(S) *((S)->numContStatesPtr)
|
||||
|
||||
#define rtsiSetErrorStatusPtr(S, esp) ((S)->errStatusPtr = (esp))
|
||||
#define rtsiSetErrorStatus(S, es) (*((S)->errStatusPtr) = (es))
|
||||
#define rtsiGetErrorStatus(S) *((S)->errStatusPtr)
|
||||
|
||||
#define rtsiSetModelMethodsPtr(S, mmp) ((S)->modelMethodsPtr = (mmp))
|
||||
#define rtsiGetModelMethodsPtr(S) (S)->modelMethodsPtr
|
||||
|
||||
#define rtsiSetSolverComputingJacobian(S, val) \
|
||||
((S)->isComputingJacobian = (val))
|
||||
#define rtsiIsSolverComputingJacobian(S) (S)->isComputingJacobian
|
||||
|
||||
#define rtsiSetSolverOutputComputed(S, val) \
|
||||
((S)->isOutputMethodComputed = (val))
|
||||
#define rtsiIsSolverOutputComputed(S) (S)->isOutputMethodComputed
|
||||
|
||||
#endif /* !NO_FLOATS */
|
||||
|
||||
#endif /* powerwindow___RTW_SOLVER_H__ */
|
||||
@ -0,0 +1,201 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_rtwtypes.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_rtwtypes.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow__RTWTYPES_H__
|
||||
#define powerwindow__RTWTYPES_H__
|
||||
|
||||
/* Logical type definitions */
|
||||
#if (!defined(__cplusplus))
|
||||
#ifndef false
|
||||
#define false (0U)
|
||||
#endif
|
||||
|
||||
#ifndef true
|
||||
#define true (1U)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define powerwindow__TMWTYPES__
|
||||
|
||||
/*=======================================================================*
|
||||
Target hardware information
|
||||
|
||||
Number of bits: char: 8 short: 16 int: 16
|
||||
long: 32
|
||||
native word size: 8
|
||||
Byte ordering: LittleEndian
|
||||
Signed integer division rounds to: Zero
|
||||
Shift right on a signed integer as arithmetic shift: on
|
||||
=======================================================================*/
|
||||
|
||||
/*=======================================================================*
|
||||
Fixed width word size data types:
|
||||
powerwindow_int8_T, powerwindow_int16_T, powerwindow_int32_T - signed
|
||||
8, 16, or 32 bit integers powerwindow_uint8_T, powerwindow_uint16_T,
|
||||
powerwindow_uint32_T - unsigned 8, 16, or 32 bit integers
|
||||
powerwindow_real32_T, powerwindow_real64_T - 32 and 64 bit
|
||||
floating point numbers
|
||||
=======================================================================*/
|
||||
typedef signed char powerwindow_int8_T;
|
||||
typedef unsigned char powerwindow_uint8_T;
|
||||
typedef int powerwindow_int16_T;
|
||||
typedef unsigned int powerwindow_uint16_T;
|
||||
typedef long powerwindow_int32_T;
|
||||
typedef unsigned long powerwindow_uint32_T;
|
||||
typedef float powerwindow_real32_T;
|
||||
typedef double powerwindow_real64_T;
|
||||
|
||||
/*===========================================================================*
|
||||
Generic type definitions: powerwindow_real_T, powerwindow_time_T,
|
||||
powerwindow_boolean_T, powerwindow_int_T, powerwindow_uint_T,
|
||||
powerwindow_ulong_T, powerwindow_char_T and
|
||||
powerwindow_byte_T.
|
||||
===========================================================================*/
|
||||
typedef double powerwindow_real_T;
|
||||
typedef double powerwindow_time_T;
|
||||
typedef unsigned char powerwindow_boolean_T;
|
||||
typedef int powerwindow_int_T;
|
||||
typedef unsigned int powerwindow_uint_T;
|
||||
typedef unsigned long powerwindow_ulong_T;
|
||||
typedef char powerwindow_char_T;
|
||||
typedef unsigned char powerwindow_uchar_T;
|
||||
typedef powerwindow_char_T powerwindow_byte_T;
|
||||
|
||||
/*===========================================================================*
|
||||
Complex number type definitions
|
||||
===========================================================================*/
|
||||
#define powerwindow_CREAL_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_real32_T re;
|
||||
powerwindow_real32_T im;
|
||||
} powerwindow_creal32_T;
|
||||
|
||||
typedef struct {
|
||||
powerwindow_real64_T re;
|
||||
powerwindow_real64_T im;
|
||||
} powerwindow_creal64_T;
|
||||
|
||||
typedef struct {
|
||||
powerwindow_real_T re;
|
||||
powerwindow_real_T im;
|
||||
} powerwindow_creal_T;
|
||||
|
||||
#define powerwindow_CINT8_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_int8_T re;
|
||||
powerwindow_int8_T im;
|
||||
} powerwindow_cint8_T;
|
||||
|
||||
#define powerwindow_CUINT8_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_uint8_T re;
|
||||
powerwindow_uint8_T im;
|
||||
} powerwindow_cuint8_T;
|
||||
|
||||
#define powerwindow_CINT16_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_int16_T re;
|
||||
powerwindow_int16_T im;
|
||||
} powerwindow_cint16_T;
|
||||
|
||||
#define powerwindow_CUINT16_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_uint16_T re;
|
||||
powerwindow_uint16_T im;
|
||||
} powerwindow_cuint16_T;
|
||||
|
||||
#define powerwindow_CINT32_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_int32_T re;
|
||||
powerwindow_int32_T im;
|
||||
} powerwindow_cint32_T;
|
||||
|
||||
#define powerwindow_CUINT32_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_uint32_T re;
|
||||
powerwindow_uint32_T im;
|
||||
} powerwindow_cuint32_T;
|
||||
|
||||
/*=======================================================================*
|
||||
Min and Max:
|
||||
powerwindow_int8_T, powerwindow_int16_T, powerwindow_int32_T - signed
|
||||
8, 16, or 32 bit integers powerwindow_uint8_T, powerwindow_uint16_T,
|
||||
powerwindow_uint32_T - unsigned 8, 16, or 32 bit integers
|
||||
=======================================================================*/
|
||||
#define powerwindow_MAX_int8_T ((powerwindow_int8_T) (127))
|
||||
#define powerwindow_MIN_int8_T ((powerwindow_int8_T) (-128))
|
||||
#define powerwindow_MAX_uint8_T ((powerwindow_uint8_T) (255U))
|
||||
#define powerwindow_MIN_uint8_T ((powerwindow_uint8_T) (0U))
|
||||
#define powerwindow_MAX_int16_T ((powerwindow_int16_T) (32767))
|
||||
#define powerwindow_MIN_int16_T ((powerwindow_int16_T) (-32768))
|
||||
#define powerwindow_MAX_uint16_T ((powerwindow_uint16_T) (65535U))
|
||||
#define powerwindow_MIN_uint16_T ((powerwindow_uint16_T) (0U))
|
||||
#define powerwindow_MAX_int32_T ((powerwindow_int32_T) (2147483647))
|
||||
#define powerwindow_MIN_int32_T ((powerwindow_int32_T) (-2147483647 - 1))
|
||||
#define powerwindow_MAX_uint32_T ((powerwindow_uint32_T) (0xFFFFFFFFU))
|
||||
#define powerwindow_MIN_uint32_T ((powerwindow_uint32_T) (0U))
|
||||
|
||||
/* Block D-Work pointer type */
|
||||
typedef void *powerwindow_pointer_T;
|
||||
|
||||
#define powerwindow_input_length 977
|
||||
|
||||
/* Simulink specific types */
|
||||
#ifndef powerwindow___ZERO_CROSSING_TYPES__
|
||||
#define powerwindow___ZERO_CROSSING_TYPES__
|
||||
|
||||
/* Trigger directions: falling, either, and rising */
|
||||
typedef enum {
|
||||
FALLING_ZERO_CROSSING = -1,
|
||||
ANY_ZERO_CROSSING = 0,
|
||||
RISING_ZERO_CROSSING = 1
|
||||
} powerwindow_ZCDirection;
|
||||
|
||||
/* Previous state of a trigger signal */
|
||||
typedef powerwindow_uint8_T ZCSigState;
|
||||
|
||||
/* Initial value of a trigger zero crossing signal */
|
||||
#define powerwindow_UNINITIALIZED_ZCSIG 0x03U
|
||||
#define powerwindow_NEG_ZCSIG 0x02U
|
||||
#define powerwindow_POS_ZCSIG 0x01U
|
||||
#define powerwindow_ZERO_ZCSIG 0x00U
|
||||
|
||||
/* Current state of a trigger signal */
|
||||
typedef enum {
|
||||
FALLING_ZCEVENT = -1,
|
||||
NO_ZCEVENT = 0,
|
||||
RISING_ZCEVENT = 1
|
||||
} powerwindow_ZCEventType;
|
||||
|
||||
#endif /* powerwindow___ZERO_CROSSING_TYPES__ */
|
||||
#endif /* powerwindow__RTWTYPES_H__ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,813 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_tmwtypes.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_tmwtypes.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_tmwtypes_h
|
||||
#define powerwindow_tmwtypes_h
|
||||
|
||||
#ifndef powerwindow__TMWTYPES__
|
||||
#define powerwindow__TMWTYPES__
|
||||
/*
|
||||
File : tmwtypes.h
|
||||
Abstract:
|
||||
Data types for use with MATLAB/SIMULINK and the Real-Time Workshop.
|
||||
|
||||
When compiling stand-alone model code, data types can be overridden
|
||||
via compiler switches.
|
||||
|
||||
Define NO_FLOATS to eliminate reference to powerwindow_real_T, etc.
|
||||
*/
|
||||
|
||||
#define LOGICAL_IS_A_TYPE
|
||||
#define SPARSE_GENERALIZATION
|
||||
|
||||
#ifdef NO_FLOATS
|
||||
#define double double_not_allowed
|
||||
#define float float_not_allowed
|
||||
#endif /*NO_FLOATS*/
|
||||
|
||||
/*
|
||||
The following data types cannot be overridden when building MEX files.
|
||||
*/
|
||||
#ifdef MATLAB_MEX_FILE
|
||||
#undef CHARACTER_T
|
||||
#undef INTEGER_T
|
||||
#undef BOOLEAN_T
|
||||
#undef REAL_T
|
||||
#undef TIME_T
|
||||
#endif
|
||||
|
||||
/*
|
||||
The powerwindow_uchar_T, powerwindow_ushort_T and powerwindow_ulong_T types
|
||||
are needed for compilers which do not allow defines to be specified, at the
|
||||
command line, with spaces in them.
|
||||
*/
|
||||
|
||||
typedef unsigned char powerwindow_uchar_T;
|
||||
typedef unsigned short powerwindow_ushort_T;
|
||||
typedef unsigned long powerwindow_ulong_T;
|
||||
|
||||
#if (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__x86_64__) || \
|
||||
defined(__LP64__) || defined(__LCC64__)
|
||||
|
||||
typedef unsigned long long powerwindow_ulonglong_T;
|
||||
#endif
|
||||
|
||||
/*=======================================================================*
|
||||
Fixed width word size data types:
|
||||
powerwindow_int8_T, powerwindow_int16_T, powerwindow_int32_T - signed
|
||||
8, 16, or 32 bit integers powerwindow_uint8_T, powerwindow_uint16_T,
|
||||
powerwindow_uint32_T - unsigned 8, 16, or 32 bit integers
|
||||
powerwindow_real32_T, powerwindow_real64_T - 32 and 64 bit
|
||||
floating point numbers
|
||||
=======================================================================*/
|
||||
|
||||
/* When used with Real Time Workshop generated code, this
|
||||
header file can be used with a variety of compilers.
|
||||
|
||||
The compiler could be for an 8 bit embedded processor that
|
||||
only had 8 bits per integer and 16 bits per long.
|
||||
In that example, a 32 bit integer size is not even available.
|
||||
This header file should be robust to that.
|
||||
|
||||
For the case of an 8 bit processor, the preprocessor
|
||||
may be limited to 16 bit math like its target. That limitation
|
||||
would mean that 32 bit comparisons can't be done accurately.
|
||||
To increase robustness to this, comparisons are done against
|
||||
smaller values first. An inaccurate 32 bit comparison isn't
|
||||
attempted if the 16 bit comparison has already succeeded.
|
||||
|
||||
Limitations on preprocessor math can also be stricter than
|
||||
for the target. There are known cases where a compiler
|
||||
targeting processors with 64 bit longs can't do accurate
|
||||
preprocessor comparisons on more than 32 bits.
|
||||
*/
|
||||
|
||||
/* Determine the number of bits for int, long, short, and char.
|
||||
If one fails to be determined, set the number of bits to -1
|
||||
*/
|
||||
|
||||
#ifndef TMW_BITS_PER_INT
|
||||
#if INT_MAX == 0x7FL
|
||||
#define TMW_BITS_PER_INT 8
|
||||
#elif INT_MAX == 0x7FFFL
|
||||
#define TMW_BITS_PER_INT 16
|
||||
#elif INT_MAX == 0x7FFFFFFFL
|
||||
#define TMW_BITS_PER_INT 32
|
||||
#else
|
||||
#define TMW_BITS_PER_INT -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_LONG
|
||||
#if LONG_MAX == 0x7FL
|
||||
#define TMW_BITS_PER_LONG 8
|
||||
#elif LONG_MAX == 0x7FFFL
|
||||
#define TMW_BITS_PER_LONG 16
|
||||
#elif LONG_MAX == 0x7FFFFFFFL
|
||||
#define TMW_BITS_PER_LONG 32
|
||||
#else
|
||||
#define TMW_BITS_PER_LONG -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_SHRT
|
||||
#if SHRT_MAX == 0x7FL
|
||||
#define TMW_BITS_PER_SHRT 8
|
||||
#elif SHRT_MAX == 0x7FFFL
|
||||
#define TMW_BITS_PER_SHRT 16
|
||||
#elif SHRT_MAX == 0x7FFFFFFFL
|
||||
#define TMW_BITS_PER_SHRT 32
|
||||
#else
|
||||
#define TMW_BITS_PER_SHRT -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_SCHAR
|
||||
#if SCHAR_MAX == 0x7FL
|
||||
#define TMW_BITS_PER_SCHAR 8
|
||||
#elif SCHAR_MAX == 0x7FFFL
|
||||
#define TMW_BITS_PER_SCHAR 16
|
||||
#elif SCHAR_MAX == 0x7FFFFFFFL
|
||||
#define TMW_BITS_PER_SCHAR 32
|
||||
#else
|
||||
#define TMW_BITS_PER_SCHAR -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_CHAR_SIGNED
|
||||
#if SCHAR_MAX == CHAR_MAX
|
||||
#define TMW_CHAR_SIGNED 1
|
||||
#else
|
||||
#define TMW_CHAR_SIGNED 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* It is common for one or more of the integer types
|
||||
to be the same size. For example, on many embedded
|
||||
processors, both shorts and ints are 16 bits. On
|
||||
processors used for workstations, it is quite common
|
||||
for both int and long to be 32 bits.
|
||||
When there is more than one choice for typdef'ing
|
||||
a portable type like powerwindow_int16_T or powerwindow_uint32_T, in
|
||||
concept, it should not matter which choice is made.
|
||||
However, some style guides and some code checking
|
||||
tools do identify and complain about seemingly
|
||||
irrelevant differences. For example, a code
|
||||
checking tool may complain about an implicit
|
||||
conversion from int to short even though both
|
||||
are 16 bits. To reduce these types of
|
||||
complaints, it is best to make int the
|
||||
preferred choice when more than one is available.
|
||||
*/
|
||||
|
||||
#ifndef INT8_T
|
||||
#if TMW_BITS_PER_INT == 8
|
||||
#define INT8_T int
|
||||
#elif TMW_BITS_PER_LONG == 8
|
||||
#define INT8_T long
|
||||
#elif TMW_BITS_PER_SCHAR == 8
|
||||
#define INT8_T signed char
|
||||
#elif TMW_BITS_PER_SHRT == 8
|
||||
#define INT8_T short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef INT8_T
|
||||
typedef INT8_T powerwindow_int8_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT8_T
|
||||
#if TMW_BITS_PER_INT == 8
|
||||
#define UINT8_T unsigned int
|
||||
#elif TMW_BITS_PER_LONG == 8
|
||||
#define UINT8_T unsigned long
|
||||
#elif TMW_BITS_PER_SCHAR == 8
|
||||
#define UINT8_T unsigned char
|
||||
#elif TMW_BITS_PER_SHRT == 8
|
||||
#define UINT8_T unsigned short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UINT8_T
|
||||
typedef UINT8_T powerwindow_uint8_T;
|
||||
#endif
|
||||
|
||||
#ifndef INT16_T
|
||||
#if TMW_BITS_PER_INT == 16
|
||||
#define INT16_T int
|
||||
#elif TMW_BITS_PER_LONG == 16
|
||||
#define INT16_T long
|
||||
#elif TMW_BITS_PER_SCHAR == 16
|
||||
#define INT16_T signed char
|
||||
#elif TMW_BITS_PER_SHRT == 16
|
||||
#define INT16_T short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef INT16_T
|
||||
typedef INT16_T powerwindow_int16_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_T
|
||||
#if TMW_BITS_PER_INT == 16
|
||||
#define UINT16_T unsigned int
|
||||
#elif TMW_BITS_PER_LONG == 16
|
||||
#define UINT16_T unsigned long
|
||||
#elif TMW_BITS_PER_SCHAR == 16
|
||||
#define UINT16_T unsigned char
|
||||
#elif TMW_BITS_PER_SHRT == 16
|
||||
#define UINT16_T unsigned short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UINT16_T
|
||||
typedef UINT16_T powerwindow_uint16_T;
|
||||
#endif
|
||||
|
||||
#ifndef INT32_T
|
||||
#if TMW_BITS_PER_INT == 32
|
||||
#define INT32_T int
|
||||
#elif TMW_BITS_PER_LONG == 32
|
||||
#define INT32_T long
|
||||
#elif TMW_BITS_PER_SCHAR == 32
|
||||
#define INT32_T signed char
|
||||
#elif TMW_BITS_PER_SHRT == 32
|
||||
#define INT32_T short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef INT32_T
|
||||
typedef INT32_T powerwindow_int32_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_T
|
||||
#if TMW_BITS_PER_INT == 32
|
||||
#define UINT32_T unsigned int
|
||||
#elif TMW_BITS_PER_LONG == 32
|
||||
#define UINT32_T unsigned long
|
||||
#elif TMW_BITS_PER_SCHAR == 32
|
||||
#define UINT32_T unsigned char
|
||||
#elif TMW_BITS_PER_SHRT == 32
|
||||
#define UINT32_T unsigned short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UINT32_T
|
||||
typedef UINT32_T powerwindow_uint32_T;
|
||||
#endif
|
||||
|
||||
/* The following is used to emulate smaller integer types when only
|
||||
larger types are available. For example, compilers for TI C3x/C4x DSPs
|
||||
define char and short to be 32 bits, so 8 and 16 bits are not directly
|
||||
available. This target is commonly used with RTW rapid prototyping.
|
||||
Other DSPs define char to be 16 bits, so 8 bits is not directly
|
||||
available.
|
||||
*/
|
||||
#ifndef INT8_T
|
||||
#ifdef INT16_T
|
||||
#define INT8_T INT16_T
|
||||
typedef INT8_T powerwindow_int8_T;
|
||||
#else
|
||||
#ifdef INT32_T
|
||||
#define INT8_T INT32_T
|
||||
typedef INT8_T powerwindow_int8_T;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT8_T
|
||||
#ifdef UINT16_T
|
||||
#define UINT8_T UINT16_T
|
||||
typedef UINT8_T powerwindow_uint8_T;
|
||||
#else
|
||||
#ifdef UINT32_T
|
||||
#define UINT8_T UINT32_T
|
||||
typedef UINT8_T powerwindow_uint8_T;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INT16_T
|
||||
#ifdef INT32_T
|
||||
#define INT16_T INT32_T
|
||||
typedef INT16_T powerwindow_int16_T;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_T
|
||||
#ifdef UINT32_T
|
||||
#define UINT16_T UINT32_T
|
||||
typedef UINT16_T powerwindow_uint16_T;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef REAL32_T
|
||||
#ifndef __MWERKS__
|
||||
#if FLT_MANT_DIG >= 23
|
||||
#define REAL32_T float
|
||||
#endif
|
||||
#else
|
||||
#define REAL32_T float
|
||||
#endif
|
||||
#endif
|
||||
#ifdef REAL32_T
|
||||
typedef REAL32_T powerwindow_real32_T;
|
||||
#endif
|
||||
|
||||
#ifndef REAL64_T
|
||||
#ifndef __MWERKS__
|
||||
#if DBL_MANT_DIG >= 52
|
||||
#define REAL64_T double
|
||||
#endif
|
||||
#else
|
||||
#define REAL64_T double
|
||||
#endif
|
||||
#endif
|
||||
#ifdef REAL64_T
|
||||
typedef REAL64_T powerwindow_real64_T;
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS*/
|
||||
|
||||
/*=======================================================================*
|
||||
Fixed width word size data types:
|
||||
powerwindow_int64_T - signed 64 bit integers
|
||||
powerwindow_uint64_T - unsigned 64 bit integers
|
||||
=======================================================================*/
|
||||
|
||||
#ifndef INT64_T
|
||||
#if defined(__APPLE__)
|
||||
#define INT64_T long long
|
||||
#define FMT64 "ll"
|
||||
#if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
|
||||
#define INT_TYPE_64_IS_LONG
|
||||
#endif
|
||||
#elif defined(__x86_64__) || defined(__LP64__)
|
||||
#define INT64_T long
|
||||
#define FMT64 "l"
|
||||
#if !defined(INT_TYPE_64_IS_LONG)
|
||||
#define INT_TYPE_64_IS_LONG
|
||||
#endif
|
||||
#elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) || \
|
||||
(defined(__WATCOMC__) && __WATCOMC__ >= 1100)
|
||||
#define INT64_T __int64
|
||||
#define FMT64 "I64"
|
||||
#elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) || defined(__LCC64__)
|
||||
#define INT64_T long long
|
||||
#define FMT64 "ll"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(INT64_T)
|
||||
#if defined(__GNUC__) && \
|
||||
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
|
||||
__extension__
|
||||
#endif
|
||||
typedef INT64_T powerwindow_int64_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT64_T
|
||||
#if defined(__APPLE__)
|
||||
#define UINT64_T unsigned long long
|
||||
#define FMT64 "ll"
|
||||
#if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
|
||||
#define INT_TYPE_64_IS_LONG
|
||||
#endif
|
||||
#elif defined(__x86_64__) || defined(__LP64__)
|
||||
#define UINT64_T unsigned long
|
||||
#define FMT64 "l"
|
||||
#if !defined(INT_TYPE_64_IS_LONG)
|
||||
#define INT_TYPE_64_IS_LONG
|
||||
#endif
|
||||
#elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) || \
|
||||
(defined(__WATCOMC__) && __WATCOMC__ >= 1100)
|
||||
#define UINT64_T unsigned __int64
|
||||
#define FMT64 "I64"
|
||||
#elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) || defined(__LCC64__)
|
||||
#define UINT64_T unsigned long long
|
||||
#define FMT64 "ll"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64) || (defined(__APPLE__) && defined(__LP64__)) || \
|
||||
defined(__x86_64__) || defined(__LP64__)
|
||||
#define INT_TYPE_64_IS_SUPPORTED
|
||||
#endif
|
||||
|
||||
#if defined(UINT64_T)
|
||||
#if defined(__GNUC__) && \
|
||||
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
|
||||
__extension__
|
||||
#endif
|
||||
typedef UINT64_T powerwindow_uint64_T;
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
Format string modifiers for using powerwindow_size_t variables in printf
|
||||
statements.
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef FMT_SIZE_T
|
||||
#if defined(__GNUC__) || defined(_STDC_C99)
|
||||
#define FMT_SIZE_T "z"
|
||||
#elif defined(__WATCOMC__)
|
||||
#define FMT_SIZE_T "l"
|
||||
#elif defined(_WIN32)
|
||||
#define FMT_SIZE_T "I"
|
||||
#else
|
||||
#define FMT_SIZE_T "l"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef FMT_PTRDIFF_T
|
||||
#if defined(__APPLE__)
|
||||
#define FMT_PTRDIFF_T "l"
|
||||
#elif defined(__GNUC__) || defined(_STDC_C99)
|
||||
#define FMT_PTRDIFF_T "t"
|
||||
#elif defined(__WATCOMC__)
|
||||
#define FMT_PTRDIFF_T "l"
|
||||
#elif defined(_WIN32)
|
||||
#define FMT_PTRDIFF_T "I"
|
||||
#else
|
||||
#define FMT_PTRDIFF_T "l"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
General or logical data types where the word size is not guaranteed.
|
||||
powerwindow_real_T - possible settings include powerwindow_real32_T or
|
||||
powerwindow_real64_T powerwindow_time_T - possible settings include
|
||||
powerwindow_real64_T or powerwindow_uint32_T powerwindow_boolean_T
|
||||
powerwindow_char_T
|
||||
powerwindow_int_T
|
||||
powerwindow_uint_T
|
||||
powerwindow_byte_T
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef REAL_T
|
||||
#ifdef REAL64_T
|
||||
#define REAL_T powerwindow_real64_T
|
||||
#else
|
||||
#ifdef REAL32_T
|
||||
#define REAL_T powerwindow_real32_T
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifdef REAL_T
|
||||
typedef REAL_T powerwindow_real_T;
|
||||
#endif
|
||||
|
||||
#ifndef TIME_T
|
||||
#ifdef REAL_T
|
||||
#define TIME_T powerwindow_real_T
|
||||
#endif
|
||||
#endif
|
||||
#ifdef TIME_T
|
||||
typedef TIME_T powerwindow_time_T;
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS */
|
||||
|
||||
#ifndef BOOLEAN_T
|
||||
#if defined(UINT8_T)
|
||||
#define BOOLEAN_T UINT8_T
|
||||
#else
|
||||
#define BOOLEAN_T unsigned int
|
||||
#endif
|
||||
#endif
|
||||
typedef BOOLEAN_T powerwindow_boolean_T;
|
||||
|
||||
#ifndef CHARACTER_T
|
||||
#define CHARACTER_T char
|
||||
#endif
|
||||
typedef CHARACTER_T powerwindow_char_T;
|
||||
|
||||
#ifndef INTEGER_T
|
||||
#define INTEGER_T int
|
||||
#endif
|
||||
typedef INTEGER_T powerwindow_int_T;
|
||||
|
||||
#ifndef UINTEGER_T
|
||||
#define UINTEGER_T unsigned
|
||||
#endif
|
||||
typedef UINTEGER_T powerwindow_uint_T;
|
||||
|
||||
#ifndef BYTE_T
|
||||
#define BYTE_T unsigned char
|
||||
#endif
|
||||
typedef BYTE_T powerwindow_byte_T;
|
||||
|
||||
/*===========================================================================*
|
||||
Define Complex Structures
|
||||
===========================================================================*/
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef CREAL32_T
|
||||
#ifdef REAL32_T
|
||||
typedef struct {
|
||||
powerwindow_real32_T re, im;
|
||||
} powerwindow_creal32_T;
|
||||
#define CREAL32_T creal32_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CREAL64_T
|
||||
#ifdef REAL64_T
|
||||
typedef struct {
|
||||
powerwindow_real64_T re, im;
|
||||
} powerwindow_creal64_T;
|
||||
#define CREAL64_T powerwindow_creal64_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CREAL_T
|
||||
#ifdef REAL_T
|
||||
typedef struct {
|
||||
powerwindow_real_T re, im;
|
||||
} powerwindow_creal_T;
|
||||
#define CREAL_T powerwindow_creal_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS */
|
||||
|
||||
#ifndef CINT8_T
|
||||
#ifdef INT8_T
|
||||
typedef struct {
|
||||
powerwindow_int8_T re, im;
|
||||
} powerwindow_cint8_T;
|
||||
#define CINT8_T powerwindow_cint8_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT8_T
|
||||
#ifdef UINT8_T
|
||||
typedef struct {
|
||||
powerwindow_uint8_T re, im;
|
||||
} powerwindow_cuint8_T;
|
||||
#define CUINT8_T powerwindow_cuint8_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT16_T
|
||||
#ifdef INT16_T
|
||||
typedef struct {
|
||||
powerwindow_int16_T re, im;
|
||||
} powerwindow_cint16_T;
|
||||
#define CINT16_T powerwindow_cint16_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT16_T
|
||||
#ifdef UINT16_T
|
||||
typedef struct {
|
||||
powerwindow_uint16_T re, im;
|
||||
} powerwindow_cuint16_T;
|
||||
#define CUINT16_T powerwindow_cuint16_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT32_T
|
||||
#ifdef INT32_T
|
||||
typedef struct {
|
||||
powerwindow_int32_T re, im;
|
||||
} powerwindow_cint32_T;
|
||||
#define CINT32_T powerwindow_cint32_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT32_T
|
||||
#ifdef UINT32_T
|
||||
typedef struct {
|
||||
powerwindow_uint32_T re, im;
|
||||
} powerwindow_cuint32_T;
|
||||
#define CUINT32_T powerwindow_cuint32_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT64_T
|
||||
#ifdef INT64_T
|
||||
typedef struct {
|
||||
powerwindow_int64_T re, im;
|
||||
} powerwindow_cint64_T;
|
||||
#define CINT64_T powerwindow_cint64_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT64_T
|
||||
#ifdef UINT64_T
|
||||
typedef struct {
|
||||
powerwindow_uint64_T re, im;
|
||||
} powerwindow_cuint64_T;
|
||||
#define CUINT64_T powerwindow_cuint64_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*=======================================================================*
|
||||
Min and Max:
|
||||
powerwindow_int8_T, powerwindow_int16_T, powerwindow_int32_T - signed
|
||||
8, 16, or 32 bit integers powerwindow_uint8_T, powerwindow_uint16_T,
|
||||
powerwindow_uint32_T - unsigned 8, 16, or 32 bit integers
|
||||
=======================================================================*/
|
||||
|
||||
#define powerwindow_MAX_int8_T ((powerwindow_int8_T) (127)) /* 127 */
|
||||
#define powerwindow_MIN_int8_T ((powerwindow_int8_T) (-128)) /* -128 */
|
||||
#define powerwindow_MAX_uint8_T ((powerwindow_uint8_T) (255)) /* 255 */
|
||||
#define powerwindow_MIN_uint8_T ((powerwindow_uint8_T) (0))
|
||||
|
||||
#define powerwindow_MAX_int16_T ((powerwindow_int16_T) (32767)) /* 32767 */
|
||||
#define powerwindow_MIN_int16_T ((powerwindow_int16_T) (-32768)) /* -32768 */
|
||||
#define powerwindow_MAX_uint16_T ((powerwindow_uint16_T) (65535)) /* 65535 */
|
||||
#define powerwindow_MIN_uint16_T ((powerwindow_uint16_T) (0))
|
||||
|
||||
#define powerwindow_MAX_int32_T \
|
||||
((powerwindow_int32_T) (2147483647)) /* 2147483647 */
|
||||
#define powerwindow_MIN_int32_T \
|
||||
((powerwindow_int32_T) (-2147483647 - 1)) /* -2147483648 */
|
||||
#define powerwindow_MAX_uint32_T \
|
||||
((powerwindow_uint32_T) (0xFFFFFFFFU)) /* 4294967295 */
|
||||
#define powerwindow_MIN_uint32_T ((powerwindow_uint32_T) (0))
|
||||
|
||||
#if defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) || \
|
||||
(defined(__WATCOMC__) && __WATCOMC__ >= 1100) || defined(__LCC64__)
|
||||
#ifdef INT64_T
|
||||
#define powerwindow_MAX_int64_T ((powerwindow_int64_T) (9223372036854775807LL))
|
||||
#define powerwindow_MIN_int64_T \
|
||||
((powerwindow_int64_T) (-9223372036854775807LL - 1LL))
|
||||
#endif
|
||||
#ifdef UINT64_T
|
||||
#define powerwindow_MAX_uint64_T \
|
||||
((powerwindow_uint64_T) (0xFFFFFFFFFFFFFFFFULL))
|
||||
#define powerwindow_MIN_uint64_T ((powerwindow_uint64_T) (0))
|
||||
#endif
|
||||
#else
|
||||
#ifdef INT64_T
|
||||
#ifdef INT_TYPE_64_IS_LONG
|
||||
#define powerwindow_MAX_int64_T ((powerwindow_int64_T) (9223372036854775807L))
|
||||
#define powerwindow_MIN_int64_T \
|
||||
((powerwindow_int64_T) (-9223372036854775807L - 1L))
|
||||
#else
|
||||
#define powerwindow_MAX_int64_T ((powerwindow_int64_T) (9223372036854775807LL))
|
||||
#define powerwindow_MIN_int64_T \
|
||||
((powerwindow_int64_T) (-9223372036854775807LL - 1LL))
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UINT64_T
|
||||
#ifdef INT_TYPE_64_IS_LONG
|
||||
#define powerwindow_MAX_uint64_T ((powerwindow_uint64_T) (0xFFFFFFFFFFFFFFFFUL))
|
||||
#define powerwindow_MIN_uint64_T ((powerwindow_uint64_T) (0))
|
||||
#else
|
||||
#define powerwindow_MAX_uint64_T \
|
||||
((powerwindow_uint64_T) (0xFFFFFFFFFFFFFFFFULL))
|
||||
#define powerwindow_MIN_uint64_T ((powerwindow_uint64_T) (0))
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* Conversion from unsigned __int64 to double is not implemented in windows
|
||||
and results in a compile error, thus the value must first be cast to
|
||||
signed __int64, and then to double.
|
||||
|
||||
If the 64 bit int value is greater than 2^63-1, which is the signed int64
|
||||
max, the macro below provides a workaround for casting a uint64 value to a
|
||||
double in windows.
|
||||
*/
|
||||
#define uint64_to_double(u) \
|
||||
(((u) > _I64_MAX) \
|
||||
? (double) (__int64) ((u) - _I64_MAX - 1) + (double) _I64_MAX + 1 \
|
||||
: (double) (__int64) (u))
|
||||
|
||||
/* The following inline function should only be used in the macro
|
||||
double_to_uint64, as it only handles the specfic range of double between 2^63
|
||||
and 2^64-1 */
|
||||
__forceinline powerwindow_uint64_T double_to_uint64_helpe
|
||||
r(double d) {
|
||||
union double_to_uint64_union_type {
|
||||
double dd;
|
||||
powerwindow_uint64_T i64;
|
||||
} di;
|
||||
di.dd = d;
|
||||
return (((di.i64 & 0x000fffffffffffff) | 0x0010000000000000) << 11);
|
||||
}
|
||||
|
||||
/* The largest double value that can be cast to uint64 in windows is the
|
||||
signed int64 max, which is 2^63-1. The macro below provides
|
||||
a workaround for casting large double values to uint64 in windows.
|
||||
*/
|
||||
/* The magic number 18446744073709551616.0 is 2^64 */
|
||||
/* The magic number 9223372036854775808.0 is 2^63 */
|
||||
#define double_to_uint64(d) \
|
||||
(((d) >= 18446744073709551616.0) ? 0xffffffffffffffffULL \
|
||||
: ((d) < 0.0) ? 0ULL \
|
||||
: ((d) >= 9223372036854775808.0) ? double_to_uint64_helper(d) \
|
||||
: (unsigned __int64) (d))
|
||||
#else
|
||||
#define uint64_to_double(u) ((double) (u))
|
||||
#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__TICCSC__)
|
||||
/* double_to_uint64 defined only for MSVC and UNIX */
|
||||
#else
|
||||
#define double_to_uint64(d) \
|
||||
(((d) > 0xffffffffffffffffULL) \
|
||||
? (unsigned long long) 0xffffffffffffffffULL \
|
||||
: ((d) < 0) ? (unsigned long long) 0 \
|
||||
: (unsigned long long) (d))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
|
||||
|
||||
#ifndef _bool_T
|
||||
#define _bool_T
|
||||
|
||||
typedef powerwindow_boolean_T bool;
|
||||
|
||||
#ifndef false
|
||||
#define false (0)
|
||||
#endif
|
||||
#ifndef true
|
||||
#define true (1)
|
||||
#endif
|
||||
|
||||
#endif /* _bool_T */
|
||||
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
/*
|
||||
This software assumes that the code is being compiled on a target using a
|
||||
2's complement representation for signed integer values.
|
||||
*/
|
||||
#if ((SCHAR_MIN + 1) != -SCHAR_MAX)
|
||||
#error \
|
||||
"This code must be compiled using a 2's complement representation for signed integer values"
|
||||
#endif
|
||||
|
||||
/*
|
||||
Maximum length of a MATLAB identifier (function/variable/model)
|
||||
including the null-termination character.
|
||||
*/
|
||||
#define TMW_NAME_LENGTH_MAX 64
|
||||
|
||||
#ifdef MX_COMPAT_32
|
||||
typedef int powerwindow_mwSize;
|
||||
typedef int powerwindow_mwIndex;
|
||||
typedef int powerwindow_mwSignedIndex;
|
||||
#else
|
||||
typedef size_t powerwindow_mwSize; /* unsigned pointer-width integer */
|
||||
typedef size_t powerwindow_mwIndex; /* unsigned pointer-width integer */
|
||||
typedef ptrdiff_t
|
||||
powerwindow_mwSignedIndex; /* a signed pointer-width integer */
|
||||
#endif
|
||||
|
||||
#if (defined(_LP64) || defined(_WIN64)) && !defined(MX_COMPAT_32)
|
||||
/* Currently 2^48 based on hardware limitations */
|
||||
#define powerwindow_MWSIZE_MAX 281474976710655UL
|
||||
#define powerwindow_MWINDEX_MAX 281474976710655UL
|
||||
#define powerwindow_MWSINDEX_MAX 281474976710655L
|
||||
#define powerwindow_MWSINDEX_MIN -281474976710655L
|
||||
#else
|
||||
#define powerwindow_MWSIZE_MAX 2147483647UL
|
||||
#define powerwindow_MWINDEX_MAX 2147483647UL
|
||||
#define powerwindow_MWSINDEX_MAX 2147483647L
|
||||
#define powerwindow_MWSINDEX_MIN -2147483647L
|
||||
#endif
|
||||
#define powerwindow_MWSIZE_MIN 0UL
|
||||
#define powerwindow_MWINDEX_MIN 0UL
|
||||
|
||||
/** UTF-16 character type */
|
||||
|
||||
#if (defined(__cplusplus) && (__cplusplus >= 201103L)) || \
|
||||
(defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && \
|
||||
_HAS_CHAR16_T_LANGUAGE_SUPPORT)
|
||||
typedef char16_t powerwindow_CHAR16_T;
|
||||
#elif defined(_MSC_VER)
|
||||
typedef wchar_t powerwindow_CHAR16_T;
|
||||
#else
|
||||
typedef UINT16_T powerwindow_CHAR16_T;
|
||||
#endif
|
||||
|
||||
#endif /* powerwindow__TMWTYPES__ */
|
||||
|
||||
#endif /* powerwindow_tmwtypes_h */
|
||||
@ -0,0 +1,16 @@
|
||||
#include "wcclib.h"
|
||||
|
||||
// Wasm loop bounds
|
||||
|
||||
__attribute__((import_module("__pragma"), import_name("loopbound"))) extern void
|
||||
__pragma_loopbound(unsigned int min_bound, unsigned int max_bound);
|
||||
|
||||
void *
|
||||
wcclib_memset(void *s, int c, size_t n) {
|
||||
unsigned char *p = s;
|
||||
|
||||
__pragma_loopbound(1, 368);
|
||||
while (n--)
|
||||
*p++ = (unsigned char) c;
|
||||
return (s);
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
|
||||
#ifndef _WCCLIB
|
||||
#define _WCCLIB
|
||||
|
||||
#define size_t unsigned long
|
||||
#define int32_t int
|
||||
#define uint32_t unsigned int
|
||||
#define u_int16_t unsigned short
|
||||
#define u_int32_t unsigned int
|
||||
|
||||
#define NULL ((void *) 0)
|
||||
|
||||
void *wcclib_memset(void *s, int c, size_t n);
|
||||
|
||||
#endif // _WCCLIB
|
||||
@ -0,0 +1,819 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: powerwindow implement the powerwindow that can be seen in cars
|
||||
nowadays. The window can be controlled by either driver or passenger. When an
|
||||
object is detected between the window frame and the glass during the raising
|
||||
of the glass, the glass will lower down for some distance. This benchmark
|
||||
contains 4 tasks which includes the driver side powerwindow, front passenger
|
||||
side powerwindow, back-left passenger side powerwindow, back-right passenger
|
||||
side powerwindow. These 4 tasks can be easily adjusted to execute in
|
||||
sequential order parallel on single or muti core.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
* 2023-12-07: Added loop bounds
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_DRV.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_controlexclusion.h" /* Control Model's header file */
|
||||
#include "powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_powerwindow_control.h" /* PW passenger control Model's header file */
|
||||
#include "powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
// Wasm loop bounds
|
||||
|
||||
|
||||
#include "powerwindow_PW_Control_DRV.c"
|
||||
#include "powerwindow_PW_Control_PSG_BackL.c"
|
||||
#include "powerwindow_PW_Control_PSG_BackR.c"
|
||||
#include "powerwindow_PW_Control_PSG_Front.c"
|
||||
#include "powerwindow_const_params.c"
|
||||
#include "powerwindow_controlexclusion.c"
|
||||
#include "powerwindow_debounce.c"
|
||||
#include "powerwindow_inputs.c"
|
||||
#include "powerwindow_powerwindow_control.c"
|
||||
#include "wcclib.c"
|
||||
|
||||
|
||||
__attribute__((import_module("__pragma"), import_name("loopbound"))) extern void
|
||||
__pragma_loopbound(unsigned int min_bound, unsigned int max_bound);
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_Booleaninputarray_initialize(powerwindow_boolean_T *,
|
||||
powerwindow_boolean_T *);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_Uint8inputarray_initialize(powerwindow_uint8_T *,
|
||||
powerwindow_uint8_T *);
|
||||
__attribute__((always_inline)) static inline void powerwindow_init();
|
||||
__attribute__((noinline)) __attribute__((export_name("entrypoint")))
|
||||
__attribute__((noinline)) __attribute__((export_name("entrypoint"))) void
|
||||
powerwindow_main();
|
||||
__attribute__((always_inline)) static inline int powerwindow_return();
|
||||
__attribute__((noinline)) __attribute__((export_name("main")))
|
||||
__attribute__((noinline)) __attribute__((export_name("main"))) int
|
||||
main(void);
|
||||
|
||||
// DRV
|
||||
__attribute__((always_inline)) static inline void powerwindow_init_DRV(int);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_input_initialize_DRV(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_initialize_DRV(void);
|
||||
__attribute__((always_inline)) static inline void powerwindow_return_DRV(void);
|
||||
__attribute__((always_inline)) static inline void powerwindow_DRV_main(void);
|
||||
|
||||
// PSG_Front
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_init_PSG_Front(int);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_input_initialize_PSG_Front(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_initialize_PSG_Front(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_return_PSG_Front(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PSG_Front_main(void);
|
||||
|
||||
// PSG_BackL
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_init_PSG_BackL(int);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_input_initialize_PSG_BackL(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_initialize_PSG_BackL(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_return_PSG_BackL(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PSG_BackL_main(void);
|
||||
|
||||
// PSG_BackR
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_init_PSG_BackR(int);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_input_initialize_PSG_BackR(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_initialize_PSG_BackR(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_return_PSG_BackR(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PSG_BackR_main(void);
|
||||
|
||||
/*
|
||||
Declaration of global variables
|
||||
*/
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
|
||||
extern powerwindow_ExternalInputs_powerwindow_PW_C powerwindow_PW_Control_DRV_U;
|
||||
extern powerwindow_ExternalOutputs_powerwindow_PW_ powerwindow_PW_Control_DRV_Y;
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_U;
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_U;
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_U;
|
||||
|
||||
powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_Front_U_Up_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_Front_U_Down_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_BackL_U_Up_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_BackL_U_Down_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_BackR_U_Up_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_Driver_BackR_U_Down_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_DRV
|
||||
[powerwindow_input_length];
|
||||
powerwindow_uint8_T powerwindow_powerwindow_control_U_currentsense_Input_DRV
|
||||
[powerwindow_input_length];
|
||||
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_Front_U_Up_Input_Front_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_Front_U_Down_Input_Front_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_BackL_U_Up_Input_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_BackR_U_Up_Input_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_Driver_BackR_U_Down_Input_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_DRV_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_uint8_T
|
||||
powerwindow_powerwindow_control_U_currentsense_DRV_Array
|
||||
[powerwindow_input_length];
|
||||
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Up_DRV_Input_Front
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. */
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Down_DRV_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_Front_U_Up_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_Front_U_Down_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_Front
|
||||
[powerwindow_input_length];
|
||||
powerwindow_uint8_T powerwindow_powerwindow_control_U_currentsense_Input_Front
|
||||
[powerwindow_input_length];
|
||||
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_Front_U_Up_Front_Array
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the
|
||||
signal is high when the button is not
|
||||
pressed. */
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_Front_U_Down_Front_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Front_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_uint8_T
|
||||
powerwindow_powerwindow_control_U_currentsense_Front_Array
|
||||
[powerwindow_input_length];
|
||||
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Up_DRV_Input_BackL
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. */
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Down_DRV_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_BackL_U_Up_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_BackL_U_Down_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
powerwindow_uint8_T powerwindow_powerwindow_control_U_currentsense_Input_BackL
|
||||
[powerwindow_input_length];
|
||||
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_BackL_U_Up_BackL_Array
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the
|
||||
signal is high when the button is not
|
||||
pressed. */
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_BackL_U_Down_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_uint8_T
|
||||
powerwindow_powerwindow_control_U_currentsense_BackL_Array
|
||||
[powerwindow_input_length];
|
||||
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Up_DRV_Input_BackR
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. */
|
||||
powerwindow_boolean_T powerwindow_controlexclusion_U_Down_DRV_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_BackR_U_Up_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T powerwindow_debounce_passenger_BackR_U_Down_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
powerwindow_uint8_T powerwindow_powerwindow_control_U_currentsense_Input_BackR
|
||||
[powerwindow_input_length];
|
||||
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_BackR_U_Up_BackR_Array
|
||||
[powerwindow_input_length]; /* Here applied a push-down button, the
|
||||
signal is high when the button is not
|
||||
pressed. */
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_debounce_passenger_BackR_U_Down_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_boolean_T
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
extern powerwindow_uint8_T
|
||||
powerwindow_powerwindow_control_U_currentsense_BackR_Array
|
||||
[powerwindow_input_length];
|
||||
|
||||
int powerwindow_main_inputcyclecounter;
|
||||
|
||||
/*
|
||||
Initialization- and return-value-related functions
|
||||
*/
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_init_DRV(int i) {
|
||||
powerwindow_PW_Control_DRV_U.In1 =
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_DRV
|
||||
[i]; /* The when the window reaches the end of the range, the
|
||||
endofdetectionrange changes to 0. */
|
||||
powerwindow_PW_Control_DRV_U.In3 =
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_DRV
|
||||
[i]; /* When the currentsense is higher than 92 (based on
|
||||
experiments), one object is stuck between the window and the
|
||||
frame. Pinch is set to True.*/
|
||||
|
||||
powerwindow_PW_Control_DRV_U.In2 =
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_DRV_U.In4 =
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
|
||||
powerwindow_PW_Control_DRV_U.In5 =
|
||||
powerwindow_debounce_Driver_Front_U_Up_Input_Front
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_DRV_U.In6 =
|
||||
powerwindow_debounce_Driver_Front_U_Down_Input_Front
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
|
||||
powerwindow_PW_Control_DRV_U.In9 =
|
||||
powerwindow_debounce_Driver_BackL_U_Up_Input_BackL
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_DRV_U.In10 =
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
|
||||
powerwindow_PW_Control_DRV_U.In7 =
|
||||
powerwindow_debounce_Driver_BackR_U_Up_Input_BackR
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_DRV_U.In8 =
|
||||
powerwindow_debounce_Driver_BackR_U_Down_Input_BackR
|
||||
[i]; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_init_PSG_Front(int i) {
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_U.Up_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out6; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_PSG_Front_U.Down_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out7; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lower the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_U.Up_PSG_Front =
|
||||
powerwindow_debounce_passenger_Front_U_Up_Input_Front[i];
|
||||
powerwindow_PW_Control_PSG_Front_U.Down_PSG_Front =
|
||||
powerwindow_debounce_passenger_Front_U_Down_Input_Front
|
||||
[i]; /* '<Root>/Down'. Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. Change to 0 to lower
|
||||
the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_U.endofdetectionrange =
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_Front
|
||||
[i]; /* The when the window reaches the end of the range, the
|
||||
endofdetectionrange changes to 0. */
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_U.currentsense =
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_Front
|
||||
[i]; /* When the currentsense is higher than 92 (based on
|
||||
experiments), one object is stuck between the window and the
|
||||
frame. Pinch is set to True.*/
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_init_PSG_BackL(int i) {
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_U.Up_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out10; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_PSG_BackL_U.Down_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out11; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lower the window.
|
||||
*/
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_U.Up_PSG_BackL =
|
||||
powerwindow_debounce_passenger_BackL_U_Up_Input_BackL[i];
|
||||
powerwindow_PW_Control_PSG_BackL_U.Down_PSG_BackL =
|
||||
powerwindow_debounce_passenger_BackL_U_Down_Input_BackL
|
||||
[i]; /* '<Root>/Down'. Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. Change to 0 to lower
|
||||
the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_U.endofdetectionrange =
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackL
|
||||
[i]; /* The when the window reaches the end of the range, the
|
||||
endofdetectionrange changes to 0. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_U.currentsense =
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_BackL
|
||||
[i]; /* When the currentsense is higher than 92 (based on
|
||||
experiments), one object is stuck between the window and the
|
||||
frame. Pinch is set to True.*/
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_init_PSG_BackR(int i) {
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_U.Up_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out8; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lift the window. */
|
||||
powerwindow_PW_Control_PSG_BackR_U.Down_DRV =
|
||||
powerwindow_PW_Control_DRV_Y
|
||||
.Out9; /* The debounced control signal from the driver. 1 when the
|
||||
button is not pressed, change to 0 to lower the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_U.Up_PSG_BackR =
|
||||
powerwindow_debounce_passenger_BackR_U_Up_Input_BackR[i];
|
||||
powerwindow_PW_Control_PSG_BackR_U.Down_PSG_BackR =
|
||||
powerwindow_debounce_passenger_BackR_U_Down_Input_BackR
|
||||
[i]; /* '<Root>/Down'. Here applied a push-down button, the signal
|
||||
is high when the button is not pressed. Change to 0 to lower
|
||||
the window. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_U.endofdetectionrange =
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackR
|
||||
[i]; /* The when the window reaches the end of the range, the
|
||||
endofdetectionrange changes to 0. */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_U.currentsense =
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_BackR
|
||||
[i]; /* When the currentsense is higher than 92 (based on
|
||||
experiments), one object is stuck between the window and the
|
||||
frame. Pinch is set to True.*/
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_input_initialize_DRV(void) {
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV,
|
||||
powerwindow_debounce_Driver_DRV_U_Up_Input_DRV_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV,
|
||||
powerwindow_debounce_Driver_DRV_U_Down_Input_DRV_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_Front_U_Up_Input_Front,
|
||||
powerwindow_debounce_Driver_Front_U_Up_Input_Front_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_Front_U_Down_Input_Front,
|
||||
powerwindow_debounce_Driver_Front_U_Down_Input_Front_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_BackL_U_Up_Input_BackL,
|
||||
powerwindow_debounce_Driver_BackL_U_Up_Input_BackL_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL,
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_BackL_U_Down_Input_BackL,
|
||||
powerwindow_debounce_Driver_BackR_U_Up_Input_BackR_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_Driver_BackR_U_Down_Input_BackR,
|
||||
powerwindow_debounce_Driver_BackR_U_Down_Input_BackR_Array);
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_DRV,
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_DRV_Array);
|
||||
powerwindow_Uint8inputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_currentsense_DRV_Array,
|
||||
powerwindow_powerwindow_control_U_currentsense_DRV_Array);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_input_initialize_PSG_Front(void) {
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_Front_U_Up_Input_Front,
|
||||
powerwindow_debounce_passenger_Front_U_Up_Front_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_Front_U_Down_Input_Front,
|
||||
powerwindow_debounce_passenger_Front_U_Down_Front_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_Front,
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Front_Array);
|
||||
|
||||
powerwindow_Uint8inputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_Front,
|
||||
powerwindow_powerwindow_control_U_currentsense_Front_Array);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_input_initialize_PSG_BackL(void) {
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_BackL_U_Up_Input_BackL,
|
||||
powerwindow_debounce_passenger_BackL_U_Up_BackL_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_BackL_U_Down_Input_BackL,
|
||||
powerwindow_debounce_passenger_BackL_U_Down_BackL_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackL,
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_BackL_Array);
|
||||
|
||||
powerwindow_Uint8inputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_BackL,
|
||||
powerwindow_powerwindow_control_U_currentsense_BackL_Array);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_input_initialize_PSG_BackR(void) {
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_BackR_U_Up_Input_BackR,
|
||||
powerwindow_debounce_passenger_BackR_U_Up_BackR_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_debounce_passenger_BackR_U_Down_Input_BackR,
|
||||
powerwindow_debounce_passenger_BackR_U_Down_BackR_Array);
|
||||
|
||||
powerwindow_Booleaninputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_Input_BackR,
|
||||
powerwindow_powerwindow_control_U_endofdetectionrange_BackR_Array);
|
||||
|
||||
powerwindow_Uint8inputarray_initialize(
|
||||
powerwindow_powerwindow_control_U_currentsense_Input_BackR,
|
||||
powerwindow_powerwindow_control_U_currentsense_BackR_Array);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_Booleaninputarray_initialize(powerwindow_boolean_T *arrayA,
|
||||
powerwindow_boolean_T *arrayB) {
|
||||
|
||||
register int i;
|
||||
__pragma_loopbound(977, 977);
|
||||
for (i = 0; i < powerwindow_input_length; i++)
|
||||
arrayA[i] = arrayB[i];
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_Uint8inputarray_initialize(powerwindow_uint8_T *arrayA,
|
||||
powerwindow_uint8_T *arrayB) {
|
||||
|
||||
register int i;
|
||||
__pragma_loopbound(977, 977);
|
||||
for (i = 0; i < powerwindow_input_length; i++)
|
||||
arrayA[i] = arrayB[i];
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_initialize_DRV(void) {
|
||||
/* Initialize model */
|
||||
powerwindow_PW_Control_DRV_initialize();
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_initialize_PSG_Front(void) {
|
||||
/* Initialize model */
|
||||
powerwindow_PW_Control_PSG_Front_initialize();
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_initialize_PSG_BackL(void) {
|
||||
/* Initialize model */
|
||||
powerwindow_PW_Control_PSG_BackL_initialize();
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_initialize_PSG_BackR(void) {
|
||||
/* Initialize model */
|
||||
powerwindow_PW_Control_PSG_BackR_initialize();
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_return_DRV(void) {
|
||||
/* Terminate model */
|
||||
powerwindow_PW_Control_DRV_terminate();
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_return_PSG_Front(void) {
|
||||
/* Terminate model */
|
||||
powerwindow_PW_Control_PSG_Front_terminate();
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_return_PSG_BackL(void) {
|
||||
/* Terminate model */
|
||||
powerwindow_PW_Control_PSG_BackL_terminate();
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_return_PSG_BackR(void) {
|
||||
/* Terminate model */
|
||||
powerwindow_PW_Control_PSG_BackR_terminate();
|
||||
}
|
||||
|
||||
/*
|
||||
Main functions
|
||||
*/
|
||||
|
||||
/*
|
||||
Associating powerwindow_main with a real-time clock or interrupt service
|
||||
routine is what makes the generated code "real-time". The function
|
||||
powerwindow_main is always associated with the base rate of the model.
|
||||
Subrates are managed by the base rate from inside the generated code.
|
||||
Enabling/disabling interrupts and floating point context switches are target
|
||||
specific. This example code indicates where these should take place relative
|
||||
to executing the generated code step function. Overrun behavior should be
|
||||
tailored to your application needs. This example simply sets an error status
|
||||
in the real-time model and returns from powerwindow_main.
|
||||
*/
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_DRV_main(void) {
|
||||
|
||||
static powerwindow_boolean_T OverrunFlag = 0;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
powerwindow_PW_DRV_rtmSetErrorStatus(powerwindow_PW_Control_DRV_M,
|
||||
"Overrun"); //////////
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
powerwindow_PW_Control_DRV_main();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
/*
|
||||
The example "main" function illustrates what is required by your
|
||||
application code to initialize, execute, and terminate the generated code.
|
||||
Attaching powerwindow_main to a real-time clock is target specific. This
|
||||
example illustates how you do this relative to initializing the model.
|
||||
*/
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PSG_Front_main(void) {
|
||||
|
||||
static powerwindow_boolean_T OverrunFlag = 0;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
powerwindow_PW_PSG_Front_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_Front_M, "Overrun");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
powerwindow_PW_Control_PSG_Front_main();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PSG_BackL_main(void) {
|
||||
|
||||
static powerwindow_boolean_T OverrunFlag = 0;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
powerwindow_PW_PSG_BackL_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_BackL_M, "Overrun");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackL_main();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PSG_BackR_main(void) {
|
||||
|
||||
static powerwindow_boolean_T OverrunFlag = 0;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
powerwindow_PW_PSG_BackR_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_BackR_M, "Overrun");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
powerwindow_PW_Control_PSG_BackR_main();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_init(void) {
|
||||
powerwindow_initialize_DRV();
|
||||
powerwindow_initialize_PSG_Front();
|
||||
powerwindow_initialize_PSG_BackL();
|
||||
powerwindow_initialize_PSG_BackR();
|
||||
powerwindow_main_inputcyclecounter = 0;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) __attribute__((export_name("entrypoint")))
|
||||
__attribute__((noinline)) __attribute__((export_name("entrypoint"))) void
|
||||
powerwindow_main(void) {
|
||||
/* Attach powerwindow_main to a timer or interrupt service routine with
|
||||
period 0.005 seconds (the model's base sample time) here. The
|
||||
call syntax for powerwindow_main is
|
||||
|
||||
powerwindow_main();
|
||||
*/
|
||||
// Task 1: Driver side window
|
||||
|
||||
powerwindow_input_initialize_DRV();
|
||||
powerwindow_input_initialize_PSG_Front();
|
||||
powerwindow_input_initialize_PSG_BackL();
|
||||
powerwindow_input_initialize_PSG_BackR();
|
||||
|
||||
__pragma_loopbound(977, 977);
|
||||
while (powerwindow_main_inputcyclecounter < powerwindow_input_length) {
|
||||
|
||||
powerwindow_init_DRV(powerwindow_main_inputcyclecounter);
|
||||
powerwindow_DRV_main();
|
||||
|
||||
// Task 2: Front passenger side window
|
||||
|
||||
powerwindow_init_PSG_Front(powerwindow_main_inputcyclecounter);
|
||||
powerwindow_PSG_Front_main();
|
||||
|
||||
// Task 3: Back left passenger side window
|
||||
|
||||
powerwindow_init_PSG_BackL(powerwindow_main_inputcyclecounter);
|
||||
powerwindow_PSG_BackL_main();
|
||||
|
||||
// Task 4: Back right passenger side window
|
||||
|
||||
powerwindow_init_PSG_BackR(powerwindow_main_inputcyclecounter);
|
||||
powerwindow_PSG_BackR_main();
|
||||
|
||||
powerwindow_main_inputcyclecounter++;
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int
|
||||
powerwindow_return(void) {
|
||||
powerwindow_return_DRV();
|
||||
powerwindow_return_PSG_Front();
|
||||
powerwindow_return_PSG_BackL();
|
||||
powerwindow_return_PSG_BackR();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) __attribute__((export_name("main")))
|
||||
__attribute__((noinline)) __attribute__((export_name("main"))) int
|
||||
main(void) {
|
||||
powerwindow_init();
|
||||
powerwindow_main();
|
||||
return powerwindow_return();
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,23 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((viod *) 0)
|
||||
#endif
|
||||
@ -0,0 +1,331 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_DRV.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: PW_Control_DRV realizes the functionality of driver side
|
||||
powerwindow. It connects the 3 smaller modules together.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_powerwindow_control.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_DRV.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_DRV_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_terminate(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_main(void);
|
||||
|
||||
/* Block states (auto storage) */
|
||||
powerwindow_D_Work_powerwindow_PW_Control_D powerwindow_PW_Control_DR_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
powerwindow_ExternalInputs_powerwindow_PW_C powerwindow_PW_Control_DRV_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
powerwindow_ExternalOutputs_powerwindow_PW_ powerwindow_PW_Control_DRV_Y;
|
||||
|
||||
/* Real-time model */
|
||||
powerwindow_RT_MODEL_PW_Control_DRV powerwindow_PW_Control_DRV_M_;
|
||||
powerwindow_RT_MODEL_PW_Control_DRV *const powerwindow_PW_Control_DRV_M =
|
||||
&powerwindow_PW_Control_DRV_M_;
|
||||
|
||||
/* Model step function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_main(void) {
|
||||
/* local block i/o variables */
|
||||
powerwindow_boolean_T rtb_Debounce_Up_DRV;
|
||||
powerwindow_boolean_T rtb_Debounce_Down_DRV;
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In2, &rtb_Debounce_Up_DRV,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Down_DRV' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In4, &rtb_Debounce_Down_DRV,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In9, &powerwindow_PW_Control_DRV_Y.Out10,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In10, &powerwindow_PW_Control_DRV_Y.Out11,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In5, &powerwindow_PW_Control_DRV_Y.Out6,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In6, &powerwindow_PW_Control_DRV_Y.Out7,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In7, &powerwindow_PW_Control_DRV_Y.Out8,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_DRV_U.In8, &powerwindow_PW_Control_DRV_Y.Out9,
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* ModelReference: '<S1>/PW_DRV' */
|
||||
powerwindow_powerwindow_control_main(
|
||||
&rtb_Debounce_Up_DRV, &rtb_Debounce_Down_DRV,
|
||||
&powerwindow_PW_Control_DRV_U.In1, &powerwindow_PW_Control_DRV_U.In3,
|
||||
&powerwindow_PW_Control_DRV_Y.Out1, &powerwindow_PW_Control_DRV_Y.Out2,
|
||||
&powerwindow_PW_Control_DRV_Y.Out3, &powerwindow_PW_Control_DRV_Y.Out4,
|
||||
&powerwindow_PW_Control_DRV_Y.Out5,
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtzce));
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_initialize(void) {
|
||||
/* Registration code */
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_DR_DWork, 0,
|
||||
sizeof(powerwindow_D_Work_powerwindow_PW_Control_D));
|
||||
|
||||
/* external inputs */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_DRV_U, 0,
|
||||
sizeof(powerwindow_ExternalInputs_powerwindow_PW_C));
|
||||
|
||||
/* external outputs */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_DRV_Y, 0,
|
||||
sizeof(powerwindow_ExternalOutputs_powerwindow_PW_));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/Debounce_Down_DRV'
|
||||
*/
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/PW_DRV' */
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
powerwindow_PW_DRV_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_DRV_M),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtzce));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Down_DRV' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S1>/PW_DRV' */
|
||||
powerwindow_powerwindow_control_Start(
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_DRV_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Down_DRV' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_DRV_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_Front_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_Front_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Up_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_DR_DWork.Debounce_Down_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* SystemInitialize for ModelReference: '<S1>/PW_DRV' */
|
||||
powerwindow_powerwindow_control_Init(
|
||||
&powerwindow_PW_Control_DRV_Y.Out1, &powerwindow_PW_Control_DRV_Y.Out2,
|
||||
&powerwindow_PW_Control_DRV_Y.Out3, &powerwindow_PW_Control_DRV_Y.Out4,
|
||||
&powerwindow_PW_Control_DRV_Y.Out5,
|
||||
&(powerwindow_PW_Control_DR_DWork.PW_DRV_DWORK1.rtdw));
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,157 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_DRV.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_DRV.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_powerwindow_PW_Control_DRV_h_
|
||||
#define powerwindow_RTW_HEADER_powerwindow_PW_Control_DRV_h_
|
||||
#ifndef powerwindow_PW_Control_DRV_COMMON_INCLUDES_
|
||||
#define powerwindow_PW_Control_DRV_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* powerwindow_PW_Control_DRV_COMMON_INCLUDES_ */
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_PW_Control_DRV_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Child system includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_PW_DRV_rtmGetErrorStatus
|
||||
#define powerwindow_PW_DRV_rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_DRV_rtmSetErrorStatus
|
||||
#define powerwindow_PW_DRV_rtmSetErrorStatus(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_DRV_rtmGetErrorStatusPointer
|
||||
#define powerwindow_PW_DRV_rtmGetErrorStatusPointer(rtm) \
|
||||
((const powerwindow_char_T **) (&((rtm)->errorStatus)))
|
||||
#endif
|
||||
|
||||
/* Block states (auto storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_DRV_DWORK1; /* '<S2>/Debounce_Up_DRV' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_DRV_DWORK1; /* '<S2>/Debounce_Down_DRV' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_PSG_BackL_DWORK1; /* '<S2>/Debounce_Up_PSG_BackL' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_PSG_BackL_DWORK1; /* '<S2>/Debounce_Down_PSG_BackL' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_PSG_Front_DWORK1; /* '<S2>/Debounce_Up_PSG_Front' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_PSG_Front_DWORK1; /* '<S2>/Debounce_Down_PSG_Front' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_PSG_BackR_DWORK1; /* '<S2>/Debounce_Up_PSG_BackR' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_PSG_BackR_DWORK1; /* '<S2>/Debounce_Down_PSG_BackR' */
|
||||
powerwindow_rtMdlrefDWork_PowerWindow_contr
|
||||
PW_DRV_DWORK1; /* '<S1>/PW_DRV' */
|
||||
} powerwindow_D_Work_powerwindow_PW_Control_D;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T In1; /* '<Root>/In1' */
|
||||
powerwindow_boolean_T In2; /* '<Root>/In2' */
|
||||
powerwindow_uint8_T In3; /* '<Root>/In3' */
|
||||
powerwindow_boolean_T In4; /* '<Root>/In4' */
|
||||
powerwindow_boolean_T In5; /* '<Root>/In5' */
|
||||
powerwindow_boolean_T In6; /* '<Root>/In6' */
|
||||
powerwindow_boolean_T In7; /* '<Root>/In7' */
|
||||
powerwindow_boolean_T In8; /* '<Root>/In8' */
|
||||
powerwindow_boolean_T In9; /* '<Root>/In9' */
|
||||
powerwindow_boolean_T In10; /* '<Root>/In10' */
|
||||
} powerwindow_ExternalInputs_powerwindow_PW_C;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Out1; /* '<Root>/Out1' */
|
||||
powerwindow_boolean_T Out2; /* '<Root>/Out2' */
|
||||
powerwindow_boolean_T Out3; /* '<Root>/Out3' */
|
||||
powerwindow_boolean_T Out4; /* '<Root>/Out4' */
|
||||
powerwindow_boolean_T Out5; /* '<Root>/Out5' */
|
||||
powerwindow_boolean_T Out6; /* '<Root>/Out6' */
|
||||
powerwindow_boolean_T Out7; /* '<Root>/Out7' */
|
||||
powerwindow_boolean_T Out8; /* '<Root>/Out8' */
|
||||
powerwindow_boolean_T Out9; /* '<Root>/Out9' */
|
||||
powerwindow_boolean_T Out10; /* '<Root>/Out10' */
|
||||
powerwindow_boolean_T Out11; /* '<Root>/Out11' */
|
||||
} powerwindow_ExternalOutputs_powerwindow_PW_;
|
||||
|
||||
struct powerwindow_tag_RTM_PW_Control_DRV {
|
||||
const powerwindow_char_T *volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block states (auto storage) */
|
||||
extern powerwindow_D_Work_powerwindow_PW_Control_D
|
||||
powerwindow_PW_Control_DR_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
extern powerwindow_ExternalInputs_powerwindow_PW_C powerwindow_PW_Control_DRV_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
extern powerwindow_ExternalOutputs_powerwindow_PW_ powerwindow_PW_Control_DRV_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_main(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_DRV_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern powerwindow_RT_MODEL_PW_Control_DRV *const powerwindow_PW_Control_DRV_M;
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Note that this particular code originates from a subsystem build,
|
||||
and has its own system numbers different from the parent model.
|
||||
Refer to the system hierarchy for this subsystem below, and use the
|
||||
MATLAB hilite_system command to trace the generated code back
|
||||
to the parent model. For example,
|
||||
|
||||
hilite_system('PowerWindow/powerwindow_PW_Control_DRV') - opens subsystem
|
||||
PowerWindow/powerwindow_PW_Control_DRV
|
||||
hilite_system('PowerWindow/powerwindow_PW_Control_DRV/Kp') - opens and
|
||||
selects block Kp
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow'
|
||||
'<S1>' : 'PowerWindow/powerwindow_PW_Control_DRV'
|
||||
'<S2>' : 'PowerWindow/powerwindow_PW_Control_DRV/Debounce_DRV'
|
||||
*/
|
||||
#endif /* RTW_HEADER_powerwindow_PW_Control_DRV_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_DRV_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_DRV_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_powerwindow_PW_Control_DRV_private_h_
|
||||
#define powerwindow_RTW_HEADER_powerwindow_PW_Control_DRV_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_powerwindow_PW_Control_DRV_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_DRV_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_DRV_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_DRV_types_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_DRV_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PW_Control_DRV
|
||||
powerwindow_RT_MODEL_PW_Control_DRV;
|
||||
|
||||
#endif /* RTW_HEADER_PW_Control_DRV_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,195 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackL.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: PW_Control_DRV realizes the functionality of back-left passenger
|
||||
side powerwindow. It connects the 3 smaller modules together.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_powerwindow_control.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_terminate(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_main(void);
|
||||
|
||||
/* Block states (auto storage) */
|
||||
powerwindow_D_Work_PW_Control_PSG_BackL powerwindow_PW_Control_PSG_BackL_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
powerwindow_ExternalInputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
powerwindow_ExternalOutputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_Y;
|
||||
|
||||
/* Real-time model */
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackL powerwindow_PW_Control_PSG_BackL_M_;
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackL *const
|
||||
powerwindow_PW_Control_PSG_BackL_M = &powerwindow_PW_Control_PSG_BackL_M_;
|
||||
|
||||
/* Model step function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_main(void) {
|
||||
/* local block i/o variables */
|
||||
powerwindow_boolean_T rtb_debounce_Up;
|
||||
powerwindow_boolean_T rtb_debounce_Down;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_BackL_o1;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_BackL_o2;
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_BackL_U.Up_PSG_BackL, &rtb_debounce_Up,
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_BackL_U.Down_PSG_BackL, &rtb_debounce_Down,
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S1>/ControlEx_PSG_BackL' */
|
||||
powerwindow_controlexclusion_main(
|
||||
&powerwindow_PW_Control_PSG_BackL_U.Up_DRV,
|
||||
&powerwindow_PW_Control_PSG_BackL_U.Down_DRV, &rtb_debounce_Up,
|
||||
&rtb_debounce_Down, &powerwindow_rtb_ControlEx_PSG_BackL_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_BackL_o2);
|
||||
|
||||
/* ModelReference: '<S1>/PW_PSG_BackL' */
|
||||
powerwindow_powerwindow_control_main(
|
||||
&powerwindow_rtb_ControlEx_PSG_BackL_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_BackL_o2,
|
||||
&powerwindow_PW_Control_PSG_BackL_U.endofdetectionrange,
|
||||
&powerwindow_PW_Control_PSG_BackL_U.currentsense,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtzce));
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_initialize(void) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_PW_PSG_BackL_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_BackL_M, (NULL));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_PSG_BackL_DWork, 0,
|
||||
sizeof(powerwindow_D_Work_PW_Control_PSG_BackL));
|
||||
|
||||
/* external inputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_BackL_U, 0,
|
||||
sizeof(powerwindow_ExternalInputs_PW_Control_PSG_BackL));
|
||||
|
||||
/* external outputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_BackL_Y, 0,
|
||||
sizeof(powerwindow_ExternalOutputs_PW_Control_PSG_BackL));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/ControlEx_PSG_BackL'
|
||||
*/
|
||||
powerwindow_controlexclusion_initialize();
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackL_M),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackL_M),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/PW_PSG_BackL' */
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackL_M),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtzce));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S1>/PW_PSG_BackL' */
|
||||
powerwindow_powerwindow_control_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S1>/PW_PSG_BackL' */
|
||||
powerwindow_powerwindow_control_Init(
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_BackL_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw));
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,142 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackL.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackL_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackL_h_
|
||||
#ifndef powerwindow_PW_Control_PSG_BackL_COMMON_INCLUDES_
|
||||
#define powerwindow_PW_Control_PSG_BackL_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* powerwindow_PW_Control_PSG_BackL_COMMON_INCLUDES_*/
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Child system includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_controlexclusion.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_PW_PSG_BackL_BackL_rtmGetErrorStatus
|
||||
#define powerwindow_PW_PSG_BackL_rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_BackL_rtmSetErrorStatus
|
||||
#define powerwindow_PW_PSG_BackL_rtmSetErrorStatus(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer
|
||||
#define powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(rtm) \
|
||||
((const powerwindow_char_T **) (&((rtm)->errorStatus)))
|
||||
#endif
|
||||
|
||||
/* Block states (auto storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_DWORK1; /* '<S2>/Debounce_Up' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_DWORK1; /* '<S2>/Debounce_Down' */
|
||||
powerwindow_rtMdlrefDWork_PowerWindow_contr
|
||||
PW_PSG_BackL_DWORK1; /* '<S1>/PW_PSG_BackL' */
|
||||
} powerwindow_D_Work_PW_Control_PSG_BackL;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Up_DRV; /* '<Root>/Up_DRV' */
|
||||
powerwindow_boolean_T Down_DRV; /* '<Root>/Down_DRV' */
|
||||
powerwindow_boolean_T
|
||||
endofdetectionrange; /* '<Root>/end of detection range' */
|
||||
powerwindow_uint8_T currentsense; /* '<Root>/current sense' */
|
||||
powerwindow_boolean_T Up_PSG_BackL; /* '<Root>/Up_PSG_BackL' */
|
||||
powerwindow_boolean_T Down_PSG_BackL; /* '<Root>/Down_PSG_BackL' */
|
||||
} powerwindow_ExternalInputs_PW_Control_PSG_BackL;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T window_up; /* '<Root>/window_up' */
|
||||
powerwindow_boolean_T window_down; /* '<Root>/window_down' */
|
||||
powerwindow_boolean_T overcurrent; /* '<Root>/overcurrent' */
|
||||
powerwindow_boolean_T pinch; /* '<Root>/pinch' */
|
||||
powerwindow_boolean_T wake; /* '<Root>/wake' */
|
||||
} powerwindow_ExternalOutputs_PW_Control_PSG_BackL;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_PW_Control_PSG_BackL {
|
||||
const powerwindow_char_T *volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block states (auto storage) */
|
||||
extern powerwindow_D_Work_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
extern powerwindow_ExternalOutputs_PW_Control_PSG_BackL
|
||||
powerwindow_PW_Control_PSG_BackL_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_main(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackL_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern powerwindow_RT_MODEL_PW_Control_PSG_BackL
|
||||
*const powerwindow_PW_Control_PSG_BackL_M;
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Note that this particular code originates from a subsystem build,
|
||||
and has its own system numbers different from the parent model.
|
||||
Refer to the system hierarchy for this subsystem below, and use the
|
||||
MATLAB hilite_system command to trace the generated code back
|
||||
to the parent model. For example,
|
||||
|
||||
hilite_system('PowerWindow/PW_Control_PSG_BackL') - opens subsystem
|
||||
PowerWindow/PW_Control_PSG_BackL
|
||||
hilite_system('PowerWindow/PW_Control_PSG_BackL/Kp') - opens and selects
|
||||
block Kp
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow'
|
||||
'<S1>' : 'PowerWindow/PW_Control_PSG_BackL'
|
||||
'<S2>' : 'PowerWindow/PW_Control_PSG_BackL/Debounce_PSG_BackL'
|
||||
*/
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackL_h_*/
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackL_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackL_private_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackL_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackL_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackL_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackL_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackL_types_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackL_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PW_Control_PSG_BackL
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackL;
|
||||
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackL_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,195 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackR.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: PW_Control_DRV realizes the functionality of back-right passenger
|
||||
side powerwindow. It connects the 3 smaller modules together.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_PW_Control_PSG_BackR.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_terminate(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_main(void);
|
||||
|
||||
/* Block states (auto storage) */
|
||||
powerwindow_D_Work_PW_Control_PSG_BackR powerwindow_PW_Control_PSG_BackR_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
powerwindow_ExternalInputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
powerwindow_ExternalOutputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_Y;
|
||||
|
||||
/* Real-time model */
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackR powerwindow_PW_Control_PSG_BackR_M_;
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackR *const
|
||||
powerwindow_PW_Control_PSG_BackR_M = &powerwindow_PW_Control_PSG_BackR_M_;
|
||||
|
||||
/* Model step function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_main(void) {
|
||||
/* local block i/o variables */
|
||||
powerwindow_boolean_T rtb_debounce_Up;
|
||||
powerwindow_boolean_T rtb_debounce_Down;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_BackR_o1;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_BackR_o2;
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_BackR_U.Up_PSG_BackR, &rtb_debounce_Up,
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_BackR_U.Down_PSG_BackR, &rtb_debounce_Down,
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S1>/ControlEx_PSG_BackR' */
|
||||
powerwindow_controlexclusion_main(
|
||||
&powerwindow_PW_Control_PSG_BackR_U.Up_DRV,
|
||||
&powerwindow_PW_Control_PSG_BackR_U.Down_DRV, &rtb_debounce_Up,
|
||||
&rtb_debounce_Down, &powerwindow_rtb_ControlEx_PSG_BackR_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_BackR_o2);
|
||||
|
||||
/* ModelReference: '<S1>/PW_PSG_BackR' */
|
||||
powerwindow_powerwindow_control_main(
|
||||
&powerwindow_rtb_ControlEx_PSG_BackR_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_BackR_o2,
|
||||
&powerwindow_PW_Control_PSG_BackR_U.endofdetectionrange,
|
||||
&powerwindow_PW_Control_PSG_BackR_U.currentsense,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtzce));
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_initialize(void) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_PW_PSG_BackR_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_BackR_M, (NULL));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_PSG_BackR_DWork, 0,
|
||||
sizeof(powerwindow_D_Work_PW_Control_PSG_BackR));
|
||||
|
||||
/* external inputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_BackR_U, 0,
|
||||
sizeof(powerwindow_ExternalInputs_PW_Control_PSG_BackR));
|
||||
|
||||
/* external outputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_BackR_Y, 0,
|
||||
sizeof(powerwindow_ExternalOutputs_PW_Control_PSG_BackR));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/ControlEx_PSG_BackR'
|
||||
*/
|
||||
powerwindow_controlexclusion_initialize();
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackR_M),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackR_M),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/PW_PSG_BackR' */
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_BackR_M),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtzce));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S1>/PW_PSG_BackR' */
|
||||
powerwindow_powerwindow_control_Start(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S1>/PW_PSG_BackR' */
|
||||
powerwindow_powerwindow_control_Init(
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_BackR_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_BackR_DWork.PW_PSG_BackR_DWORK1.rtdw));
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,142 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackR.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackR_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackR_h_
|
||||
#ifndef powerwindow_PW_Control_PSG_BackR_COMMON_INCLUDES_
|
||||
#define powerwindow_PW_Control_PSG_BackR_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* powerwindow_PW_Control_PSG_BackR_COMMON_INCLUDES_*/
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Child system includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_controlexclusion.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_PW_PSG_BackR_rtmGetErrorStatus
|
||||
#define powerwindow_PW_PSG_BackR_rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_BackR_rtmSetErrorStatus
|
||||
#define powerwindow_PW_PSG_BackR_rtmSetErrorStatus(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer
|
||||
#define powerwindow_PW_PSG_BackR_rtmGetErrorStatusPointer(rtm) \
|
||||
((const powerwindow_char_T **) (&((rtm)->errorStatus)))
|
||||
#endif
|
||||
|
||||
/* Block states (auto storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_DWORK1; /* '<S2>/Debounce_Up' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_DWORK1; /* '<S2>/Debounce_Down' */
|
||||
powerwindow_rtMdlrefDWork_PowerWindow_contr
|
||||
PW_PSG_BackR_DWORK1; /* '<S1>/PW_PSG_BackR' */
|
||||
} powerwindow_D_Work_PW_Control_PSG_BackR;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Up_DRV; /* '<Root>/Up_DRV' */
|
||||
powerwindow_boolean_T Down_DRV; /* '<Root>/Down_DRV' */
|
||||
powerwindow_boolean_T
|
||||
endofdetectionrange; /* '<Root>/end of detection range' */
|
||||
powerwindow_uint8_T currentsense; /* '<Root>/current sense' */
|
||||
powerwindow_boolean_T Up_PSG_BackR; /* '<Root>/Up_PSG_BackR' */
|
||||
powerwindow_boolean_T Down_PSG_BackR; /* '<Root>/Down_PSG_BackR' */
|
||||
} powerwindow_ExternalInputs_PW_Control_PSG_BackR;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T window_up; /* '<Root>/window_up' */
|
||||
powerwindow_boolean_T window_down; /* '<Root>/window_down' */
|
||||
powerwindow_boolean_T overcurrent; /* '<Root>/overcurrent' */
|
||||
powerwindow_boolean_T pinch; /* '<Root>/pinch' */
|
||||
powerwindow_boolean_T wake; /* '<Root>/wake' */
|
||||
} powerwindow_ExternalOutputs_PW_Control_PSG_BackR;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_PW_Control_PSG_BackR {
|
||||
const powerwindow_char_T *volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block states (auto storage) */
|
||||
extern powerwindow_D_Work_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
extern powerwindow_ExternalOutputs_PW_Control_PSG_BackR
|
||||
powerwindow_PW_Control_PSG_BackR_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_main(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_BackR_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern powerwindow_RT_MODEL_PW_Control_PSG_BackR
|
||||
*const powerwindow_PW_Control_PSG_BackR_M;
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Note that this particular code originates from a subsystem build,
|
||||
and has its own system numbers different from the parent model.
|
||||
Refer to the system hierarchy for this subsystem below, and use the
|
||||
MATLAB hilite_system command to trace the generated code back
|
||||
to the parent model. For example,
|
||||
|
||||
hilite_system('PowerWindow/PW_Control_PSG_BackR') - opens subsystem
|
||||
PowerWindow/PW_Control_PSG_BackR
|
||||
hilite_system('PowerWindow/PW_Control_PSG_BackR/Kp') - opens and selects
|
||||
block Kp
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow'
|
||||
'<S1>' : 'PowerWindow/PW_Control_PSG_BackR'
|
||||
'<S2>' : 'PowerWindow/PW_Control_PSG_BackR/Debounce_PSG'
|
||||
*/
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_h_*/
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackR_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackR_private_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackR_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackR_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_BackR_tyoes.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_BackR_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_BackR_types_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_BackR_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PW_Control_PSG_BackR
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_BackR;
|
||||
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_BackR_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,201 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_Front.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: PW_Control_DRV realizes the functionality of front passenger side
|
||||
powerwindow. It connects the 3 smaller modules together.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_powerwindow_control.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_terminate(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_main(void);
|
||||
|
||||
/* Block states (auto storage) */
|
||||
powerwindow_D_Work_PW_Control_PSG_Front powerwindow_PW_Control_PSG_Front_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
powerwindow_ExternalInputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
powerwindow_ExternalOutputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_Y;
|
||||
|
||||
/* Real-time model */
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_Front powerwindow_PW_Control_PSG_Front_M_;
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_Front *const
|
||||
powerwindow_PW_Control_PSG_Front_M = &powerwindow_PW_Control_PSG_Front_M_;
|
||||
|
||||
/* Model step function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_main(void) {
|
||||
/* local block i/o variables */
|
||||
powerwindow_boolean_T rtb_debounce_Up;
|
||||
powerwindow_boolean_T rtb_debounce_Down;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_Front_Front_o1;
|
||||
powerwindow_boolean_T powerwindow_rtb_ControlEx_PSG_Front_Front_o2;
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_Front_U.Up_PSG_Front, &rtb_debounce_Up,
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_main(
|
||||
&powerwindow_PW_Control_PSG_Front_U.Down_PSG_Front, &rtb_debounce_Down,
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* ModelReference: '<S1>/ControlEx_PSG_Front_Front' */
|
||||
powerwindow_controlexclusion_main(
|
||||
&powerwindow_PW_Control_PSG_Front_U.Up_DRV,
|
||||
&powerwindow_PW_Control_PSG_Front_U.Down_DRV, &rtb_debounce_Up,
|
||||
&rtb_debounce_Down, &powerwindow_rtb_ControlEx_PSG_Front_Front_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_Front_Front_o2);
|
||||
|
||||
/* ModelReference: '<S1>/PW_PSG_Front_Front' */
|
||||
powerwindow_powerwindow_control_main(
|
||||
&powerwindow_rtb_ControlEx_PSG_Front_Front_o1,
|
||||
&powerwindow_rtb_ControlEx_PSG_Front_Front_o2,
|
||||
&powerwindow_PW_Control_PSG_Front_U.endofdetectionrange,
|
||||
&powerwindow_PW_Control_PSG_Front_U.currentsense,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtzce));
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_initialize(void) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_PW_PSG_Front_rtmSetErrorStatus(
|
||||
powerwindow_PW_Control_PSG_Front_M, (NULL));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) &powerwindow_PW_Control_PSG_Front_DWork, 0,
|
||||
sizeof(powerwindow_D_Work_PW_Control_PSG_Front));
|
||||
|
||||
/* external inputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_Front_U, 0,
|
||||
sizeof(powerwindow_ExternalInputs_PW_Control_PSG_Front));
|
||||
|
||||
/* external outputs */
|
||||
(void) wcclib_memset(
|
||||
(void *) &powerwindow_PW_Control_PSG_Front_Y, 0,
|
||||
sizeof(powerwindow_ExternalOutputs_PW_Control_PSG_Front));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block:
|
||||
* '<S1>/ControlEx_PSG_Front_Front' */
|
||||
powerwindow_controlexclusion_initialize();
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_Front_M),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_initialize(
|
||||
powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_Front_M),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtzce));
|
||||
|
||||
/* Model Initialize fcn for ModelReference Block: '<S1>/PW_PSG_Front_Front'
|
||||
*/
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer(
|
||||
powerwindow_PW_Control_PSG_Front_M),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1.rtm),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtdw),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtzce));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Start(
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* Start for ModelReference: '<S1>/PW_PSG_Front_Front' */
|
||||
powerwindow_powerwindow_control_Start(&(
|
||||
powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Up' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Up_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S2>/debounce_Down' */
|
||||
powerwindow_debounce_Init(
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtb),
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.Debounce_Down_DWORK1.rtdw));
|
||||
|
||||
/* InitializeConditions for ModelReference: '<S1>/PW_PSG_Front_Front' */
|
||||
powerwindow_powerwindow_control_Init(
|
||||
&powerwindow_PW_Control_PSG_Front_Y.window_up,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.window_down,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.overcurrent,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.pinch,
|
||||
&powerwindow_PW_Control_PSG_Front_Y.wake,
|
||||
&(powerwindow_PW_Control_PSG_Front_DWork.PW_PSG_Front_Front_DWORK1
|
||||
.rtdw));
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,142 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_Front.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_Front_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_Front_h_
|
||||
#ifndef powerwindow_PW_Control_PSG_Front_COMMON_INCLUDES_
|
||||
#define powerwindow_PW_Control_PSG_Front_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* powerwindow_PW_Control_PSG_Front_COMMON_INCLUDES_*/
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Child system includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_controlexclusion.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_PW_PSG_Front_rtmGetErrorStatus
|
||||
#define powerwindow_PW_PSG_Front_rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_Front_rtmSetErrorStatus
|
||||
#define powerwindow_PW_PSG_Front_rtmSetErrorStatus(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer
|
||||
#define powerwindow_PW_PSG_Front_rtmGetErrorStatusPointer(rtm) \
|
||||
((const powerwindow_char_T **) (&((rtm)->errorStatus)))
|
||||
#endif
|
||||
|
||||
/* Block states (auto storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Up_DWORK1; /* '<S2>/Debounce_Up' */
|
||||
powerwindow_rtMdlrefDWork_debounce_T
|
||||
Debounce_Down_DWORK1; /* '<S2>/Debounce_Down' */
|
||||
powerwindow_rtMdlrefDWork_PowerWindow_contr
|
||||
PW_PSG_Front_Front_DWORK1; /* '<S1>/PW_PSG_Front_Front' */
|
||||
} powerwindow_D_Work_PW_Control_PSG_Front;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Up_DRV; /* '<Root>/Up_DRV' */
|
||||
powerwindow_boolean_T Down_DRV; /* '<Root>/Down_DRV' */
|
||||
powerwindow_boolean_T
|
||||
endofdetectionrange; /* '<Root>/end of detection range' */
|
||||
powerwindow_uint8_T currentsense; /* '<Root>/current sense' */
|
||||
powerwindow_boolean_T Up_PSG_Front; /* '<Root>/Up_PSG_Front' */
|
||||
powerwindow_boolean_T Down_PSG_Front; /* '<Root>/Down_PSG_Front' */
|
||||
} powerwindow_ExternalInputs_PW_Control_PSG_Front;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T window_up; /* '<Root>/window_up' */
|
||||
powerwindow_boolean_T window_down; /* '<Root>/window_down' */
|
||||
powerwindow_boolean_T overcurrent; /* '<Root>/overcurrent' */
|
||||
powerwindow_boolean_T pinch; /* '<Root>/pinch' */
|
||||
powerwindow_boolean_T wake; /* '<Root>/wake' */
|
||||
} powerwindow_ExternalOutputs_PW_Control_PSG_Front;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_PW_Control_PSG_Front {
|
||||
const powerwindow_char_T *volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block states (auto storage) */
|
||||
extern powerwindow_D_Work_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_DWork;
|
||||
|
||||
/* External inputs (root inport signals with auto storage) */
|
||||
extern powerwindow_ExternalInputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with auto storage) */
|
||||
extern powerwindow_ExternalOutputs_PW_Control_PSG_Front
|
||||
powerwindow_PW_Control_PSG_Front_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_main(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_PW_Control_PSG_Front_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern powerwindow_RT_MODEL_PW_Control_PSG_Front
|
||||
*const powerwindow_PW_Control_PSG_Front_M;
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Note that this particular code originates from a subsystem build,
|
||||
and has its own system numbers different from the parent model.
|
||||
Refer to the system hierarchy for this subsystem below, and use the
|
||||
MATLAB hilite_system command to trace the generated code back
|
||||
to the parent model. For example,
|
||||
|
||||
hilite_system('PowerWindow/PW_Control_PSG_Front') - opens subsystem
|
||||
PowerWindow/PW_Control_PSG_Front
|
||||
hilite_system('PowerWindow/PW_Control_PSG_Front/Kp') - opens and selects
|
||||
block Kp
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow'
|
||||
'<S1>' : 'PowerWindow/PW_Control_PSG_Front'
|
||||
'<S2>' : 'PowerWindow/PW_Control_PSG_Front/Debounce_PSG_Front_Front'
|
||||
*/
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_Front_h_*/
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_Front_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_Front_private_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_Front_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_Front_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_PW_Control_PSG_Front_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_PW_Control_PSG_Front_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PW_Control_PSG_Front_types_h_
|
||||
#define powerwindow_RTW_HEADER_PW_Control_PSG_Front_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PW_Control_PSG_Front
|
||||
powerwindow_RT_MODEL_PW_Control_PSG_Front;
|
||||
|
||||
#endif /* RTW_HEADER_PW_Control_PSG_Front_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_const_params.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: the lookup table for stateflow chart in
|
||||
powerwindow_powerwindow_control
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_const_params.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
extern const powerwindow_boolean_T powerwindow_rtCP_pooled_6bUUQf1tASYw[12];
|
||||
const powerwindow_boolean_T powerwindow_rtCP_pooled_6bUUQf1tASYw[12] = {
|
||||
1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0};
|
||||
@ -0,0 +1,91 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_controlexclusion
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: powerwindow_controlexclusion is one functionality of the power
|
||||
window benchmark. It takes the input signal from the driver and the passenger
|
||||
to determine the final control signal.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_controlexclusion.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_controlexclusion.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_controlexclusion_private.h"
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_terminate(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_main(const powerwindow_boolean_T *rtu_Up_DRV,
|
||||
const powerwindow_boolean_T *rtu_Down_DRV,
|
||||
const powerwindow_boolean_T *rtu_Up_PSG,
|
||||
const powerwindow_boolean_T *rtu_Down_PSG,
|
||||
powerwindow_boolean_T *rty_Up,
|
||||
powerwindow_boolean_T *rty_Down);
|
||||
|
||||
/* Model initialize function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_initialize(void) {
|
||||
/* (no initialization code required) */
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_terminate(void) {
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
Algorithm core functions
|
||||
*/
|
||||
|
||||
/* Output and update for referenced model: 'ControlExclusion' */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_main(const powerwindow_boolean_T *rtu_Up_DRV,
|
||||
const powerwindow_boolean_T *rtu_Down_DRV,
|
||||
const powerwindow_boolean_T *rtu_Up_PSG,
|
||||
const powerwindow_boolean_T *rtu_Down_PSG,
|
||||
powerwindow_boolean_T *rty_Up,
|
||||
powerwindow_boolean_T *rty_Down) {
|
||||
/* Logic: '<S2>/Logical Operator11' incorporates:
|
||||
Logic: '<S2>/Logical Operator2'
|
||||
Logic: '<S2>/Logical Operator3'
|
||||
Logic: '<S2>/Logical Operator5'
|
||||
Logic: '<S2>/Logical Operator6'
|
||||
Logic: '<S2>/Logical Operator7'
|
||||
*/
|
||||
*rty_Up = !(((!*rtu_Up_DRV) && (*rtu_Down_DRV)) ||
|
||||
((*rtu_Down_DRV) && (!*rtu_Up_PSG) && (*rtu_Down_PSG)));
|
||||
|
||||
/* Logic: '<S2>/Logical Operator12' incorporates:
|
||||
Logic: '<S2>/Logical Operator1'
|
||||
Logic: '<S2>/Logical Operator10'
|
||||
Logic: '<S2>/Logical Operator4'
|
||||
Logic: '<S2>/Logical Operator8'
|
||||
Logic: '<S2>/Logical Operator9'
|
||||
*/
|
||||
*rty_Down = !(((*rtu_Up_DRV) && (!*rtu_Down_DRV)) ||
|
||||
((*rtu_Up_DRV) && (*rtu_Up_PSG) && (!*rtu_Down_PSG)));
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,79 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_controlexclusion.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_controlexclusion.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_controlexclusion_h_
|
||||
#define powerwindow_RTW_HEADER_controlexclusion_h_
|
||||
#ifndef powerwindow_controlexclusion_COMMON_INCLUDES_
|
||||
#define powerwindow_controlexclusion_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#endif /* powerwindow_controlexclusion_COMMON_INCLUDES_ */
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_controlexclusion_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* user code (top of header file) */
|
||||
|
||||
/* Model reference registration function */
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_initialize(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_terminate(void);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_controlexclusion_main(const powerwindow_boolean_T *rtu_Up_DRV,
|
||||
const powerwindow_boolean_T *rtu_Down_DRV,
|
||||
const powerwindow_boolean_T *rtu_Up_PSG,
|
||||
const powerwindow_boolean_T *rtu_Down_PSG,
|
||||
powerwindow_boolean_T *rty_Up,
|
||||
powerwindow_boolean_T *rty_Down);
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Use the MATLAB hilite_system command to trace the generated code back
|
||||
to the model. For example,
|
||||
|
||||
hilite_system('<S3>') - opens system 3
|
||||
hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'ControlExclusion'
|
||||
'<S1>' : 'ControlExclusion/Control_Clock_TicToc'
|
||||
'<S2>' : 'ControlExclusion/Control_Clock_TicToc/ControlEx_PSG'
|
||||
'<S3>' : 'ControlExclusion/Control_Clock_TicToc/Tic'
|
||||
'<S4>' : 'powerwindow_controlexclusion_main/Control_Clock_TicToc/Toc'
|
||||
'<S5>' : 'ControlExclusion/Control_Clock_TicToc/Tic/Tic_T'
|
||||
'<S6>' : 'ControlExclusion/Control_Clock_TicToc/Toc/Toc_T'
|
||||
*/
|
||||
#endif /* RTW_HEADER_ControlExclusion_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_controlexclusion_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_controlexclusion_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_controlexclusion_private_h_
|
||||
#define powerwindow_RTW_HEADER_controlexclusion_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* RTW_HEADER_controlexclusion_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_controlexclusion_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_controlexclusion_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_controlexclusion_types_h_
|
||||
#define powerwindow_RTW_HEADER_controlexclusion_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
#endif /* powerwindow_RTW_HEADER_controlexclusion_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,231 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_debounce.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: powerwindow_debounce_main is used to powerwindow_debounce_main the
|
||||
push-down button of the power window. In order to input a manual switch signal
|
||||
into a digital circuit, debouncing is necessary so that a single press does
|
||||
not appear like multiple presses. Without debouncing, pressing the button once
|
||||
may cause unpredictable results. powerwindow_debounce_main.c defines all the
|
||||
functions that will be used in debounce_PSG_Front which is a part of the Power
|
||||
window.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_debounce.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_debounce.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_debounce_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/* Named constants for Chart: '<Root>/Chart' */
|
||||
#define debounce_IN_debounce ((powerwindow_uint8_T) 1U)
|
||||
#define debounce_IN_NO_ACTIVE_CHILD ((powerwindow_uint8_T) 0U)
|
||||
#define debounce_IN_Off ((powerwindow_uint8_T) 2U)
|
||||
#define debounce_IN_Off_h ((powerwindow_uint8_T) 1U)
|
||||
#define debounce_IN_On ((powerwindow_uint8_T) 3U)
|
||||
#define debounce_IN_On_b ((powerwindow_uint8_T) 2U)
|
||||
|
||||
/*
|
||||
Forward declaration of functions
|
||||
*/
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_Init(powerwindow_rtB_debounce_T *,
|
||||
powerwindow_rtDW_debounce_T *);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_Start(powerwindow_rtDW_debounce_T *);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_initialize(const powerwindow_char_T **,
|
||||
powerwindow_RT_MODEL_debounce_T *const,
|
||||
powerwindow_rtB_debounce_T *,
|
||||
powerwindow_rtDW_debounce_T *,
|
||||
powerwindow_rtZCE_debounce_T *);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_main(const powerwindow_boolean_T *,
|
||||
powerwindow_boolean_T *, powerwindow_rtB_debounce_T *,
|
||||
powerwindow_rtDW_debounce_T *,
|
||||
powerwindow_rtZCE_debounce_T *);
|
||||
|
||||
/*
|
||||
Initialization- and return-value-related functions
|
||||
*/
|
||||
|
||||
/* Initial conditions for referenced model: 'powerwindow_debounce_main' */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_Init(powerwindow_rtB_debounce_T *localB,
|
||||
powerwindow_rtDW_debounce_T *localDW) {
|
||||
/* InitializeConditions for Chart: '<Root>/Chart' */
|
||||
localDW->is_debounce = debounce_IN_NO_ACTIVE_CHILD;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
localDW->is_active_c3_debounce = 0U;
|
||||
localDW->is_c3_debounce = debounce_IN_NO_ACTIVE_CHILD;
|
||||
localB->Q = false;
|
||||
}
|
||||
|
||||
/* Start for referenced model: 'powerwindow_debounce_main' */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_Start(powerwindow_rtDW_debounce_T *localDW) {
|
||||
/* Start for DiscretePulseGenerator: '<Root>/period of 10ms' */
|
||||
localDW->clockTickCounter = 0L;
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_debounce_T *const debounce_M,
|
||||
powerwindow_rtB_debounce_T *localB, powerwindow_rtDW_debounce_T *localDW,
|
||||
powerwindow_rtZCE_debounce_T *localZCE) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_rtmSetErrorStatusPointer(debounce_M, rt_errorStatus);
|
||||
|
||||
/* block I/O */
|
||||
(void) wcclib_memset(((void *) localB), 0,
|
||||
sizeof(powerwindow_rtB_debounce_T));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) localDW, 0,
|
||||
sizeof(powerwindow_rtDW_debounce_T));
|
||||
localZCE->Chart_Trig_ZCE = powerwindow_POS_ZCSIG;
|
||||
}
|
||||
|
||||
/*
|
||||
Algorithm core functions
|
||||
*/
|
||||
|
||||
/* Output and update for referenced model: 'powerwindow_debounce_main' */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_main(const powerwindow_boolean_T *rtu_Switch,
|
||||
powerwindow_boolean_T *rty_debounced_Switch,
|
||||
powerwindow_rtB_debounce_T *localB,
|
||||
powerwindow_rtDW_debounce_T *localDW,
|
||||
powerwindow_rtZCE_debounce_T *localZCE) {
|
||||
powerwindow_int16_T rtb_periodof10ms;
|
||||
|
||||
/* DiscretePulseGenerator: '<Root>/period of 10ms' */
|
||||
rtb_periodof10ms =
|
||||
(localDW->clockTickCounter < 1L) && (localDW->clockTickCounter >= 0L)
|
||||
? 1
|
||||
: 0;
|
||||
if (localDW->clockTickCounter >= 1L)
|
||||
localDW->clockTickCounter = 0L;
|
||||
|
||||
else
|
||||
localDW->clockTickCounter++;
|
||||
|
||||
/* End of DiscretePulseGenerator: '<Root>/period of 10ms' */
|
||||
|
||||
/* Chart: '<Root>/Chart' incorporates:
|
||||
TriggerPort: '<S1>/ticks'
|
||||
*/
|
||||
/* DataTypeConversion: '<Root>/Data Type Conversion' */
|
||||
if ((rtb_periodof10ms != 0) &&
|
||||
(localZCE->Chart_Trig_ZCE != powerwindow_POS_ZCSIG)) {
|
||||
/* Gateway: Chart */
|
||||
if (localDW->temporalCounter_i1 < 7U)
|
||||
localDW->temporalCounter_i1++;
|
||||
|
||||
/* Event: '<S1>:13' */
|
||||
/* During: Chart */
|
||||
if (localDW->is_active_c3_debounce == 0U) {
|
||||
/* Entry: Chart */
|
||||
localDW->is_active_c3_debounce = 1U;
|
||||
|
||||
/* Entry Internal: Chart */
|
||||
/* Transition: '<S1>:9' */
|
||||
localDW->is_c3_debounce = debounce_IN_Off;
|
||||
|
||||
/* Entry 'Off': '<S1>:1' */
|
||||
localB->Q = true;
|
||||
} else {
|
||||
switch (localDW->is_c3_debounce) {
|
||||
case debounce_IN_debounce:
|
||||
/* During 'powerwindow_debounce_main': '<S1>:6' */
|
||||
if (localDW->is_debounce == debounce_IN_Off_h) {
|
||||
/* During 'Off': '<S1>:8' */
|
||||
if ((powerwindow_int16_T) *rtu_Switch < 1) {
|
||||
/* Transition: '<S1>:12' */
|
||||
localDW->is_debounce = debounce_IN_On_b;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
} else {
|
||||
if (localDW->temporalCounter_i1 >= 3) {
|
||||
/* Transition: '<S1>:16' */
|
||||
localDW->is_debounce = debounce_IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_c3_debounce = debounce_IN_Off;
|
||||
|
||||
/* Entry 'Off': '<S1>:1' */
|
||||
localB->Q = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* During 'On': '<S1>:7' */
|
||||
if ((powerwindow_int16_T) *rtu_Switch > 0) {
|
||||
/* Transition: '<S1>:11' */
|
||||
localDW->is_debounce = debounce_IN_Off_h;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
} else {
|
||||
if (localDW->temporalCounter_i1 >= 3) {
|
||||
/* Transition: '<S1>:14' */
|
||||
localDW->is_debounce = debounce_IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_c3_debounce = debounce_IN_On;
|
||||
|
||||
/* Entry 'On': '<S1>:5' */
|
||||
localB->Q = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case debounce_IN_Off:
|
||||
/* During 'Off': '<S1>:1' */
|
||||
if ((powerwindow_int16_T) *rtu_Switch < 1) {
|
||||
/* Transition: '<S1>:10' */
|
||||
localDW->is_c3_debounce = debounce_IN_debounce;
|
||||
localDW->is_debounce = debounce_IN_On_b;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'On': '<S1>:5' */
|
||||
if ((powerwindow_int16_T) *rtu_Switch > 0) {
|
||||
/* Transition: '<S1>:15' */
|
||||
localDW->is_c3_debounce = debounce_IN_debounce;
|
||||
localDW->is_debounce = debounce_IN_Off_h;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
localZCE->Chart_Trig_ZCE =
|
||||
(powerwindow_uint8_T) (rtb_periodof10ms != 0
|
||||
? (powerwindow_int16_T) powerwindow_POS_ZCSIG
|
||||
: (powerwindow_int16_T)
|
||||
powerwindow_ZERO_ZCSIG);
|
||||
|
||||
/* End of DataTypeConversion: '<Root>/Data Type Conversion' */
|
||||
|
||||
/* DataTypeConversion: '<Root>/Data Type Conversion2' */
|
||||
*rty_debounced_Switch = localB->Q;
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,106 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_debounce.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_debounce.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_debounce_h_
|
||||
#define powerwindow_RTW_HEADER_debounce_h_
|
||||
#ifndef powerwindow_debounce_COMMON_INCLUDES_
|
||||
#define powerwindow_debounce_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#endif /* debounce_COMMON_INCLUDES_ */
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_debounce_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* Block signals for model 'powerwindow_debounce_main' */
|
||||
typedef struct {
|
||||
powerwindow_boolean_T Q; /* '<Root>/Chart' */
|
||||
} powerwindow_rtB_debounce_T;
|
||||
|
||||
/* Block states (auto storage) for model 'powerwindow_debounce_main' */
|
||||
typedef struct {
|
||||
powerwindow_int32_T clockTickCounter; /* '<Root>/period of 10ms' */
|
||||
powerwindow_uint8_T is_active_c3_debounce; /* '<Root>/Chart' */
|
||||
powerwindow_uint8_T is_c3_debounce; /* '<Root>/Chart' */
|
||||
powerwindow_uint8_T is_debounce; /* '<Root>/Chart' */
|
||||
powerwindow_uint8_T temporalCounter_i1; /* '<Root>/Chart' */
|
||||
} powerwindow_rtDW_debounce_T;
|
||||
|
||||
/* Zero-crossing (trigger) state for model 'powerwindow_debounce_main' */
|
||||
typedef struct {
|
||||
ZCSigState Chart_Trig_ZCE; /* '<Root>/Chart' */
|
||||
} powerwindow_rtZCE_debounce_T;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_debounce_T {
|
||||
const powerwindow_char_T **errorStatus;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
powerwindow_rtB_debounce_T rtb;
|
||||
powerwindow_rtDW_debounce_T rtdw;
|
||||
powerwindow_RT_MODEL_debounce_T rtm;
|
||||
powerwindow_rtZCE_debounce_T rtzce;
|
||||
} powerwindow_rtMdlrefDWork_debounce_T;
|
||||
|
||||
/* Model reference registration function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_debounce_T *const debounce_M,
|
||||
powerwindow_rtB_debounce_T *localB, powerwindow_rtDW_debounce_T *localDW,
|
||||
powerwindow_rtZCE_debounce_T *localZCE);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_Init(powerwindow_rtB_debounce_T *localB,
|
||||
powerwindow_rtDW_debounce_T *localDW);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_Start(powerwindow_rtDW_debounce_T *localDW);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_debounce_main(const powerwindow_boolean_T *rtu_Switch,
|
||||
powerwindow_boolean_T *rty_debounced_Switch,
|
||||
powerwindow_rtB_debounce_T *localB,
|
||||
powerwindow_rtDW_debounce_T *localDW,
|
||||
powerwindow_rtZCE_debounce_T *localZCE);
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Use the MATLAB hilite_system command to trace the generated code back
|
||||
to the model. For example,
|
||||
|
||||
hilite_system('<S3>') - opens system 3
|
||||
hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'powerwindow_debounce_main'
|
||||
'<S1>' : 'powerwindow_debounce_main/Chart'
|
||||
*/
|
||||
#endif /* RTW_HEADER_debounce_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,49 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_debounce_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_debounce_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_debounce_private_h_
|
||||
#define powerwindow_RTW_HEADER_debounce_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_rtmGetErrorStatus
|
||||
#define powerwindow_rtmGetErrorStatus(rtm) (*((rtm)->errorStatus))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_rtmSetErrorStatus
|
||||
#define powerwindow_rtmSetErrorStatus(rtm, val) (*((rtm)->errorStatus) = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_rtmGetErrorStatusPointer
|
||||
#define powerwindow_rtmGetErrorStatusPointer(rtm) (rtm)->errorStatus
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_rtmSetErrorStatusPointer
|
||||
#define powerwindow_rtmSetErrorStatusPointer(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
#endif /* RTW_HEADER_debounce_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,33 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_debounce_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_debounce_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_debounce_types_h_
|
||||
#define powerwindow_RTW_HEADER_debounce_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_debounce_T powerwindow_RT_MODEL_debounce_T;
|
||||
|
||||
#endif /* RTW_HEADER_debounce_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,52 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_model_reference_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_model_reference_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow___MODEL_REFERENCE_TYPES_H__
|
||||
#define powerwindow___MODEL_REFERENCE_TYPES_H__
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
#ifndef powerwindow___MODEL_REFERENCE_TYPES__
|
||||
#define powerwindow___MODEL_REFERENCE_TYPES__
|
||||
|
||||
/*===========================================================================*
|
||||
Model reference type definitions
|
||||
===========================================================================*/
|
||||
/*
|
||||
This structure is used by model reference to
|
||||
communicate timing information through the hierarchy.
|
||||
*/
|
||||
typedef struct powerwindow__rtTimingBridge_tag powerwindow_rtTimingBridge;
|
||||
struct powerwindow__rtTimingBridge_tag {
|
||||
powerwindow_uint32_T nTasks;
|
||||
powerwindow_uint32_T **clockTick;
|
||||
powerwindow_uint32_T **clockTickH;
|
||||
powerwindow_uint32_T *taskCounter;
|
||||
powerwindow_real_T **taskTime;
|
||||
powerwindow_boolean_T **rateTransition;
|
||||
powerwindow_boolean_T *firstInitCond;
|
||||
};
|
||||
|
||||
#endif /* __MODEL_REFERENCE_TYPES__ */
|
||||
#endif /* __MODEL_REFERENCE_TYPES_H__ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,597 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_powerwindow_control.c
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: powerwindow_control is the main functionality of the power window
|
||||
benchmark. It contains 3 states: System, EndReached and Pinch, which are used
|
||||
to controll the position of the glass, if the window is fully closed and
|
||||
sensing pinch force to realize the powerwindow function.
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow//powerwindow_powerwindow_control.c
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#include "powerwindow_HeaderFiles/powerwindow_powerwindow_control.h"
|
||||
#include "powerwindow_HeaderFiles/powerwindow_powerwindow_control_private.h"
|
||||
#include "wcclib.h"
|
||||
|
||||
/* Named constants for Chart: '<S2>/stateflow control model' */
|
||||
#define powerwindow_powerwindow__IN_NO_ACTIVE_CHILD ((powerwindow_uint8_T) 0U)
|
||||
#define powerwindow_powerwindow_contr_IN_EndReached ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_contr_IN_SensePinch ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_AutoDown ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_control_IN_AutoUp ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_control_IN_Down ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_Down_d ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_control_IN_InitDown ((powerwindow_uint8_T) 3U)
|
||||
#define powerwindow_powerwindow_control_IN_InitUp ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_Neutral ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_Pinch ((powerwindow_uint8_T) 2U)
|
||||
#define powerwindow_powerwindow_control_IN_SenseEnd ((powerwindow_uint8_T) 1U)
|
||||
#define powerwindow_powerwindow_control_IN_Start ((powerwindow_uint8_T) 3U)
|
||||
#define powerwindow_powerwindow_control_IN_System ((powerwindow_uint8_T) 3U)
|
||||
#define powerwindow_powerwindow_control_IN_Up ((powerwindow_uint8_T) 3U)
|
||||
|
||||
/* Forward declaration for local functions */
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_Start(
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_Init(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_Start(
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_PowerWindow_control *const PowerWindow_control_M,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE);
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_main(
|
||||
const powerwindow_boolean_T *rtu_up, const powerwindow_boolean_T *rtu_down,
|
||||
const powerwindow_boolean_T *rtu_endofdetectionrange,
|
||||
const powerwindow_uint8_T *rtu_currentsense,
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE);
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_con_broadcast_ticks(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
|
||||
/* Function for Chart: '<S2>/stateflow control model' */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_con_broadcast_ticks(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW) {
|
||||
/* Event: '<S3>:30' */
|
||||
/* During: PW_PSG/PWExternalClock/stateflow control model */
|
||||
if (localDW->is_active_c2_PowerWindow_contro == 0U) {
|
||||
/* Entry: PW_PSG/PWExternalClock/stateflow control model */
|
||||
localDW->is_active_c2_PowerWindow_contro = 1U;
|
||||
|
||||
/* Entry Internal: PW_PSG/PWExternalClock/stateflow control model */
|
||||
/* Transition: '<S3>:102' */
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_control_IN_System;
|
||||
|
||||
/* Entry Internal 'System': '<S3>:94' */
|
||||
localDW->is_active_Logic = 1U;
|
||||
|
||||
/* Entry Internal 'Logic': '<S3>:95' */
|
||||
/* Transition: '<S3>:82' */
|
||||
localDW->is_Logic = powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
localDW->is_active_Sensing = 1U;
|
||||
|
||||
/* Entry Internal 'Sensing': '<S3>:96' */
|
||||
/* Transition: '<S3>:153' */
|
||||
localDW->is_Sensing = powerwindow_powerwindow_control_IN_Start;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Start': '<S3>:170' */
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
} else {
|
||||
switch (localDW->is_c2_PowerWindow_control) {
|
||||
case powerwindow_powerwindow_contr_IN_EndReached:
|
||||
/* During 'EndReached': '<S3>:97' */
|
||||
if (localDW->temporalCounter_i1 >= 10) {
|
||||
/* Transition: '<S3>:101' */
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_control_IN_System;
|
||||
|
||||
/* Entry Internal 'System': '<S3>:94' */
|
||||
localDW->is_active_Logic = 1U;
|
||||
|
||||
/* Entry Internal 'Logic': '<S3>:95' */
|
||||
/* Transition: '<S3>:82' */
|
||||
localDW->is_Logic = powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
localDW->is_active_Sensing = 1U;
|
||||
|
||||
/* Entry Internal 'Sensing': '<S3>:96' */
|
||||
/* Transition: '<S3>:153' */
|
||||
localDW->is_Sensing = powerwindow_powerwindow_control_IN_Start;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Start': '<S3>:170' */
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_control_IN_Pinch:
|
||||
/* During 'Pinch': '<S3>:152' */
|
||||
if (localDW->temporalCounter_i1 >= 40) {
|
||||
/* Transition: '<S3>:157' */
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_control_IN_System;
|
||||
|
||||
/* Entry Internal 'System': '<S3>:94' */
|
||||
localDW->is_active_Logic = 1U;
|
||||
|
||||
/* Entry Internal 'Logic': '<S3>:95' */
|
||||
/* Transition: '<S3>:82' */
|
||||
localDW->is_Logic = powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
localDW->is_active_Sensing = 1U;
|
||||
|
||||
/* Entry Internal 'Sensing': '<S3>:96' */
|
||||
/* Transition: '<S3>:153' */
|
||||
localDW->is_Sensing = powerwindow_powerwindow_control_IN_Start;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* Entry 'Start': '<S3>:170' */
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* During 'System': '<S3>:94' */
|
||||
if (*rty_pinch == 1) {
|
||||
/* Transition: '<S3>:155' */
|
||||
/* Exit Internal 'System': '<S3>:94' */
|
||||
/* Exit Internal 'Sensing': '<S3>:96' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_active_Sensing = 0U;
|
||||
|
||||
/* Exit Internal 'Logic': '<S3>:95' */
|
||||
/* Exit Internal 'Down': '<S3>:18' */
|
||||
localDW->is_Down = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
|
||||
/* Exit Internal 'Up': '<S3>:17' */
|
||||
localDW->is_Up = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_active_Logic = 0U;
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_control_IN_Pinch;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
|
||||
/* Entry 'Pinch': '<S3>:152' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = true;
|
||||
} else if (*rty_overcurrent == 1) {
|
||||
/* Transition: '<S3>:100' */
|
||||
/* Exit Internal 'System': '<S3>:94' */
|
||||
/* Exit Internal 'Sensing': '<S3>:96' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_active_Sensing = 0U;
|
||||
|
||||
/* Exit Internal 'Logic': '<S3>:95' */
|
||||
/* Exit Internal 'Down': '<S3>:18' */
|
||||
localDW->is_Down = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
|
||||
/* Exit Internal 'Up': '<S3>:17' */
|
||||
localDW->is_Up = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_active_Logic = 0U;
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow_contr_IN_EndReached;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
|
||||
/* Entry 'EndReached': '<S3>:97' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
} else {
|
||||
/* During 'Logic': '<S3>:95' */
|
||||
switch (localDW->is_Logic) {
|
||||
case powerwindow_powerwindow_control_IN_Down_d:
|
||||
/* During 'Down': '<S3>:18' */
|
||||
if (localB->map[1]) {
|
||||
/* Transition: '<S3>:169' */
|
||||
/* Exit Internal 'Down': '<S3>:18' */
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Up;
|
||||
|
||||
/* Entry 'Up': '<S3>:17' */
|
||||
*rty_window_up = true;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = true;
|
||||
localDW->is_Up = powerwindow_powerwindow_control_IN_Up;
|
||||
} else {
|
||||
switch (localDW->is_Down) {
|
||||
case powerwindow_powerwindow_control_IN_AutoDown:
|
||||
/* During 'AutoDown': '<S3>:111' */
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_control_IN_Down:
|
||||
/* During 'Down': '<S3>:110' */
|
||||
if (localB->map[0]) {
|
||||
/* Transition: '<S3>:26' */
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'InitDown': '<S3>:109' */
|
||||
if (localDW->temporalCounter_i1 >= 20) {
|
||||
/* Transition: '<S3>:119' */
|
||||
if (localB->map[0]) {
|
||||
/* Transition: '<S3>:120' */
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow_control_IN_AutoDown;
|
||||
} else {
|
||||
if (localB->map[2]) {
|
||||
/* Transition: '<S3>:121' */
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow_control_IN_Down;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_control_IN_Neutral:
|
||||
/* During 'Neutral': '<S3>:16' */
|
||||
if (localB->map[1]) {
|
||||
/* Transition: '<S3>:24' */
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Up;
|
||||
|
||||
/* Entry 'Up': '<S3>:17' */
|
||||
*rty_window_up = true;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = true;
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow_control_IN_InitUp;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
} else {
|
||||
if (localB->map[2]) {
|
||||
/* Transition: '<S3>:25' */
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Down_d;
|
||||
|
||||
/* Entry 'Down': '<S3>:18' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = true;
|
||||
*rty_wake = true;
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow_control_IN_InitDown;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'Up': '<S3>:17' */
|
||||
if (localB->map[2]) {
|
||||
/* Transition: '<S3>:166' */
|
||||
/* Exit Internal 'Up': '<S3>:17' */
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Down_d;
|
||||
|
||||
/* Entry 'Down': '<S3>:18' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = true;
|
||||
*rty_wake = true;
|
||||
localDW->is_Down =
|
||||
powerwindow_powerwindow_control_IN_Down;
|
||||
} else {
|
||||
switch (localDW->is_Up) {
|
||||
case powerwindow_powerwindow_control_IN_AutoUp:
|
||||
/* During 'AutoUp': '<S3>:108' */
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_control_IN_InitUp:
|
||||
/* During 'InitUp': '<S3>:106' */
|
||||
if (localDW->temporalCounter_i1 >= 20) {
|
||||
/* Transition: '<S3>:115' */
|
||||
if (localB->map[0]) {
|
||||
/* Transition: '<S3>:118' */
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow_control_IN_AutoUp;
|
||||
} else {
|
||||
if (localB->map[1]) {
|
||||
/* Transition: '<S3>:117' */
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow_control_IN_Up;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'Up': '<S3>:107' */
|
||||
if (localB->map[0]) {
|
||||
/* Transition: '<S3>:23' */
|
||||
localDW->is_Up =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Logic =
|
||||
powerwindow_powerwindow_control_IN_Neutral;
|
||||
|
||||
/* Entry 'Neutral': '<S3>:16' */
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_wake = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* During 'Sensing': '<S3>:96' */
|
||||
switch (localDW->is_Sensing) {
|
||||
case powerwindow_powerwindow_control_IN_SenseEnd:
|
||||
/* During 'SenseEnd': '<S3>:147' */
|
||||
if ((localB->LogicalOperator == 0) &&
|
||||
(*rty_window_up == 1)) {
|
||||
/* Transition: '<S3>:173' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow_control_IN_Start;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
|
||||
/* Entry 'Start': '<S3>:170' */
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
} else
|
||||
*rty_overcurrent = (localB->RateTransition1 > 184);
|
||||
break;
|
||||
|
||||
case powerwindow_powerwindow_contr_IN_SensePinch:
|
||||
/* During 'SensePinch': '<S3>:148' */
|
||||
if ((localB->LogicalOperator == 1) ||
|
||||
(*rty_window_down == 1)) {
|
||||
/* Transition: '<S3>:150' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow_control_IN_SenseEnd;
|
||||
} else
|
||||
*rty_pinch = (localB->RateTransition1 > 92);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* During 'Start': '<S3>:170' */
|
||||
if (localDW->temporalCounter_i2 >= 6) {
|
||||
/* Transition: '<S3>:171' */
|
||||
localDW->is_Sensing =
|
||||
powerwindow_powerwindow_contr_IN_SensePinch;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Initial conditions for referenced model: 'powerwindow_powerwindow_control' */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_Init(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW) {
|
||||
/* InitializeConditions for Chart: '<S2>/stateflow control model' */
|
||||
localDW->is_active_Logic = 0U;
|
||||
localDW->is_Logic = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Down = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->is_Up = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->temporalCounter_i1 = 0U;
|
||||
localDW->is_active_Sensing = 0U;
|
||||
localDW->is_Sensing = powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
localDW->temporalCounter_i2 = 0U;
|
||||
localDW->is_active_c2_PowerWindow_contro = 0U;
|
||||
localDW->is_c2_PowerWindow_control =
|
||||
powerwindow_powerwindow__IN_NO_ACTIVE_CHILD;
|
||||
*rty_window_up = false;
|
||||
*rty_window_down = false;
|
||||
*rty_overcurrent = false;
|
||||
*rty_pinch = false;
|
||||
*rty_wake = false;
|
||||
}
|
||||
|
||||
/* Start for referenced model: 'powerwindow_powerwindow_control' */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_Start(
|
||||
powerwindow_rtDW_PowerWindow_control *localDW) {
|
||||
/* Start for DiscretePulseGenerator: '<S2>/period of 50ms' */
|
||||
localDW->clockTickCounter = 0L;
|
||||
}
|
||||
|
||||
/* Output and update for referenced model: 'powerwindow_powerwindow_control' */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_main(
|
||||
const powerwindow_boolean_T *rtu_up, const powerwindow_boolean_T *rtu_down,
|
||||
const powerwindow_boolean_T *rtu_endofdetectionrange,
|
||||
const powerwindow_uint8_T *rtu_currentsense,
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE) {
|
||||
powerwindow_int16_T rowIdx;
|
||||
powerwindow_int16_T rtb_periodof50ms;
|
||||
|
||||
/* DiscretePulseGenerator: '<S2>/period of 50ms' */
|
||||
rtb_periodof50ms =
|
||||
(localDW->clockTickCounter < 5L) && (localDW->clockTickCounter >= 0L)
|
||||
? 1
|
||||
: 0;
|
||||
if (localDW->clockTickCounter >= 9L)
|
||||
localDW->clockTickCounter = 0L;
|
||||
|
||||
else
|
||||
localDW->clockTickCounter++;
|
||||
|
||||
/* End of DiscretePulseGenerator: '<S2>/period of 50ms' */
|
||||
|
||||
/* Logic: '<S2>/Logical Operator' */
|
||||
localB->LogicalOperator = !*rtu_endofdetectionrange;
|
||||
|
||||
/* RateTransition: '<S2>/Rate Transition1' */
|
||||
localB->RateTransition1 = *rtu_currentsense;
|
||||
|
||||
/* CombinatorialLogic: '<S2>/map' */
|
||||
rowIdx = (powerwindow_int16_T) (((powerwindow_uint16_T) *rtu_up << 1) +
|
||||
*rtu_down);
|
||||
localB->map[0U] = rtCP_map_table[(powerwindow_uint16_T) rowIdx];
|
||||
localB->map[1U] = rtCP_map_table[rowIdx + 4U];
|
||||
localB->map[2U] = rtCP_map_table[rowIdx + 8U];
|
||||
|
||||
/* Chart: '<S2>/stateflow control model' incorporates:
|
||||
TriggerPort: '<S3>/ticks'
|
||||
*/
|
||||
/* DataTypeConversion: '<S2>/Data Type Conversion' */
|
||||
if (((rtb_periodof50ms != 0) !=
|
||||
(localZCE->stateflowcontrolmodel_Trig_ZCE == powerwindow_POS_ZCSIG)) &&
|
||||
(localZCE->stateflowcontrolmodel_Trig_ZCE !=
|
||||
powerwindow_UNINITIALIZED_ZCSIG)) {
|
||||
/* Gateway: PW_PSG/PWExternalClock/stateflow control model */
|
||||
if (localDW->temporalCounter_i1 < 63U)
|
||||
localDW->temporalCounter_i1++;
|
||||
|
||||
if (localDW->temporalCounter_i2 < 7U)
|
||||
localDW->temporalCounter_i2++;
|
||||
|
||||
powerwindow_powerwindow_con_broadcast_ticks(
|
||||
rty_window_up, rty_window_down, rty_overcurrent, rty_pinch,
|
||||
rty_wake, localB, localDW);
|
||||
}
|
||||
|
||||
localZCE->stateflowcontrolmodel_Trig_ZCE =
|
||||
(powerwindow_uint8_T) (rtb_periodof50ms != 0
|
||||
? (powerwindow_int16_T) powerwindow_POS_ZCSIG
|
||||
: (powerwindow_int16_T)
|
||||
powerwindow_ZERO_ZCSIG);
|
||||
|
||||
/* End of DataTypeConversion: '<S2>/Data Type Conversion' */
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_PowerWindow_control *const PowerWindow_control_M,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE) {
|
||||
/* Registration code */
|
||||
|
||||
/* initialize error status */
|
||||
powerwindow_powerwindow_control_rtmSetErrorStatusPointer(
|
||||
PowerWindow_control_M, rt_errorStatus);
|
||||
|
||||
/* block I/O */
|
||||
(void) wcclib_memset(((void *) localB), 0,
|
||||
sizeof(powerwindow_rtB_PowerWindow_control));
|
||||
|
||||
/* states (dwork) */
|
||||
(void) wcclib_memset((void *) localDW, 0,
|
||||
sizeof(powerwindow_rtDW_PowerWindow_control));
|
||||
localZCE->stateflowcontrolmodel_Trig_ZCE = powerwindow_UNINITIALIZED_ZCSIG;
|
||||
}
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,140 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_powerwindow_control.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_powerwindow_control.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PowerWindow_control_h_
|
||||
#define powerwindow_RTW_HEADER_PowerWindow_control_h_
|
||||
#ifndef powerwindow_powerWindow_control_COMMON_INCLUDES_
|
||||
#define powerwindow_powerWindow_control_COMMON_INCLUDES_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtw_solver.h"
|
||||
#endif /* PowerWindow_control_COMMON_INCLUDES_ */
|
||||
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control_private.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_powerwindow_control_types.h"
|
||||
|
||||
/* Shared type includes */
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
|
||||
/* user code (top of header file) */
|
||||
|
||||
/* Block signals for model 'PowerWindow_control' */
|
||||
typedef struct {
|
||||
powerwindow_uint8_T RateTransition1; /* '<S2>/Rate Transition1' */
|
||||
powerwindow_boolean_T LogicalOperator; /* '<S2>/Logical Operator' */
|
||||
powerwindow_boolean_T map[3]; /* '<S2>/map' */
|
||||
} powerwindow_rtB_PowerWindow_control;
|
||||
|
||||
/* Block states (auto storage) for model 'PowerWindow_control' */
|
||||
typedef struct {
|
||||
powerwindow_int32_T clockTickCounter; /* '<S2>/period of 50ms' */
|
||||
powerwindow_uint8_T
|
||||
is_active_c2_PowerWindow_contro; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T
|
||||
is_c2_PowerWindow_control; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_Up; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_Down; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_Logic; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_active_Logic; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_Sensing; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T is_active_Sensing; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T temporalCounter_i1; /* '<S2>/stateflow control model' */
|
||||
powerwindow_uint8_T temporalCounter_i2; /* '<S2>/stateflow control model' */
|
||||
} powerwindow_rtDW_PowerWindow_control;
|
||||
|
||||
/* Zero-crossing (trigger) state for model 'PowerWindow_control' */
|
||||
typedef struct {
|
||||
ZCSigState
|
||||
stateflowcontrolmodel_Trig_ZCE; /* '<S2>/stateflow control model' */
|
||||
} powerwindow_rtZCE_PowerWindow_control;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct powerwindow_tag_RTM_PowerWindow_control {
|
||||
const powerwindow_char_T **errorStatus;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
powerwindow_rtB_PowerWindow_control rtb;
|
||||
powerwindow_rtDW_PowerWindow_control rtdw;
|
||||
powerwindow_RT_MODEL_PowerWindow_control rtm;
|
||||
powerwindow_rtZCE_PowerWindow_control rtzce;
|
||||
} powerwindow_rtMdlrefDWork_PowerWindow_contr;
|
||||
|
||||
/* Model reference registration function */
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_initialize(
|
||||
const powerwindow_char_T **rt_errorStatus,
|
||||
powerwindow_RT_MODEL_PowerWindow_control *const PowerWindow_control_M,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_Init(
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_Start(
|
||||
powerwindow_rtDW_PowerWindow_control *localDW);
|
||||
__attribute__((always_inline)) static inline void
|
||||
powerwindow_powerwindow_control_main(
|
||||
const powerwindow_boolean_T *rtu_up, const powerwindow_boolean_T *rtu_down,
|
||||
const powerwindow_boolean_T *rtu_endofdetectionrange,
|
||||
const powerwindow_uint8_T *rtu_currentsense,
|
||||
powerwindow_boolean_T *rty_window_up,
|
||||
powerwindow_boolean_T *rty_window_down,
|
||||
powerwindow_boolean_T *rty_overcurrent, powerwindow_boolean_T *rty_pinch,
|
||||
powerwindow_boolean_T *rty_wake,
|
||||
powerwindow_rtB_PowerWindow_control *localB,
|
||||
powerwindow_rtDW_PowerWindow_control *localDW,
|
||||
powerwindow_rtZCE_PowerWindow_control *localZCE);
|
||||
|
||||
/*-
|
||||
The generated code includes comments that allow you to trace directly
|
||||
back to the appropriate location in the model. The basic format
|
||||
is <system>/block_name, where system is the system number (uniquely
|
||||
assigned by Simulink) and block_name is the name of the block.
|
||||
|
||||
Use the MATLAB hilite_system command to trace the generated code back
|
||||
to the model. For example,
|
||||
|
||||
hilite_system('<S3>') - opens system 3
|
||||
hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
|
||||
Here is the system hierarchy for this model
|
||||
|
||||
'<Root>' : 'PowerWindow_control'
|
||||
'<S1>' : 'PowerWindow_control/PW_PSG'
|
||||
'<S2>' : 'PowerWindow_control/PW_PSG/PW_PSG'
|
||||
'<S3>' : 'PowerWindow_control/PW_PSG/Tic'
|
||||
'<S4>' : 'PowerWindow_control/PW_PSG/Toc'
|
||||
'<S5>' : 'PowerWindow_control/PW_PSG/PW_PSG/stateflow control model'
|
||||
'<S6>' : 'PowerWindow_control/PW_PSG/Tic/Tic_T'
|
||||
'<S7>' : 'PowerWindow_control/PW_PSG/Toc/Toc_T'
|
||||
*/
|
||||
#endif /* powerwindow_RTW_HEADER_PowerWindow_control_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,59 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_powerwindow_control_private.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_powerwindow_control_private.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_PowerWindow_control_private_h_
|
||||
#define powerwindow_RTW_HEADER_PowerWindow_control_private_h_
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_model_reference_types.h"
|
||||
#include "../powerwindow_HeaderFiles/powerwindow_rtwtypes.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef powerwindow_powerwindow_control_rtmGetErrorStatus
|
||||
#define powerwindow_powerwindow_control_rtmGetErrorStatus(rtm) \
|
||||
(*((rtm)->errorStatus))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_powerwindow_control_rtmSetErrorStatus
|
||||
#define powerwindow_powerwindow_control_rtmSetErrorStatus(rtm, val) \
|
||||
(*((rtm)->errorStatus) = (val))
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_powerwindow_control_rtmGetErrorStatusPointer
|
||||
#define powerwindow_powerwindow_control_rtmGetErrorStatusPointer(rtm) \
|
||||
(rtm)->errorStatus
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_powerwindow_control_rtmSetErrorStatusPointer
|
||||
#define powerwindow_powerwindow_control_rtmSetErrorStatusPointer(rtm, val) \
|
||||
((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
extern const powerwindow_boolean_T powerwindow_rtCP_pooled_6bUUQf1tASYw[12];
|
||||
|
||||
#define rtCP_map_table \
|
||||
powerwindow_rtCP_pooled_6bUUQf1tASYw /* Computed Parameter: map_table \
|
||||
Referenced by: '<S2>/map' \
|
||||
*/
|
||||
#endif /* RTW_HEADER_PowerWindow_control_private_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_powerwindow_control_types.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_powerwindow_control_types.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow_RTW_HEADER_powerwindow_control_types_h_
|
||||
#define powerwindow_RTW_HEADER_powerwindow_control_types_h_
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct powerwindow_tag_RTM_PowerWindow_control
|
||||
powerwindow_RT_MODEL_PowerWindow_control;
|
||||
|
||||
#endif /* RTW_HEADER_powerwindow_control_types_h_ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,127 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_rtw_continuous.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_rtw_continuous.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow___RTW_CONTINUOUS_H__
|
||||
#define powerwindow___RTW_CONTINUOUS_H__
|
||||
|
||||
// #include "../powerwindow_HeaderFiles/powerwindow_tmwtypes.h"
|
||||
|
||||
/* For models registering MassMatrix */
|
||||
typedef enum {
|
||||
SS_MATRIX_NONE,
|
||||
SS_MATRIX_CONSTANT,
|
||||
SS_MATRIX_TIMEDEP,
|
||||
SS_MATRIX_STATEDEP
|
||||
} powerwindow_ssMatrixType;
|
||||
|
||||
typedef enum {
|
||||
SOLVER_MODE_AUTO, /* only occurs in
|
||||
mdlInitializeSizes/mdlInitializeSampleTimes */
|
||||
SOLVER_MODE_SINGLETASKING,
|
||||
SOLVER_MODE_MULTITASKING
|
||||
} powerwindow_SolverMode;
|
||||
|
||||
typedef enum { MINOR_TIME_STEP, MAJOR_TIME_STEP } powerwindow_SimTimeStep;
|
||||
|
||||
/* =============================================================================
|
||||
Model methods object
|
||||
=============================================================================
|
||||
*/
|
||||
typedef void (*powerwindow_rtMdlInitializeSizesFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlInitializeSampleTimesFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlStartFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlOutputsFcn)(void *rtModel,
|
||||
powerwindow_int_T tid);
|
||||
typedef void (*powerwindow_rtMdlUpdateFcn)(void *rtModel,
|
||||
powerwindow_int_T tid);
|
||||
typedef void (*powerwindow_rtMdlDerivativesFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlProjectionFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlMassMatrixFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlForcingFunctionFcn)(void *rtModel);
|
||||
typedef void (*powerwindow_rtMdlTerminateFcn)(void *rtModel);
|
||||
#ifdef RT_MALLOC
|
||||
typedef real_T (*rtMdlDiscreteEventsFcn)(
|
||||
void *pModel, powerwindow_int_T rtmNumSampTimes, void *rtmTimingData,
|
||||
powerwindow_int_T *rtmSampleHitPtr,
|
||||
powerwindow_int_T *rtmPerTaskSampleHits);
|
||||
#endif
|
||||
|
||||
typedef struct powerwindow__RTWRTModelMethodsInfo_tag {
|
||||
void *rtModelPtr;
|
||||
powerwindow_rtMdlInitializeSizesFcn rtmInitSizesFcn;
|
||||
powerwindow_rtMdlInitializeSampleTimesFcn rtmInitSampTimesFcn;
|
||||
powerwindow_rtMdlStartFcn rtmStartFcn;
|
||||
powerwindow_rtMdlOutputsFcn rtmOutputsFcn;
|
||||
powerwindow_rtMdlUpdateFcn rtmUpdateFcn;
|
||||
powerwindow_rtMdlDerivativesFcn rtmDervisFcn;
|
||||
powerwindow_rtMdlProjectionFcn rtmProjectionFcn;
|
||||
powerwindow_rtMdlMassMatrixFcn rtmMassMatrixFcn;
|
||||
powerwindow_rtMdlForcingFunctionFcn rtmForcingFunctionFcn;
|
||||
powerwindow_rtMdlTerminateFcn rtmTerminateFcn;
|
||||
#ifdef RT_MALLOC
|
||||
rtMdlDiscreteEventsFcn rtmDiscreteEventsFcn;
|
||||
#endif
|
||||
} powerwindow_RTWRTModelMethodsInfo;
|
||||
|
||||
#define rtmiSetRTModelPtr(M, rtmp) ((M).rtModelPtr = (rtmp))
|
||||
#define rtmiGetRTModelPtr(M) (M).rtModelPtr
|
||||
|
||||
#define rtmiSetInitSizesFcn(M, fp) \
|
||||
((M).rtmInitSizesFcn = ((powerwindow_rtMdlInitializeSizesFcn) (fp)))
|
||||
#define rtmiSetInitSampTimesFcn(M, fp) \
|
||||
((M).rtmInitSampTimesFcn = \
|
||||
((powerwindow_rtMdlInitializeSampleTimesFcn) (fp)))
|
||||
#define rtmiSetStartFcn(M, fp) \
|
||||
((M).rtmStartFcn = ((powerwindow_rtMdlStartFcn) (fp)))
|
||||
#define rtmiSetOutputsFcn(M, fp) \
|
||||
((M).rtmOutputsFcn = ((powerwindow_rtMdlOutputsFcn) (fp)))
|
||||
#define rtmiSetUpdateFcn(M, fp) \
|
||||
((M).rtmUpdateFcn = ((powerwindow_rtMdlUpdateFcn) (fp)))
|
||||
#define rtmiSetDervisFcn(M, fp) \
|
||||
((M).rtmDervisFcn = ((powerwindow_rtMdlDerivativesFcn) (fp)))
|
||||
#define rtmiSetProjectionFcn(M, fp) \
|
||||
((M).rtmProjectionFcn = ((powerwindow_rtMdlProjectionFcn) (fp)))
|
||||
#define rtmiSetMassMatrixFcn(M, fp) \
|
||||
((M).rtmMassMatrixFcn = ((powerwindow_rtMdlMassMatrixFcn) (fp)))
|
||||
#define rtmiSetForcingFunctionFcn(M, fp) \
|
||||
((M).rtmForcingFunctionFcn = ((powerwindow_rtMdlForcingFunctionFcn) (fp)))
|
||||
#define rtmiSetTerminateFcn(M, fp) \
|
||||
((M).rtmTerminateFcn = ((powerwindow_rtMdlTerminateFcn) (fp)))
|
||||
#ifdef RT_MALLOC
|
||||
#define rtmiSetDiscreteEventsFcn(M, fp) \
|
||||
((M).rtmDiscreteEventsFcn = ((rtMdlDiscreteEventsFcn) (fp)))
|
||||
#endif
|
||||
|
||||
#define rtmiInitializeSizes(M) ((*(M).rtmInitSizesFcn)((M).rtModelPtr))
|
||||
#define rtmiInitializeSampleTimes(M) \
|
||||
((*(M).rtmInitSampTimesFcn)((M).rtModelPtr))
|
||||
#define rtmiStart(M) ((*(M).rtmStartFcn)((M).rtModelPtr))
|
||||
#define rtmiOutputs(M, tid) ((*(M).rtmOutputsFcn)((M).rtModelPtr, tid))
|
||||
#define rtmiUpdate(M, tid) ((*(M).rtmUpdateFcn)((M).rtModelPtr, tid))
|
||||
#define rtmiDerivatives(M) ((*(M).rtmDervisFcn)((M).rtModelPtr))
|
||||
#define rtmiProjection(M) ((*(M).rtmProjectionFcn)((M).rtModelPtr))
|
||||
#define rtmiMassMatrix(M) ((*(M).rtmMassMatrixFcn)((M).rtModelPtr))
|
||||
#define rtmiForcingFunction(M) ((*(M).rtmForcingFunctionFcn)((M).rtModelPtr))
|
||||
#define rtmiTerminate(M) ((*(M).rtmTerminateFcn)((M).rtModelPtr))
|
||||
#ifdef RT_MALLOC
|
||||
#define rtmiDiscreteEvents(M, x1, x2, x3, x4) \
|
||||
((*(M).rtmDiscreteEventsFcn)((M).rtModelPtr, (x1), (x2), (x3), (x4)))
|
||||
#endif
|
||||
#endif /* __RTW_CONTINUOUS_H__ */
|
||||
@ -0,0 +1,255 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_rtw_solver.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_rtw_solver.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow___RTW_SOLVER_H__
|
||||
#define powerwindow___RTW_SOLVER_H__
|
||||
|
||||
/* =============================================================================
|
||||
Solver object
|
||||
=============================================================================
|
||||
*/
|
||||
#ifndef NO_FLOATS /* ERT integer-only */
|
||||
/*
|
||||
Enum for solver tolerance
|
||||
*/
|
||||
typedef enum {
|
||||
SL_SOLVER_TOLERANCE_AUTO = 0, /* Set Automatically by Solver */
|
||||
SL_SOLVER_TOLERANCE_LOCAL = 1, /* Set Locally, e.g., by Blocks */
|
||||
SL_SOLVER_TOLERANCE_GLOBAL = 2, /* Set Globally, e.g., by Block Diagram */
|
||||
SL_SOLVER_TOLERANCE_UNDEFINED = 255 /* Signal uninitialized */
|
||||
} powerwindow_SL_SolverToleranceControlFlag_T;
|
||||
|
||||
/*
|
||||
Enum for jacobian method control
|
||||
*/
|
||||
typedef enum {
|
||||
SL_JM_BD_AUTO = 0,
|
||||
SL_JM_BD_SPARSE_PERTURBATION,
|
||||
SL_JM_BD_FULL_PERTURBATION,
|
||||
SL_JM_BD_SPARSE_ANALYTICAL,
|
||||
SL_JM_BD_FULL_ANALYTICAL
|
||||
} powerwindow_slJmBdControl;
|
||||
|
||||
typedef struct _ssSolverInfo_tag {
|
||||
void *rtModelPtr;
|
||||
|
||||
const char *solverName;
|
||||
powerwindow_boolean_T isVariableStepSolver;
|
||||
powerwindow_boolean_T solverNeedsReset;
|
||||
|
||||
powerwindow_time_T solverStopTime;
|
||||
powerwindow_time_T *stepSizePtr;
|
||||
powerwindow_time_T minStepSize;
|
||||
powerwindow_time_T maxStepSize;
|
||||
powerwindow_time_T fixedStepSize;
|
||||
|
||||
powerwindow_int_T solverShapePreserveControl;
|
||||
powerwindow_int_T solverMaxConsecutiveMinStep;
|
||||
powerwindow_int_T maxNumMinSteps;
|
||||
powerwindow_int_T solverMaxOrder;
|
||||
powerwindow_real_T solverConsecutiveZCsStepRelTol;
|
||||
powerwindow_int_T solverMaxConsecutiveZCs;
|
||||
|
||||
powerwindow_int_T solverExtrapolationOrder;
|
||||
powerwindow_int_T solverNumberNewtonIterations;
|
||||
|
||||
powerwindow_int_T solverRefineFactor;
|
||||
powerwindow_real_T solverRelTol;
|
||||
powerwindow_real_T unused_real_T_1;
|
||||
|
||||
powerwindow_real_T **dXPtr;
|
||||
powerwindow_time_T **tPtr;
|
||||
|
||||
powerwindow_int_T *numContStatesPtr;
|
||||
powerwindow_real_T **contStatesPtr;
|
||||
|
||||
powerwindow_real_T *zcSignalVector;
|
||||
powerwindow_uint8_T *zcEventsVector;
|
||||
powerwindow_uint8_T *zcSignalAttrib;
|
||||
powerwindow_int_T zcSignalVectorLength;
|
||||
powerwindow_uint8_T *reserved;
|
||||
|
||||
powerwindow_boolean_T foundContZcEvents;
|
||||
powerwindow_boolean_T isAtLeftPostOfContZcEvent;
|
||||
powerwindow_boolean_T isAtRightPostOfContZcEvent;
|
||||
powerwindow_boolean_T adaptiveZcDetection;
|
||||
|
||||
powerwindow_int_T numZcSignals;
|
||||
|
||||
powerwindow_boolean_T stateProjection;
|
||||
powerwindow_boolean_T robustResetMethod; /* user's preference */
|
||||
powerwindow_boolean_T updateJacobianAtReset; /* S-Fcn request (sticky) */
|
||||
powerwindow_boolean_T consistencyChecking;
|
||||
|
||||
powerwindow_int_T massMatrixNzMax;
|
||||
powerwindow_int_T *massMatrixIr;
|
||||
powerwindow_int_T *massMatrixJc;
|
||||
powerwindow_real_T *massMatrixPr;
|
||||
|
||||
const powerwindow_char_T **errStatusPtr;
|
||||
|
||||
powerwindow_real_T zcThreshold;
|
||||
powerwindow_int_T zeroCrossAlgorithm;
|
||||
powerwindow_int_T consecutiveZCsError;
|
||||
|
||||
powerwindow_boolean_T isComputingJacobian;
|
||||
powerwindow_slJmBdControl solverJacobianMethodControl;
|
||||
powerwindow_int_T ignoredZcDiagnostic;
|
||||
powerwindow_int_T maskedZcDiagnostic;
|
||||
powerwindow_boolean_T isOutputMethodComputed;
|
||||
} ssSolverInfo;
|
||||
|
||||
/* Support old name RTWSolverInfo */
|
||||
typedef ssSolverInfo RTWSolverInfo;
|
||||
|
||||
#define rtsiSetRTModelPtr(S, rtmp) ((S)->rtModelPtr = (rtmp))
|
||||
#define rtsiGetRTModelPtr(S) (S)->rtModelPtr
|
||||
|
||||
#define rtsiSetSimTimeStepPtr(S, stp) ((S)->simTimeStepPtr = (stp))
|
||||
#define rtsiGetSimTimeStepPtr(S) ((S)->simTimeStepPtr)
|
||||
#define rtsiGetSimTimeStep(S) *((S)->simTimeStepPtr)
|
||||
#define rtsiSetSimTimeStep(S, st) (*((S)->simTimeStepPtr) = (st))
|
||||
|
||||
#define rtsiSetSolverData(S, sd) ((S)->solverData = (sd))
|
||||
#define rtsiGetSolverData(S) (S)->solverData
|
||||
|
||||
#define rtsiSetSolverName(S, sn) ((S)->solverName = (sn))
|
||||
#define rtsiGetSolverName(S) (S)->solverName
|
||||
|
||||
#define rtsiSetVariableStepSolver(S, vs) ((S)->isVariableStepSolver = (vs))
|
||||
#define rtsiIsVariableStepSolver(S) (S)->isVariableStepSolver
|
||||
|
||||
#define rtsiSetSolverNeedsReset(S, sn) ((S)->solverNeedsReset = (sn))
|
||||
#define rtsiGetSolverNeedsReset(S) (S)->solverNeedsReset
|
||||
|
||||
#define rtsiSetBlkStateChange(S, sn) ((S)->blkStateChange = (sn))
|
||||
#define rtsiGetBlkStateChange(S) (S)->blkStateChange
|
||||
|
||||
#define rtsiSetSolverMode(S, sm) ((S)->solverMode = (sm))
|
||||
#define rtsiGetSolverMode(S) (S)->solverMode
|
||||
|
||||
#define rtsiSetSolverStopTime(S, st) ((S)->solverStopTime = (st))
|
||||
#define rtsiGetSolverStopTime(S) (S)->solverStopTime
|
||||
|
||||
#define rtsiSetStepSizePtr(S, ssp) ((S)->stepSizePtr = (ssp))
|
||||
#define rtsiSetStepSize(S, ss) (*((S)->stepSizePtr) = (ss))
|
||||
#define rtsiGetStepSize(S) *((S)->stepSizePtr)
|
||||
|
||||
#define rtsiSetMinStepSize(S, ss) (((S)->minStepSize = (ss)))
|
||||
#define rtsiGetMinStepSize(S) (S)->minStepSize
|
||||
|
||||
#define rtsiSetMaxStepSize(S, ss) ((S)->maxStepSize = (ss))
|
||||
#define rtsiGetMaxStepSize(S) (S)->maxStepSize
|
||||
|
||||
#define rtsiSetFixedStepSize(S, ss) ((S)->fixedStepSize = (ss))
|
||||
#define rtsiGetFixedStepSize(S) (S)->fixedStepSize
|
||||
|
||||
#define rtsiSetMaxNumMinSteps(S, mns) ((S)->maxNumMinSteps = (mns))
|
||||
#define rtsiGetMaxNumMinSteps(S) (S)->maxNumMinSteps
|
||||
|
||||
#define rtsiSetSolverMaxOrder(S, smo) ((S)->solverMaxOrder = (smo))
|
||||
#define rtsiGetSolverMaxOrder(S) (S)->solverMaxOrder
|
||||
|
||||
#define rtsiSetSolverJacobianMethodControl(S, smcm) \
|
||||
(ssGetSolverInfo(S)->solverJacobianMethodControl = (smcm))
|
||||
#define rtsiGetSolverJacobianMethodControl(S) \
|
||||
ssGetSolverInfo(S)->solverJacobianMethodControl
|
||||
|
||||
#define rtsiSetSolverShapePreserveControl(S, smcm) \
|
||||
(ssGetSolverInfo(S)->solverShapePreserveControl = (smcm))
|
||||
#define rtsiGetSolverShapePreserveControl(S) \
|
||||
ssGetSolverInfo(S)->solverShapePreserveControl
|
||||
|
||||
#define rtsiSetSolverConsecutiveZCsStepRelTol(S, scr) \
|
||||
(ssGetSolverInfo(S)->solverConsecutiveZCsStepRelTol = (scr))
|
||||
#define rtsiGetSolverConsecutiveZCsStepRelTol(S) \
|
||||
ssGetSolverInfo(S)->solverConsecutiveZCsStepRelTol
|
||||
|
||||
#define rtsiSetSolverMaxConsecutiveZCs(S, smcz) \
|
||||
(ssGetSolverInfo(S)->solverMaxConsecutiveZCs = (smcz))
|
||||
#define rtsiGetSolverMaxConsecutiveZCs(S) \
|
||||
ssGetSolverInfo(S)->solverMaxConsecutiveZCs
|
||||
|
||||
#define rtsiSetSolverMaxConsecutiveMinStep(S, smcm) \
|
||||
(ssGetSolverInfo(S)->solverMaxConsecutiveMinStep = (smcm))
|
||||
#define rtsiGetSolverMaxConsecutiveMinStep(S) \
|
||||
ssGetSolverInfo(S)->solverMaxConsecutiveMinStep
|
||||
|
||||
#define rtsiSetSolverExtrapolationOrder(S, seo) \
|
||||
((S)->solverExtrapolationOrder = (seo))
|
||||
#define rtsiGetSolverExtrapolationOrder(S) (S)->solverExtrapolationOrder
|
||||
|
||||
#define rtsiSetSolverNumberNewtonIterations(S, nni) \
|
||||
((S)->solverNumberNewtonIterations = (nni))
|
||||
#define rtsiGetSolverNumberNewtonIterations(S) (S)->solverNumberNewtonIterations
|
||||
|
||||
#define rtsiSetSolverRefineFactor(S, smo) ((S)->solverRefineFactor = (smo))
|
||||
#define rtsiGetSolverRefineFactor(S) (S)->solverRefineFactor
|
||||
|
||||
#define rtsiSetSolverRelTol(S, smo) ((S)->solverRelTol = (smo))
|
||||
#define rtsiGetSolverRelTol(S) (S)->solverRelTol
|
||||
|
||||
#define rtsiSetSolverMassMatrixType(S, type) ((S)->massMatrixType = (type))
|
||||
#define rtsiGetSolverMassMatrixType(S) (S)->massMatrixType
|
||||
|
||||
#define rtsiSetSolverMassMatrixNzMax(S, nzMax) ((S)->massMatrixNzMax = (nzMax))
|
||||
#define rtsiGetSolverMassMatrixNzMax(S) (S)->massMatrixNzMax
|
||||
|
||||
#define rtsiSetSolverMassMatrixIr(S, ir) ((S)->massMatrixIr = (ir))
|
||||
#define rtsiGetSolverMassMatrixIr(S) (S)->massMatrixIr
|
||||
|
||||
#define rtsiSetSolverMassMatrixJc(S, jc) ((S)->massMatrixJc = (jc))
|
||||
#define rtsiGetSolverMassMatrixJc(S) (S)->massMatrixJc
|
||||
|
||||
#define rtsiSetSolverMassMatrixPr(S, pr) ((S)->massMatrixPr = (pr))
|
||||
#define rtsiGetSolverMassMatrixPr(S) (S)->massMatrixPr
|
||||
|
||||
#define rtsiSetdXPtr(S, dxp) ((S)->dXPtr = (dxp))
|
||||
#define rtsiSetdX(S, dx) (*((S)->dXPtr) = (dx))
|
||||
#define rtsiGetdX(S) *((S)->dXPtr)
|
||||
|
||||
#define rtsiSetTPtr(S, tp) ((S)->tPtr = (tp))
|
||||
#define rtsiSetT(S, t) ((*((S)->tPtr))[0] = (t))
|
||||
#define rtsiGetT(S) (*((S)->tPtr))[0]
|
||||
|
||||
#define rtsiSetContStatesPtr(S, cp) ((S)->contStatesPtr = (cp))
|
||||
#define rtsiGetContStates(S) *((S)->contStatesPtr)
|
||||
|
||||
#define rtsiSetNumContStatesPtr(S, cp) ((S)->numContStatesPtr = (cp))
|
||||
#define rtsiGetNumContStates(S) *((S)->numContStatesPtr)
|
||||
|
||||
#define rtsiSetErrorStatusPtr(S, esp) ((S)->errStatusPtr = (esp))
|
||||
#define rtsiSetErrorStatus(S, es) (*((S)->errStatusPtr) = (es))
|
||||
#define rtsiGetErrorStatus(S) *((S)->errStatusPtr)
|
||||
|
||||
#define rtsiSetModelMethodsPtr(S, mmp) ((S)->modelMethodsPtr = (mmp))
|
||||
#define rtsiGetModelMethodsPtr(S) (S)->modelMethodsPtr
|
||||
|
||||
#define rtsiSetSolverComputingJacobian(S, val) \
|
||||
((S)->isComputingJacobian = (val))
|
||||
#define rtsiIsSolverComputingJacobian(S) (S)->isComputingJacobian
|
||||
|
||||
#define rtsiSetSolverOutputComputed(S, val) \
|
||||
((S)->isOutputMethodComputed = (val))
|
||||
#define rtsiIsSolverOutputComputed(S) (S)->isOutputMethodComputed
|
||||
|
||||
#endif /* !NO_FLOATS */
|
||||
|
||||
#endif /* powerwindow___RTW_SOLVER_H__ */
|
||||
@ -0,0 +1,201 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_rtwtypes.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_rtwtypes.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#ifndef powerwindow__RTWTYPES_H__
|
||||
#define powerwindow__RTWTYPES_H__
|
||||
|
||||
/* Logical type definitions */
|
||||
#if (!defined(__cplusplus))
|
||||
#ifndef false
|
||||
#define false (0U)
|
||||
#endif
|
||||
|
||||
#ifndef true
|
||||
#define true (1U)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define powerwindow__TMWTYPES__
|
||||
|
||||
/*=======================================================================*
|
||||
Target hardware information
|
||||
|
||||
Number of bits: char: 8 short: 16 int: 16
|
||||
long: 32
|
||||
native word size: 8
|
||||
Byte ordering: LittleEndian
|
||||
Signed integer division rounds to: Zero
|
||||
Shift right on a signed integer as arithmetic shift: on
|
||||
=======================================================================*/
|
||||
|
||||
/*=======================================================================*
|
||||
Fixed width word size data types:
|
||||
powerwindow_int8_T, powerwindow_int16_T, powerwindow_int32_T - signed
|
||||
8, 16, or 32 bit integers powerwindow_uint8_T, powerwindow_uint16_T,
|
||||
powerwindow_uint32_T - unsigned 8, 16, or 32 bit integers
|
||||
powerwindow_real32_T, powerwindow_real64_T - 32 and 64 bit
|
||||
floating point numbers
|
||||
=======================================================================*/
|
||||
typedef signed char powerwindow_int8_T;
|
||||
typedef unsigned char powerwindow_uint8_T;
|
||||
typedef int powerwindow_int16_T;
|
||||
typedef unsigned int powerwindow_uint16_T;
|
||||
typedef long powerwindow_int32_T;
|
||||
typedef unsigned long powerwindow_uint32_T;
|
||||
typedef float powerwindow_real32_T;
|
||||
typedef double powerwindow_real64_T;
|
||||
|
||||
/*===========================================================================*
|
||||
Generic type definitions: powerwindow_real_T, powerwindow_time_T,
|
||||
powerwindow_boolean_T, powerwindow_int_T, powerwindow_uint_T,
|
||||
powerwindow_ulong_T, powerwindow_char_T and
|
||||
powerwindow_byte_T.
|
||||
===========================================================================*/
|
||||
typedef double powerwindow_real_T;
|
||||
typedef double powerwindow_time_T;
|
||||
typedef unsigned char powerwindow_boolean_T;
|
||||
typedef int powerwindow_int_T;
|
||||
typedef unsigned int powerwindow_uint_T;
|
||||
typedef unsigned long powerwindow_ulong_T;
|
||||
typedef char powerwindow_char_T;
|
||||
typedef unsigned char powerwindow_uchar_T;
|
||||
typedef powerwindow_char_T powerwindow_byte_T;
|
||||
|
||||
/*===========================================================================*
|
||||
Complex number type definitions
|
||||
===========================================================================*/
|
||||
#define powerwindow_CREAL_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_real32_T re;
|
||||
powerwindow_real32_T im;
|
||||
} powerwindow_creal32_T;
|
||||
|
||||
typedef struct {
|
||||
powerwindow_real64_T re;
|
||||
powerwindow_real64_T im;
|
||||
} powerwindow_creal64_T;
|
||||
|
||||
typedef struct {
|
||||
powerwindow_real_T re;
|
||||
powerwindow_real_T im;
|
||||
} powerwindow_creal_T;
|
||||
|
||||
#define powerwindow_CINT8_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_int8_T re;
|
||||
powerwindow_int8_T im;
|
||||
} powerwindow_cint8_T;
|
||||
|
||||
#define powerwindow_CUINT8_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_uint8_T re;
|
||||
powerwindow_uint8_T im;
|
||||
} powerwindow_cuint8_T;
|
||||
|
||||
#define powerwindow_CINT16_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_int16_T re;
|
||||
powerwindow_int16_T im;
|
||||
} powerwindow_cint16_T;
|
||||
|
||||
#define powerwindow_CUINT16_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_uint16_T re;
|
||||
powerwindow_uint16_T im;
|
||||
} powerwindow_cuint16_T;
|
||||
|
||||
#define powerwindow_CINT32_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_int32_T re;
|
||||
powerwindow_int32_T im;
|
||||
} powerwindow_cint32_T;
|
||||
|
||||
#define powerwindow_CUINT32_T
|
||||
|
||||
typedef struct {
|
||||
powerwindow_uint32_T re;
|
||||
powerwindow_uint32_T im;
|
||||
} powerwindow_cuint32_T;
|
||||
|
||||
/*=======================================================================*
|
||||
Min and Max:
|
||||
powerwindow_int8_T, powerwindow_int16_T, powerwindow_int32_T - signed
|
||||
8, 16, or 32 bit integers powerwindow_uint8_T, powerwindow_uint16_T,
|
||||
powerwindow_uint32_T - unsigned 8, 16, or 32 bit integers
|
||||
=======================================================================*/
|
||||
#define powerwindow_MAX_int8_T ((powerwindow_int8_T) (127))
|
||||
#define powerwindow_MIN_int8_T ((powerwindow_int8_T) (-128))
|
||||
#define powerwindow_MAX_uint8_T ((powerwindow_uint8_T) (255U))
|
||||
#define powerwindow_MIN_uint8_T ((powerwindow_uint8_T) (0U))
|
||||
#define powerwindow_MAX_int16_T ((powerwindow_int16_T) (32767))
|
||||
#define powerwindow_MIN_int16_T ((powerwindow_int16_T) (-32768))
|
||||
#define powerwindow_MAX_uint16_T ((powerwindow_uint16_T) (65535U))
|
||||
#define powerwindow_MIN_uint16_T ((powerwindow_uint16_T) (0U))
|
||||
#define powerwindow_MAX_int32_T ((powerwindow_int32_T) (2147483647))
|
||||
#define powerwindow_MIN_int32_T ((powerwindow_int32_T) (-2147483647 - 1))
|
||||
#define powerwindow_MAX_uint32_T ((powerwindow_uint32_T) (0xFFFFFFFFU))
|
||||
#define powerwindow_MIN_uint32_T ((powerwindow_uint32_T) (0U))
|
||||
|
||||
/* Block D-Work pointer type */
|
||||
typedef void *powerwindow_pointer_T;
|
||||
|
||||
#define powerwindow_input_length 977
|
||||
|
||||
/* Simulink specific types */
|
||||
#ifndef powerwindow___ZERO_CROSSING_TYPES__
|
||||
#define powerwindow___ZERO_CROSSING_TYPES__
|
||||
|
||||
/* Trigger directions: falling, either, and rising */
|
||||
typedef enum {
|
||||
FALLING_ZERO_CROSSING = -1,
|
||||
ANY_ZERO_CROSSING = 0,
|
||||
RISING_ZERO_CROSSING = 1
|
||||
} powerwindow_ZCDirection;
|
||||
|
||||
/* Previous state of a trigger signal */
|
||||
typedef powerwindow_uint8_T ZCSigState;
|
||||
|
||||
/* Initial value of a trigger zero crossing signal */
|
||||
#define powerwindow_UNINITIALIZED_ZCSIG 0x03U
|
||||
#define powerwindow_NEG_ZCSIG 0x02U
|
||||
#define powerwindow_POS_ZCSIG 0x01U
|
||||
#define powerwindow_ZERO_ZCSIG 0x00U
|
||||
|
||||
/* Current state of a trigger signal */
|
||||
typedef enum {
|
||||
FALLING_ZCEVENT = -1,
|
||||
NO_ZCEVENT = 0,
|
||||
RISING_ZCEVENT = 1
|
||||
} powerwindow_ZCEventType;
|
||||
|
||||
#endif /* powerwindow___ZERO_CROSSING_TYPES__ */
|
||||
#endif /* powerwindow__RTWTYPES_H__ */
|
||||
|
||||
/*
|
||||
File trailer for generated code.
|
||||
|
||||
[ EOF ]
|
||||
*/
|
||||
@ -0,0 +1,814 @@
|
||||
/*
|
||||
|
||||
This program is part of the TACLeBench benchmark suite.
|
||||
Version V 1.x
|
||||
|
||||
Name: powerwindow_tmwtypes.h
|
||||
|
||||
Author: CoSys-Lab, University of Antwerp
|
||||
|
||||
Function: headerfile
|
||||
|
||||
Source:
|
||||
https://github.com/tacle/tacle-bench/blob/master/bench/app/PowerWindow/powerwindow_HeaderFiles/powerwindow_tmwtypes.h
|
||||
|
||||
Changes: a brief summary of major functional changes and formatting)
|
||||
|
||||
License: GNU General Public License
|
||||
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef powerwindow_tmwtypes_h
|
||||
#define powerwindow_tmwtypes_h
|
||||
|
||||
#ifndef powerwindow__TMWTYPES__
|
||||
#define powerwindow__TMWTYPES__
|
||||
/*
|
||||
File : tmwtypes.h
|
||||
Abstract:
|
||||
Data types for use with MATLAB/SIMULINK and the Real-Time Workshop.
|
||||
|
||||
When compiling stand-alone model code, data types can be overridden
|
||||
via compiler switches.
|
||||
|
||||
Define NO_FLOATS to eliminate reference to powerwindow_real_T, etc.
|
||||
*/
|
||||
|
||||
#define LOGICAL_IS_A_TYPE
|
||||
#define SPARSE_GENERALIZATION
|
||||
|
||||
#ifdef NO_FLOATS
|
||||
#define double double_not_allowed
|
||||
#define float float_not_allowed
|
||||
#endif /*NO_FLOATS*/
|
||||
|
||||
/*
|
||||
The following data types cannot be overridden when building MEX files.
|
||||
*/
|
||||
#ifdef MATLAB_MEX_FILE
|
||||
#undef CHARACTER_T
|
||||
#undef INTEGER_T
|
||||
#undef BOOLEAN_T
|
||||
#undef REAL_T
|
||||
#undef TIME_T
|
||||
#endif
|
||||
|
||||
/*
|
||||
The powerwindow_uchar_T, powerwindow_ushort_T and powerwindow_ulong_T types
|
||||
are needed for compilers which do not allow defines to be specified, at the
|
||||
command line, with spaces in them.
|
||||
*/
|
||||
|
||||
typedef unsigned char powerwindow_uchar_T;
|
||||
typedef unsigned short powerwindow_ushort_T;
|
||||
typedef unsigned long powerwindow_ulong_T;
|
||||
|
||||
#if (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__x86_64__) || \
|
||||
defined(__LP64__) || defined(__LCC64__)
|
||||
|
||||
typedef unsigned long long powerwindow_ulonglong_T;
|
||||
#endif
|
||||
|
||||
/*=======================================================================*
|
||||
Fixed width word size data types:
|
||||
powerwindow_int8_T, powerwindow_int16_T, powerwindow_int32_T - signed
|
||||
8, 16, or 32 bit integers powerwindow_uint8_T, powerwindow_uint16_T,
|
||||
powerwindow_uint32_T - unsigned 8, 16, or 32 bit integers
|
||||
powerwindow_real32_T, powerwindow_real64_T - 32 and 64 bit
|
||||
floating point numbers
|
||||
=======================================================================*/
|
||||
|
||||
/* When used with Real Time Workshop generated code, this
|
||||
header file can be used with a variety of compilers.
|
||||
|
||||
The compiler could be for an 8 bit embedded processor that
|
||||
only had 8 bits per integer and 16 bits per long.
|
||||
In that example, a 32 bit integer size is not even available.
|
||||
This header file should be robust to that.
|
||||
|
||||
For the case of an 8 bit processor, the preprocessor
|
||||
may be limited to 16 bit math like its target. That limitation
|
||||
would mean that 32 bit comparisons can't be done accurately.
|
||||
To increase robustness to this, comparisons are done against
|
||||
smaller values first. An inaccurate 32 bit comparison isn't
|
||||
attempted if the 16 bit comparison has already succeeded.
|
||||
|
||||
Limitations on preprocessor math can also be stricter than
|
||||
for the target. There are known cases where a compiler
|
||||
targeting processors with 64 bit longs can't do accurate
|
||||
preprocessor comparisons on more than 32 bits.
|
||||
*/
|
||||
|
||||
/* Determine the number of bits for int, long, short, and char.
|
||||
If one fails to be determined, set the number of bits to -1
|
||||
*/
|
||||
|
||||
#ifndef TMW_BITS_PER_INT
|
||||
#if INT_MAX == 0x7FL
|
||||
#define TMW_BITS_PER_INT 8
|
||||
#elif INT_MAX == 0x7FFFL
|
||||
#define TMW_BITS_PER_INT 16
|
||||
#elif INT_MAX == 0x7FFFFFFFL
|
||||
#define TMW_BITS_PER_INT 32
|
||||
#else
|
||||
#define TMW_BITS_PER_INT -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_LONG
|
||||
#if LONG_MAX == 0x7FL
|
||||
#define TMW_BITS_PER_LONG 8
|
||||
#elif LONG_MAX == 0x7FFFL
|
||||
#define TMW_BITS_PER_LONG 16
|
||||
#elif LONG_MAX == 0x7FFFFFFFL
|
||||
#define TMW_BITS_PER_LONG 32
|
||||
#else
|
||||
#define TMW_BITS_PER_LONG -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_SHRT
|
||||
#if SHRT_MAX == 0x7FL
|
||||
#define TMW_BITS_PER_SHRT 8
|
||||
#elif SHRT_MAX == 0x7FFFL
|
||||
#define TMW_BITS_PER_SHRT 16
|
||||
#elif SHRT_MAX == 0x7FFFFFFFL
|
||||
#define TMW_BITS_PER_SHRT 32
|
||||
#else
|
||||
#define TMW_BITS_PER_SHRT -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_SCHAR
|
||||
#if SCHAR_MAX == 0x7FL
|
||||
#define TMW_BITS_PER_SCHAR 8
|
||||
#elif SCHAR_MAX == 0x7FFFL
|
||||
#define TMW_BITS_PER_SCHAR 16
|
||||
#elif SCHAR_MAX == 0x7FFFFFFFL
|
||||
#define TMW_BITS_PER_SCHAR 32
|
||||
#else
|
||||
#define TMW_BITS_PER_SCHAR -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_CHAR_SIGNED
|
||||
#if SCHAR_MAX == CHAR_MAX
|
||||
#define TMW_CHAR_SIGNED 1
|
||||
#else
|
||||
#define TMW_CHAR_SIGNED 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* It is common for one or more of the integer types
|
||||
to be the same size. For example, on many embedded
|
||||
processors, both shorts and ints are 16 bits. On
|
||||
processors used for workstations, it is quite common
|
||||
for both int and long to be 32 bits.
|
||||
When there is more than one choice for typdef'ing
|
||||
a portable type like powerwindow_int16_T or powerwindow_uint32_T, in
|
||||
concept, it should not matter which choice is made.
|
||||
However, some style guides and some code checking
|
||||
tools do identify and complain about seemingly
|
||||
irrelevant differences. For example, a code
|
||||
checking tool may complain about an implicit
|
||||
conversion from int to short even though both
|
||||
are 16 bits. To reduce these types of
|
||||
complaints, it is best to make int the
|
||||
preferred choice when more than one is available.
|
||||
*/
|
||||
|
||||
#ifndef INT8_T
|
||||
#if TMW_BITS_PER_INT == 8
|
||||
#define INT8_T int
|
||||
#elif TMW_BITS_PER_LONG == 8
|
||||
#define INT8_T long
|
||||
#elif TMW_BITS_PER_SCHAR == 8
|
||||
#define INT8_T signed char
|
||||
#elif TMW_BITS_PER_SHRT == 8
|
||||
#define INT8_T short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef INT8_T
|
||||
typedef INT8_T powerwindow_int8_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT8_T
|
||||
#if TMW_BITS_PER_INT == 8
|
||||
#define UINT8_T unsigned int
|
||||
#elif TMW_BITS_PER_LONG == 8
|
||||
#define UINT8_T unsigned long
|
||||
#elif TMW_BITS_PER_SCHAR == 8
|
||||
#define UINT8_T unsigned char
|
||||
#elif TMW_BITS_PER_SHRT == 8
|
||||
#define UINT8_T unsigned short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UINT8_T
|
||||
typedef UINT8_T powerwindow_uint8_T;
|
||||
#endif
|
||||
|
||||
#ifndef INT16_T
|
||||
#if TMW_BITS_PER_INT == 16
|
||||
#define INT16_T int
|
||||
#elif TMW_BITS_PER_LONG == 16
|
||||
#define INT16_T long
|
||||
#elif TMW_BITS_PER_SCHAR == 16
|
||||
#define INT16_T signed char
|
||||
#elif TMW_BITS_PER_SHRT == 16
|
||||
#define INT16_T short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef INT16_T
|
||||
typedef INT16_T powerwindow_int16_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_T
|
||||
#if TMW_BITS_PER_INT == 16
|
||||
#define UINT16_T unsigned int
|
||||
#elif TMW_BITS_PER_LONG == 16
|
||||
#define UINT16_T unsigned long
|
||||
#elif TMW_BITS_PER_SCHAR == 16
|
||||
#define UINT16_T unsigned char
|
||||
#elif TMW_BITS_PER_SHRT == 16
|
||||
#define UINT16_T unsigned short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UINT16_T
|
||||
typedef UINT16_T powerwindow_uint16_T;
|
||||
#endif
|
||||
|
||||
#ifndef INT32_T
|
||||
#if TMW_BITS_PER_INT == 32
|
||||
#define INT32_T int
|
||||
#elif TMW_BITS_PER_LONG == 32
|
||||
#define INT32_T long
|
||||
#elif TMW_BITS_PER_SCHAR == 32
|
||||
#define INT32_T signed char
|
||||
#elif TMW_BITS_PER_SHRT == 32
|
||||
#define INT32_T short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef INT32_T
|
||||
typedef INT32_T powerwindow_int32_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_T
|
||||
#if TMW_BITS_PER_INT == 32
|
||||
#define UINT32_T unsigned int
|
||||
#elif TMW_BITS_PER_LONG == 32
|
||||
#define UINT32_T unsigned long
|
||||
#elif TMW_BITS_PER_SCHAR == 32
|
||||
#define UINT32_T unsigned char
|
||||
#elif TMW_BITS_PER_SHRT == 32
|
||||
#define UINT32_T unsigned short
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UINT32_T
|
||||
typedef UINT32_T powerwindow_uint32_T;
|
||||
#endif
|
||||
|
||||
/* The following is used to emulate smaller integer types when only
|
||||
larger types are available. For example, compilers for TI C3x/C4x DSPs
|
||||
define char and short to be 32 bits, so 8 and 16 bits are not directly
|
||||
available. This target is commonly used with RTW rapid prototyping.
|
||||
Other DSPs define char to be 16 bits, so 8 bits is not directly
|
||||
available.
|
||||
*/
|
||||
#ifndef INT8_T
|
||||
#ifdef INT16_T
|
||||
#define INT8_T INT16_T
|
||||
typedef INT8_T powerwindow_int8_T;
|
||||
#else
|
||||
#ifdef INT32_T
|
||||
#define INT8_T INT32_T
|
||||
typedef INT8_T powerwindow_int8_T;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT8_T
|
||||
#ifdef UINT16_T
|
||||
#define UINT8_T UINT16_T
|
||||
typedef UINT8_T powerwindow_uint8_T;
|
||||
#else
|
||||
#ifdef UINT32_T
|
||||
#define UINT8_T UINT32_T
|
||||
typedef UINT8_T powerwindow_uint8_T;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INT16_T
|
||||
#ifdef INT32_T
|
||||
#define INT16_T INT32_T
|
||||
typedef INT16_T powerwindow_int16_T;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_T
|
||||
#ifdef UINT32_T
|
||||
#define UINT16_T UINT32_T
|
||||
typedef UINT16_T powerwindow_uint16_T;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef REAL32_T
|
||||
#ifndef __MWERKS__
|
||||
#if FLT_MANT_DIG >= 23
|
||||
#define REAL32_T float
|
||||
#endif
|
||||
#else
|
||||
#define REAL32_T float
|
||||
#endif
|
||||
#endif
|
||||
#ifdef REAL32_T
|
||||
typedef REAL32_T powerwindow_real32_T;
|
||||
#endif
|
||||
|
||||
#ifndef REAL64_T
|
||||
#ifndef __MWERKS__
|
||||
#if DBL_MANT_DIG >= 52
|
||||
#define REAL64_T double
|
||||
#endif
|
||||
#else
|
||||
#define REAL64_T double
|
||||
#endif
|
||||
#endif
|
||||
#ifdef REAL64_T
|
||||
typedef REAL64_T powerwindow_real64_T;
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS*/
|
||||
|
||||
/*=======================================================================*
|
||||
Fixed width word size data types:
|
||||
powerwindow_int64_T - signed 64 bit integers
|
||||
powerwindow_uint64_T - unsigned 64 bit integers
|
||||
=======================================================================*/
|
||||
|
||||
#ifndef INT64_T
|
||||
#if defined(__APPLE__)
|
||||
#define INT64_T long long
|
||||
#define FMT64 "ll"
|
||||
#if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
|
||||
#define INT_TYPE_64_IS_LONG
|
||||
#endif
|
||||
#elif defined(__x86_64__) || defined(__LP64__)
|
||||
#define INT64_T long
|
||||
#define FMT64 "l"
|
||||
#if !defined(INT_TYPE_64_IS_LONG)
|
||||
#define INT_TYPE_64_IS_LONG
|
||||
#endif
|
||||
#elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) || \
|
||||
(defined(__WATCOMC__) && __WATCOMC__ >= 1100)
|
||||
#define INT64_T __int64
|
||||
#define FMT64 "I64"
|
||||
#elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) || defined(__LCC64__)
|
||||
#define INT64_T long long
|
||||
#define FMT64 "ll"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(INT64_T)
|
||||
#if defined(__GNUC__) && \
|
||||
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
|
||||
__extension__
|
||||
#endif
|
||||
typedef INT64_T powerwindow_int64_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT64_T
|
||||
#if defined(__APPLE__)
|
||||
#define UINT64_T unsigned long long
|
||||
#define FMT64 "ll"
|
||||
#if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
|
||||
#define INT_TYPE_64_IS_LONG
|
||||
#endif
|
||||
#elif defined(__x86_64__) || defined(__LP64__)
|
||||
#define UINT64_T unsigned long
|
||||
#define FMT64 "l"
|
||||
#if !defined(INT_TYPE_64_IS_LONG)
|
||||
#define INT_TYPE_64_IS_LONG
|
||||
#endif
|
||||
#elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) || \
|
||||
(defined(__WATCOMC__) && __WATCOMC__ >= 1100)
|
||||
#define UINT64_T unsigned __int64
|
||||
#define FMT64 "I64"
|
||||
#elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) || defined(__LCC64__)
|
||||
#define UINT64_T unsigned long long
|
||||
#define FMT64 "ll"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64) || (defined(__APPLE__) && defined(__LP64__)) || \
|
||||
defined(__x86_64__) || defined(__LP64__)
|
||||
#define INT_TYPE_64_IS_SUPPORTED
|
||||
#endif
|
||||
|
||||
#if defined(UINT64_T)
|
||||
#if defined(__GNUC__) && \
|
||||
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
|
||||
__extension__
|
||||
#endif
|
||||
typedef UINT64_T powerwindow_uint64_T;
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
Format string modifiers for using powerwindow_size_t variables in printf
|
||||
statements.
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef FMT_SIZE_T
|
||||
#if defined(__GNUC__) || defined(_STDC_C99)
|
||||
#define FMT_SIZE_T "z"
|
||||
#elif defined(__WATCOMC__)
|
||||
#define FMT_SIZE_T "l"
|
||||
#elif defined(_WIN32)
|
||||
#define FMT_SIZE_T "I"
|
||||
#else
|
||||
#define FMT_SIZE_T "l"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef FMT_PTRDIFF_T
|
||||
#if defined(__APPLE__)
|
||||
#define FMT_PTRDIFF_T "l"
|
||||
#elif defined(__GNUC__) || defined(_STDC_C99)
|
||||
#define FMT_PTRDIFF_T "t"
|
||||
#elif defined(__WATCOMC__)
|
||||
#define FMT_PTRDIFF_T "l"
|
||||
#elif defined(_WIN32)
|
||||
#define FMT_PTRDIFF_T "I"
|
||||
#else
|
||||
#define FMT_PTRDIFF_T "l"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
General or logical data types where the word size is not guaranteed.
|
||||
powerwindow_real_T - possible settings include powerwindow_real32_T or
|
||||
powerwindow_real64_T powerwindow_time_T - possible settings include
|
||||
powerwindow_real64_T or powerwindow_uint32_T powerwindow_boolean_T
|
||||
powerwindow_char_T
|
||||
powerwindow_int_T
|
||||
powerwindow_uint_T
|
||||
powerwindow_byte_T
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef REAL_T
|
||||
#ifdef REAL64_T
|
||||
#define REAL_T powerwindow_real64_T
|
||||
#else
|
||||
#ifdef REAL32_T
|
||||
#define REAL_T powerwindow_real32_T
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifdef REAL_T
|
||||
typedef REAL_T powerwindow_real_T;
|
||||
#endif
|
||||
|
||||
#ifndef TIME_T
|
||||
#ifdef REAL_T
|
||||
#define TIME_T powerwindow_real_T
|
||||
#endif
|
||||
#endif
|
||||
#ifdef TIME_T
|
||||
typedef TIME_T powerwindow_time_T;
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS */
|
||||
|
||||
#ifndef BOOLEAN_T
|
||||
#if defined(UINT8_T)
|
||||
#define BOOLEAN_T UINT8_T
|
||||
#else
|
||||
#define BOOLEAN_T unsigned int
|
||||
#endif
|
||||
#endif
|
||||
typedef BOOLEAN_T powerwindow_boolean_T;
|
||||
|
||||
#ifndef CHARACTER_T
|
||||
#define CHARACTER_T char
|
||||
#endif
|
||||
typedef CHARACTER_T powerwindow_char_T;
|
||||
|
||||
#ifndef INTEGER_T
|
||||
#define INTEGER_T int
|
||||
#endif
|
||||
typedef INTEGER_T powerwindow_int_T;
|
||||
|
||||
#ifndef UINTEGER_T
|
||||
#define UINTEGER_T unsigned
|
||||
#endif
|
||||
typedef UINTEGER_T powerwindow_uint_T;
|
||||
|
||||
#ifndef BYTE_T
|
||||
#define BYTE_T unsigned char
|
||||
#endif
|
||||
typedef BYTE_T powerwindow_byte_T;
|
||||
|
||||
/*===========================================================================*
|
||||
Define Complex Structures
|
||||
===========================================================================*/
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef CREAL32_T
|
||||
#ifdef REAL32_T
|
||||
typedef struct {
|
||||
powerwindow_real32_T re, im;
|
||||
} powerwindow_creal32_T;
|
||||
#define CREAL32_T creal32_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CREAL64_T
|
||||
#ifdef REAL64_T
|
||||
typedef struct {
|
||||
powerwindow_real64_T re, im;
|
||||
} powerwindow_creal64_T;
|
||||
#define CREAL64_T powerwindow_creal64_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CREAL_T
|
||||
#ifdef REAL_T
|
||||
typedef struct {
|
||||
powerwindow_real_T re, im;
|
||||
} powerwindow_creal_T;
|
||||
#define CREAL_T powerwindow_creal_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS */
|
||||
|
||||
#ifndef CINT8_T
|
||||
#ifdef INT8_T
|
||||
typedef struct {
|
||||
powerwindow_int8_T re, im;
|
||||
} powerwindow_cint8_T;
|
||||
#define CINT8_T powerwindow_cint8_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT8_T
|
||||
#ifdef UINT8_T
|
||||
typedef struct {
|
||||
powerwindow_uint8_T re, im;
|
||||
} powerwindow_cuint8_T;
|
||||
#define CUINT8_T powerwindow_cuint8_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT16_T
|
||||
#ifdef INT16_T
|
||||
typedef struct {
|
||||
powerwindow_int16_T re, im;
|
||||
} powerwindow_cint16_T;
|
||||
#define CINT16_T powerwindow_cint16_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT16_T
|
||||
#ifdef UINT16_T
|
||||
typedef struct {
|
||||
powerwindow_uint16_T re, im;
|
||||
} powerwindow_cuint16_T;
|
||||
#define CUINT16_T powerwindow_cuint16_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT32_T
|
||||
#ifdef INT32_T
|
||||
typedef struct {
|
||||
powerwindow_int32_T re, im;
|
||||
} powerwindow_cint32_T;
|
||||
#define CINT32_T powerwindow_cint32_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT32_T
|
||||
#ifdef UINT32_T
|
||||
typedef struct {
|
||||
powerwindow_uint32_T re, im;
|
||||
} powerwindow_cuint32_T;
|
||||
#define CUINT32_T powerwindow_cuint32_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT64_T
|
||||
#ifdef INT64_T
|
||||
typedef struct {
|
||||
powerwindow_int64_T re, im;
|
||||
} powerwindow_cint64_T;
|
||||
#define CINT64_T powerwindow_cint64_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT64_T
|
||||
#ifdef UINT64_T
|
||||
typedef struct {
|
||||
powerwindow_uint64_T re, im;
|
||||
} powerwindow_cuint64_T;
|
||||
#define CUINT64_T powerwindow_cuint64_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*=======================================================================*
|
||||
Min and Max:
|
||||
powerwindow_int8_T, powerwindow_int16_T, powerwindow_int32_T - signed
|
||||
8, 16, or 32 bit integers powerwindow_uint8_T, powerwindow_uint16_T,
|
||||
powerwindow_uint32_T - unsigned 8, 16, or 32 bit integers
|
||||
=======================================================================*/
|
||||
|
||||
#define powerwindow_MAX_int8_T ((powerwindow_int8_T) (127)) /* 127 */
|
||||
#define powerwindow_MIN_int8_T ((powerwindow_int8_T) (-128)) /* -128 */
|
||||
#define powerwindow_MAX_uint8_T ((powerwindow_uint8_T) (255)) /* 255 */
|
||||
#define powerwindow_MIN_uint8_T ((powerwindow_uint8_T) (0))
|
||||
|
||||
#define powerwindow_MAX_int16_T ((powerwindow_int16_T) (32767)) /* 32767 */
|
||||
#define powerwindow_MIN_int16_T ((powerwindow_int16_T) (-32768)) /* -32768 */
|
||||
#define powerwindow_MAX_uint16_T ((powerwindow_uint16_T) (65535)) /* 65535 */
|
||||
#define powerwindow_MIN_uint16_T ((powerwindow_uint16_T) (0))
|
||||
|
||||
#define powerwindow_MAX_int32_T \
|
||||
((powerwindow_int32_T) (2147483647)) /* 2147483647 */
|
||||
#define powerwindow_MIN_int32_T \
|
||||
((powerwindow_int32_T) (-2147483647 - 1)) /* -2147483648 */
|
||||
#define powerwindow_MAX_uint32_T \
|
||||
((powerwindow_uint32_T) (0xFFFFFFFFU)) /* 4294967295 */
|
||||
#define powerwindow_MIN_uint32_T ((powerwindow_uint32_T) (0))
|
||||
|
||||
#if defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) || \
|
||||
(defined(__WATCOMC__) && __WATCOMC__ >= 1100) || defined(__LCC64__)
|
||||
#ifdef INT64_T
|
||||
#define powerwindow_MAX_int64_T ((powerwindow_int64_T) (9223372036854775807LL))
|
||||
#define powerwindow_MIN_int64_T \
|
||||
((powerwindow_int64_T) (-9223372036854775807LL - 1LL))
|
||||
#endif
|
||||
#ifdef UINT64_T
|
||||
#define powerwindow_MAX_uint64_T \
|
||||
((powerwindow_uint64_T) (0xFFFFFFFFFFFFFFFFULL))
|
||||
#define powerwindow_MIN_uint64_T ((powerwindow_uint64_T) (0))
|
||||
#endif
|
||||
#else
|
||||
#ifdef INT64_T
|
||||
#ifdef INT_TYPE_64_IS_LONG
|
||||
#define powerwindow_MAX_int64_T ((powerwindow_int64_T) (9223372036854775807L))
|
||||
#define powerwindow_MIN_int64_T \
|
||||
((powerwindow_int64_T) (-9223372036854775807L - 1L))
|
||||
#else
|
||||
#define powerwindow_MAX_int64_T ((powerwindow_int64_T) (9223372036854775807LL))
|
||||
#define powerwindow_MIN_int64_T \
|
||||
((powerwindow_int64_T) (-9223372036854775807LL - 1LL))
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UINT64_T
|
||||
#ifdef INT_TYPE_64_IS_LONG
|
||||
#define powerwindow_MAX_uint64_T ((powerwindow_uint64_T) (0xFFFFFFFFFFFFFFFFUL))
|
||||
#define powerwindow_MIN_uint64_T ((powerwindow_uint64_T) (0))
|
||||
#else
|
||||
#define powerwindow_MAX_uint64_T \
|
||||
((powerwindow_uint64_T) (0xFFFFFFFFFFFFFFFFULL))
|
||||
#define powerwindow_MIN_uint64_T ((powerwindow_uint64_T) (0))
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* Conversion from unsigned __int64 to double is not implemented in windows
|
||||
and results in a compile error, thus the value must first be cast to
|
||||
signed __int64, and then to double.
|
||||
|
||||
If the 64 bit int value is greater than 2^63-1, which is the signed int64
|
||||
max, the macro below provides a workaround for casting a uint64 value to a
|
||||
double in windows.
|
||||
*/
|
||||
#define uint64_to_double(u) \
|
||||
(((u) > _I64_MAX) \
|
||||
? (double) (__int64) ((u) - _I64_MAX - 1) + (double) _I64_MAX + 1 \
|
||||
: (double) (__int64) (u))
|
||||
|
||||
/* The following inline function should only be used in the macro
|
||||
double_to_uint64, as it only handles the specfic range of double between 2^63
|
||||
and 2^64-1 */
|
||||
__forceinline powerwindow_uint64_T
|
||||
__attribute__((always_inline)) static inline double_to_uint64_helpe
|
||||
r(double d) {
|
||||
union double_to_uint64_union_type {
|
||||
double dd;
|
||||
powerwindow_uint64_T i64;
|
||||
} di;
|
||||
di.dd = d;
|
||||
return (((di.i64 & 0x000fffffffffffff) | 0x0010000000000000) << 11);
|
||||
}
|
||||
|
||||
/* The largest double value that can be cast to uint64 in windows is the
|
||||
signed int64 max, which is 2^63-1. The macro below provides
|
||||
a workaround for casting large double values to uint64 in windows.
|
||||
*/
|
||||
/* The magic number 18446744073709551616.0 is 2^64 */
|
||||
/* The magic number 9223372036854775808.0 is 2^63 */
|
||||
#define double_to_uint64(d) \
|
||||
(((d) >= 18446744073709551616.0) ? 0xffffffffffffffffULL \
|
||||
: ((d) < 0.0) ? 0ULL \
|
||||
: ((d) >= 9223372036854775808.0) ? double_to_uint64_helper(d) \
|
||||
: (unsigned __int64) (d))
|
||||
#else
|
||||
#define uint64_to_double(u) ((double) (u))
|
||||
#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__TICCSC__)
|
||||
/* double_to_uint64 defined only for MSVC and UNIX */
|
||||
#else
|
||||
#define double_to_uint64(d) \
|
||||
(((d) > 0xffffffffffffffffULL) \
|
||||
? (unsigned long long) 0xffffffffffffffffULL \
|
||||
: ((d) < 0) ? (unsigned long long) 0 \
|
||||
: (unsigned long long) (d))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
|
||||
|
||||
#ifndef _bool_T
|
||||
#define _bool_T
|
||||
|
||||
typedef powerwindow_boolean_T bool;
|
||||
|
||||
#ifndef false
|
||||
#define false (0)
|
||||
#endif
|
||||
#ifndef true
|
||||
#define true (1)
|
||||
#endif
|
||||
|
||||
#endif /* _bool_T */
|
||||
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
/*
|
||||
This software assumes that the code is being compiled on a target using a
|
||||
2's complement representation for signed integer values.
|
||||
*/
|
||||
#if ((SCHAR_MIN + 1) != -SCHAR_MAX)
|
||||
#error \
|
||||
"This code must be compiled using a 2's complement representation for signed integer values"
|
||||
#endif
|
||||
|
||||
/*
|
||||
Maximum length of a MATLAB identifier (function/variable/model)
|
||||
including the null-termination character.
|
||||
*/
|
||||
#define TMW_NAME_LENGTH_MAX 64
|
||||
|
||||
#ifdef MX_COMPAT_32
|
||||
typedef int powerwindow_mwSize;
|
||||
typedef int powerwindow_mwIndex;
|
||||
typedef int powerwindow_mwSignedIndex;
|
||||
#else
|
||||
typedef size_t powerwindow_mwSize; /* unsigned pointer-width integer */
|
||||
typedef size_t powerwindow_mwIndex; /* unsigned pointer-width integer */
|
||||
typedef ptrdiff_t
|
||||
powerwindow_mwSignedIndex; /* a signed pointer-width integer */
|
||||
#endif
|
||||
|
||||
#if (defined(_LP64) || defined(_WIN64)) && !defined(MX_COMPAT_32)
|
||||
/* Currently 2^48 based on hardware limitations */
|
||||
#define powerwindow_MWSIZE_MAX 281474976710655UL
|
||||
#define powerwindow_MWINDEX_MAX 281474976710655UL
|
||||
#define powerwindow_MWSINDEX_MAX 281474976710655L
|
||||
#define powerwindow_MWSINDEX_MIN -281474976710655L
|
||||
#else
|
||||
#define powerwindow_MWSIZE_MAX 2147483647UL
|
||||
#define powerwindow_MWINDEX_MAX 2147483647UL
|
||||
#define powerwindow_MWSINDEX_MAX 2147483647L
|
||||
#define powerwindow_MWSINDEX_MIN -2147483647L
|
||||
#endif
|
||||
#define powerwindow_MWSIZE_MIN 0UL
|
||||
#define powerwindow_MWINDEX_MIN 0UL
|
||||
|
||||
/** UTF-16 character type */
|
||||
|
||||
#if (defined(__cplusplus) && (__cplusplus >= 201103L)) || \
|
||||
(defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && \
|
||||
_HAS_CHAR16_T_LANGUAGE_SUPPORT)
|
||||
typedef char16_t powerwindow_CHAR16_T;
|
||||
#elif defined(_MSC_VER)
|
||||
typedef wchar_t powerwindow_CHAR16_T;
|
||||
#else
|
||||
typedef UINT16_T powerwindow_CHAR16_T;
|
||||
#endif
|
||||
|
||||
#endif /* powerwindow__TMWTYPES__ */
|
||||
|
||||
#endif /* powerwindow_tmwtypes_h */
|
||||
@ -0,0 +1,16 @@
|
||||
#include "wcclib.h"
|
||||
|
||||
// Wasm loop bounds
|
||||
|
||||
__attribute__((import_module("__pragma"), import_name("loopbound"))) extern void
|
||||
__pragma_loopbound(unsigned int min_bound, unsigned int max_bound);
|
||||
|
||||
__attribute__((always_inline)) static inline void *
|
||||
wcclib_memset(void *s, int c, size_t n) {
|
||||
unsigned char *p = s;
|
||||
|
||||
__pragma_loopbound(1, 368);
|
||||
while (n--)
|
||||
*p++ = (unsigned char) c;
|
||||
return (s);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
|
||||
#ifndef _WCCLIB
|
||||
#define _WCCLIB
|
||||
|
||||
#define size_t unsigned long
|
||||
#define int32_t int
|
||||
#define uint32_t unsigned int
|
||||
#define u_int16_t unsigned short
|
||||
#define u_int32_t unsigned int
|
||||
|
||||
#define NULL ((void *) 0)
|
||||
|
||||
__attribute__((always_inline)) static inline void *wcclib_memset(void *s, int c,
|
||||
size_t n);
|
||||
|
||||
#endif // _WCCLIB
|
||||
Reference in New Issue
Block a user