Commit graph

161 commits

Author SHA1 Message Date
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
Cédric Pasteur 66078effbd Added support for tuples in normalize
- (v1, v2, ... ) fby (e1, e2, ...) is translated to
(v1 fby e1, v2 fby e2, ...)

This has made the code even more complex. This will
need to be refactored at some point.
2010-07-15 17:58:32 +02:00
Cédric Pasteur 0c1860ccbd Fixed problem with tuple consts in Mls2obc 2010-07-15 13:12:11 +02:00
Cédric Pasteur 93fef027f0 Keep the list of static parameters in Obc 2010-07-15 11:31:32 +02:00
Cédric Pasteur aad8545055 Set the correct location for obj_dec 2010-07-15 10:06:16 +02:00
Cédric Pasteur 4f9d6b2d82 Added v_loc in Minils too 2010-07-15 10:02:42 +02:00
Cédric Pasteur 46a09cf369 Make Efield an op (as in Minils)
The fact that this commit mostly removes code proves
that this was a good choice.
2010-07-15 09:56:21 +02:00
Léonard Gérard c657ce8ecb Schedule with the iterator and eqs/var_decs added in mapfold. 2010-07-14 03:45:38 +02:00
Cédric Pasteur dab569d8ad Add missing case for ifthenelse 2010-07-13 14:42:46 +02:00
Cédric Pasteur ee767064b1 Instantiation of parametrized nodes (v2)
- Many changes to make Hept2mls, mls2obc, etc
compile with the api changes
- Added Callgraph_mapfold: starting from a main
program, generates the list of instances of each
node necessary and creates them.
- Mls2seq deals with giving to the code generators
the correct source (mls or obc, wit or without
static parameters)

It is now possible to use parametrized nodes that 
are defined in other files. For that to work, the 
first file has to be compiled to an object file:
	heptc -c mylib.ept
which creates a mylib.epo file. Compiling the main
file will then generate all the instances of 
parametrized nodes from the lib (only the called 
nodes will be compiled, but all the nodes in the 
main file are compiled).
2010-07-13 14:03:39 +02:00
Cédric Pasteur e2af987967 Compile fix 2010-07-13 08:38:51 +02:00
Cédric Pasteur 2fd0860ba8 Renamed Scoping and Parsetree 2010-07-08 15:19:04 +02:00
Cédric Pasteur 7ed81a8950 Moved Obc_printer to a separate file 2010-07-08 15:19:04 +02:00
Cédric Pasteur 978313de1e Moved sequential to compiler/ dir 2010-07-08 15:19:04 +02:00
Cédric Pasteur 769cb1d881 Updated ast for Static
- Static are used for consts in Heptagon and Minils.
For now, node static parameters remain int only
(ie they are type parameters). Do we need more ?
- Also updated Parsetree AST to the recent changes
in API
2010-07-08 15:16:27 +02:00