Commit graph

397 commits

Author SHA1 Message Date
Léonard Gérard f0cbbccc2a unsafe in minils node 2011-12-12 11:27:18 +01:00
Léonard Gérard b86555e013 global env misc 2011-12-12 11:08:47 +01:00
Léonard Gérard ba5f336a6f Fix antidependance calculation 2011-12-12 11:01:22 +01:00
Cédric Pasteur 2fc0435393 Added simple printf
Typing and clocking done
2011-12-12 10:36:24 +01:00
Adrien Guatto 8c6926c5bd TOMATO was confused about having several empty patterns in the equations
of a node.

He should be better now.
2011-12-06 15:44:21 +01:00
Léonard Gérard fe1f02402b Test to watch sampling of returned stateful exps. 2011-12-06 15:44:20 +01:00
Cédric Pasteur f76667e042 Second part of the fix 2011-12-06 15:44:20 +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 646cfab82b Enforce style : no tab, no trailing whitespace. 2011-11-21 03:26:27 +01:00
Léonard Gérard a08da94edc Scheduling bonus for array updates. 2011-11-21 03:26:26 +01:00
Léonard Gérard b49c37f7bf Add ways to declare unsafe functions + unsafe fix 2011-11-21 03:26:26 +01:00
Léonard Gérard bdd85f5f81 mapfold over var_ident. 2011-11-18 12:32:36 +01:00
Cédric Pasteur 1a28ed96e8 Improvement for normalize memories
Only create necessary copies (for outputs
and recursive registers).
2011-11-16 16:07:36 +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
Léonard Gérard ffe2b23a82 new sheduler by default 2011-10-23 17:42:26 +02:00
Léonard Gérard 81ad14ab7b changed interf_schedule to use clocks correctly 2011-10-20 16:52:50 +02:00
Cédric Pasteur 21433f6416 Only do one copy for two recursive registers 2011-10-20 09:16:51 +02:00
Cédric Pasteur 72cac326a8 Fixed normalization of fby
We should normalize not only outputs but also 
other fbys to generate correct code. The test shows
a program that was compiled incorrectly.
2011-10-19 16:31:40 +02:00
Cédric Pasteur 85be1252b0 Another try to fix causality of linear ifs 2011-10-17 18:10:38 +02:00
Adrien Guatto 1ec97d187b Adapted minimization to reinit. 2011-10-17 15:43:55 +02: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
Léonard Gérard ef4478e37e removed some stupid warnings. 2011-10-14 13:33:34 +02:00
Adrien Guatto ee2f5ca443 Tomato: simplification + update signature via modules.
test/good/linear_init.ept now compiles.
2011-10-10 17:01:08 +02:00
Adrien Guatto 3269a04052 Do not inline linear extended values. 2011-10-06 16:18:48 +02:00
Adrien Guatto 30089e7d0f Fixed extvalue inlining w.r.t. linear copy 2011-10-05 17:44:01 +02:00
Adrien Guatto d0ed09c3e5 Ext-value inlining pass. 2011-10-04 15:14:02 +02:00
Cédric Pasteur 902cbaf7a1 Fixed error with memalloc and const value with when 2011-10-04 14:34:44 +02:00
Adrien Guatto 2fb27770b8 Fixed iterator minimization bug. 2011-10-03 10:54:50 +02:00
Cédric Pasteur 70787757aa Fixed normalization of fby
The incorrect behaviour was introduced in commit
6b86b86e9d.

We should have:
       o = v fby e
     becomes
       mem_o = v fby e;
       o = mem_o

The old way would break with:
 v = true fby false fby v
that would generate unschedulable code.
2011-09-08 11:45:43 +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 9d1702587a Fix interaction between tomato and memalloc
Take linearity into account when comparing exps
2011-09-07 14:15:33 +02:00
Cédric Pasteur caa43f163f Added dependency from a read to a linear read
This got lost along the way when porting memalloc
to the new branch
2011-09-07 14:14:59 +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
Cédric Pasteur 8cc879be7a Generate code from interface (.epi) files
It includes the definition of types, constants
and prototypes defined in the interface.
2011-09-06 11:55:06 +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
Gwenal Delaval 2c4be9d42c Correct scoping and typing with contracts 2011-07-27 16:13:45 +02:00
Gwenal Delaval c77386d517 Active Boolean pass and Sigali backend 2011-07-27 11:21:34 +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
Léonard Gérard 57155b45e2 remove the ; _ } from ocaml 3.12 ... 2011-07-08 15:31:17 +02:00
Adrien Guatto 1e95cc4098 patch tomato wrong merge. 2011-07-08 15:27:17 +02:00
Adrien Guatto 40e64b305d Tomato: disable debug messages by default 2011-07-08 11:56:38 +02:00
Adrien Guatto 7d9e31a83b Tomato checking in check.sh 2011-07-08 11:56:38 +02:00
Adrien Guatto d1c2789574 Tomato: properly handle n-ary functions. 2011-07-08 11:56:38 +02:00
Adrien Guatto 8f0ef3a256 Properly use clocking information in corner cases. 2011-07-08 11:56:38 +02:00
Adrien Guatto 2283fcdfaa Properly handle fused outputs. 2011-07-08 11:56:38 +02:00
Adrien Guatto 3657018861 Tomato: finer equivalence classes for Eapp and
Eiterator when a reset variable is present.
2011-07-08 11:56:38 +02:00
Adrien Guatto 3c5bb4e8b7 Tomato working with clocks and when. 2011-07-08 11:56:37 +02:00
Adrien Guatto 891174d73c All-new and fresh tomato!
Not working ATM:
  * tuples
  * when
2011-07-08 11:56:37 +02:00
Léonard Gérard 0518ecafe6 Merge branch 'multidimensional' into decade
Conflicts:
	compiler/obc/c/cgen.ml
	compiler/obc/java/java_main.ml
2011-07-08 11:36:46 +02:00
Brice Gelineau 42c2936040 Bugfix for the clocking analysis of iterators 2011-07-06 15:56:56 +02:00
Adrien Guatto cedcabfbc4 Fix memory normalization: the correct clock was
missing.
2011-07-06 11:50:02 +02:00
Léonard Gérard 5837f3906f Multidimensional iterators in java. 2011-06-28 17:50:42 +02:00
Brice Gelineau c70d34ec06 Preliminary version of multidimensional iterators. 2011-06-28 17:50:42 +02:00
Léonard Gérard 83b0182874 Merge branch 'clocked_inputs' into decade
Conflicts:
	compiler/heptagon/analysis/typing.ml
	compiler/heptagon/parsing/hept_scoping.ml
	compiler/heptagon/parsing/hept_static_scoping.ml
	compiler/main/mls2obc.ml
	compiler/obc/c/cmain.ml
2011-06-28 14:46:43 +02:00
Léonard Gérard 108981c0eb Static constraints in the source. Equal removed
( = ) in pervasives is a stub, it will be typed in a polymorphic way.
This is necessary to have a simple way to transform exp into a static_exp
even when there is the = operator.
2011-06-09 14:53:40 +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
Brice Gelineau 938e8897b2 n-ary Sarray_power Earray_fill 2011-05-26 18:43:30 +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
Léonard Gérard fd00f099f5 correct reset and level clock 2011-05-26 15:56:59 +02:00
Léonard Gérard 2a2b363bf7 Real asynchronous resets. 2011-05-26 15:56:59 +02:00
Léonard Gérard fbfa6eda1a Add Ewhen to the minils ast, And clocking of iterators.
Ewhen is now the only case of possible recursion for minils exps.
This add was motivated by equations like :
(y,z) = f(x) when c
This equation to be correctly normalized in minils before needed :
y',z' = f(x)
y = y' when c
z = z' when c
But this new variables where needless since the final translation of when c
is the identity.
2011-05-26 15:56:59 +02:00
Léonard Gérard 87dc76f113 Code formating fixes (typos, tabs, spaces at endofline,...) 2011-05-26 15:56:59 +02:00
Léonard Gérard de49540a76 clean signature printing. 2011-05-26 15:56:59 +02:00
Léonard Gérard 74cc367a0e correct base_clock and signature. 2011-05-26 15:56:59 +02:00
Léonard Gérard 9a17648516 good clocks in signatures 2011-05-26 15:56:59 +02:00
Leonard Gerard 88497a2da3 parsing clocks. 2011-05-26 15:56:58 +02:00
Leonard Gerard a8215c8083 compile ! nearly all tests passed. 2011-05-26 15:56:58 +02:00
Cédric Pasteur de3a61557b Improvements on Schedule_Interf
Only take into account optimized types.
Reuse code from Interference to compute uses.
2011-05-25 09:12:16 +02:00
Cédric Pasteur b7ba8e7913 Remove useless case
As targeting is only done for linear variables, 
this case is already dealt with by 
coalesce_linear_vars
2011-05-25 09:12:15 +02:00
Cédric Pasteur d1a68c5df3 Missing file 2011-05-25 09:12:15 +02:00
Cédric Pasteur 75b4fa9ddc Fixed bug in the interference of fold 2011-05-25 09:12:15 +02:00
Cédric Pasteur 1ea4290f9e Added scheduler that tries to minimize interferences 2011-05-25 09:12:15 +02:00
Cédric Pasteur 2b2cba8e2d Added split operator 2011-05-25 09:12:14 +02:00
Cédric Pasteur 28b9eaa203 Fixed problems with types 2011-05-25 09:12:14 +02:00
Cédric Pasteur c3d47f4d4b Fixed error in computation of targeting 2011-05-25 09:12:14 +02:00
Cédric Pasteur 6f32564ad5 Added a sepecial case to deal with iterators 2011-05-25 09:12:14 +02:00
Cédric Pasteur 0728f3dae7 More work on code generation 2011-05-25 09:12:13 +02:00
Cédric Pasteur 822e87605b One step closer to code generation with memalloc 2011-05-25 09:12:13 +02:00
Cédric Pasteur 3f29e8623d Interaction between linear typing and memalloc 2011-05-25 09:12:13 +02:00
Cédric Pasteur cf34234ed5 Fixed linear typing of iterators 2011-05-25 09:12:13 +02:00
Cédric Pasteur 6c9d9e90d1 Linearity annotations in the AST 2011-05-25 09:12:13 +02:00
Cédric Pasteur 0b9dc1fc01 Correct fix 2011-05-25 09:12:12 +02:00
Cédric Pasteur 7d2b1e5865 Fixed bug in disjoint clock 2011-05-25 09:12:12 +02:00
Cédric Pasteur 285abc48bf Fixed some bugs 2011-05-25 09:12:12 +02:00
Cédric Pasteur dec8cb69c8 Fixed bug in computation of live vars 2011-05-25 09:12:12 +02:00
Cédric Pasteur 68e1fe1ee8 Always check if a var should be optimized 2011-05-25 09:12:12 +02:00
Cédric Pasteur 66386ddca2 Fixed some bugs 2011-05-25 09:12:12 +02:00
Cédric Pasteur 448c163181 Dsatur coloring algorithm
It is not completely generic, as we need to know 
the difference between affinity and interference
edges.
2011-05-25 09:12:11 +02:00
Cédric Pasteur 3f9918b570 Added memory alloc application pass 2011-05-25 09:12:11 +02:00
Cédric Pasteur a7015a9bf4 Fix for interference
Works on a simple program
2011-05-25 09:12:11 +02:00
Cédric Pasteur 9a7f9254d2 Added memalloc pass to the compiler 2011-05-25 09:12:11 +02:00
Cédric Pasteur 1059329c0e Interference compiles 2011-05-25 09:12:11 +02:00
Cédric Pasteur 197e24b73e Rename Graph to Sgraph
The Graph module name is already used  
in OCamlGraph
2011-05-25 09:12:10 +02:00
Cédric Pasteur 7787428f34 Compile fixes 2011-05-25 09:12:10 +02:00
Cédric Pasteur 3ee0e5e7b4 First version of interference.ml 2011-05-25 09:12:10 +02:00
Gwenal Delaval bf4d80c5a3 Correction of Mls_compare for new AST 2011-05-11 14:25:45 +02:00
Gwenal Delaval 9e41fcf71f Current Boolean pass for Heptagon 2011-05-05 11:54:38 +02:00
Cédric Pasteur f110727568 Better fix for Normalize_mem
We have to modify the var_dec and arg as they may
have other fields that need to be kept
2011-05-02 11:20:37 +02:00
Léonard Gérard 9fa8e7e6ff mk_equation in hept computes the stateful field. 2011-04-29 15:04:47 +02:00
Léonard Gérard b8ee46d58f fix normalize_mem 2011-04-27 14:29:21 +02:00
Léonard Gérard 6b86b86e9d really fix normalize_mem.
in the old fix was missing the renaming, and there was wrong equations
order :
f () returns x
[here rename x by mem_x]
mem_x = fby ...
x = mem_x

so the simplest was :
f () returns out_x
var x;
[ nothing to do]
out_x = x
x = fby ...

pay attention to the order of equations since we are after the
scheduling..
probably it should be done before the scheduling anyway ?
2011-04-20 20:47:06 +02:00
Cédric Pasteur 2757e7c1bf Fixed normalized_mem
It inverted the order of equations
2011-04-20 16:23:44 +02:00
Gwenal Delaval 8c4217ab83 Rebase bzr branch on old decade 2011-04-20 14:50:09 +02:00
Gwenaël Delaval 85bbe21d6c Sigali pass into compiler + added a_id field to applications
- Added "z3z" target language, calling sigali code generation

- a_id is application id, so as to identify node applications; added
to Minils AST. a_id is given on hept2mls pass.

This is needed for the controller execution from controller synthesis.
2011-04-20 12:47:28 +02:00
Gwenaël Delaval da37fd8e58 Sigali code generation
Sigali AST and Sigalimain module for sigali code generation
from normalized and Boolean minils program
2011-04-20 12:28:38 +02:00
Gwenaël ac9715ad90 Correction of Boolean pass
Correction of Boolean pass: correct translation of variable declarations,
including full clock translation (in two passes for variable declarations:
one to build the env, one for clock translation).
2011-04-20 12:28:38 +02:00
Gwenal Delaval 0f6ddb739b Correction of Boolean pass
Corrections to handle modifications on AST
(fresh/gen_fresh on idents, Tunit type,
e_base_ck = Cbase everywhere)
2011-04-20 12:28:37 +02:00
Gwenal Delaval 4e267d82c6 Boolean transformation pass (translate every enumeration type to boolean tuples) 2011-04-20 12:28:37 +02:00
Léonard Gérard d6240e1c67 100 and java scalarized 2011-04-19 18:45:56 +02:00
Cédric Pasteur 802178fb28 Added a pass to normalize memories
This adds a copy for outputs that are also
memories.
2011-04-19 17:19:40 +02:00
Cédric Pasteur 740114764c Fixed stupid bug in the order of args 2011-04-19 10:38:48 +02:00
Cédric Pasteur a2303ec7e1 Other compile fixes
The java backend is disabled temporarily
2011-04-19 09:49:00 +02:00
Leonard Gerard 8da5ce4648 no order in declarations 2011-04-18 19:20:35 +02:00
Leonard Gerard c0602c6df6 etuple removed 2011-04-18 16:09:07 +02:00
Cédric Pasteur c6aa63b444 Heptc compiles again
AFor now expects expressions instead of static exps
2011-04-18 15:38:42 +02:00
Léonard Gérard 5d2f7dfa85 jeudi soir. still on mls2obc. 2011-04-14 20:14:21 +02:00
Cédric Pasteur 2f346f873c Control optimization as a pass on Obc
There is now a obc_compiler.ml file, as in hept
and minils.
2011-04-14 11:53:39 +02:00
Cédric Pasteur 6adb45c3ad Normalize in Heptagon compiles 2011-04-13 16:21:28 +02:00
Cédric Pasteur 611c94bbbd Itfusion moved to heptagon 2011-04-13 15:10:15 +02:00
Cédric Pasteur cbf92beba2 First try at a normalization in Heptagon
I can't see if it compiles yet
2011-04-13 14:40:06 +02:00
Cédric Pasteur 2c7b609d2e Forme normale Minils 2011-04-12 14:07:05 +02:00
Cédric Pasteur 2fdf2855d3 Added a new truncated select operator
a[>e<] returns the element in the array at index
e, a[0] if e < 0 and a[n-1] if e >= n
2011-03-22 22:12:59 +01:00
Cédric Pasteur 99eeacbceb Added mapi iterator
The last argument of the iterated function is the
index of the element in the array.
2011-03-22 09:28:41 +01:00
Léonard Gérard b8b16a7355 blop 2011-03-21 17:41:00 +01:00
Léonard Gérard 02730b8a0b refactoring static evaluation. 2011-03-21 17:41:00 +01:00
Cédric Pasteur b1b8e103f2 Added partial application for iterators
For instance:
  ... = map<<n>> (f<<se>>)((t1, t1'))(t2, t3)

is translated to:
  for(int i =...)
    ... = f(t1, t1', t2[i], t3[i])
2011-03-21 17:22:03 +01:00
Cédric Pasteur 35775c4131 C backend ported to recent API changes in Obc 2011-03-09 09:46:00 +01:00
Léonard Gérard cab8bb706e backport from async. 2011-03-09 00:06:36 +01:00
Léonard Gérard 159bab2a55 async constants. 2011-03-08 13:41:28 +01:00
Léonard Gérard 8f4411e145 Recursives Qualnames.
In order to have a correct handling of inner classes in Java, and to prepare for modules inside modules.
2011-02-07 14:24:17 +01:00
Léonard Gérard 09419a77a5 again 2011-01-24 16:09:28 +01:00
Léonard Gérard df469db394 New Java backend closing 2011-01-24 16:09:28 +01:00
Léonard Gérard ed21462706 Add java to the compiling process. 2011-01-24 16:09:27 +01:00
Léonard Gérard 315527231c Async in Heptagon Minils Obc. 2011-01-24 16:09:27 +01:00
Léonard Gérard d265d7a89b Minimize created exps with invalid_type. 2011-01-12 13:39:21 +01:00
Léonard Gérard 0768babab7 Removed brocken and useless mlsc, cleaned heptc. 2011-01-07 17:30:04 +01:00
Léonard Gérard f3584601f0 Refactoring and todo.txt update. 2011-01-05 15:47:53 +01:00
Léonard Gérard 467f4b3250 Clearer compilation targets handling. 2010-12-16 16:52:23 +01:00
Léonard Gérard 9e431c0cc7 remove TODO. 2010-12-15 18:35:45 +01:00
Léonard Gérard 2ae809c971 Fresh vars, and ident refactoring.
Idents.enter_node should be called when entering a node, it is done automagically by the mapfold unless you call directly Hept_mapfold.node_dec.
2010-12-15 11:26:29 +01:00
Léonard Gérard 82caa5a83d Adding a base clock in the Hept AST. 2010-12-10 00:39:25 +01:00
Léonard Gérard 9a69c30dc5 Clock annotation in Hept AST 2010-12-10 00:39:25 +01:00
Léonard Gérard 9998d7ea39 Added a unit type. Tunit. 2010-12-10 00:39:25 +01:00
Gwenal Delaval ed2642f847 Added controllables in every pass 2010-12-08 17:32:24 +01:00
gwenael delaval 4d5cc091d7 Add "with" syntax
Add with syntax on AST, parsetrees, parsers and printers
2010-12-06 18:24:04 +01:00
Adrien Guatto 5c8e1a47fe Tomato: stop trying to be smart about tuples
Removed Elimtuples module.
2010-11-10 15:46:32 +01:00