diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
| commit | 386b7d3366f1359a265da207a9cafa3edf553b64 (patch) | |
| tree | c76120c2c138faed822e4ae386be6ef22a738a78 /baseline/source/statemate | |
| parent | 54a3f7091a2146b29c73a6fdc4b62a5c4ad7a3d8 (diff) | |
Reorganize and commit all the modified TACLeBench code and run scripts
Diffstat (limited to 'baseline/source/statemate')
| -rw-r--r-- | baseline/source/statemate/ChangeLog.txt | 60 | ||||
| -rw-r--r-- | baseline/source/statemate/statemate.c | 1286 |
2 files changed, 1346 insertions, 0 deletions
diff --git a/baseline/source/statemate/ChangeLog.txt b/baseline/source/statemate/ChangeLog.txt new file mode 100644 index 0000000..bce75dc --- /dev/null +++ b/baseline/source/statemate/ChangeLog.txt | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | File: statemate.c | ||
| 2 | Original provenience: Mälardalen benchmark suite, | ||
| 3 | http://www.mrtc.mdh.se/projects/wcet/benchmarks.html | ||
| 4 | |||
| 5 | 2016-02-02: | ||
| 6 | - Removed original header comment, replaced by TACLeBench header. | ||
| 7 | - Removed macro '#define float int' and replaced each 'float' by 'int' (8 in | ||
| 8 | total) | ||
| 9 | - Removed unused macro | ||
| 10 | - #define entered_EINSCHALTSTROM_MESSEN_BLOCK_ERKENNUNG_CTRL_copy_IDX 1 | ||
| 11 | - Removed unused variables | ||
| 12 | - int FH_TUERMODUL_CTRL__N_copy; | ||
| 13 | - int BLOCK_ERKENNUNG_CTRL__I_EIN_MAX_copy; | ||
| 14 | - int BLOCK_ERKENNUNG_CTRL__N_copy; | ||
| 15 | - char FH_TUERMODUL_CTRL__FT; | ||
| 16 | - char FH_TUERMODUL__COM_OPEN; | ||
| 17 | - char FH_TUERMODUL__COM_CLOSE; | ||
| 18 | - char FH_DU__S_FH_TMBFAUFCAN_copy; | ||
| 19 | - char FH_DU__S_FH_TMBFZUCAN_copy; | ||
| 20 | - Moved around all the following so that they are in the given order just after | ||
| 21 | the header | ||
| 22 | - macro definitions | ||
| 23 | - forward declarations of fuctions | ||
| 24 | - declarations of global variables | ||
| 25 | - Reordered functions in source code: initialization-related functions first, | ||
| 26 | followed by algorithm core functions, followed by main functions | ||
| 27 | - Added a new main function that first calls init function then the old main | ||
| 28 | function sans init | ||
| 29 | - Annotated statemate_main() as the entry point of the analysis | ||
| 30 | - Removed seemingly unnecessary empty lines | ||
| 31 | - Changed remaining floating number literals, all being used for time related | ||
| 32 | comparisons, to integer literals by multiplying them by 1000 so that the | ||
| 33 | code is totally floating number free. E.g: | ||
| 34 | changed 'time - sc_FH_TUERMODUL_CTRL_2375_2 >= 0.5f' | ||
| 35 | to 'time - sc_FH_TUERMODUL_CTRL_2375_2 >= 500' | ||
| 36 | Info: All time related variables were already converted to 'unsigned long' | ||
| 37 | - Applied code formatting according to the following rules | ||
| 38 | - Lines shall not be wider than 80 characters; whenever possible, appropriate | ||
| 39 | line breaks shall be inserted to keep lines below 80 characters | ||
| 40 | - Indentation is done using whitespaces only, no tabs. Code is indented by | ||
| 41 | two whitespaces | ||
| 42 | - Two empty lines are put between any two functions | ||
| 43 | - In non-empty lists or index expressions, opening '(' and '[' are followed by | ||
| 44 | one whitespace, closing ')' and ']' are preceded by one whitespace | ||
| 45 | - In comma- or colon-separated argument lists, one whitespace is put after | ||
| 46 | each comma/colon | ||
| 47 | - Names of functions and global variables all start with a benchmark-specific | ||
| 48 | prefix (here: statemate_) followed by lowercase letter | ||
| 49 | - For pointer types, one whitespace is put before the '*' | ||
| 50 | - Operators within expressions shall be preceded and followed by one | ||
| 51 | whitespace | ||
| 52 | - Code of then- and else-parts of if-then-else statements shall be put in | ||
| 53 | separate lines, not in the same lines as the if-condition or the keyword | ||
| 54 | "else" | ||
| 55 | - Opening braces '{' denoting the beginning of code for some if-else or loop | ||
| 56 | body shall be put at the end of the same line where the keywords "if", | ||
| 57 | "else", "for", "while" etc. occur | ||
| 58 | |||
| 59 | 2016-10-10: | ||
| 60 | - added statemate_return() function | ||
diff --git a/baseline/source/statemate/statemate.c b/baseline/source/statemate/statemate.c new file mode 100644 index 0000000..379366a --- /dev/null +++ b/baseline/source/statemate/statemate.c | |||
| @@ -0,0 +1,1286 @@ | |||
| 1 | /* | ||
| 2 | |||
| 3 | This program is part of the TACLeBench benchmark suite. | ||
| 4 | Version V 2.0 | ||
| 5 | |||
| 6 | Name: statemate | ||
| 7 | |||
| 8 | Author: Friedhelm Stappert, C-LAB, Paderborn, Germany | ||
| 9 | |||
| 10 | Function: This code was automatically generated by | ||
| 11 | the STAtechart Real-time-Code generator STARC | ||
| 12 | which was developed at C-LAB. | ||
| 13 | |||
| 14 | The original StateChart specifies an experimental | ||
| 15 | car window lift control. | ||
| 16 | |||
| 17 | Source: MRTC | ||
| 18 | http://www.mrtc.mdh.se/projects/wcet/wcet_bench/statemate/statemate.c | ||
| 19 | |||
| 20 | Changes: no major functional changes | ||
| 21 | |||
| 22 | License: may be used, modified, and re-distributed freely | ||
| 23 | |||
| 24 | */ | ||
| 25 | |||
| 26 | /* | ||
| 27 | Macro definitions | ||
| 28 | */ | ||
| 29 | |||
| 30 | #include "../extra.h" | ||
| 31 | |||
| 32 | #define SYS_bit_get(a,b) (a)[(b)] | ||
| 33 | #define SYS_bit_clr(a,b) (a)[(b)] = 0 | ||
| 34 | #define SYS_bit_set(a,b) (a)[(b)] = 1 | ||
| 35 | #define SYS_bit_cpy(a1,i1,a2,i2) (a1)[(i1)] = (a2)[(i2)] | ||
| 36 | |||
| 37 | #define active_KINDERSICHERUNG_CTRL_IDX 10 | ||
| 38 | #define active_KINDERSICHERUNG_CTRL_copy_IDX 11 | ||
| 39 | #define active_KINDERSICHERUNG_CTRL_old_IDX 12 | ||
| 40 | #define active_FH_TUERMODUL_CTRL_IDX 13 | ||
| 41 | #define active_FH_TUERMODUL_CTRL_copy_IDX 14 | ||
| 42 | #define active_FH_TUERMODUL_CTRL_old_IDX 15 | ||
| 43 | #define active_EINKLEMMSCHUTZ_CTRL_IDX 16 | ||
| 44 | #define active_EINKLEMMSCHUTZ_CTRL_copy_IDX 17 | ||
| 45 | #define active_EINKLEMMSCHUTZ_CTRL_old_IDX 18 | ||
| 46 | #define active_BLOCK_ERKENNUNG_CTRL_IDX 19 | ||
| 47 | #define active_BLOCK_ERKENNUNG_CTRL_copy_IDX 20 | ||
| 48 | #define active_BLOCK_ERKENNUNG_CTRL_old_IDX 21 | ||
| 49 | #define entered_EINSCHALTSTROM_MESSEN_BLOCK_ERKENNUNG_CTRL_IDX 0 | ||
| 50 | |||
| 51 | #define entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL_IDX 4 | ||
| 52 | #define entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL_copy_IDX 5 | ||
| 53 | #define exited_BEREIT_FH_TUERMODUL_CTRL_IDX 6 | ||
| 54 | #define exited_BEREIT_FH_TUERMODUL_CTRL_copy_IDX 7 | ||
| 55 | |||
| 56 | #define FH_TUERMODUL_CTRL__END_REVERS_IDX 22 | ||
| 57 | #define FH_TUERMODUL_CTRL__END_REVERS_copy_IDX 23 | ||
| 58 | #define FH_TUERMODUL__EINKLEMMUNG_IDX 24 | ||
| 59 | |||
| 60 | |||
| 61 | /* | ||
| 62 | Forward declaration of functions | ||
| 63 | */ | ||
| 64 | |||
| 65 | void statemate_init( void ); | ||
| 66 | void statemate_interface( void ); | ||
| 67 | void statemate_generic_KINDERSICHERUNG_CTRL( void ); | ||
| 68 | void statemate_generic_FH_TUERMODUL_CTRL( void ); | ||
| 69 | void statemate_generic_EINKLEMMSCHUTZ_CTRL( void ); | ||
| 70 | void statemate_generic_BLOCK_ERKENNUNG_CTRL( void ); | ||
| 71 | void statemate_FH_DU( void ); | ||
| 72 | void statemate_main( void ); | ||
| 73 | int statemate_return ( void ); | ||
| 74 | |||
| 75 | |||
| 76 | /* | ||
| 77 | Declaration of global variables | ||
| 78 | */ | ||
| 79 | |||
| 80 | static char statemate_bitlist[64]; | ||
| 81 | unsigned long | ||
| 82 | statemate_tm_entered_EINSCHALTSTROM_MESSEN_BLOCK_ERKENNUNG_CTRLch_BLOCK_ERKENNUNG_CTRL__N_copy; | ||
| 83 | unsigned long | ||
| 84 | statemate_tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRLexited_BEREIT_FH_TUERMODUL_CTRL; | ||
| 85 | unsigned long statemate_tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL; | ||
| 86 | unsigned long statemate_sc_FH_TUERMODUL_CTRL_2375_2; | ||
| 87 | unsigned long statemate_sc_FH_TUERMODUL_CTRL_2352_1; | ||
| 88 | unsigned long statemate_sc_FH_TUERMODUL_CTRL_2329_1; | ||
| 89 | int statemate_FH_TUERMODUL_CTRL__N; | ||
| 90 | int statemate_FH_TUERMODUL_CTRL__N_old; | ||
| 91 | unsigned long statemate_sc_FH_TUERMODUL_CTRL_1781_10; | ||
| 92 | unsigned long statemate_sc_FH_TUERMODUL_CTRL_1739_10; | ||
| 93 | int statemate_FH_TUERMODUL__POSITION; | ||
| 94 | int statemate_FH_TUERMODUL__I_EIN; | ||
| 95 | int statemate_FH_TUERMODUL__I_EIN_old; | ||
| 96 | int statemate_FH_DU__MFH; | ||
| 97 | int statemate_FH_DU__MFH_copy; | ||
| 98 | int statemate_FH_DU__POSITION; | ||
| 99 | int statemate_FH_DU__I_EIN; | ||
| 100 | int statemate_FH_DU__I_EIN_old; | ||
| 101 | int statemate_BLOCK_ERKENNUNG_CTRL__I_EIN_MAX; | ||
| 102 | int statemate_BLOCK_ERKENNUNG_CTRL__N; | ||
| 103 | int statemate_BLOCK_ERKENNUNG_CTRL__N_old; | ||
| 104 | char statemate_FH_TUERMODUL_CTRL__INREVERS2; | ||
| 105 | char statemate_FH_TUERMODUL_CTRL__INREVERS2_copy; | ||
| 106 | char statemate_FH_TUERMODUL_CTRL__INREVERS1; | ||
| 107 | char statemate_FH_TUERMODUL_CTRL__INREVERS1_copy; | ||
| 108 | char statemate_FH_TUERMODUL__SFHZ_ZENTRAL; | ||
| 109 | char statemate_FH_TUERMODUL__SFHZ_ZENTRAL_old; | ||
| 110 | char statemate_FH_TUERMODUL__SFHZ_MEC; | ||
| 111 | char statemate_FH_TUERMODUL__SFHZ_MEC_old; | ||
| 112 | char statemate_FH_TUERMODUL__SFHA_ZENTRAL; | ||
| 113 | char statemate_FH_TUERMODUL__SFHA_ZENTRAL_old; | ||
| 114 | char statemate_FH_TUERMODUL__SFHA_MEC; | ||
| 115 | char statemate_FH_TUERMODUL__SFHA_MEC_old; | ||
| 116 | char statemate_FH_TUERMODUL__KL_50; | ||
| 117 | char statemate_FH_TUERMODUL__BLOCK; | ||
| 118 | char statemate_FH_TUERMODUL__BLOCK_copy; | ||
| 119 | char statemate_FH_TUERMODUL__BLOCK_old; | ||
| 120 | char statemate_FH_TUERMODUL__FT; | ||
| 121 | char statemate_FH_TUERMODUL__SFHZ; | ||
| 122 | char statemate_FH_TUERMODUL__SFHZ_copy; | ||
| 123 | char statemate_FH_TUERMODUL__SFHZ_old; | ||
| 124 | char statemate_FH_TUERMODUL__SFHA; | ||
| 125 | char statemate_FH_TUERMODUL__SFHA_copy; | ||
| 126 | char statemate_FH_TUERMODUL__SFHA_old; | ||
