Commit graph

175 commits

Author SHA1 Message Date
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
Léonard Gérard d58e83a985 Proposition 1. 2010-07-08 15:04:57 +02:00
Cédric Pasteur 01d0cd02c3 Remove bounds hack in Eselect_dyn
We no longer need to store the bounds as the 
bounds check expression is generated from MiniLS
code where the type is directly available.
2010-06-30 13:46:46 +02:00
Cédric Pasteur b4419a6760 Better deal with memory less nodes
There are now 3 kinds of nodes: Eprim : primitive 
nodes, Enode: nodes with memory, Efun: nodes 
without memory.

Typing now sets correct eq_statefull and b_statefull
for equations and blocks. Resets are only added 
when a node with memory is called.

The calling convention is the generated code needs
to be modified so that we can remove the context 
for nodes without memory.
2010-06-30 13:37:54 +02:00
Léonard Gérard 0c5a8d8ffe compilers refactoring. and bug fix of heptc vs heptcheck. 2010-06-29 19:21:07 +02:00
Léonard Gérard 7c0c2e0415 v_name -> v_ident for idents.... 2010-06-29 19:21:01 +02:00
Léonard Gérard 0f2d046d59 Gros blop pour que Mlsc compile.
-* Séparation du fichier minils avec création de mls_utils
-* Lexer et Parser qui fonctionnent (pas complets encore)
-* Use of menhir with --explain pour debug du parser
-* Quelques refactoring (ident/name...)
2010-06-28 18:06:39 +02:00
Adrien Guatto ff07d77667 Assertion generation for C back-end. 2010-06-27 23:28:38 +02:00
Adrien Guatto b4ddefa65c Tabs, trailing ws and long lines shall receive no mercy! 2010-06-26 17:17:28 +02:00
Cédric Pasteur c57ae52862 Do not forget to write the interface file 2010-06-24 05:01:10 +02:00
Léonard Gérard 9fff8e4ad8 Refactoring and organisation.
Separate parser, lexer and printer of hpetagon (Hetp_*) from the minils ones (Mls_*)
ident_of_var -> ident_of_name
get_current_location -> current_loc
2010-06-24 03:30:14 +02:00
Léonard Gérard 60a3ad15f8 move to subfolder compiler. 2010-06-21 11:58:57 +02:00