Commit graph

116 commits

Author SHA1 Message Date
Timothy Bourke
4dadf6b4d6 Enforce well-formedness of clocks
For a clock (ck on x) to be well-formed in an environment H, we must
have H x = ck, i.e., the clock of x is the same as the clock ck of the
stream being sampled.

This constraint is guaranteed by construction for fully inferred clocks
(by the rules for when and merge), but nothing guarantees that user
declarations be well-formed. This can lead to problems.

For instance, this invalid program is incorrectly accepted:

    node f (x : bool; a : bool :: . on b;
		      b : bool :: . on a) returns (y:bool);
    let
	y = true;
    tel

as is this one:

    node f(a: bool :: . on a; b: bool :: . on a)
    returns (z: bool);
    var w : bool;
    let
	w = a when b;
	z = false fby w;
    tel

This invalid program is incorrectly accepted and leads to an internal
compiler error:

    node f (x : bool) returns (y:bool);
    var a : bool :: . on b;
	b : bool :: . on a;
    let
	y = true;
	a = true;
	b = true;
    tel

This patch enforces the well-formedness constraint. It gives a sensible
error message when the constraint cannot be satisfied.
2017-09-29 00:08:42 +02:00
Gwenaël Delaval
7d6106d0aa Passes optimization
Translation to tail-recursive versions of functions
for handling of (very) big nodes.
2017-05-23 22:13:32 +02:00
Gwenaël Delaval
2f18926bf4 Clean up documentation comments 2017-03-03 11:41:57 +01:00
Gwenaël Delaval
3dfbeffeb6 Added syntax for reachability and attractivity in contracts
Contracts can now comprise a list of objectives (in any order).

One objective can be (e being a Boolean heptagon expression) :
- invariance, with the syntax "enforce e"
- reachability, "reachable e"
- attractivity, "attractive e"
2015-01-06 00:26:59 +01:00
Nicolas Berthier
c86d7af0b1 Introducing a hack to normalize comparison of tuples in Heptagon. 2014-12-15 15:42:37 +01:00
Nicolas Berthier
541dd83fca Optional compilation of Controllable-Nbac-related modules and tools. 2014-10-21 15:41:40 +02:00
Nicolas Berthier
99ab12aa13 Fixed warnings. 2014-03-18 11:01:56 +01:00
Nicolas Berthier
216550c0d1 Fixed warnings & documentation comments.
- gitignore: ignore files generated by `configure' script.
2013-11-08 18:51:06 +01:00
Cédric Pasteur
a00620ca19 Fixed interference of fast memories
A fast memory should be considered alive during
the whole step function when its clock is false.
2013-05-06 11:47:05 +02:00
Cédric Pasteur
99dc7820c7 Avoid crash in memalloc
Check if both variables are optmized
2013-04-22 18:11:10 +02:00
Gwenaël Delaval
5a9b27d6a9 Correct handling of local assume/enforce of contracts 2012-12-11 08:20:04 +01:00
Cédric Pasteur
36bfa81b17 Fix for memalloc
Take the simplified versions of types (i.e. 
with constants instantiated) to check the 
equality of types
2012-09-14 16:08:26 +02:00
Gwenaël Delaval
72b1bd8de3 Typo in error message 2012-07-26 01:33:32 +02:00
Gwenaël Delaval
ef00823cf7 Added Marc as co-author 2012-06-29 01:43:15 +02:00
Gwenaël Delaval
58086190eb Headers and license file for GPL
Headers for every source file (excluding examples), mentioning
authors, copyright and license (GPL)

COPYING file with GPLv3 content.
2012-06-27 18:14:29 +02:00
Cédric Pasteur
7a10ba028a Fixed disjoint clock computation 2012-06-20 17:09:17 +02:00
Cédric Pasteur
8815a2cd03 Better handling of clocks in memalloc
- We can do a better allocation if we take into
account 'when' in extvalues 
(test/good/memalloc_clocks.ept shows the
improvement)
- Fixed a bug with memalloc on records: if we 
translate:
o = { a with .f = u }
to
o = a; o.f = u
then we cannot share u and o.f
2012-06-20 09:17:13 +02:00
Cédric Pasteur
ed2c08315b Should be affinity, not copy 2012-06-19 09:33:27 +02:00
Gwenal Delaval
2bd31db883 Causality and scheduling with contracts
Correction of the causality analysis and scheduling (with interference)
to take contracts into account.
2012-06-07 15:27:07 +02:00
Gwenal Delaval
bb0bc8bfe5 Added local assume/guarantee
Added local assume/guarantee in contracts.

No syntax associated to these local asume/guarantee: internal use only.
2012-05-29 14:14:46 +02:00
Adrien Guatto
8153bc4eb5 Fixed Tomato: did not reconstruct internal clocks of extvalues 2012-03-30 14:47:47 +02:00
Adrien Guatto
44d3a639e5 Internal error for unknown clocks. 2012-03-02 17:12:30 +01:00
Cédric Pasteur
6e2e2a9f47 Fixed bug in interference computation
To know the variables read by an equation, we should
only look at the clock of variables. Otherwise, 
there could be a problem for node calls that 
define new clocks.
2012-02-09 11:48:36 +01:00
Cédric Pasteur
7866321089 Fixed bug in interference 2012-02-09 11:06:28 +01:00
Adrien Guatto
3aeb499cc2 Re-enable interference for enums 2012-02-08 11:13:02 +01:00
Adrien Guatto
1cb4b1154b Memory allocation: do not share enums (and thus clocks). 2012-01-30 17:48:47 +01:00
Cédric Pasteur
2f993a602c Fixed base clock in code generation
Put the base clock inside the equation where it 
belongs.
2012-01-25 09:34:58 +01:00
Cédric Pasteur
06e997e0c8 Fix for -mall
Do not share memories and outputs if they are not
arrays, as it might make the register allocation
by the C compiler less efficient.
2012-01-24 10:29:05 +01:00
Cédric Pasteur
b1bd6dbd57 Compare clock repr
Not sure this is necessary but it doesn't hurt to 
check twice.
2012-01-23 16:03:01 +01:00
Cédric Pasteur
2b59ec754a Fix for memories with no uses
Add a fake use to make sure they interfere with
other memories and outputs
2012-01-23 16:02:34 +01:00
Adrien Guatto
cad8a0149f Option to perform type inference on all types 2012-01-23 13:36:24 +01:00
Léonard Gérard
da3147151d Better check signature error message 2011-12-12 11:30:18 +01:00
Cédric Pasteur
2fc0435393 Added simple printf
Typing and clocking done
2011-12-12 10:36:24 +01:00
Léonard Gérard
2b9d3828b1 debut de la correction du when.
test :

node f(c :bool) returns (out :int)
let
  out = (0 fby 1) when c
tel


et

node f(x :int) returns (out : int)
let
  out = 0 fby x
tel

node g(c :bool) returns (out :int)
let
  out = f(0) when c
tel
2011-12-06 15:44:20 +01:00
Léonard Gérard
b49c37f7bf Add ways to declare unsafe functions + unsafe fix 2011-11-21 03:26:26 +01:00
Adrien Guatto
1a9dc17618 Fixed clocking annotations.
1. Transmit annotations to extvaluese in Hept2mls.

2. Handle a pre-existing w_ck when clocking extvalues.
2011-11-10 15:36:54 +01:00
Cédric Pasteur
04b8853a1d Added a new reinit operator
It has type:
reinit: t at r * t -> t at r

It can be used to put a constant value in a 
location.
2011-10-17 15:28:04 +02:00
Cédric Pasteur
0f403e3694 Fix for wrong number of expected args 2011-10-17 10:17:18 +02:00
Cédric Pasteur
902cbaf7a1 Fixed error with memalloc and const value with when 2011-10-04 14:34:44 +02:00
Cédric Pasteur
81947eca40 Made linearity field not optional
This helped solve a few bugs with linear types,
for instance when using automata.
The intermediate code is not well-typed (wrt to
linear types only), after the encoding of automata.
2011-09-07 17:51:31 +02:00
Cédric Pasteur
7ac567cc35 Update the signature instead of recreating it
This avoids losing additional info in the
signature (such as linearity)
2011-09-07 11:32:16 +02:00
Gwenaël Delaval
c57b71b6aa Merge branch 'bzr' into decade
- Added Boolean module (enum types to boolean vectors)
- Added Hept_clocking analysis, called before Boolean
- Added z3z target from minils (sigali format)
- Bug corrections in Normalize, Normalize_mem

Conflicts:
	compiler/heptagon/analysis/typing.ml
	compiler/heptagon/heptagon.ml
	compiler/heptagon/parsing/hept_parser.mly
	compiler/heptagon/parsing/hept_parsetree.ml
	compiler/heptagon/parsing/hept_scoping.ml
	compiler/main/hept2mls.ml
	compiler/main/heptc.ml
	compiler/main/mls2seq.ml
	compiler/minils/minils.ml
	compiler/minils/transformations/normalize_mem.ml
	test/check
2011-08-04 13:37:33 +02:00
Cédric Pasteur
7d95b95ed7 Merge branch 'memalloc' into decade
Conflicts:
	compiler/global/signature.ml
	compiler/heptagon/analysis/typing.ml
	compiler/heptagon/hept_printer.ml
	compiler/heptagon/hept_utils.ml
	compiler/heptagon/heptagon.ml
	compiler/heptagon/parsing/hept_parser.mly
	compiler/heptagon/parsing/hept_parsetree.ml
	compiler/heptagon/parsing/hept_scoping.ml
	compiler/heptagon/transformations/switch.ml
	compiler/main/hept2mls.ml
	compiler/minils/minils.ml
	compiler/minils/mls_printer.ml
	compiler/obc/c/cgen.ml
	compiler/obc/control.ml
	compiler/utilities/misc.mli
2011-07-21 08:50:45 +02:00
Brice Gelineau
42c2936040 Bugfix for the clocking analysis of iterators 2011-07-06 15:56:56 +02:00
Léonard Gérard
5837f3906f Multidimensional iterators in java. 2011-06-28 17:50:42 +02:00
Léonard Gérard
46ed39b7b3 Remove some warnings. 2011-06-09 14:40:31 +02:00
Cédric Pasteur
f45e30d207 Yet another special case for iterators 2011-06-07 10:49:36 +02:00
Léonard Gérard
fe74030f78 Fix clocking of iterators. 2011-05-26 16:08:59 +02:00
Léonard Gérard
b73e6502a6 resets are now without constraint. 2011-05-26 15:56:59 +02:00
Léonard Gérard
d7d7552be4 Fix printing and parsing of clocks 2011-05-26 15:56:59 +02:00