diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-05-15 13:39:01 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-05-15 13:39:01 +0200 |
commit | 355a9272b5a800f9652707ed5854d7be529b872c (patch) | |
tree | 989a001ddf5d8f57a2d7a39b638ae10d6f1f3b2b | |
parent | 0af2ea25f0df045d6d45ae0487c6d5022490a4c4 (diff) | |
download | compcert-kvx-355a9272b5a800f9652707ed5854d7be529b872c.tar.gz compcert-kvx-355a9272b5a800f9652707ed5854d7be529b872c.zip |
Heater example from Lustre v4
-rw-r--r-- | test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c | 8 | ||||
-rw-r--r-- | test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c | 14 |
2 files changed, 18 insertions, 4 deletions
diff --git a/test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c b/test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c index 351deed6..d0298840 100644 --- a/test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c +++ b/test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c @@ -3,6 +3,7 @@ #include <stdlib.h> #include <assert.h> #include "heater_control_alloc.h" +#include "../clock.h" #include "../dm_random.c" static double _get_double(void) { @@ -22,6 +23,9 @@ int main (int argc, char *argv[]) { /* Main memory allocation */ heater_control_ALLOC(static,main_mem); + + clock_prepare(); + clock_start(); /* Initialize the main memory */ heater_control_reset(&main_mem); @@ -34,9 +38,11 @@ int main (int argc, char *argv[]) { double T3 = _get_double(); _Bool Heat_on; heater_control_step (T, T1, T2, T3, &Heat_on, &main_mem); - _put_bool("Heat_on", Heat_on); + // _put_bool("Heat_on", Heat_on); } + clock_stop(); + print_total_clock(); return 1; } diff --git a/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c b/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c index e4037e5a..d1a01268 100644 --- a/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c +++ b/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c @@ -6,6 +6,7 @@ #include <stdio.h> #include <unistd.h> #include "../dm_random.c" +#include "../clock.h" #include "heater_control_heater_control.h" /* MACROS DEFINITIONS ****************/ @@ -39,6 +40,10 @@ int main(){ _boolean Heat_on; heater_control_heater_control_ctx_type ctx_struct; heater_control_heater_control_ctx_type* ctx = &ctx_struct; + + clock_prepare(); + clock_start(); + heater_control_heater_control_ctx_init(ctx); /* Main loop */ @@ -48,8 +53,11 @@ int main(){ T2 = _get_real("T2"); T3 = _get_real("T3"); heater_control_heater_control_step(T,T1,T2,T3,&Heat_on,ctx); - _put_bool("Heat_on", Heat_on); + // _put_bool("Heat_on", Heat_on); } - return 1; - + + clock_stop(); + print_total_clock(); + + return 1; } |