Commit graph

238 commits

Author SHA1 Message Date
Adrien Guatto ec0274cc82 C backend: do not inline consts by default. 2012-02-08 17:49:21 +01:00
Adrien Guatto fa09d86dc1 Unrolling in C backend. 2012-02-08 17:47:28 +01:00
Adrien Guatto 76ae2f4518 Loop unrolling. 2012-02-08 16:16:41 +01:00
Adrien Guatto 998b3b0b89 Generate C89 2012-01-25 12:42:14 +01:00
Léonard Gérard b86555e013 global env misc 2011-12-12 11:08:47 +01:00
Cédric Pasteur 54cde301f6 C code generation for printf 2011-12-12 10:36:24 +01:00
Adrien Guatto 0f71dbe145 Bitwise or. 2011-12-06 17:46:35 +01:00
Adrien Guatto 8d772e20e2 Bitwise and. 2011-12-06 15:44:21 +01:00
Adrien Guatto 1ec15b9409 Bitwise operators on integers. 2011-12-06 15:44:21 +01:00
Adrien Guatto 5097c62449 C backend: put memory of the main node in a global variable. 2011-12-05 10:18:50 +01:00
Cédric Pasteur add09fe465 Fixed complexity of control optimization 2011-11-29 13:34:50 +01:00
Léonard Gérard 5be7a6acc2 java main void return handling 2011-11-25 18:56:15 +01:00
Léonard Gérard 05750352f8 pat_ty ne semble pas fiable. Voir t19.ept 2011-11-25 18:55:12 +01:00
Cédric Pasteur 3369f6dffc Don't forget to optimise control recursively 2011-11-24 16:10:14 +01:00
Léonard Gérard 57f7da94c2 Deal with const ref in Java. 2011-11-21 11:42:26 +01:00
Cédric Pasteur 641b76133d Don't inline all const 2011-11-21 10:55:53 +01:00
Léonard Gérard fdab1ac55c Strict-SSA option to switch array encoding. 2011-11-21 03:26:26 +01:00
Léonard Gérard adc47c536a Improve Java printing and main.
genToString is a fully generic to string function
dealing with arrays, primitive arrays, etc.
2011-11-21 03:26:25 +01:00
Léonard Gérard 7b281317f4 fix scalarize 2011-11-20 22:37:00 +01:00
Léonard Gérard 9d8a0be512 Improve scalarize 2011-11-18 12:33:37 +01:00
Léonard Gérard efa6b5cf70 Correct scalarize and java load_conf 2011-11-18 12:32:37 +01:00
Léonard Gérard be28156de9 Add a simplify pass to Obc 2011-11-18 12:32:37 +01:00
Léonard Gérard 9274ef24aa Java support type alias. 2011-11-18 12:32:37 +01:00
Léonard Gérard 35a9a24467 Correct obc_mapfold 2011-11-18 12:32:37 +01:00
Léonard Gérard 2a6dab836a Add alias to obc vd. 2011-11-18 12:32:37 +01:00
Léonard Gérard fa956a00ad Remarques pour Control 2011-11-18 12:32:37 +01:00
Léonard Gérard bdd85f5f81 mapfold over var_ident. 2011-11-18 12:32:36 +01:00
Léonard Gérard 3e64635f95 optimize the control at the end to maximize profit
Indeed, some examples showed that memory allocation could trigger a profit-full deadcode removal for the control. See Downscaler.down avec -flatten.
2011-11-03 00:43:36 +01:00
Léonard Gérard 919eaa72e1 Fix floating point printing. 2011-11-02 16:08:51 +01:00
Léonard Gérard 50487f9296 Fix java main to deal with unit return type. 2011-11-02 16:07:19 +01:00
Léonard Gérard 04263a126b Correct small bug in java initialized arrays. 2011-11-02 16:04:47 +01:00
Léonard Gérard ef4478e37e removed some stupid warnings. 2011-10-14 13:33:34 +02:00
Cédric Pasteur 175c8e34ff Fixed control fusion 2011-10-05 10:49:51 +02:00
Cédric Pasteur 36c1c7252e Fixed memalloc application with fields 2011-09-15 16:55:17 +02:00
Cédric Pasteur 1c43a8b1ac Fixed code generation for constant arrays 2011-09-14 09:08:28 +02:00
Cédric Pasteur 1d6b68cef6 Fix syntax for ocaml < 3.12 2011-09-09 17:03:54 +02:00
Cédric Pasteur 4d912e9349 Added more options for memalloc
There is now three options for memory allocation:
  - -only-linear activates only the linear 
annotations (with typing and code generation)
  - -only-memalloc does only memory allocation
  - -memalloc does both

When linear typing is not activated, linearity 
annotations are ignored (the signature in the .epi
does not contain the annotations)
2011-09-09 16:05:44 +02:00
Cédric Pasteur eb18342c33 Do not forget to also traverse local linear vars 2011-09-09 16:00:21 +02:00
Cédric Pasteur b0bb7ad39f Fixed problem with application of memalloc 2011-09-09 15:53:15 +02:00
Cédric Pasteur c550b09805 Fixed code generated for alias types to arrays 2011-09-09 13:54:29 +02:00
Cédric Pasteur 53043b403c Small fixes in the C backend 2011-09-07 13:24:33 +02:00
Cédric Pasteur 732a956855 Adapt to the (not so) new extvalues 2011-09-06 15:56:07 +02:00
Cédric Pasteur eec957cc6a Use underscores for generated variables 2011-09-06 14:42:34 +02:00
Cédric Pasteur 2147402a20 Const should be declared static
Otherwise the C compiler complains about multiple
definitions of the same symbol
2011-09-06 14:31:14 +02:00
Cédric Pasteur 4cd506f3db Added c ast for constant
Also print only short names for struct fields
2011-09-06 14:20:57 +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
Cédric Pasteur da8956e247 Revert changes
Bring back cvarlist_of_ovarlist with a more 
explicit name to show its specificity
2011-07-22 10:52:31 +02:00
Brice Gelineau 9fb42a5feb Removed unused functions in C generation 2011-07-21 18:01:32 +02:00
Cédric Pasteur a52e80bcad Fixed some TODOs 2011-07-21 11:54:52 +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 13955147ca patch java wrong merge. 2011-07-08 15:25:00 +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
Léonard Gérard ab3823874c Feature: Java main will give bin args as static params to the main.
consider having a main node like this one:

node main<<i : int; b : bool>> () returns...

Then if to call the generated program, you'll need ot give an int and a bool.
Furthermore, if you give an additional arg, it'll be used as the wanted
iteration number.
Conflicts:

	compiler/obc/java/java_main.ml
2011-07-08 11:26:05 +02:00
Léonard Gérard 4ac4347dc8 Add an error (in java main) when the specified main node is incorrect.
Conflicts:

	compiler/obc/java/java_main.ml
2011-07-08 11:18:39 +02:00
Brice Gelineau 10115684d9 bugfix for reset calls in C 2011-07-08 10:51:10 +02:00
Brice Gelineau b6aecf9869 Bugfix for reset calls in C 2011-07-07 16:18:25 +02:00
Cédric Pasteur 34b65c1234 Do not generate for loops
These loops are already present in the Obc code.
2011-07-05 18:08:21 +02:00
Cédric Pasteur bb6b9868b0 Use the variable type to add or not an indirection 2011-07-05 17:46:43 +02:00
Léonard Gérard 5837f3906f Multidimensional iterators in java. 2011-06-28 17:50:42 +02:00
Léonard Gérard c5fbcbe765 removing white spaces 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 46ed39b7b3 Remove some warnings. 2011-06-09 14:40:31 +02:00
Adrien Guatto 4794045208 Reworked Obc AST: from right patterns to extvalues.
I introduced a notion of extended values in Obc expressions,
replacing the Epattern constructor. Patterns may now only
occur at their rightful place, on the left of an assignment.

This change allows to index global constant arrays.
2011-05-30 16:25:00 +02:00
Brice Gelineau 938e8897b2 n-ary Sarray_power Earray_fill 2011-05-26 18:43:30 +02:00
Léonard Gérard 2a2b363bf7 Real asynchronous resets. 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 4c2a5121e4 remove useless ml folder. 2011-05-26 15:56:59 +02:00
Cédric Pasteur a48981f72c Fix memalloc_apply 2011-05-25 09:12:16 +02:00
Cédric Pasteur d39e883e08 Filter outputs removed by memalloc 2011-05-25 09:12:16 +02:00
Cédric Pasteur 75b4fa9ddc Fixed bug in the interference of fold 2011-05-25 09:12:15 +02:00
Cédric Pasteur 9686e2db01 Oops, forgot to recurse on the pattern of Acall 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 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 66386ddca2 Fixed some bugs 2011-05-25 09:12:12 +02:00
Cédric Pasteur 032fe693ef Deadcode removal pass 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 96054a67b6 Correct order for indices in array declaration
In C, the order in the declaration of variables
is the same as for access
2011-05-24 11:16:27 +02:00
Cédric Pasteur 72892a9d82 Fixed missing case in Obc_mapfold 2011-05-16 17:30:48 +02:00
Adrien Guatto 36d93a411d Fix generated C code calling between(). 2011-05-12 16:32:52 +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
Gwenal Delaval da648254d8 Added type string to pervasives, with string constants in AST 2011-05-10 17:07:17 +02:00
Cédric Pasteur 568dfc59fd Fixed generation of includes in C
The module names must be uncapitalized in includes
2011-05-09 09:50:18 +02:00
Cédric Pasteur c8055cd1ff Fixed bugs with static records in C generation 2011-05-03 13:21:27 +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
Adrien Guatto aa1041319f C backend: do not use memory structs for combinatorial main() functions. 2011-04-27 15:29:33 +02:00
Adrien Guatto 00cb203dd9 Revert "C generation: fixed struct field name in step() call."
This reverts commit fc920d88ea.
2011-04-27 14:02:50 +02:00
Adrien Guatto fc920d88ea C generation: fixed struct field name in step() call. 2011-04-27 11:53:44 +02:00
Léonard Gérard 5fb518d8ed Java bugfix 2011-04-20 17:33:50 +02:00
Léonard Gérard 73abbad1f9 small java module fix 2011-04-20 17:24:09 +02:00
Léonard Gérard d6240e1c67 100 and java scalarized 2011-04-19 18:45:56 +02:00
Cédric Pasteur 845d084658 Preserve the order of type and classes definitions 2011-04-19 13:08:35 +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 3c8fc39745 Fix C backend with new obc ast 2011-04-19 09:23:52 +02:00
Leonard Gerard 8da5ce4648 no order in declarations 2011-04-18 19:20:35 +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