1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/* This file was generated by lv6 version master.737 (2727a7744111c84f7984634d2bd3ad6f7c6c7ff9). */
/* lv6 -2cgc -node main convertible.lus */
/* on vanoise the 08/05/2019 at 23:54:11 */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include "convertible_main.h"
#include "../clock.h"
#include "../dm_random.c"
/* MACROS DEFINITIONS ****************/
#ifndef TT
#define TT "1"
#endif
#ifndef FF
#define FF "0"
#endif
#ifndef BB
#define BB "bottom"
#endif
#ifdef CKCHECK
/* set this macro for testing output clocks */
#endif
/* Standard Input procedures **************/
_boolean _get_bool(char* n){
return dm_random_uint32() & 1;
}
/*
_integer _get_int(char* n){
return (_integer) (dm_random_uint32() % 21) - 10;
}
*/
_real _get_real(char* n){
return ((_integer) (dm_random_uint32() % 2000001) - 1000000)*1E-6;
}
/* Output procedures **********************/
void convertible_main_O_n(void* cdata, _integer _V) {
}
/* Main procedure *************************/
int main(){
int _s = 0;
_boolean Start;
_boolean Parked;
_boolean Rot;
_boolean Tick;
_boolean OnOff;
_boolean Done;
_real Dist;
_boolean Danger;
_boolean Locked;
_real Speed;
_real Roof_Speed;
convertible_main_ctx_type ctx_struct;
convertible_main_ctx_type* ctx = &ctx_struct;
convertible_main_ctx_init(ctx);
// printf("#inputs \"Start\":bool \"Parked\":bool \"Rot\":bool \"Tick\":bool \"OnOff\":bool \"Done\":bool \"Dist\":real\n");
// printf("#outputs \"Danger\":bool \"Locked\":bool \"Speed\":real \"Roof_Speed\":real\n");
/* Main loop */
clock_prepare();
clock_start();
for(int count=0; count<1000; count++){
++_s;
Start = _get_bool("Start");
Parked = _get_bool("Parked");
Rot = _get_bool("Rot");
Tick = _get_bool("Tick");
OnOff = _get_bool("OnOff");
Done = _get_bool("Done");
Dist = _get_real("Dist");
convertible_main_step(Start,Parked,Rot,Tick,OnOff,Done,Dist,&Danger,&Locked,&Speed,&Roof_Speed,ctx);
// printf("%d %d %d %d %d %d %f #outs %d %d %f %f\n",Start,Parked,Rot,Tick,OnOff,Done,Dist,Danger,Locked,Speed,Roof_Speed);
// printf("%d %d %f %f\n",Danger,Locked,Speed,Roof_Speed);
}
clock_stop();
print_total_clock();
return 0;
}
|