Commit graph

175 commits

Author SHA1 Message Date
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
db8c87ff07 Fix generation of bounds check expression 2011-05-25 09:12:14 +02:00
Cédric Pasteur
3f29e8623d Interaction between linear typing and memalloc 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
3f9918b570 Added memory alloc application pass 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
Gwenal Delaval
acad16b98a Graphical simulator hepts
Added graphical simulator hepts

Added option -hepts to the compiler: this option formats the output of the simulation loop
to fit with hepts (currently working only on C target code). Typically, suppresses all
"decoration" output, like input or output names, and prints output on single lines.

Currently not implemented in hepts: array types.

Usage: to simulate the node Modulename.f:

heptc -target c -s f -hepts modulename.ept
gcc modulename_c/*.c -o ./f_sim
hepts -mod Modulename -node f -exec ./f_sim
2011-05-12 10:08:13 +02:00
Cédric Pasteur
fd347cb4e4 Fix generation of bounds check expression 2011-05-02 11:24:12 +02:00
Cédric Pasteur
59c8106e46 Also use idents for Ewhen in Heptagon 2011-04-29 15:21:12 +02:00
Cédric Pasteur
aae38a7844 Use idents for Emerge in Heptagon 2011-04-29 15:21:12 +02:00
Adrien Guatto
10418197c8 Initial support for return-less external functions.
The compiler still does not support unsafe functions that well. For example, putting an assert()/exit() in an automaton's state does not work correctly.
2011-04-28 15:24:35 +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
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
073ccc2603 Better handling of static arrays 2011-04-19 12:58:41 +02:00
Leonard Gerard
220db42076 java readded 2011-04-19 11:39:37 +02:00
Cédric Pasteur
a2303ec7e1 Other compile fixes
The java backend is disabled temporarily
2011-04-19 09:49:00 +02:00
Cédric Pasteur
028dfe0468 Fix for nested if and merge with tuples 2011-04-19 09:04:36 +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
f57d7f1589 Correct translation for Eupdate and Eupdate_field
As the language is SSA, we should assign each 
element only once.
2011-04-14 15:14:41 +02:00
Cédric Pasteur
975418ffff Missing part from last commit 2011-04-14 13:56:24 +02:00
Cédric Pasteur
57bc9f210b Added a generic onfiguration for backends
Each backend gives a function used to 
enable/disable passes, executed before the
beginning of the compilation
2011-04-14 13:53:30 +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
6f0c9af006 First port of mls2obc
Does not compile yet
2011-04-14 11:17:12 +02:00
Cédric Pasteur
e2e8a93656 Hept2mls ported and very simplified
Does not compile yet
2011-04-14 10:00:06 +02:00
Léonard Gérard
0aef6fcb5b pattern_of_idx in right order.
Probably array_elt_of_exp is also wrong.
2011-03-23 16:52:32 +01: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
b913edcd5e Decade alpha1
On the road to beta is the new Minils AST, for now :

* Heptagon and Obc AST changes,
* Java code generation,
* Recursives Qualnames,
* Various bug fixes,

* 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 22:24:36 +01:00
Léonard Gérard
6b720e6c23 Merge branch 'java'
Conflicts:
	.gitignore
	compiler/global/global_printer.ml
	compiler/main/mls2obc.ml
2011-03-21 22:21:00 +01:00
Léonard Gérard
b8b16a7355 blop 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
Léonard Gérard
cab8bb706e backport from async. 2011-03-09 00:06:36 +01:00
Léonard Gérard
86f743318b Fixes and basic Java main. 2011-02-14 15:21:57 +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
Cédric Pasteur
51fea00808 Added TODOs 2011-02-04 12:45:58 +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
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
e174151d37 Unclutter ident printing. 2010-12-15 11:27:19 +01:00
Léonard Gérard
ac6dab15ee Switch removing. 2010-12-15 11:26:29 +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
e39a0484ff Add 'block' to Heptagon. 2010-12-10 00:42:49 +01:00
Léonard Gérard
9a69c30dc5 Clock annotation in Hept AST 2010-12-10 00:39:25 +01:00
Gwenal Delaval
ed2642f847 Added controllables in every pass 2010-12-08 17:32:24 +01:00
Gwenal Delaval
b7cba3315a Compiler option -nocaus
Added a compiler option de-activating causality analysis
2010-12-08 17:31:16 +01:00
Cédric Pasteur
0bb84532b9 Added a new static scoping pass
This pass transforms exps that should be static 
to Econst se. The regular scoping then only has
to check this case.

The conversion is done in a single traversal of
the AST (unlike the old solution).
2010-11-20 17:39:24 +01:00
Léonard Gérard
684f3337f8 Removed unused arguments in mls2obc 2010-11-05 16:27:45 +01:00
Léonard Gérard
3e2fb0b4b1 Rename [lhs] to [pattern] in obc
lhs was verrrry bad.
2010-11-05 16:27:44 +01:00
Léonard Gérard
a22f7216f2 Added when and merge to heptagon. Need tests !
Clocking is still done in minils since it is way simpler.
2010-11-01 01:05:37 +01:00
Adrien Guatto
6ff8ed993f Switched back to plain strings for some compiler options.
To be consistent or to be convenient, that is the question.
2010-10-04 00:35:12 +02:00
Adrien Guatto
412fd1f81b New operator: modulo (written (%))! 2010-10-02 13:01:35 +02:00
Adrien Guatto
4044d8a0a2 Automata minimization. 2010-09-30 21:52:32 +02:00
Adrien Guatto
a4c3d9e856 Relevant command-line options are now stored as qualnames. 2010-09-30 21:40:04 +02:00
Cédric Pasteur
db732621a1 Re enabled iterator fusion
Added an option to enable it (off by default)
2010-09-15 09:53:20 +02:00
Cédric Pasteur
df12e081ae Refactored Misc
Created two new files: 
 - utilities/global/compiler_options.ml: contains
 the options that can be set using the cli
 - utilities/global/errors.ml: contains global
 errors definition

Misc now only contains helper functions that have 
nothing to do with the ast or the compiler.
2010-09-15 09:38:52 +02:00
Cédric Pasteur
cae8d39f3d Renamed exp_ty label to ty for consistency 2010-09-14 17:14:27 +02:00
Léonard Gérard
02db2ad6b4 Changed compile flags, and cleaned a bit.
Warn as error for partial match.
Warn for unused variables : added some TODO to check.
PS : I'll deal with callgraph which is doing things that Modules does.
2010-09-14 09:39:02 +02:00
Cédric Pasteur
0b12e6a4ae Enum in Obc should also be qualnames 2010-09-13 15:19:52 +02:00
Cédric Pasteur
3d02b85bd6 Fixed some non exhaustive pattern matchings
Added assert_n functions to decompose to get a
tuple from a list of known size, and assert_nmin
when the list has at least n elements.
2010-09-13 15:19:40 +02:00
Léonard Gérard
412425301a Added Sfield to differentiate from Sconstructor. 2010-09-13 12:05:10 +02:00
Cédric Pasteur
cba5f4893e Move cases for arrays operators
Only functions that modify si or j needs to be
in translate_equation. The others should be in 
translate_act.
2010-09-13 11:23:52 +02:00
Cédric Pasteur
cb521c9b68 Fix the (commented) code that prints an exp 2010-09-13 10:20:24 +02:00
Cédric Pasteur
36addab3cc Use qualnames in Obc too 2010-09-13 09:03:15 +02:00
Cédric Pasteur
cc039ac42d Make heptc compile 2010-09-10 14:29:13 +02:00
Léonard Gérard
a54e570d0f Hept Scoping should be ok and documented,
Hept Parsing too,
all the reset to review carefully,
Typing to cut from all the scoping.
2010-09-09 19:48:20 +02:00
Léonard Gérard
15448fdff9 mlsc and mls_parsetree etc. 2010-09-07 16:32:08 +02:00
Cédric Pasteur
ffff23b675 Remove Elambda
Replace Elambda with a central repository of 
anonymous nodes. It made the AST unnecessarily 
complex.
2010-09-06 14:03:47 +02:00
Léonard Gérard
9eaafe9736 replaced mapfold with callgraph_mapfold. And the fixes to compile. 2010-08-26 13:55:29 +02:00
Léonard Gérard
9df4f625a2 Fixed location to use formatter instead of out_channel. 2010-08-24 17:29:00 +02:00
Adrien Guatto
6b87bb5ac0 Fixed confusion in mls2obc: concatenation should be handled at the
action level.
2010-08-04 15:36:20 +02:00
Léonard Gérard
4b3c3ba8b5 Revert "Fixed problem in clocking" e3676d1e3c
Fixing the actual bug :
* static_exp should not be created without type
after or during the typing pass.
2010-08-03 22:38:42 +02:00
Léonard Gérard
418b961293 Small fixes to the compilation processes.
*Locations should be pretty damn good now.
*Mlsc is up to date, still need a scoping pass (to be posted soon)
2010-08-02 16:31:57 +02:00
Cédric Pasteur
8f4220e08d Made Eupdate dynamic
Modifying an array with
 [ a with [i] = v ]
should expected a dynamic (not static) value
for i (nothing happens if i is in the wrong range).
This is the same behaviour as in Scade and it is 
useful eg to modify an array in a foldi.
2010-07-28 12:34:07 +02:00
Adrien Guatto
d4f441ae19 Fixed missing control in node apps with resets. 2010-07-27 17:56:15 +02:00
Cédric Pasteur
627979534a Generate correct call for operators 2010-07-27 17:48:21 +02:00
Cédric Pasteur
221eea1644 Added polymorphic (=) and (<>) operators
These two operators really need to be polymorphic, 
so they cannot be in Pervasives. a <> b is translated
to not (a = b>) at parsing.
2010-07-27 17:16:49 +02:00
Cédric Pasteur
2e44402b03 Two fixes in heptc
- Add the directory of the file as an include
- write interfaces with uncapitalized filenames,
as expected by modules.
2010-07-27 14:00:15 +02:00
Cédric Pasteur
02dd7fa124 Added alias for types (aka typedef)
For instance:
type metres = int
type metres = MyLib.longueur
type matrice = metres^10^100

Code generation in C (with typedef) included. The 
code uses the aliases for traceability.
2010-07-27 09:23:16 +02:00
Cédric Pasteur
a081f2dacf Added foldi iterator
Same as fold but the iterated function takes an 
integer as the last but one argument.
This is not something that is necessarily 
important to have in trunk but the patch is so 
small that it doesn't hurt.
2010-07-26 09:33:22 +02:00
Léonard Gérard
dc9bec28bf Clock refactoring. 2010-07-23 22:13:03 +02:00
Léonard Gérard
f124bb4fd7 Refactoring Ident -> Idents ( uniform with Names etc ) 2010-07-23 19:45:19 +02:00
Adrien Guatto
7f91ffab53 Output MiniLS code before clocking when in verbose mode. 2010-07-22 11:12:58 +02:00
Cédric Pasteur
75774cc685 Refactoring
Directly create a obj_dec instead of storing a tuple.
2010-07-22 10:15:11 +02:00
Cédric Pasteur
c12f1add0c Keep params in Obc
Remember the parameters of the called node in the 
parametrized version of Obc.
2010-07-22 09:44:57 +02:00
Cédric Pasteur
1be9f1c789 Fixed code generation for Elambda
- Added block notion in Obc
- Correct translation to C
2010-07-22 09:36:22 +02:00
Cédric Pasteur
dd660f4424 Added anonymous functions in Minils
- Added Elamba(inp, outp, eq_list) constructor. This
is necessary for iterator fusion.
- Refactored Mls2obc to allow to generate code
for anonymous functions (basically we have to
remember if we are within an iterator, as there is
no nesting of iterators)

There is a known problem with the local vars defined in 
the anonymous function that needs to be declared.
2010-07-21 17:15:19 +02:00
Léonard Gérard
5e737d0094 location change. Heptc works with menhir. 2010-07-21 15:15:57 +02:00
Cédric Pasteur
b2c88810c5 Make Heptagon API more uniform
Use a block instead of variable list + equation list
for contract and node.
The new program transformations based on the 
mapfold iterator are now enabled by default.
2010-07-20 09:31:29 +02:00
Adrien Guatto
d75f4f8901 Added an option for global inlining (-flatten). 2010-07-19 13:20:11 +02:00
Adrien Guatto
1d6df4ecb2 Inlining pass added. Use with -inline. 2010-07-19 12:02:29 +02:00
Cédric Pasteur
336b6eac00 Simplify a little Mls2obc
We don't need to return the memory vars as they
are already computed
2010-07-16 09:58:56 +02:00