Commit 0841ce15 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

lurette 1.43 Fri, 08 Dec 2006 15:36:26 +0100 by jahier

Parent-Version:      1.42
Parent-Version:      1.42
Parent-Version:      unstable_1_43.6
Parent-Version:      unstable_1_43.10
Parent-Version:      unstable_1_43.11
Version-Log:

Some progress in the scade tcl gui connection.

Add code to be able to parse type definitions that are coming
from the Scade tcl Gui. Thanks to that, we do not need to parse
generated C header files anymore.

Not yet finished.

Add a lot of files that were not prcs-ed.

source/util.ml
source/parse_luc.ml
source/lustreExp.ml
   «from_char_pos_to_line_and_col» that is useg to guess the line and col
number
   from the char number, was returning bad line numbers because cpp adds lines
   preceeded by «#». Therefore, we add boolean flag to this function so that it

   does not count such lines if the flag is set to true.

source/lurettetop.ml:
   Sim2chro and gnuplot were called with a bad arg in some cases (i do not
remember
   which ones. Probably on win32.

source/parse_c_scade.ml:
   Enhance the debug messages wrt line numbers.

source/lurette_exe.c
   Add ifdef-ed debug dump (in a log file).

install/configure.in:
Makefile.common.source:
Makefile
source/Makefile.show_luc
source/Makefile.lucky
source/Makefile
   Minor changes.

polka/caml/polka_lexer.mll:
   Allow ident starting by «_».

polka/Makefile.config
install/set_env_var.in
install/lurettetop.bat.in
   Minor changes.

xlurette/Scade/LuretteGUILauncher.tcl
xlurette/Scade/GenMake_l4sim.tcl
  The lurette dir in the Scade hierarchie is now «lurette/bin» instead of
  «lurette/win32/bin» (ditto for «lib», and «include»).

  Some fix after my visit to Esterel (thanks to Aubanel).

source/Makefile.luc4ocaml
   Add mli files.

xlurette/Scade/Makefile
   Add a few rules to copy various files at various places.

source/liblutin_c.c
   This a change from Pascal :
   « The interval algorithm was completely false ».

examples/Makefile
   Typo.

examples/ocaml/crazy-rabbit/rabbit.out
examples/lucky/other/test4.rif
examples/lucky/other/test4.res
examples/xlurette/heater/test3.rif0
   A few non-reg tests broke because of the changes to lutin_lib.c.

examples/luckyDraw/ocaml/Makefile
examples/xlurette/Gyro/Makefile
source/Makefile.release
   Some changes.

Project-Description: Lurette
parent 5e6fc3c0
This diff is collapsed.
#------------------------------------------------------------------
# wrappeur ocaml pour gbdd
#------------------------------------------------------------------
# n.b. on recompile gbdd.o plutot que d'utiliser la librairie standard
# du LUSTRE_INSTALL (pour tre sur d'utiliser des compilos
# caml et gcc compatibles)
#------------------------------------------------------------------
# Pour utiliser la librairie, il faut linker avec une commande du style :
#
# pour gcc > 3.* !
# ocamlopt bdd.cmx $(MES_CMX) gbdd_cml.o gbdd.o -cclib -lstdc++ -o $(MON_PRG)
#
#------------------------------------------------------------------
# SOURCES
#------------
# * bdd.ml => bdd.cmi et bdd.cmx
# (interface + qq utils en ocaml)
#
# * gbdd_cml.cc => gbdd_cml.o
# (le gros de l'implementation de bdd.ml
# en C++ compatible C via macro extern "C")
#
# * gbdd.cc/gbdd.h => gbdd.o
# (le source du module C++ originel)
#
# * test.ml => un test pour voir ...
#
#------------------------------------------------------------------
#OCAML_INSTALL=$OCAMLLIB
ifeq ($(HOST_TYPE),win32)
# windows
OCAML_LIB="c:\TEMP\ocaml\lib"
OCAMLOPT = /cygdrive/c/TEMP/ocaml/bin/ocamlopt
OCAMLC = /cygdrive/c/TEMP/ocaml/bin/ocamlc
OCAML = /cygdrive/c/TEMP/ocaml/bin/ocaml
CPP_COMPILER=g++ -mno-cygwin
CPP_LINKER=g++ -mno-cygwin
else
ifeq ($(HOST_TYPE),sparc-sun)
OCAML_LIB=ocaml
OCAMLOPT =ocamlopt
OCAMLC = ocamlc
CPP_COMPILER=g++
CPP_LINKER=g++
else
OCAML_LIB=ocaml
OCAMLOPT =ocamlopt
OCAMLC = ocamlc
CPP_COMPILER=g++ # -DGBDD_CML_PARANO -DGBDD_CML_DBG
CPP_LINKER=g++
endif
endif
#OCAMLOPT = ocamlopt
CPP_FLAGS=-g -fno-operator-names -I$(OCAML_LIB)
LFLAGS = -cclib -lstdc++
# bdd.cmi : bdd.mli
# ocamlopt -c bdd.mli
bdd.cmo : bdd.ml
$(OCAMLC) -c bdd.ml
bdd.cmx : bdd.ml
$(OCAMLOPT) -c bdd.ml
test.cmx : test.ml
$(OCAMLOPT) -c test.ml
gbdd_cml.o : gbdd.h gbdd_cml.cc
$(CPP_COMPILER) -c $(CPP_FLAGS) gbdd_cml.cc -o gbdd_cml.o
gbdd.o : gbdd.h gbdd.cc
$(CPP_COMPILER) -c $(CPP_FLAGS) gbdd.cc -o gbdd.o
test : bdd.cmx gbdd_cml.o gbdd.o test.cmx
$(OCAMLOPT) bdd.cmx test.cmx gbdd_cml.o gbdd.o $(LFLAGS) -o test
libbdd_stubs.a : gbdd_cml.o gbdd.o
ar rc libbdd_stubs.a gbdd_cml.o gbdd.o
ranlib libbdd_stubs.a
%.cmo: %.ml %.cmi
$(OCAMLC) -c $<
bdd.cma: bdd.cmo
$(OCAMLC) -a -o bdd.cma bdd.cmo
bdd.cmxa : bdd.ml libbdd_stubs.a bdd.cmx
$(OCAMLOPT) -a -verbose -cclib -lstdc++ -cclib -lbdd_stubs \
-o bdd.cmxa bdd.cmx
bdd.a: bdd.cmx
ar rc bdd.a bdd.o
ranlib bdd.a
all : bdd.a libbdd_stubs.a bdd.cmxa bdd.cma
clean:
rm -f *.o *.cmo *.cmi *.cmx *.a *.cma *.cmxa
cp:
cp libbdd_stubs.a ../$(HOSTTYPE)/lib/
cp bdd.a ../$(HOSTTYPE)/lib/
cp bdd.a ../$(HOSTTYPE)/lib/libbdd.a
cp bdd.cm* ../$(HOSTTYPE)/lib/
OCAMLMAKEFILE = ./OCamlMakefile
ifeq ($(HOST_TYPE),cygwin)
# windows
OCAML_LIB="c:\TEMP\ocaml\lib"
OCAMLLIB=c:\TEMP\ocaml\lib
OCAMLOPT = /cygdrive/c/TEMP/ocaml/bin/ocamlopt
OCAMLC = /cygdrive/c/TEMP/ocaml/bin/ocamlc
OCAML = /cygdrive/c/TEMP/ocaml/bin/ocaml
GCC=g++ -O2 -mno-cygwin
CXX=g++ -O2 -fno-operator-names -mno-cygwin
else
# OCAML_LIB=/usr/local/soft/ocaml/3.08/lib/ocaml
# OCAMLLIB=/usr/local/soft/ocaml/3.08/lib/ocaml
# OCAMLOPT = /usr/local/soft/ocaml/3.08/bin/ocamlopt
GCC=g++ -O2
CXX=g++ -O2 -fno-operator-names
endif
CFLAGS= -g -fno-operator-names
OCAMLLDFLAGS= -verbose -cclib -lstdc++
SOURCES = gbdd_cml.cc gbdd.cc bdd.ml
RESULT = bdd
all: ncl bdd.cma
include $(OCAMLMAKEFILE)
cp: ncl
cp libbdd_stubs.a $(HOME)/$(HOSTTYPE)/lib/
cp bdd.a $(HOME)/$(HOSTTYPE)/lib/
cp bdd.cm* $(HOME)/$(HOSTTYPE)/lib/
up:clean
cp /home/raymond/other_tools/gcc3/GBDDML/gbdd.cc .
cp /home/raymond/other_tools/gcc3/GBDDML/gbdd_cml.cc .
cp /home/raymond/other_tools/gcc3/GBDDML/gbdd.h .
make cp
\ No newline at end of file
#------------------------------------------------------------------
# wrappeur ocaml pour gbdd
#------------------------------------------------------------------
# n.b. on recompile gbdd.o plutot que d'utiliser la librairie standard
# du LUSTRE_INSTALL (pour tre sur d'utiliser des compilos
# caml et gcc compatibles)
#------------------------------------------------------------------
# Pour utiliser la librairie, il faut linker avec une commande du style :
#
# ocamlopt bdd.cmx $(MES_CMX) gbdd_cml.o gbdd.o -cclib -lstdc++ -o $(MON_PRG)
#
#------------------------------------------------------------------
# SOURCES
#------------
# * bdd.ml => bdd.cmi et bdd.cmx
# (interface + qq utils en ocaml)
#
# * gbdd_cml.cc => gbdd_cml.o
# (le gros de l'implementation de bdd.ml
# en C++ compatible C via macro extern "C")
#
# * gbdd.cc/gbdd.h => gbdd.o
# (le source du module C++ originel)
#
# * test.ml => un test pour voir ...
#
#------------
# TARGETS
#------------
# * test => un exemple d'executable natif
#
# * lib => bdd.cma
#
# * runtime => ocamlbddrun (ocaml + bdd runtime)
#
# * toplevel => ocamlbdd (ocaml + bdd toplevel)
#
#------------------------------------------------------------------
OCAML_INSTALL=/usr/local/soft/ocaml/3.08
OCAML_LIB=$(OCAML_INSTALL)/lib/ocaml/
CPP_COMPILER=g++
CPP_LINKER=g++
C_COMPILER=gcc
C_LINKER=gcc
CPP_FLAGS=-g -fno-operator-names -I$(OCAML_LIB)
LFLAGS = -cclib -lstdc++
# -ccopt -L$(LUSTRE_INSTALL)/lib -cclib -lgbdd
# -ccopt -L$(OCAML_LIB) -cclib -lcamlrun
all : test
lib : bdd.cma
toplevel : ocamlbdd
runtime : ocamlbddrun
test : bdd.cmx gbdd_cml.o gbdd.o test.cmx
ocamlopt bdd.cmx test.cmx gbdd_cml.o gbdd.o $(LFLAGS) -o test
bdd.cma : bdd.cmo gbdd_cml.o gbdd.o
ocamlc -a -o bdd.cma -custom bdd.cmo gbdd_cml.o gbdd.o $(LFLAGS)
# ocamlopt -a -o bdd.cma -custom bdd.cmx gbdd_cml.o gbdd.o $(LFLAGS)
ocamlbdd : bdd.cma
ocamlmktop -o ocamlbdd bdd.cma
ocamlbddrun : bdd.cma
ocamlc -make-runtime -o ocamlbddrun bdd.cma
bdd.cmo : bdd.ml
ocamlc -c bdd.ml
bdd.cmx : bdd.ml
ocamlopt -c bdd.ml
test.cmx : test.ml
ocamlopt -c test.ml
gbdd_cml.o : gbdd.h gbdd_cml.cc
$(CPP_COMPILER) -c $(CPP_FLAGS) gbdd_cml.cc -o gbdd_cml.o
gbdd.o : gbdd.h gbdd.cc
$(CPP_COMPILER) -c $(CPP_FLAGS) gbdd.cc -o gbdd.o
clean:
rm -f *.o *.cmo *.cmi *.cmx
This diff is collapsed.
(* ----------------------------------------------------------------
Interface ocaml pour gbdd
-------------------------------------------------------------------
On garde les noms compatibles "cudd-idl" utiliss dans lurette :
Bdd._print ??
Bdd.draw
Bdd.nbminterms
---------------------------------------------------------------- *)
(* Le type abstrait *)
type t
(* Init du module *)
external init : unit -> unit = "gbdd_cml_init"
(* Accs aux noeuds *)
external root_var : t -> int = "gbdd_cml_root_var"
external high_part : t -> t = "gbdd_cml_high_part"
external low_part : t -> t = "gbdd_cml_low_part"
(* Tests *)
external is_leaf : t -> bool = "gbdd_cml_is_leaf"
external is_true : t -> bool = "gbdd_cml_is_true"
external is_false : t -> bool = "gbdd_cml_is_false"
(* Constantes *)
external dtrue : unit -> t = "gbdd_cml_true"
external dfalse : unit -> t = "gbdd_cml_false"
external null : unit -> t = "gbdd_cml_null"
(* Identit et Inverse *)
external idy : int -> t = "gbdd_cml_idy"
external nidy : int -> t = "gbdd_cml_nidy"
(* Oprations boolennes *)
external dnot : t -> t = "gbdd_cml_not"
external dor : t -> t -> t = "gbdd_cml_or"
external dand : t -> t -> t = "gbdd_cml_and"
external xor : t -> t -> t = "gbdd_cml_xor"
external eq : t -> t -> t = "gbdd_cml_eq"
external ite : t -> t -> t -> t = "gbdd_cml_ite"
(* Infos sur la structure *)
external size : t -> int = "gbdd_cml_size"
external supportsize : t -> int = "gbdd_cml_supportsize"
(* Extra *)
external print_mons : t -> unit = "gbdd_cml_print_mons"
(* compatibilit cudd *)
external topvar : t -> int = "gbdd_cml_root_var"
external dthen : t -> t = "gbdd_cml_high_part"
external delse : t -> t = "gbdd_cml_low_part"
external ithvar : int -> t = "gbdd_cml_idy"
external is_cst : t -> bool = "gbdd_cml_is_leaf"
external support : t -> t = "gbdd_cml_cube"
(* Extra programms directement en caml *)
let rec list_of_support (b: t) = (
let rec los x = (
if(is_leaf x) then []
else (
(topvar x)::(los (dthen x))
)
) in
los (support b)
)
type t
(* Init du module *)
external init : unit -> unit = "gbdd_cml_init"
(* Accs aux noeuds *)
external root_var : t -> int = "gbdd_cml_root_var"
external high_part : t -> t = "gbdd_cml_high_part"
external low_part : t -> t = "gbdd_cml_low_part"
(* Tests *)
external is_leaf : t -> bool = "gbdd_cml_is_leaf"
external is_true : t -> bool = "gbdd_cml_is_true"
external is_false : t -> bool = "gbdd_cml_is_false"
(* Constantes *)
external dtrue : unit -> t = "gbdd_cml_true"
external dfalse : unit -> t = "gbdd_cml_false"
external null : unit -> t = "gbdd_cml_null"
(* Identit et Inverse *)
external idy : int -> t = "gbdd_cml_idy"
external nidy : int -> t = "gbdd_cml_nidy"
(* Oprations boolennes *)
external dnot : t -> t -> t = "gbdd_cml_not"
external dor : t -> t -> t = "gbdd_cml_or"
external dand : t -> t -> t = "gbdd_cml_and"
external xor : t -> t -> t = "gbdd_cml_xor"
external eq : t -> t -> t = "gbdd_cml_eq "
external ite : t -> t -> t -> t = "gbdd_cml_ite"
(* Infos sur la structure *)
external size : t -> int = "gbdd_cml_size"
external supportsize : t -> int = "gbdd_cml_supportsize"
(* Extra *)
external print_mons : t -> unit = "gbdd_cml_print_mons"
(* compatibilit cudd *)
external topvar : t -> int = "gbdd_cml_root_var"
external dthen : t -> t = "gbdd_cml_high_part"
external delse : t -> t = "gbdd_cml_low_part"
external ithvar : int -> t = "gbdd_cml_idy"
external is_leaf : t -> bool = "gbdd_cml_is_leaf"
external support : t -> t = "gbdd_cml_cube"
(* Extra programms directement en caml *)
val list_of_support : t -> int list
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
open Bdd
open Printf
(*let _ = Bdd.init ()
*)
let x = Bdd.idy 1
let y = Bdd.idy 2
let p = Bdd.eq (Bdd.idy 1) (Bdd.nidy 1)
let _ = if(p = Bdd.dtrue ()) then (
printf "ok\n"
) else (
printf "ko\n"
)
let _ = flush stdout
let z = Bdd.dand x y
let _ = Bdd.print_mons z
let sl = Bdd.list_of_support z
let _ = List.iter (printf "%d; ") sl
let _ = printf "\n"
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment