diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-03 08:17:40 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-03 08:17:40 +0100 |
commit | 1ab7b51c30e1b10ac45b0bd64cefdc01da0f7f68 (patch) | |
tree | 210ffc156c83f04fb0c61a40b4f9037d7ba8a7e1 /test/monniaux/lustrev6-carlightV2/carlightV2_carlight_loop.c | |
parent | 222c9047d61961db9c6b19fed5ca49829223fd33 (diff) | |
parent | 12be46d59a2483a10d77fa8ee67f7e0ca1bd702f (diff) | |
download | compcert-kvx-1ab7b51c30e1b10ac45b0bd64cefdc01da0f7f68.tar.gz compcert-kvx-1ab7b51c30e1b10ac45b0bd64cefdc01da0f7f68.zip |
Merge branch 'mppa-cse2' of gricad-gitlab.univ-grenoble-alpes.fr:sixcy/CompCert into mppa-work
Diffstat (limited to 'test/monniaux/lustrev6-carlightV2/carlightV2_carlight_loop.c')
-rw-r--r-- | test/monniaux/lustrev6-carlightV2/carlightV2_carlight_loop.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/test/monniaux/lustrev6-carlightV2/carlightV2_carlight_loop.c b/test/monniaux/lustrev6-carlightV2/carlightV2_carlight_loop.c new file mode 100644 index 00000000..a9b4417a --- /dev/null +++ b/test/monniaux/lustrev6-carlightV2/carlightV2_carlight_loop.c @@ -0,0 +1,62 @@ +/* This file was generated by lv6 version master.737 (2727a7744111c84f7984634d2bd3ad6f7c6c7ff9). */ +/* lv6 carlightV2.lus -n carlight --to-c */ +/* on vanoise the 08/05/2019 at 22:54:09 */ + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include "carlightV2_carlight.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; +} + +/* Main procedure *************************/ +int main(){ + int _s = 0; + _integer switch_pos; + _real intensity; + _boolean is_on; + carlightV2_carlight_ctx_type* ctx = carlightV2_carlight_ctx_new_ctx(NULL); + + /* Main loop */ + clock_prepare(); + clock_start(); + + for(int count=0; count<1000; count++){ + ++_s; + switch_pos = _get_int("switch_pos"); + intensity = _get_real("intensity"); + carlightV2_carlight_step(switch_pos,intensity,&is_on,ctx); + // printf("%d %f #outs %d\n",switch_pos,intensity,is_on); + // printf("%d\n",is_on); + } + + clock_stop(); + print_total_clock(); + + return 0; +} |