From 8a456dbb08948c1c24076cea6b87dc938276263b Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 15 May 2019 13:13:46 +0200 Subject: example from Lustre v4 compiled with ONERA's lustrec compiler --- .../heater_control_alloc.h | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 test/monniaux/lustrev4_lustrec_heater_control/heater_control_alloc.h (limited to 'test/monniaux/lustrev4_lustrec_heater_control/heater_control_alloc.h') diff --git a/test/monniaux/lustrev4_lustrec_heater_control/heater_control_alloc.h b/test/monniaux/lustrev4_lustrec_heater_control/heater_control_alloc.h new file mode 100644 index 00000000..270ed4a3 --- /dev/null +++ b/test/monniaux/lustrev4_lustrec_heater_control/heater_control_alloc.h @@ -0,0 +1,73 @@ +/* C code generated by lustrec + Version number 1.6-@GITBRANCH@ + Code is C99 compliant + Using (double) floating-point numbers */ + +#ifndef _HEATER_CONTROL_alloc +#define _HEATER_CONTROL_alloc + +/* Import header from heater_control */ +#include "heater_control.h" + +/* Import dependencies */ + +/* Struct definitions */ +struct not_a_sauna2_mem {struct not_a_sauna2_reg {double __not_a_sauna2_2; + } _reg; + struct _arrow_mem *ni_0; + }; +struct heater_control_mem {struct heater_control_reg {_Bool __heater_control_16; + } _reg; + struct _arrow_mem *ni_1; + }; +struct not_a_sauna_mem {struct not_a_sauna_reg {double __not_a_sauna_2; + } _reg; + struct _arrow_mem *ni_2; + }; + +/* Node allocation function/macro prototypes */ +#define not_a_sauna2_DECLARE(attr, inst)\ + attr struct not_a_sauna2_mem inst;\ + _arrow_DECLARE(attr, inst ## _ni_0); + +#define not_a_sauna2_LINK(inst) do {\ + _arrow_LINK(inst ## _ni_0);\ + inst.ni_0 = &inst ## _ni_0;\ +} while (0) + +#define not_a_sauna2_ALLOC(attr, inst)\ + not_a_sauna2_DECLARE(attr, inst);\ + not_a_sauna2_LINK(inst); + + +#define heater_control_DECLARE(attr, inst)\ + attr struct heater_control_mem inst;\ + _arrow_DECLARE(attr, inst ## _ni_1); + +#define heater_control_LINK(inst) do {\ + _arrow_LINK(inst ## _ni_1);\ + inst.ni_1 = &inst ## _ni_1;\ +} while (0) + +#define heater_control_ALLOC(attr, inst)\ + heater_control_DECLARE(attr, inst);\ + heater_control_LINK(inst); + + +#define not_a_sauna_DECLARE(attr, inst)\ + attr struct not_a_sauna_mem inst;\ + _arrow_DECLARE(attr, inst ## _ni_2); + +#define not_a_sauna_LINK(inst) do {\ + _arrow_LINK(inst ## _ni_2);\ + inst.ni_2 = &inst ## _ni_2;\ +} while (0) + +#define not_a_sauna_ALLOC(attr, inst)\ + not_a_sauna_DECLARE(attr, inst);\ + not_a_sauna_LINK(inst); + + + +#endif + -- cgit