Newer
Older
Erwan Jahier
committed
Non-regression tests
usage: lus2lic [options] <lustre files>
where [options] can be:
Erwan Jahier
committed
--node <node>
-n <node>
Set the main node (all items are compiled if unset)
--output-file <file>
-o <file>
Set the output file name.
--keep-nested-calls
-knc
Keep nested calls. By default, only one node per equation is generated.
--expand-iterators
-ei
Expand array iterators.
--expand-enums
-ee
Translate enums into integers.
--expand-structs-and-arrays
-esa
Expand structures and arrays using as many variables as necessary (automatically impose '-ei').
--expand-nodes
-en
Expand the main node (use the first node if no one is specified).
--lustre-v4
-lv4
Use Lustre V4 syntax (automatically impose '-ei -ee -esa').
--expanded-code
-ec
Generate ec (actually just an alias for '-en -lv4').
-unit
Run some (internal) unit tests
Erwan Jahier
committed
--verbose-level <int>
-vl <int>
Set the verbose level.
--verbose
-v
Set the verbose level to 1.
--version
-version
Display the current version of the tool.
Erwan Jahier
committed
-h
-help
--help
Display this message.
Erwan Jahier
committed
Opening file should_work/NONREG/ex.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/ex.lus should_work/NONREG/ex.lus
Erwan Jahier
committed
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
87
88
type _ex::t = A_A_A_int_1_2_3^4;
type _ex::t1 = A_A_A_A_int_1_2_3_4^4;
type _ex::t2 = struct {a : int; b : A_A_bool_11_22};
type _ex::s1 = struct {x : int; y : A_A_A_A_int_1_2_3_4};
type _ex::s = struct {x : A_A_A_A_int_1_2_3_4; y : _ex::s1};
node ex::ex(a:_ex::s) returns (b:int);
var
_v1:A_A_A_A_int_1_2_3_4;
_v2:A_A_A_int_1_2_3;
_v3:A_A_int_1_2;
_v4:A_int_1;
_v5:int;
_v6:_ex::s1;
_v7:A_A_A_A_int_1_2_3_4;
_v8:A_A_A_int_1_2_3;
_v9:A_A_int_1_2;
_v10:A_int_1;
_v11:int;
let
b = _v5 + _v11;
_v1 = a.x;
_v2 = _v1[0];
_v3 = _v2[0];
_v4 = _v3[0];
_v5 = _v4[0];
_v6 = a.y;
_v7 = _v6.y;
_v8 = _v7[0];
_v9 = _v8[0];
_v10 = _v9[0];
_v11 = _v10[0];
tel
-- end of node ex::ex
-- automatically defined aliases:
type A_A_A_A_int_1_2_3_4 = A_A_A_int_1_2_3^4;
type A_A_bool_11_22 = A_bool_11^22;
type A_bool_11 = bool^11;
type A_A_A_int_1_2_3 = A_A_int_1_2^3;
type A_A_int_1_2 = A_int_1^2;
type A_int_1 = int^1;
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/COUNTER.lus
Opening file should_work/NONREG/COUNTER.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/COUNTER.lus
node COUNTER::COUNTER(
init:int;
incr:int;
X:bool;
reset:bool)
returns (
N:int);
var
PN:int;
_v1:int;
_v2:int;
_v3:int;
let
PN = init -> _v1;
_v1 = pre N;
N = if reset then init else _v3;
_v2 = PN + incr;
_v3 = if X then _v2 else PN;
tel
-- end of node COUNTER::COUNTER
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/CURRENT.lus
Opening file should_work/NONREG/CURRENT.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/CURRENT.lus
node CURRENT::CURRENT(x:bool; y:bool when x) returns (z:bool when x);
-- end of node CURRENT::CURRENT
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/EDGE.lus
Opening file should_work/NONREG/EDGE.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/EDGE.lus
node EDGE::EDGE(X:bool) returns (Y:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
let
Y = false -> _v3;
_v1 = pre X;
_v2 = not _v1;
_v3 = X and _v2;
tel
-- end of node EDGE::EDGE
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/FALLING_EDGE.lus
Opening file should_work/NONREG/FALLING_EDGE.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/FALLING_EDGE.lus
node FALLING_EDGE::EDGE(X:bool) returns (Y:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
let
Y = false -> _v3;
_v1 = pre X;
_v2 = not _v1;
_v3 = X and _v2;
tel
-- end of node FALLING_EDGE::EDGE
node FALLING_EDGE::FALLING_EDGE(X:bool) returns (Y:bool);
var
_v1:bool;
let
Y = FALLING_EDGE::EDGE(_v1);
_v1 = not X;
tel
-- end of node FALLING_EDGE::FALLING_EDGE
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/Int.lus
Opening file should_work/NONREG/Int.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/Int.lus
const Int8::n = 8;
type _Int8::Int = bool^8;
const Int8::zero = [false, false, false, false, false, false, false, false];
function Int8::fulladd(
ci:bool;
x:bool;
y:bool)
returns (
s:bool;
co:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
_v4:bool;
_v5:bool;
let
s = ci xor _v1;
_v1 = x xor y;
co = _v4 or _v5;
_v2 = ci and x;
_v3 = x and y;
_v4 = _v2 or _v3;
_v5 = y and ci;
-- end of node Int8::fulladd
function Int8::incr(x:A_bool_8) returns (incr:A_bool_8);
(co, incr) = fillred<<Int8::fulladd, 8>>(true, x, _v1);
_v1 = [false, false, false, false, false, false, false, false];
tel
-- end of node Int8::incr
function Int8::add(x:A_bool_8; y:A_bool_8) returns (sum:A_bool_8);
(co, sum) = fillred<<Int8::fulladd, 8>>(false, x, y);
tel
-- end of node Int8::add
node mainPack::Nat(evt:bool; reset:bool) returns (nat:_Int8::Int);
var
_v1:bool;
_v2:_Int8::Int;
_v3:_Int8::Int;
_v4:_Int8::Int;
_v5:_Int8::Int;
nat = if _v1 then Int8::zero else _v5;
_v1 = true -> reset;
_v2 = pre nat;
_v3 = Int8::incr(_v2);
_v4 = pre nat;
_v5 = if evt then _v3 else _v4;
tel
-- end of node mainPack::Nat
-- automatically defined aliases:
type A_bool_8 = bool^8;
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/PCOND.lus
Opening file should_work/NONREG/PCOND.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/PCOND.lus
node PCOND::PCOND(
hA:bool when h0;
hB:bool when h0;
hC:bool when h0;
A:int when hA;
B:int when hB;
C:bool when hC;
hD:bool when hC;
D:bool when hD)
returns (
hX:bool when h0;
var
_v1:bool when h0;
_v2:bool when h0;
_v3:bool when hC;
_v4:bool when h0;
_v5:bool when h0;
_v6:bool when hC;
_v7:bool when h0;
_v8:bool when h0;
_v9:bool when h0;
_v10:bool when h0;
_v11:bool when hC;
_v12:bool when h0;
_v13:bool when h0;
_v14:int when h0;
_v15:int when h0;
_v16:int when h0;
hX = _v2 and _v10;
_v1 = current hD;
_v2 = hC and _v1;
_v3 = current D;
_v4 = current _v3;
_v5 = hA and _v4;
_v6 = current D;
_v7 = current _v6;
_v8 = not _v7;
_v9 = hB and _v8;
_v10 = _v5 or _v9;
_v11 = current D;
_v12 = current _v11;
_v13 = hA and _v12;
_v14 = current A;
_v15 = current B;
_v16 = if _v13 then _v14 else _v15;
-- end of node PCOND::PCOND
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/PCOND1.lus
Opening file should_work/NONREG/PCOND1.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/PCOND1.lus
node PCOND1::PCOND1(
hA:bool when h0;
hB:bool when h0;
hC:bool when h0;
A:int when hA;
B:int when hB;
C:bool when hC;
hD:bool when hC;
D:bool when hD)
hX:bool when h0);
var
_v1:bool when h0;
_v2:bool when h0;
_v3:bool when h0;
hX = _v2 and _v3;
_v1 = current hD;
_v2 = hC and _v1;
-- end of node PCOND1::PCOND1
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/SOURIS.lus
Opening file should_work/NONREG/SOURIS.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/SOURIS.lus
node SOURIS::SOURIS(
B1:bool;
B2:bool;
B3:bool;
TOP:bool)
returns (
SIMPLE:bool;
DOUBLE:bool;
TRIPLE:bool;
BOUTON:int);
var
count:int;
prev:int;
date:int;
SIMPLE_2:bool;
clic:bool;
chgt:bool;
fin_tps:bool;
fin_tps2:bool;
etat0:bool;
etat1:bool;
etat2:bool;
etat3:bool;
_v1:bool;
_v2:bool;
_v3:bool;
_v4:int;
_v5:int;
_v6:bool;
_v7:bool;
_v8:bool;
_v9:bool;
_v10:bool;
_v11:bool;
_v12:bool;
_v13:bool;
_v14:bool;
_v15:bool;
_v16:bool;
_v17:bool;
_v18:bool;
_v19:bool;
_v20:bool;
_v21:bool;
_v22:bool;
_v23:bool;
_v24:bool;
_v25:bool;
_v26:bool;
_v27:bool;
_v28:bool;
_v29:bool;
_v30:bool;
_v31:bool;
_v32:bool;
_v33:int;
_v34:int;
_v35:int;
_v36:int;
_v37:int;
_v38:bool;
_v39:int;
_v40:bool;
_v41:bool;
_v42:int;
_v43:bool;
_v44:int;
_v45:bool;
_v46:bool;
_v47:bool;
_v48:bool;
_v49:bool;
_v50:bool;
_v51:bool;
_v52:bool;
_v53:bool;
_v54:bool;
_v55:bool;
_v56:bool;
_v57:bool;
_v58:int;
_v59:bool;
_v60:bool;
_v61:bool;
_v62:bool;
_v63:int;
_v64:int;
_v65:int;
_v66:int;
_v67:int;
_v68:int;
_v69:int;
_v70:int;
_v71:int;
_v72:int;
_v73:int;
_v74:int;
_v75:int;
_v76:int;
_v77:bool;
_v78:bool;
_v79:bool;
_v80:bool;
_v81:bool;
_v82:bool;
_v83:bool;
_v84:bool;
_v85:bool;
_v86:bool;
_v87:bool;
_v88:bool;
_v89:bool;
_v90:bool;
_v91:bool;
_v92:bool;
_v93:bool;
_v94:bool;
_v95:bool;
_v96:bool;
_v97:bool;
_v98:bool;
_v99:bool;
_v100:bool;
_v101:bool;
_v102:bool;
_v103:bool;
_v104:bool;
_v105:bool;
_v106:bool;
_v107:bool;
_v108:bool;
_v109:bool;
_v110:bool;
_v111:bool;
_v112:bool;
_v113:bool;
_v114:bool;
_v115:bool;
_v116:bool;
_v117:bool;
_v118:bool;
_v119:bool;
_v120:bool;
_v121:bool;
_v122:bool;
_v123:bool;
_v124:bool;
_v125:bool;
_v126:bool;
_v127:bool;
_v128:bool;
_v129:bool;
_v130:bool;
_v131:bool;
_v132:bool;
_v133:bool;
_v134:bool;
_v135:bool;
_v136:bool;
_v137:bool;
_v138:bool;
_v139:bool;
_v140:bool;
_v141:bool;
_v142:bool;
_v143:bool;
_v144:bool;
_v145:bool;
_v146:bool;
_v147:bool;
_v148:bool;
_v149:bool;
_v150:int;
_v151:int;
_v152:int;
_v153:bool;
_v154:bool;
_v155:bool;
_v156:bool;
_v157:bool;
_v158:bool;
_v159:bool;
_v160:bool;
_v161:bool;
_v162:bool;
_v163:bool;
_v164:bool;
_v165:bool;
_v166:bool;
_v167:bool;
_v168:bool;
_v169:bool;
_v170:bool;
_v171:bool;
_v172:bool;
_v173:bool;
_v174:bool;
_v175:bool;
_v176:bool;
_v177:bool;
_v178:bool;
_v179:bool;
_v180:bool;
_v181:bool;
_v182:bool;
_v183:bool;
_v184:bool;
_v185:bool;
_v186:bool;
_v187:bool;
_v188:bool;
_v189:bool;
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
date = 0 -> _v5;
_v1 = etat2 or etat3;
_v2 = pre etat1;
_v3 = _v1 and _v2;
_v4 = pre date;
_v5 = if _v3 then count else _v4;
chgt = false -> _v24;
_v6 = not clic;
_v7 = prev = 3;
_v8 = B3 and _v7;
_v9 = prev = 1;
_v10 = B1 and _v9;
_v11 = _v8 or _v10;
_v12 = prev = 2;
_v13 = B2 and _v12;
_v14 = _v11 or _v13;
_v15 = prev = 0;
_v16 = _v14 or _v15;
_v17 = not B1;
_v18 = not B2;
_v19 = _v17 and _v18;
_v20 = not B3;
_v21 = _v19 and _v20;
_v22 = _v16 or _v21;
_v23 = if _v22 then false else true;
_v24 = if _v6 then false else _v23;
clic = _v26 and _v29;
_v25 = B1 xor B2;
_v26 = _v25 xor B3;
_v27 = B1 and B2;
_v28 = _v27 and B3;
_v29 = not _v28;
prev = 0 -> _v36;
_v30 = pre B1;
_v31 = pre B2;
_v32 = pre B3;
_v33 = pre prev;
_v34 = if _v32 then 3 else _v33;
_v35 = if _v31 then 2 else _v34;
_v36 = if _v30 then 1 else _v35;
fin_tps = false -> _v41;
_v37 = pre count;
_v38 = _v37 > 6;
_v39 = pre count;
_v40 = _v39 > 7;
_v41 = if TOP then _v38 else _v40;
fin_tps2 = false -> _v46;
_v42 = pre count;
_v43 = _v42 > 4;
_v44 = pre count;
_v45 = _v44 > 5;
_v46 = if TOP then _v43 else _v45;
count = 0 -> _v76;
_v47 = pre etat0;
_v48 = pre etat1;
_v49 = _v48 and chgt;
_v50 = _v47 or _v49;
_v51 = pre etat2;
_v52 = _v51 and chgt;
_v53 = _v50 or _v52;
_v54 = pre etat3;
_v55 = _v54 and chgt;
_v56 = _v53 or _v55;
_v57 = etat1 and _v56;
_v58 = if TOP then 1 else 0;
_v59 = pre etat2;
_v60 = pre etat3;
_v61 = _v59 or _v60;
_v62 = etat1 and _v61;
_v63 = pre count;
_v64 = pre date;
_v65 = _v63 - _v64;
_v66 = _v65 + 1;
_v67 = pre count;
_v68 = pre date;
_v69 = _v67 - _v68;
_v70 = if TOP then _v66 else _v69;
_v71 = pre count;
_v72 = _v71 + 1;
_v73 = pre count;
_v74 = if TOP then _v72 else _v73;
_v75 = if _v62 then _v70 else _v74;
_v76 = if _v57 then _v58 else _v75;
etat0 = true -> _v98;
_v77 = pre etat1;
_v78 = _v77 and fin_tps;
_v79 = not clic;
_v80 = _v78 and _v79;
_v81 = pre etat2;
_v82 = _v81 and clic;
_v83 = not chgt;
_v84 = _v82 and _v83;
_v85 = _v80 or _v84;
_v86 = pre etat2;
_v87 = _v86 and fin_tps;
_v88 = _v85 or _v87;
_v89 = pre etat3;
_v90 = _v89 and clic;
_v91 = not chgt;
_v92 = _v90 and _v91;
_v93 = _v88 or _v92;
_v94 = pre etat0;
_v95 = not clic;
_v96 = _v94 and _v95;
_v97 = _v93 or _v96;
_v98 = if _v97 then true else false;
etat1 = false -> _v117;
_v99 = pre etat0;
_v100 = _v99 and clic;
_v101 = pre etat2;
_v102 = _v101 and chgt;
_v103 = _v100 or _v102;
_v104 = pre etat3;
_v105 = chgt or fin_tps;
_v106 = _v104 and _v105;
_v107 = _v103 or _v106;
_v108 = pre etat1;
_v109 = not clic;
_v110 = _v108 and _v109;
_v111 = not fin_tps;
_v112 = _v110 and _v111;
_v113 = _v107 or _v112;
_v114 = pre etat1;
_v115 = _v114 and chgt;
_v116 = _v113 or _v115;
_v117 = if _v116 then true else false;
etat2 = false -> _v130;
_v118 = pre etat1;
_v119 = _v118 and clic;
_v120 = not fin_tps2;
_v121 = _v119 and _v120;
_v122 = not chgt;
_v123 = _v121 and _v122;
_v124 = pre etat2;
_v125 = not clic;
_v126 = _v124 and _v125;
_v127 = not fin_tps;
_v128 = _v126 and _v127;
_v129 = _v123 or _v128;
_v130 = if _v129 then true else false;
etat3 = false -> _v142;
_v131 = pre etat1;
_v132 = _v131 and clic;
_v133 = _v132 and fin_tps2;
_v134 = not chgt;
_v135 = _v133 and _v134;
_v136 = pre etat3;
_v137 = not clic;
_v138 = _v136 and _v137;
_v139 = not fin_tps;
_v140 = _v138 and _v139;
_v141 = _v135 or _v140;
_v142 = if _v141 then true else false;
BOUTON = 0 -> _v152;
_v143 = pre SIMPLE_2;
_v144 = not _v143;
_v145 = SIMPLE and _v144;
_v146 = _v145 or DOUBLE;
_v147 = _v146 or TRIPLE;
_v148 = pre SIMPLE_2;
_v149 = SIMPLE and _v148;
_v150 = pre prev;
_v151 = if _v149 then _v150 else 0;
_v152 = if _v147 then prev else _v151;
SIMPLE = false -> _v167;
_v153 = pre etat1;
_v154 = _v153 and etat0;
_v155 = pre etat1;
_v156 = _v155 and chgt;
_v157 = _v154 or _v156;
_v158 = pre etat3;
_v159 = _v158 and etat1;
_v160 = _v159 and fin_tps;
_v161 = _v157 or _v160;
_v162 = pre etat3;
_v163 = _v162 and etat1;
_v164 = _v163 and chgt;
_v165 = _v161 or _v164;
_v166 = pre SIMPLE_2;
_v167 = _v165 or _v166;
SIMPLE_2 = false -> _v175;
_v168 = pre etat3;
_v169 = _v168 and etat1;
_v170 = _v169 and chgt;
_v171 = pre etat1;
_v172 = pre SIMPLE_2;
_v173 = _v171 and _v172;
_v174 = _v173 and chgt;
_v175 = _v170 or _v174;
DOUBLE = false -> _v180;
_v176 = pre etat2;
_v177 = _v176 and chgt;
_v178 = pre etat2;
_v179 = _v178 and fin_tps;
_v180 = _v177 or _v179;
TRIPLE = false -> _v189;
_v181 = pre etat3;
_v182 = _v181 and etat0;
_v183 = pre etat2;
_v184 = not fin_tps;
_v185 = _v183 and _v184;
_v186 = not chgt;
_v187 = _v185 and _v186;
_v188 = _v187 and etat0;
_v189 = _v182 or _v188;
-- end of node SOURIS::SOURIS
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/STABLE.lus
Opening file should_work/NONREG/STABLE.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/STABLE.lus
node STABLE::STABLE(set:bool; delay:int) returns (level:bool);
var
count:int;
_v1:bool;
_v2:bool;
_v3:int;
_v4:int;
_v5:int;
let
level = count > 0;
count = if set then delay else _v5;
_v1 = pre level;
_v2 = false -> _v1;
_v3 = pre count;
_v4 = _v3 - 1;
_v5 = if _v2 then _v4 else 0;
tel
-- end of node STABLE::STABLE
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/SWITCH.lus
Opening file should_work/NONREG/SWITCH.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/SWITCH.lus
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
node SWITCH::SWITCH(
set:bool;
reset:bool;
initial:bool)
returns (
level:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
_v4:bool;
_v5:bool;
_v6:bool;
let
level = initial -> _v6;
_v1 = pre level;
_v2 = not _v1;
_v3 = set and _v2;
_v4 = pre level;
_v5 = if reset then false else _v4;
_v6 = if _v3 then true else _v5;
tel
-- end of node SWITCH::SWITCH
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/SWITCH1.lus
Opening file should_work/NONREG/SWITCH1.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/SWITCH1.lus
node SWITCH1::SWITCH1(
set:bool;
reset:bool;
initial:bool)
returns (
level:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
let
level = initial -> _v3;
_v1 = pre level;
_v2 = if reset then false else _v1;
_v3 = if set then true else _v2;
tel
-- end of node SWITCH1::SWITCH1
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/TIME_STABLE.lus
Opening file should_work/NONREG/TIME_STABLE.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/TIME_STABLE.lus
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
node TIME_STABLE::STABLE(set:bool; delay:int) returns (level:bool);
var
count:int;
_v1:bool;
_v2:bool;
_v3:int;
_v4:int;
_v5:int;
let
level = count > 0;
count = if set then delay else _v5;
_v1 = pre level;
_v2 = false -> _v1;
_v3 = pre count;
_v4 = _v3 - 1;
_v5 = if _v2 then _v4 else 0;
tel
-- end of node TIME_STABLE::STABLE
node TIME_STABLE::TIME_STABLE(
set:bool;
second:bool;
delay:int)
returns (
level:bool);
var
ck:bool;
_v1:bool when ck;
_v2:int when ck;
_v3:bool when ck;
_v4:bool;
let
level = current _v3;
_v1 = set when ck;
_v2 = delay when ck;
_v3 = TIME_STABLE::STABLE(_v1, _v2);
ck = true -> _v4;
_v4 = set or second;
tel
-- end of node TIME_STABLE::TIME_STABLE
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/TIME_STABLE1.lus
Opening file should_work/NONREG/TIME_STABLE1.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/TIME_STABLE1.lus
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
node TIME_STABLE1::TIME1_STABLE1(
set:bool;
second:bool;
delay:int)
returns (
level:bool);
var
count:int;
_v1:bool;
_v2:bool;
_v3:int;
_v4:int;
_v5:int;
_v6:int;
_v7:int;
_v8:int;
let
level = count > 0;
count = if set then delay else _v8;
_v1 = pre level;
_v2 = false -> _v1;
_v3 = pre count;
_v4 = _v3 - 1;
_v5 = if _v2 then _v4 else 0;
_v6 = pre count;
_v7 = 0 -> _v6;
_v8 = if second then _v5 else _v7;
tel
-- end of node TIME_STABLE1::TIME1_STABLE1
----------------------------------------------------------------------
====> ../lus2lic -vl 2 should_work/NONREG/Watch.lus
Opening file should_work/NONREG/Watch.lus
Erwan Jahier
committed
-- ../lus2lic -vl 2 should_work/NONREG/Watch.lus
type _Watch::STATUS_TYPE;
type _Watch::ALARM_TIME_TYPE;
type _Watch::WATCH_TIME_POSITION;
type _Watch::ALARM_TIME_POSITION;
type _Watch::DISPLAY_TYPE;
type _Watch::WATCH_TIME_TYPE;
type _Watch::STOPWATCH_TIME_TYPE;
type _Watch::MAIN_DISPLAY_TYPE;
type _Watch::LABELS_TYPE;
type _Watch::DISPLAY_POSITION;
type _Watch::MINI_DISPLAY_TYPE;
type _Watch::string;
const Watch::INITIAL_WATCH_POSITION:_Watch::WATCH_TIME_POSITION;
const Watch::INITIAL_WATCH_TIME:_Watch::WATCH_TIME_TYPE;
const Watch::ALARM_DURATION:int;
const Watch::stringST:_Watch::string;
const Watch::stringAL:_Watch::string;
const Watch::INITIAL_ALARM_TIME:_Watch::ALARM_TIME_TYPE;
const Watch::INITIAL_ALARM_POSITION:_Watch::ALARM_TIME_POSITION;
const Watch::NULL_POSITION:_Watch::DISPLAY_POSITION;
const Watch::INITIAL_STOPWATCH_TIME:_Watch::STOPWATCH_TIME_TYPE;
extern function Watch::ALARM_TO_DISPLAY_POS(
apos:_Watch::ALARM_TIME_POSITION)
returns (
dpos:_Watch::DISPLAY_POSITION);
extern function Watch::INCREMENT_STOPWATCH_TIME(
time:_Watch::STOPWATCH_TIME_TYPE)
returns (
newtime:_Watch::STOPWATCH_TIME_TYPE);
node Watch::TWO_STATES(
init:bool;
set:bool;
reset:bool)
returns (
state:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
_v4:bool;
_v5:bool;
_v6:bool;
_v7:bool;
_v8:bool;
state = init -> _v8;
_v1 = pre state;
_v2 = not _v1;
_v3 = set and _v2;
_v4 = pre state;
_v5 = reset and _v4;
_v6 = pre state;
_v7 = if _v5 then false else _v6;
_v8 = if _v3 then true else _v7;
-- end of node Watch::TWO_STATES
node Watch::DIVIDE(scale:int) returns (quotient:bool);
var
n:int;
_v1:int;
_v2:int;
_v3:bool;
_v4:int;
_v5:int;
_v6:int;
_v7:bool;
let
n = 0 -> _v6;
quotient = true -> _v7;
_v1 = pre n;
_v2 = _v1 + 1;
_v3 = _v2 = scale;
_v4 = pre n;
_v5 = _v4 + 1;
_v6 = if _v3 then 0 else _v5;
_v7 = if _v3 then true else false;
-- end of node Watch::DIVIDE
extern function Watch::MAKE_DISPLAY(
main:_Watch::MAIN_DISPLAY_TYPE;