Index: /latest/INSTALL
===================================================================
--- /latest/INSTALL	(revision 1)
+++ /latest/INSTALL	(revision 1)
@@ -0,0 +1,33 @@
+SystemCASS Installation
+=======================
+
+To install SystemCASS on linux, do the following steps:
+
+  1. Set the following environment variable(s):
+
+     TARGET_ARCH : architecture name.
+
+     SYSTEMCASS  : SystemCASS top directory.
+
+     ALLIANCE (optional) : ALLIANCE top directory
+                           See also 'PAT trace output' section.
+
+     For example :
+
+       setenv TARGET_ARCH linux
+       setenv SYSTEMCASS /users/tools/systemcass/
+
+  2. Change to the top level directory (systemcass)
+
+  3. Type the following command:
+
+       (cd src ; make)
+
+
+PAT trace ouput
+===============
+
+PAT trace output is disable by default.
+Set the environment variable 'ALLIANCE' to ALLIANCE top directory, 
+then make again.
+
Index: /latest/examples/Makefile
===================================================================
--- /latest/examples/Makefile	(revision 1)
+++ /latest/examples/Makefile	(revision 1)
@@ -0,0 +1,17 @@
+# EXAMPLES   
+EXAMPLES = \
+           soclib_date04/timer4_gmn_handmade/ \
+#
+
+# RULES
+main :  
+	@for i in $(EXAMPLES) ; do \
+	  echo "Making \'$$i\'" ; \
+          (cd $$i ; make -f Makefile.casc) ; \
+	done
+
+clean :
+	@for i in $(EXAMPLES) ; do \
+	 echo "Cleaning $$i..." ; \
+	 (cd $$i ; make -f Makefile.casc clean) ; \
+	done
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile	(revision 1)
@@ -0,0 +1,76 @@
+#TARGET_ARCH  		= linux
+BFD_LIBERTY     = -lbfd -liberty
+SOCLIB_LIB 		  = $(SOCLIB)/lib/libsoclib.a
+SOCLIB_INCLUDE 	= $(SOCLIB)/include
+#SYSTEMC         = /users/outil/systemc/systemc-2.0.1
+#SYSTEMC         = /dsk/l1/misc/richard/systemc_2_1.oct_12_2004.beta
+#SYSTEMCASS      = /users/cao/buchmann/systemcass/systemcass
+SYSTEMC_INC     = $(SYSTEMC)/include
+SYSTEMCASS_INC  = $(SYSTEMCASS)/include
+SYSTEMC_LIB     = $(SYSTEMC)/lib-$(TARGET_ARCH)/libsystemc.a
+SYSTEMCASS_LIB  = $(SYSTEMCASS)/lib-$(TARGET_ARCH)/libsystemc_$(firstword $(CXX)).a
+
+#CXX         		= g++
+#CXX          		= icc -w1
+CPPFILT     		= c++filt
+#DEBUG           = -g -DDEBUG
+OPT             = -O2 -UENABLE_TRACE -UENABLE_PAT
+#PROF        = -pg # gcc
+#PROF        = -qp # icc
+CFLAGS      = $(PROF) $(DEBUG) $(OPT) -I. -I$(SOCLIB)/include
+LFLAGS      = $(PROF) $(SOCLIB_LIB) $(BFD_LIBERTY) -ldl
+
+CFLAGS_SYSTEMC    = $(CFLAGS) -I$(SYSTEMC_INC)
+CFLAGS_SYSTEMCASS = $(CFLAGS) -I$(SYSTEMCASS_INC) -rdynamic #-Wno-deprecated
+LFLAGS_SYSTEMC    = $(LFLAGS) $(SYSTEMC_LIB)
+LFLAGS_SYSTEMCASS = $(LFLAGS) -rdynamic $(SYSTEMCASS_LIB) 
+
+EXE     = system_systemc.x system_systemcass.x
+OBJECTS = $(EXE:.x=.o)
+LINKS   = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+view_%.dot : %.gif
+	gqview $*.gif &
+
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f *.txt 
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -f trace_file.vcd
+	-rm -f trace_file.pat
+	-rm -f TTY_* 
+	-rm -rf code-*.cc code-*.so .libs/
+	
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile.casc
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile.casc	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile.casc	(revision 1)
@@ -0,0 +1,5 @@
+main :
+	make system_systemcass.x
+
+clean : 
+	make clean
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile.deps
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile.deps	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/chrono.h
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/chrono.h	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/chrono.h	(revision 1)
@@ -0,0 +1,39 @@
+#ifndef __CHRONO_H__
+#define __CHRONO_H__
+
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+struct chrono_t {
+	unsigned int sec;
+	chrono_t () 
+	{
+		sec = 0;
+	}
+	void start () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec;
+	}
+	void cont () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec - sec;
+	}
+	void stop ()
+	{
+		cont ();
+	}
+	operator unsigned int () const
+	{ return sec; }	
+	friend std::ostream& operator << (std::ostream& o, const chrono_t &c)
+	{
+		return o << c.sec << "sec";
+	}
+};
+
+#endif
+
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/soft/Makefile
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/soft/Makefile	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/soft/Makefile	(revision 1)
@@ -0,0 +1,37 @@
+MIPSEL = $(DISYDENT)/latest/i686-pc-linux-gnu/bin
+CC = $(MIPSEL)/mipsel-cass-elf-gcc
+AS = $(MIPSEL)/mipsel-cass-elf-as
+LD = $(MIPSEL)/mipsel-cass-elf-ld
+OBJDUMP = $(MIPSEL)/mipsel-cass-elf-objdump
+
+../aout.txt : ../a.out
+	$(OBJDUMP) -D ../a.out > ../aout.txt
+
+../a.out : main.o it.o uputs.o procnum.o ldscript reset.o exception.o 
+	$(LD) -T./ldscript -o ../a.out main.o it.o uputs.o procnum.o
+
+reset.o : reset.s
+	$(AS) reset.s -o reset.o
+
+exception.o : exception.s
+	$(AS) exception.s -o exception.o
+
+main.o : main.c
+	$(CC) -c main.c
+
+main.s : main.c
+	$(CC) -S main.c
+
+it.o : it.c
+	$(CC) -c it.c
+
+uputs.o : uputs.s
+	$(AS) uputs.s -o uputs.o
+
+procnum.o : procnum.s
+	$(AS) procnum.s -o procnum.o
+
+clean :
+	-rm *.o
+	-rm ../a.out
+	-rm ../aout.txt
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/soft/exception.s
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/soft/exception.s	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/soft/exception.s	(revision 1)
@@ -0,0 +1,402 @@
+/* 
+ * Authors: Frédéric Pétrot and Denis Hommais
+ * $Log: exception.s,v $
+ * Revision 1.1  2005/03/02 12:37:22  buchmann
+ * Add "soft" directory.
+ * It allows to generate MIPS binary using cross compiler.
+ *
+ * Revision 1.2  2003/07/18 16:21:30  fred
+ * Now interprets the instruction that causes a DBE in order to print the
+ * address responsible for the failure.
+ * Cleaned up the code a little (mainly comments :)
+ *
+ * Revision 1.1  2003/03/10 13:39:07  fred
+ * Adding the hardware dependent stuff to smoothly handle multi
+ * architecture compilation of this kernel
+ * 
+ * Revision 1.1.1.1  2002/02/28 12:58:55  disydent
+ * Creation of Disydent CVS Tree
+ * 
+ * Revision 1.1.1.1  2001/11/19 16:55:37  pwet
+ * Changing the CVS tree structure of disydent
+ * 
+ * Revision 1.3  2001/11/14 12:08:45  fred
+ * Making the ldscript being generated for correct path accesses
+ * Removing the syscall entry of the exception handler for now
+ * 
+ * Revision 1.2  2001/11/09 14:51:03  fred
+ * Remove the reset executable and make the assembler be piped through
+ * cpp.
+ * The ldscript is not usable. I have to think before going on
+ * 
+ * $Id: exception.S,v 1.1 2003/03/10 13:39:07 fred Exp
+ *  Note   : we do not check BD at any time yet! Beware, ...
+ *  Rev 0  : minimal handler to support syscall for system calls
+ *           implementation
+ *  Rev 1  : added correct exception/interruption detection and messages
+ *  Rev 2  : added mult and div interpretation in illegal instruction
+ *  Rev 3  : Makes it compliant with multi-thread/multi-processor 
+ *           Stack is thread stack now (it must at least for preemptive
+ *           scheduling stuffs 
+ */
+        .rdata
+        .align 2
+msg  :  .ascii "An exception occurred with the following cause :\n\000"
+
+jmptable:
+        .word Int
+        .word Uimp
+        .word Uimp
+        .word Uimp
+        .word AdEL
+        .word AdES
+        .word IBE
+        .word DBE
+        .word Sys
+        .word Bp
+        .word RI
+        .word CpU
+        .word Ovf
+        .word Ukn
+        .word Ukn
+
+        .text
+        .align 2
+        .ent     excep
+excep:
+        /*
+         * Here I save the whole C compatible register context, which is a
+         * waste of time if only assembly functions are to be used
+         * A more optimized way to do things would be to check for critical
+         * events (typically external interrupts) and do the saving only
+         * when an other events took place
+         * Note that this implies to check which registers to save according
+         * to the interrupt handling routines, that are usually user defined!
+         *
+         * Reminder: $26 and $27 are kernel registers that need not be saved
+         * This shall be executed in critical section since the stack pointer
+         * is not properly set until the subu!
+         */
+        .set noreorder
+        /* Shall not touch $1 until it is saved */
+        .set noat
+         
+         subu   $29, $29, 26*4  /* Load kernel stack addr + stack update */
+         sw     $1,   1*4($29)  /*  save all temporaries*/
+        .set at
+         sw     $2,   2*4($29)  /*  others are saved when calling procedures*/
+         sw     $3,   3*4($29)
+         sw     $4,   4*4($29)
+         sw     $5,   5*4($29)
+         sw     $6,   6*4($29)
+         sw     $7,   7*4($29)
+         sw     $8,   8*4($29)
+         sw     $9,   9*4($29)
+         sw    $10,  10*4($29)
+         sw    $11,  11*4($29)
+         sw    $12,  12*4($29)
+         sw    $13,  13*4($29)
+         sw    $14,  14*4($29)
+         sw    $15,  15*4($29)
+         sw    $24,  16*4($29)
+         sw    $25,  17*4($29)
+         mfc0  $26,      $14     /* load EPC into k0 (two cycles befor use)*/
+         sw    $29,  18*4($29)
+         sw    $30,  19*4($29)
+         sw    $31,  20*4($29)
+         sw    $26,  21*4($29)   /* and store it to be recallable*/
+         mfhi  $26
+         sw    $26,  22*4($29)
+         mflo  $26
+         sw    $26,  23*4($29)
+
+         /* Check the cause of the arrival in this code */
+
+         mfc0  $27, $13           /*  load CAUSE into $27*/
+         nop
+         andi  $27, $27,  0x3c    /*  get the exception code (ExcCode)*/
+         beqz  $27, Int           /*  Test if it is an interrupt. If so*/
+         sw     $0,  24*4($29)    /* return address is epc + 0 */
+                                  /* it's faster.*/
+         la    $26,      jmptable /*  load the base of the jump table*/
+                                  /* get the exception code (ExcCode)*/
+         addu  $26, $26, $27      /*  load the offset in the table*/
+         lw    $27,      ($26)    /*  load the pointed value*/
+         li    $26,           4
+         j     $27                /*  and jump there*/
+         sw    $26,  24*4($29)    /* faulty insn is at epc - 4 */
+         nop                      /*  delayed slot too*/
+
+ /*
+  * External interupts:
+  * The meaning of these interupts is for sure system dependent, so
+  * this routine must be adapted to each system particularities
+  *
+  * Right now we just find out what interrupt lead us here, and print
+  * a small message about it.
+  */
+        .rdata
+        .align 2
+        .text
+Int :   
+        .set noat
+         mfc0  $4, $13           /*  load CAUSE into $27*/
+         mfc0  $26, $12           /*  load STATUS into $26*/
+         andi  $4, $4,   0xFF00 /*  mask CAUSE to get the ITs only*/
+         and   $4, $4,   $26    /*  keep only the enabled ITs*/
+         srl   $4, $4,   8      /*  and put them in the LSBees*/
+         beqz  $4,        _endit  /* If none, then what are we doing here? */
+         nop
+
+         .extern  SwitchOnIt
+
+         la     $26, SwitchOnIt
+         jal    $26
+         nop
+
+_endit:
+         j                 _return  /*  go back to user*/
+         nop
+        .set at
+
+ /*
+  * Clearly fatal exceptions as far as we're concerned, ...
+  */
+        .rdata
+        .align 2
+m2  :   .ascii "Unimplemented TLB Exception!\n\000"
+m2k :   .ascii "Reserved Exception!\n\000"
+m2o :   .ascii "Integer Arithmetic Overflow!\n\000"
+
+        .text
+        .align 2
+        .set reorder
+Uimp :   la     $4, m2            /*  load the appropriate message,...*/
+         j      U                 /* */
+Ukn  :   la     $4, m2k           /* */
+         j      U                 /* */
+Ovf  :   la     $4, m2o           /* */
+U    :   la     $2, uputs
+         jal    $2                /*  and print it!*/
+         j      _exit             /* */
+        .set noreorder
+
+ /*
+  * Illegal instructions:
+  * we interpret mult/div and lwl/lwr here, and exit on an other code
+  * Before modifing this code think that NO REGISTER CONTENT should
+  * be touched before the end of the register loading routine
+  * This explains why some code seems duplicated (several mfc0)
+  */
+        .rdata
+m2i  :  .ascii "Illegal or Reserved Instruction!\n\000"
+        .text
+        .set noat
+RI   :   mfc0  $26,      $14      /*  load EPC into $26*/
+         nop                      /* */
+         nop                      /* */
+         lw    $26,      ($26)    /*  $26 contains the faulty ins*/
+         lui   $27,      0xFC00    /*  mask for special*/
+         and   $27, $26, $27        /* */
+         bne   $27,  $0, Ilg         /*  this is not a special trap*/
+
+/*
+ * I do not handle the mult/div trap, as we have added the
+ * instructions in our R3000 model
+ */
+         nop
+
+Ilg:     la     $4, m2i
+         la     $2, uputs
+         jal    $2                /*  we got an illegal ins, so we quit*/
+         nop
+         j      _exit             /* */
+         nop
+
+ /*
+  * Unaligned access:
+  * Quite fatal, I'm afraid
+  */
+        .rdata
+        .align 2
+m3   :  .ascii "Unaligned/unallowed Access while %s address 0x%x at pc 0x%x!\n\000"
+m3l  :  .ascii "reading\000"
+m3e  :  .ascii "writing\000"
+
+        .text
+        .align 2
+        .set reorder
+AdEL :   la     $5,   m3l
+         j      AdE  
+AdES :   la     $5,   m3e
+AdE  :   la     $4,   m3
+        .set noreorder
+         mfc0   $6,   $8          /*  load BAR into thrid arg ($6)*/
+         mfc0   $7,  $14          /*  load EPC into fourth arg ($7)*/
+         la     $2,  uputs
+         jal    $2                /*  print all that stuff*/
+         nop
+         j               _exit
+         nop
+
+ /*
+  * Synchronous bus error
+  */
+        .rdata
+        .align 2
+m4i:    .ascii "Bus error while loading the instrunction at pc 0x%x!\n\000"
+m4d:    .ascii "Bus error while loading the datum at pc 0x%x for addr 0x%x!\n\000"
+        .data
+        .text
+
+        .align 2
+        .set reorder
+IBE :    mfc0   $5,   $14         /*  load EPC */
+         la     $4,   m4i
+         j      BE
+        .set noreorder
+DBE :    la     $4,   m4d
+         /*
+          * The instruction at EPC must be interpreted to get the
+          * address that caused the fault.
+          * The register value must be reloaded from the stack, and
+          * since the storage of the registers is quite exotic right
+          * now, this will work only for registers 1 to 15!
+          */
+         mfc0   $5,   $14         /* load EPC */
+         lw     $6, 0($5)         /* load faulty insn */
+         andi   $8,  $6, 0xFFFF   /* get the imm field of it */
+         srl    $9,  $6, 19
+         andi   $9,  $9, 0x7c     /* get the rs register index times 4 */
+         add    $9, $29, $9       /* compute the stack index of this register */
+         lw     $9, 0($9)
+         addu   $6, $9, $8        /* get the address as computed */
+
+BE :     la     $2,   uputs
+         jal    $2                /*  print all that stuff*/
+         nop
+         j               _exit
+         nop
+
+ /*
+  * Syscall: simple and straightforward.
+  * Even elegant : nothing's done at all anymore
+  */
+        .rdata
+        .align 2
+m5 :    .ascii "Syscall : no actions performed anymore\000"
+        .text
+        .align 2
+Sys : 
+         la     $4, m5
+         la     $2, uputs
+         jalr   $2
+         nop
+         j       _ret_sys         /* get back to caller */
+         nop
+#endif
+
+ /*
+  *
+  * We just indicate we got a breakpoint
+  * This shall be filled on a system per system basis
+  *
+  */
+        .rdata
+        .align 2
+m6 :    .ascii "Breakpoint of code %d!\n\000"
+
+        .text
+        .align 2
+Bp :     la     $4,   m6
+         mfc0   $3, $14           /*  load EPC*/
+         nop
+         nop
+         lw     $5, ($3)          /*  load the 'break' instruction*/
+         li     $3,      0xF      /*  filled delayed slot (load a mask)*/
+         srl    $5,  $5, 16       /*  shift it*/
+         and    $5,  $5, $3       /*  and get the code from the insn*/
+         la     $2,  uputs
+         jal    $2                /*  print the string*/
+         nop
+         j               _return
+         nop
+
+ /*
+  *
+  * Kernel/user violation, or coprocessor unusable.
+  * that's pretty fatal, ain't it ?
+  *
+  */
+        .rdata
+        .align 2
+m7 :    .ascii "Unusable Coprocessor %d!\n\000"
+m70:    .ascii "Trying to use a kernel instruction in user mode!\n\000"
+
+        .text
+        .align 2
+CpU :    mfc0   $3, $13           /*  load CAUSE*/
+         nop
+         li     $2,     0x30000000/* */
+         and    $2, $2, $3        /*  mask to get the CE bits */
+         bnez   $2,     cun       /*  not zero, so it is a CUN*/
+         nop                      /*  cannot put a 'la' here,...*/
+        .set reorder
+         la     $4,     m70       /*  here, it is a kernel violation*/
+         j      C
+        .set noreorder
+cun:     la     $4,   m7
+         srl    $5,   $2,  28     /*  LSByte contains now the copro number*/
+C:       la     $2,   uputs
+         jal    $2
+         nop
+         j               _exit
+         nop
+
+_exit:   li     $2, 100000
+_exit_l: bne    $2, $0,  _exit_l
+         addiu  $2, $2, -1
+         c0     00
+         nop
+
+_return :
+         lw     $2,    2*4($29)
+         j      tmp
+         nop
+_ret_sys: /* Special case for syscall : $2 is not restored */
+tmp:    .set noat      
+         lw     $1,    1*4($29)
+        .set at        
+         lw     $3,    3*4($29)
+         lw     $4,    4*4($29)
+         lw     $5,    5*4($29)
+         lw     $6,    6*4($29)
+         lw     $7,    7*4($29)
+         lw     $8,    8*4($29)
+         lw     $9,    9*4($29)
+         lw    $10,   10*4($29)
+         lw    $11,   11*4($29)
+         lw    $12,   12*4($29)
+         lw    $13,   13*4($29)
+         lw    $14,   14*4($29)
+         lw    $15,   15*4($29)
+         lw    $24,   16*4($29)
+         lw    $25,   17*4($29)
+         lw    $29,   18*4($29)
+         lw    $30,   19*4($29)
+         lw    $31,   20*4($29)
+
+         /* Take care of hi and lo also */
+         lw    $26,   22*4($29)
+         mthi  $26
+         lw    $26,   23*4($29)
+         mtlo  $26
+
+         lw    $26,   21*4($29)   /* This is the epc of this context */
+         lw    $27,   24*4($29)   /* This is the offset: 4 excep, 0 int */
+         addu  $29,   $29, 26*4   /* Stack update : fill lw stall */
+         addu  $26,   $26, $27    /* Addr for return from excep */
+         j     $26                /* Jump back where the exception occured*/
+         rfe                      /* And restore the original mode*/
+        .set     reorder
+        .end  excep
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/soft/it.c
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/soft/it.c	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/soft/it.c	(revision 1)
@@ -0,0 +1,43 @@
+extern char s[];
+extern int waitInt;
+extern void itoa(int,char*);
+
+void SwitchOnIt(int it)
+{
+int i,ti;
+int *timer=(int*)0xB0000000;
+
+   /* Identify the active interrupt of highest priority */
+   for (i=0; i<8; i++)
+      if (it&(1<<i))
+         break;
+
+   switch (i) {
+      case 0:   /* SwIt 0 */
+         break;
+      case 1:   /* SwIt 1 */
+         break;
+      case 2: { /* It 0   */
+         int CPU = procnum() << 2;
+         int current_time=timer[0 | CPU];
+         uputs("timer interrupt acknowledge at :",procnum());
+	 itoa(current_time,s);
+	 uputs(s,procnum());
+	 uputs("",procnum());
+	 timer[3 | CPU] = 0; // reset timer irq
+         break;
+      }           
+      case 3:   /* It 1   */
+         break;           
+      case 4:   /* It 2   */
+         break;           
+      case 5:   /* It 3   */
+         break;           
+      case 6:   /* It 4   */
+         break;           
+      case 7:   /* It 5   */
+         break;
+      default:
+         break;
+   }
+}
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/soft/ldscript
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/soft/ldscript	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/soft/ldscript	(revision 1)
@@ -0,0 +1,44 @@
+SECTIONS
+{
+   . = 0x80000080;
+   .excep : {
+      ./exception.o
+   }
+
+   . = 0xbfc00000;
+   .reset : {
+      ./reset.o
+   }
+
+   . = 0x00400000;
+   .text : {
+      *(.text)
+   }
+   . = 0x10000000;
+   .rodata : {
+      *(.rodata)
+      . = ALIGN(4);
+   }
+   .data  : {
+      *(.data)
+   }
+   .sdata : {
+      *(.lit8)
+      *(.lit4)
+      *(.sdata)
+   }
+   _gp = .;
+   . = ALIGN(4);
+   _edata = .;
+   .sbss  : {
+      *(.sbss)
+      *(.scommon)
+   }
+   .bss   : {
+      *(.bss)
+      *(COMMON)
+   }
+   . = ALIGN(4);
+   _end = .;
+   _stack = 0x10000000 + 0x00001000;
+}
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/soft/main.c
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/soft/main.c	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/soft/main.c	(revision 1)
@@ -0,0 +1,81 @@
+int waitInt;
+char s[10];
+
+void itoa(int v,char *s)
+{
+	int i;
+	int t=10000000;
+	int ratio,c;
+	int cpt=0;
+	int b=1;
+
+	for (i=0;i<8;i++)
+		s[i]=0;
+
+	while (t>0)
+	{
+		ratio=v/t;
+		s[cpt++]=(char)ratio+'0';
+		v=v-ratio*t;
+		t=t/10;
+	}
+}
+
+void
+test (int i)
+{
+	char s[2];
+	s[0] = procnum () + '0';
+	s[1] = '\0';
+	uputs (s,i);
+}
+
+void
+configure_timer (int proc)
+{
+  int *timer=(int*)0xB0000000;
+  enum{ // REGISTER OFFSET
+	VALUE_ADDRESS	 	= 0,
+	MODE_ADDRESS		= 1,
+	PERIOD_ADDRESS		= 2,
+	RESETIRQ_ADDRESS  	= 3 
+  };
+  // specific CPU MASK
+  int CPU = proc << 2;
+  // set timer
+  timer[PERIOD_ADDRESS | CPU] = 0x00001000; // lancement du timer
+  timer[MODE_ADDRESS | CPU ] = 0x00000003; 
+  // run timer
+}
+
+int main0(void)
+{
+  uputs("Hello from processor 0",procnum());
+  configure_timer (0);
+  while (1) ;
+}
+
+int main1(void)
+{
+   uputs("Hello from processor 1",procnum());
+   configure_timer (1);
+   while (1);
+   return 0;
+}
+
+int main2(void)
+{
+   uputs("Hello from processor 2",procnum());
+   configure_timer (2);
+   while (1);
+   return 0;
+}
+
+int main3(void)
+{
+   uputs("Hello from processor 3",procnum());
+   configure_timer (3);
+   while (1);
+   return 0;
+}
+
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/soft/procnum.s
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/soft/procnum.s	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/soft/procnum.s	(revision 1)
@@ -0,0 +1,17 @@
+.text
+.align 2
+.globl procnum 
+.ent procnum 
+.set noreorder
+
+procnum:
+   mfc0      $2, $0
+	 nop /* 2 delayed after mfc0 */
+   nop
+   j          $31
+   nop
+
+.end procnum 
+
+.set reorder
+
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/soft/reset.s
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/soft/reset.s	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/soft/reset.s	(revision 1)
@@ -0,0 +1,64 @@
+  .extern     _stack
+  .extern     _gp
+
+  .text
+  .align 2
+
+   li         $26,0x0000FF15
+   mtc0       $26,$12
+
+   la         $2,     _edata
+   la         $3,     _end
+   li         $4,     0
+
+   /* set bss to zero */
+loop:
+   beq        $2, $3, endloop
+   sw         $4, 0($2)
+   addiu      $2, $2, 4
+   j          loop
+endloop:
+   mfc0       $2,$0
+	 nop /* 2 delayed after mfc0 */
+	 nop
+   beq        $2,$0,toMain0
+	 nop
+   ori        $3,$0,1
+   beq        $2,$3,toMain1
+   nop
+   ori        $3,$0,2
+   beq        $2,$3,toMain2
+   nop
+   ori        $3,$0,3
+   beq        $2,$3,toMain3
+	 nop  
+   j          endloop
+
+toMain0: 
+   la         $sp,    _stack - 4
+   la         $28,    _gp
+   la         $27,    main0
+   j          $27
+   nop
+toMain1: 
+   la         $sp,    _stack - 256 - 4
+   la         $28,    _gp
+   la         $27,    main1
+   j          $27
+   nop
+toMain2: 
+   la         $sp,    _stack - 512 - 4
+   la         $28,    _gp
+   la         $27,    main2
+   j          $27
+   nop
+toMain3: 
+   la         $sp,    _stack - 768 - 4
+   la         $28,    _gp
+   la         $27,    main3
+   j          $27
+   nop
+
+
+
+
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/soft/uputs.s
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/soft/uputs.s	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/soft/uputs.s	(revision 1)
@@ -0,0 +1,35 @@
+.text
+.align 2
+.globl uputs
+.ent uputs
+.set noreorder
+
+uputs:
+   addu      $8, $0, $4 
+   la        $3, 0xa0000000
+
+   or      $9,$0,$5
+   sll     $9,$9,24
+   or	     $3,$3,$9
+
+   lb        $2, ($8)
+   beq       $2, $0, endputs
+   nop
+   addiu     $8, $8, 1
+
+loop:
+   sb        $2, ($3)
+   lb        $2, ($8)
+   addiu     $8, $8, 1
+   bne       $2, $0, loop
+   nop
+
+endputs:
+   addiu      $2, $0, 0xA
+   sb         $2, ($3)
+   j          $31
+   addu       $2, $0, 0
+.end uputs
+
+.set reorder
+
Index: /latest/examples/soclib_date04/timer4_gmn_handmade/system.cpp
===================================================================
--- /latest/examples/soclib_date04/timer4_gmn_handmade/system.cpp	(revision 1)
+++ /latest/examples/soclib_date04/timer4_gmn_handmade/system.cpp	(revision 1)
@@ -0,0 +1,476 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <systemc.h>
+
+#include "chrono.h"
+#include "shared/soclib_vci_interfaces.h"
+#include "cache/soclib_caches_interfaces.h"
+#include "binary/mips_binary.h"
+
+/* VCI template parameters */
+const int ERRLEN   = 0;
+const short ADDRSIZE = 32;
+const short CELLSIZE = 4;
+
+#include "interconnect/soclib_vci_gmn.h"
+#include "processor/soclib_multi_mips.h"
+#include "cache/soclib_vci_xcache.h"
+#include "tty/soclib_vci_tty.h"
+#include "systemio/locks/soclib_vci_ramlocks.h"
+#include "systemio/timer/soclib_vci_multi_timer.h"
+#include "shared/soclib_segment_table.h"
+#include "ram/soclib_vci_multiram.h"
+
+/* Max number of cycles to perform */
+int max_cycles;
+
+/* signal handler */
+void sighandler (int i)
+{
+	cerr << "Simulation aborted.\n";
+	exit (-1);
+}
+
+
+/* main */
+int sc_main (int argc, char *argv[])
+{
+
+	if (argc!=2)
+	{
+		printf("Usage : ./system.x nbCyclesToGo\n");
+		exit(1);
+	}
+	sscanf(argv[1],"%d",&max_cycles);
+
+	signal( SIGINT, sighandler );
+	signal( SIGTERM, sighandler );
+
+	/************************************************************************
+	 *
+	 * Signal declaration
+	 *
+	 ************************************************************************/
+
+	sc_clock signal_clk("clock");
+	sc_signal<bool> signal_resetn("resetn");
+	ICACHE_SIGNALS _xcache0_ICACHE_mips0_ICACHE;
+	DCACHE_SIGNALS _xcache0_DCACHE_mips0_DCACHE;
+	ICACHE_SIGNALS _xcache1_ICACHE_mips1_ICACHE;
+	DCACHE_SIGNALS _xcache1_DCACHE_mips1_DCACHE;
+	ICACHE_SIGNALS _xcache2_ICACHE_mips2_ICACHE;
+	DCACHE_SIGNALS _xcache2_DCACHE_mips2_DCACHE;
+	ICACHE_SIGNALS _xcache3_ICACHE_mips3_ICACHE;
+	DCACHE_SIGNALS _xcache3_DCACHE_mips3_DCACHE;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _gmn_T_VCI_3__xcache3_VCI;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _gmn_T_VCI_2__xcache2_VCI;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _gmn_T_VCI_1__xcache1_VCI;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _gmn_T_VCI_0__xcache0_VCI;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _vcitty0_VCI_gmn_I_VCI_0_;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _vcitty1_VCI_gmn_I_VCI_1_;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _vcitty2_VCI_gmn_I_VCI_2_;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _vcitty3_VCI_gmn_I_VCI_3_;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _locks_VCI_gmn_I_VCI_6_;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _multitimer_VCI_gmn_I_VCI_5_;
+	sc_signal<bool> _multitimer_IRQ_0__mips0_IT_0;
+	sc_signal<bool> _multitimer_IRQ_1__mips1_IT_0;
+	sc_signal<bool> _multitimer_IRQ_2__mips2_IT_0;
+	sc_signal<bool> _multitimer_IRQ_3__mips3_IT_0;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _multiram0_VCI_gmn_I_VCI_4_;
+	ADVANCED_VCI_SIGNALS<ADDRSIZE,CELLSIZE,ERRLEN> _multiram1_VCI_gmn_I_VCI_7_;
+	sc_signal<bool> _mips0_IT_5;
+	sc_signal<bool> _mips0_IT_4;
+	sc_signal<bool> _mips0_IT_3;
+	sc_signal<bool> _mips0_IT_2;
+	sc_signal<bool> _mips0_IT_1;
+	sc_signal<sc_uint<1> > _mips0_D_FRZ;
+	sc_signal<sc_uint<1> > _mips0_I_FRZ;
+	sc_signal<bool> _mips1_IT_5;
+	sc_signal<bool> _mips1_IT_4;
+	sc_signal<bool> _mips1_IT_3;
+	sc_signal<bool> _mips1_IT_2;
+	sc_signal<bool> _mips1_IT_1;
+	sc_signal<sc_uint<1> > _mips1_D_FRZ;
+	sc_signal<sc_uint<1> > _mips1_I_FRZ;
+	sc_signal<bool> _mips2_IT_5;
+	sc_signal<bool> _mips2_IT_4;
+	sc_signal<bool> _mips2_IT_3;
+	sc_signal<bool> _mips2_IT_2;
+	sc_signal<bool> _mips2_IT_1;
+	sc_signal<sc_uint<1> > _mips2_D_FRZ;
+	sc_signal<sc_uint<1> > _mips2_I_FRZ;
+	sc_signal<bool> _mips3_IT_5;
+	sc_signal<bool> _mips3_IT_4;
+	sc_signal<bool> _mips3_IT_3;
+	sc_signal<bool> _mips3_IT_2;
+	sc_signal<bool> _mips3_IT_1;
+	sc_signal<sc_uint<1> > _mips3_D_FRZ;
+	sc_signal<sc_uint<1> > _mips3_I_FRZ;
+
+	/************************************************************************
+	 *
+	 * Segment table
+	 *
+	 ************************************************************************/
+
+	SOCLIB_SEGMENT_TABLE segtab;
+	segtab.setMSBNumber(8);
+	segtab.setDefaultTarget(0);
+	segtab.addSegment("rom_reset",0xBFC00000,10000,4,false);
+	segtab.addSegment("rom_excep",0x80000080,10000,4,false);
+	segtab.addSegment("rom_code",0x00400000,50000,4, false);
+	segtab.addSegment("ram_util",0x10000000,50000,7, false);
+	segtab.addSegment("loc0",0x20000000,20000,7,false);
+	segtab.addSegment("loc1",0x21000000,20000,7,false);
+	segtab.addSegment("loc2",0x22000000,20000,7,false);
+	segtab.addSegment("loc3",0x23000000,20000,7,false);
+	segtab.addSegment("tty0",0xA0000000,100,0,true);
+	segtab.addSegment("tty1",0xA1000000,100,1,true);
+	segtab.addSegment("tty2",0xA2000000,100,2,true);
+	segtab.addSegment("tty3",0xA3000000,100,3,true);
+	segtab.addSegment("timer",0xB0000000,1000,5,true);
+	segtab.addSegment("locks",0xB2000000,10000,6,true);
+
+	/************************************************************************
+	 *
+	 * Soclib components instanciation
+	 *
+	 ************************************************************************/
+
+	SOCLIB_VCI_GMN<4,8,2,8,32,4,0> gmn       ("gmn",segtab);
+	SOCLIB_MULTI_MIPS<false,1,0>   mips0     ("mips0",0,segtab);
+	SOCLIB_VCI_XCACHE<8,8,8,8>     xcache0   ("xcache0",0);
+	SOCLIB_MULTI_MIPS<false,1,0>   mips1     ("mips1",1,segtab);
+	SOCLIB_VCI_XCACHE<8,8,8,8>     xcache1   ("xcache1",1);
+	SOCLIB_MULTI_MIPS<false,1,0>   mips2     ("mips2",2,segtab);
+	SOCLIB_VCI_XCACHE<8,8,8,8>     xcache2   ("xcache2",2);
+	SOCLIB_MULTI_MIPS<false,1,0>   mips3     ("mips3",3,segtab);
+	SOCLIB_VCI_XCACHE<8,8,8,8>     xcache3   ("xcache3",3);
+	SOCLIB_VCI_TTY                 vcitty0   ("vcitty0",0,segtab,true);
+	SOCLIB_VCI_TTY                 vcitty1   ("vcitty1",1,segtab,true);
+	SOCLIB_VCI_TTY                 vcitty2   ("vcitty2",2,segtab,true);
+	SOCLIB_VCI_TTY                 vcitty3   ("vcitty3",3,segtab,true);
+	SOCLIB_VCI_RAMLOCKS            locks     ("locks",6,segtab);
+	SOCLIB_VCI_MULTI_TIMER<4>      multitimer("multitimer",5,segtab);
+	SOCLIB_VCI_MULTIRAM            multiram0 ("multiram0",4,segtab);
+	SOCLIB_VCI_MULTIRAM            multiram1 ("multiram1",7,segtab);
+
+	/************************************************************************
+	 *
+	 * Soclib topcell netlist
+	 *
+	 ************************************************************************/
+
+	gmn.I_VCI[0](_vcitty0_VCI_gmn_I_VCI_0_);
+	gmn.I_VCI[3](_vcitty3_VCI_gmn_I_VCI_3_);
+	gmn.I_VCI[6](_locks_VCI_gmn_I_VCI_6_);
+	gmn.I_VCI[1](_vcitty1_VCI_gmn_I_VCI_1_);
+	gmn.I_VCI[4](_multiram0_VCI_gmn_I_VCI_4_);
+	gmn.I_VCI[7](_multiram1_VCI_gmn_I_VCI_7_);
+	gmn.I_VCI[2](_vcitty2_VCI_gmn_I_VCI_2_);
+	gmn.I_VCI[5](_multitimer_VCI_gmn_I_VCI_5_);
+	gmn.T_VCI[1](_gmn_T_VCI_1__xcache1_VCI);
+	gmn.T_VCI[2](_gmn_T_VCI_2__xcache2_VCI);
+	gmn.T_VCI[0](_gmn_T_VCI_0__xcache0_VCI);
+	gmn.T_VCI[3](_gmn_T_VCI_3__xcache3_VCI);
+	gmn.CLK(signal_clk);
+	gmn.RESETN(signal_resetn);
+
+	mips0.DCACHE(_xcache0_DCACHE_mips0_DCACHE);
+	mips0.ICACHE(_xcache0_ICACHE_mips0_ICACHE);
+	mips0.IT_5(_mips0_IT_5);
+	mips0.IT_4(_mips0_IT_4);
+	mips0.IT_3(_mips0_IT_3);
+	mips0.IT_2(_mips0_IT_2);
+	mips0.IT_1(_mips0_IT_1);
+	mips0.IT_0(_multitimer_IRQ_0__mips0_IT_0);
+	mips0.D_FRZ(_mips0_D_FRZ);
+	mips0.I_FRZ(_mips0_I_FRZ);
+	mips0.CLK(signal_clk);
+	mips0.RESETN(signal_resetn);
+
+	xcache0.VCI(_gmn_T_VCI_0__xcache0_VCI);
+	xcache0.DCACHE(_xcache0_DCACHE_mips0_DCACHE);
+	xcache0.ICACHE(_xcache0_ICACHE_mips0_ICACHE);
+	xcache0.CLK(signal_clk);
+	xcache0.RESETN(signal_resetn);
+
+	mips1.DCACHE(_xcache1_DCACHE_mips1_DCACHE);
+	mips1.ICACHE(_xcache1_ICACHE_mips1_ICACHE);
+	mips1.IT_5(_mips1_IT_5);
+	mips1.IT_4(_mips1_IT_4);
+	mips1.IT_3(_mips1_IT_3);
+	mips1.IT_2(_mips1_IT_2);
+	mips1.IT_1(_mips1_IT_1);
+	mips1.IT_0(_multitimer_IRQ_1__mips1_IT_0);
+	mips1.D_FRZ(_mips1_D_FRZ);
+	mips1.I_FRZ(_mips1_I_FRZ);
+	mips1.CLK(signal_clk);
+	mips1.RESETN(signal_resetn);
+
+	xcache1.VCI(_gmn_T_VCI_1__xcache1_VCI);
+	xcache1.DCACHE(_xcache1_DCACHE_mips1_DCACHE);
+	xcache1.ICACHE(_xcache1_ICACHE_mips1_ICACHE);
+	xcache1.CLK(signal_clk);
+	xcache1.RESETN(signal_resetn);
+
+	mips2.DCACHE(_xcache2_DCACHE_mips2_DCACHE);
+	mips2.ICACHE(_xcache2_ICACHE_mips2_ICACHE);
+	mips2.IT_5(_mips2_IT_5);
+	mips2.IT_4(_mips2_IT_4);
+	mips2.IT_3(_mips2_IT_3);
+	mips2.IT_2(_mips2_IT_2);
+	mips2.IT_1(_mips2_IT_1);
+	mips2.IT_0(_multitimer_IRQ_2__mips2_IT_0);
+	mips2.D_FRZ(_mips2_D_FRZ);
+	mips2.I_FRZ(_mips2_I_FRZ);
+	mips2.CLK(signal_clk);
+	mips2.RESETN(signal_resetn);
+
+	xcache2.VCI(_gmn_T_VCI_2__xcache2_VCI);
+	xcache2.DCACHE(_xcache2_DCACHE_mips2_DCACHE);
+	xcache2.ICACHE(_xcache2_ICACHE_mips2_ICACHE);
+	xcache2.CLK(signal_clk);
+	xcache2.RESETN(signal_resetn);
+
+	mips3.DCACHE(_xcache3_DCACHE_mips3_DCACHE);
+	mips3.ICACHE(_xcache3_ICACHE_mips3_ICACHE);
+	mips3.IT_5(_mips3_IT_5);
+	mips3.IT_4(_mips3_IT_4);
+	mips3.IT_3(_mips3_IT_3);
+	mips3.IT_2(_mips3_IT_2);
+	mips3.IT_1(_mips3_IT_1);
+	mips3.IT_0(_multitimer_IRQ_3__mips3_IT_0);
+	mips3.D_FRZ(_mips3_D_FRZ);
+	mips3.I_FRZ(_mips3_I_FRZ);
+	mips3.CLK(signal_clk);
+	mips3.RESETN(signal_resetn);
+
+	xcache3.VCI(_gmn_T_VCI_3__xcache3_VCI);
+	xcache3.DCACHE(_xcache3_DCACHE_mips3_DCACHE);
+	xcache3.ICACHE(_xcache3_ICACHE_mips3_ICACHE);
+	xcache3.CLK(signal_clk);
+	xcache3.RESETN(signal_resetn);
+
+	vcitty0.VCI(_vcitty0_VCI_gmn_I_VCI_0_);
+	vcitty0.CLK(signal_clk);
+	vcitty0.RESETN(signal_resetn);
+
+	vcitty1.VCI(_vcitty1_VCI_gmn_I_VCI_1_);
+	vcitty1.CLK(signal_clk);
+	vcitty1.RESETN(signal_resetn);
+
+	vcitty2.VCI(_vcitty2_VCI_gmn_I_VCI_2_);
+	vcitty2.CLK(signal_clk);
+	vcitty2.RESETN(signal_resetn);
+
+	vcitty3.VCI(_vcitty3_VCI_gmn_I_VCI_3_);
+	vcitty3.CLK(signal_clk);
+	vcitty3.RESETN(signal_resetn);
+
+	locks.VCI(_locks_VCI_gmn_I_VCI_6_);
+	locks.CLK(signal_clk);
+	locks.RESETN(signal_resetn);
+
+	multitimer.IRQ[0](_multitimer_IRQ_0__mips0_IT_0);
+	multitimer.IRQ[3](_multitimer_IRQ_3__mips3_IT_0);
+	multitimer.IRQ[1](_multitimer_IRQ_1__mips1_IT_0);
+	multitimer.IRQ[2](_multitimer_IRQ_2__mips2_IT_0);
+	multitimer.VCI(_multitimer_VCI_gmn_I_VCI_5_);
+	multitimer.CLK(signal_clk);
+	multitimer.RESETN(signal_resetn);
+
+
+	multiram0.VCI(_multiram0_VCI_gmn_I_VCI_4_);
+	multiram0.CLK(signal_clk);
+	multiram0.RESETN(signal_resetn);
+
+	multiram1.VCI(_multiram1_VCI_gmn_I_VCI_7_);
+	multiram1.CLK(signal_clk);
+	multiram1.RESETN(signal_resetn);
+
+	/************************************************************************
+	 *
+	 * Load Application Binaries into memories
+	 *
+	 ************************************************************************/
+
+	char *sections_rom_reset[]={".reset",NULL};
+	MIPS_BINARY mb_rom_reset("a.out",sections_rom_reset);
+	multiram0.load("rom_reset",mb_rom_reset);
+
+	char *sections_rom_excep[]={".excep",NULL};
+	MIPS_BINARY mb_rom_excep("a.out",sections_rom_excep);
+	multiram0.load("rom_excep",mb_rom_excep);
+
+	char *sections_rom_code[]={".text",NULL};
+	MIPS_BINARY mb_rom_code("a.out",sections_rom_code);
+	multiram0.load("rom_code",mb_rom_code);
+
+	char *sections_ram_util[]={".rodata",".data",".sdata",".sbss",".bss",NULL};
+	MIPS_BINARY mb_ram_util("a.out",sections_ram_util);
+	multiram1.load("ram_util",mb_ram_util);
+
+
+	/************************************************************************
+	 *
+	 * Signal trace management
+	 *
+	 ************************************************************************/
+
+#ifdef ENABLE_TRACE
+	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file ("trace_file");
+	
+	/* clk and resetn waveforms are always useful */
+	sc_trace(system_trace_file, signal_clk, "clk");
+	sc_trace(system_trace_file, signal_resetn, "resetn");
+	sc_trace(system_trace_file, mips0.PC[0], "mips0.PC");
+	sc_trace(system_trace_file, mips1.PC[0], "mips1.PC");
+	sc_trace(system_trace_file, mips2.PC[0], "mips2.PC");
+	sc_trace(system_trace_file, mips3.PC[0], "mips3.PC");
+	sc_trace(system_trace_file, _mips0_IT_5, "_mips0_IT_5");
+	sc_trace(system_trace_file, _mips0_IT_4, "_mips0_IT_4");
+	sc_trace(system_trace_file, _mips0_IT_3, "_mips0_IT_3");
+	sc_trace(system_trace_file, _mips0_IT_2, "_mips0_IT_2");
+	sc_trace(system_trace_file, _mips0_IT_1, "_mips0_IT_1");
+	sc_trace(system_trace_file, _mips0_D_FRZ, "_mips0_D_FRZ");
+	sc_trace(system_trace_file, _mips0_I_FRZ, "_mips0_I_FRZ");
+	sc_trace(system_trace_file, _multiram0_VCI_gmn_I_VCI_4_, "_multiram0_VCI_gmn_I_VCI_4_");
+	sc_trace(system_trace_file, multiram0.VCI, "multiram0.VCI");
+	sc_trace(system_trace_file, gmn.I_VCI[4], "gmn.I_VCI(4)");
+	sc_trace(system_trace_file, gmn.I_VCI[3], "gmn.I_VCI(3)");
+	sc_trace(system_trace_file, gmn.I_VCI[2], "gmn.I_VCI(2)");
+	sc_trace(system_trace_file, gmn.I_VCI[1], "gmn.I_VCI(1)");
+	sc_trace(system_trace_file, gmn.I_VCI[0], "gmn.I_VCI(0)");
+	sc_trace(system_trace_file, gmn.T_VCI[3], "gmn.T_VCI(3)");
+	sc_trace(system_trace_file, gmn.T_VCI[2], "gmn.T_VCI(2)");
+	sc_trace(system_trace_file, gmn.T_VCI[1], "gmn.T_VCI(1)");
+	sc_trace(system_trace_file, gmn.T_VCI[0], "gmn.T_VCI(0)");
+	sc_trace(system_trace_file, _xcache0_ICACHE_mips0_ICACHE, "_ICACHE_mips0");
+	sc_trace(system_trace_file, _xcache0_DCACHE_mips0_DCACHE, "_DCACHE_mips0");
+#ifdef ENABLE_PAT
+	/* Open trace file */
+	sc_trace_file *system_trace_file2;
+	system_trace_file2 = sc_create_pat_trace_file ("trace_file");
+	
+	/* clk and resetn waveforms are always useful */
+	sc_trace(system_trace_file2, signal_clk, "clk");
+	sc_trace(system_trace_file2, signal_resetn, "resetn");
+	sc_trace(system_trace_file2, mips0.PC[0], "mips0.PC");
+	sc_trace(system_trace_file2, mips1.PC[0], "mips1.PC");
+	sc_trace(system_trace_file2, mips2.PC[0], "mips2.PC");
+	sc_trace(system_trace_file2, mips3.PC[0], "mips3.PC");
+	sc_trace(system_trace_file2, _mips2_IT_5,  "mips2_IT_5");
+	sc_trace(system_trace_file2, _mips2_IT_4,  "mips2_IT_4");
+	sc_trace(system_trace_file2, _mips2_IT_3,  "mips2_IT_3");
+	sc_trace(system_trace_file2, _mips2_IT_2,  "mips2_IT_2");
+	sc_trace(system_trace_file2, _mips2_IT_1,  "mips2_IT_1");
+	sc_trace(system_trace_file2, _mips2_D_FRZ, "mips2_D_FRZ");
+	sc_trace(system_trace_file2, _mips2_I_FRZ, "mips2_I_FRZ");
+	sc_trace(system_trace_file2, mips0     .DCACHE, "mips0.DCACHE");
+	sc_trace(system_trace_file2, mips0     .ICACHE, "mips0.ICACHE");
+	sc_trace(system_trace_file2, mips1     .DCACHE, "mips1.DCACHE");
+	sc_trace(system_trace_file2, mips1     .ICACHE, "mips1.ICACHE");
+	sc_trace(system_trace_file2, mips2     .DCACHE, "mips2.DCACHE");
+	sc_trace(system_trace_file2, mips2     .ICACHE, "mips2.ICACHE");
+	sc_trace(system_trace_file2, mips3     .DCACHE, "mips3.DCACHE");
+	sc_trace(system_trace_file2, mips3     .ICACHE, "mips3.ICACHE");
+	sc_trace(system_trace_file2, xcache0   .VCI, "xcache0.VCI");
+	sc_trace(system_trace_file2, xcache1   .VCI, "xcache1.VCI");
+	sc_trace(system_trace_file2, xcache2   .VCI, "xcache2.VCI");
+	sc_trace(system_trace_file2, xcache3   .VCI, "xcache3.VCI");
+	sc_trace(system_trace_file2, vcitty0   .VCI, "vcitty0.VCI");
+	sc_trace(system_trace_file2, vcitty1   .VCI, "vcitty1.VCI");
+	sc_trace(system_trace_file2, vcitty2   .VCI, "vcitty2.VCI");
+	sc_trace(system_trace_file2, vcitty3   .VCI, "vcitty3.VCI");
+	sc_trace(system_trace_file2, locks     .VCI, "locks.VCI");
+	sc_trace(system_trace_file2, multitimer.VCI, "multitimer.VCI");
+	sc_trace(system_trace_file2, multiram0 .VCI, "multiram0.VCI");
+	sc_trace(system_trace_file2, multiram1 .VCI, "multiram1.VCI");
+
+#endif
+
+#endif
+	
+	/******************************************************************************
+	 *
+	 * Simulation loop
+	 *
+	 ******************************************************************************/
+
+	sc_initialize ();
+
+	chrono_t chrono;
+	chrono.start ();
+	signal_resetn = false;
+	sc_start(1);
+	signal_resetn = true;
+	_mips0_IT_5=0;
+	_mips0_IT_4=0;
+	_mips0_IT_3=0;
+	_mips0_IT_2=0;
+	_mips0_IT_1=0;
+	_mips0_D_FRZ=0;
+	_mips0_I_FRZ=0;
+	_mips1_IT_5=0;
+	_mips1_IT_4=0;
+	_mips1_IT_3=0;
+	_mips1_IT_2=0;
+	_mips1_IT_1=0;
+	_mips1_D_FRZ=0;
+	_mips1_I_FRZ=0;
+	_mips2_IT_5=0;
+	_mips2_IT_4=0;
+	_mips2_IT_3=0;
+	_mips2_IT_2=0;
+	_mips2_IT_1=0;
+	_mips2_D_FRZ=0;
+	_mips2_I_FRZ=0;
+	_mips3_IT_5=0;
+	_mips3_IT_4=0;
+	_mips3_IT_3=0;
+	_mips3_IT_2=0;
+	_mips3_IT_1=0;
+	_mips3_D_FRZ=0;
+	_mips3_I_FRZ=0;
+	
+	sc_start(max_cycles);
+/*
+	for (int i = 0; i < max_cycles; i++)
+	{
+		sc_start(1);
+			cout << sc_simulation_time () << " cycle : ";
+			cout << "PC = " << hex << mips0.PC[0];
+			cout << ",IR = " << hex << mips0.IR[0];
+			cout << "\n";
+		
+		if (((int)(sc_simulation_time ()) % 10000) == 0)
+		{
+			printf("\nElapsed : %10.10d cycles.", (int)(sc_simulation_time ()));
+		}
+	}
+	*/
+	chrono.stop ();
+	unsigned int d = chrono;
+	cout << "Time elapsed (sec) : " << d << endl;
+	cout << "Cycles done        : " << sc_simulation_time () << endl;
+	cout << "Performance        : " << sc_simulation_time () / d << endl;
+
+	//
+#ifdef ENABLE_TRACE
+	sc_close_vcd_trace_file (system_trace_file);
+#ifdef ENABLE_PAT
+	sc_close_pat_trace_file (system_trace_file2);
+#endif
+#endif
+	
+	printf("\nPress <RETURN> to exit simulation.");
+	char buf_ret[2];
+	cin.getline(buf_ret,1);
+	
+	return EXIT_SUCCESS;
+}
Index: /latest/src/COPYING-2.0
===================================================================
--- /latest/src/COPYING-2.0	(revision 1)
+++ /latest/src/COPYING-2.0	(revision 1)
@@ -0,0 +1,345 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: /latest/src/COPYING.LIB-2.0
===================================================================
--- /latest/src/COPYING.LIB-2.0	(revision 1)
+++ /latest/src/COPYING.LIB-2.0	(revision 1)
@@ -0,0 +1,490 @@
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
Index: /latest/src/How-to-Use.txt
===================================================================
--- /latest/src/How-to-Use.txt	(revision 1)
+++ /latest/src/How-to-Use.txt	(revision 1)
@@ -0,0 +1,34 @@
+How To Use SystemCASS
+=====================
+--   in 4 steps    --
+---------------------
+
+1) Have the right models and the right top-level
+------------------------------------------------
+
+Models should be described as finite state machines.
+See details in SystemCASS documentation.
+
+SOCLIB models work fine.
+
+2) Compile
+----------
+
+You need to set the include path.
+For example :
+g++ -c main.cc -I/users/outil/systemc/systemcass/systemcass/latest/include
+
+3) Link
+-------
+
+You need to set the library path, specify the library and enable the shared library loader.
+For example :
+g++ -o main.x main.o -L/users/outil/systemc/systemcass/systemcass/latest/lib-SLA4x -lsystemc -rdynamic
+
+4) Execution
+------------
+
+Set SYSTEMCASS environment before executing the simulator.
+For exemple :
+export SYSTEMC=/users/outil/systemc/systemcass/systemcass/latest
+
Index: /latest/src/Makefile
===================================================================
--- /latest/src/Makefile	(revision 1)
+++ /latest/src/Makefile	(revision 1)
@@ -0,0 +1,390 @@
+# /*------------------------------------------------------------\
+# |                                                             |
+# | Tool   :                   systemcass                       |
+# |                                                             |
+# | File   :                    Makefile                        |
+# |                                                             |
+# | Author :                                                    |
+# |                                                             |
+# | Date    :                  08_07_2004                       |
+# |                                                             |
+# \------------------------------------------------------------*/
+ifndef SYSTEMC
+$(error SYSTEMC is not defined. This variable should be set to SystemCASS \
+directory when SYSTEMCASS variable is not set.)
+endif
+ifndef SYSTEMCASS
+$(error SYSTEMCASS is not defined. This variable has to be defined to install \
+SystemCASS and to run any system built with.)
+endif
+#ifndef SOCVIEW
+#$(error SOCVIEW is not defined.)
+#endif
+#################################
+#
+# SYSTEMC
+#
+#################################
+
+TARGET_ARCH     =$(shell ./guess_os.sh)
+TARGET_OS       =${TARGET_ARCH}
+TARGET_PLATFORM =$(shell uname -p)# -i doesn't work on MACOSX
+TARGET_KERNEL   =$(shell uname -s | tr '[A-Z]' '[a-z]')
+
+include Options.def
+
+##################################
+#### DIRECTORIES
+##################################
+#CURRENT_DIR           = $(shell pwd)
+#SYSTEMCASS_INSTALLDIR = ${CURRENT_DIR}/${TARGET_PLATFORM}-${TARGET_OS}
+SYSTEMCASS_INSTALLDIR = ${SYSTEMCASS}
+SYSTEMCASS_INCLUDEDIR = ${SYSTEMCASS_INSTALLDIR}/include
+SYSTEMCASS_LIBDIR     = ${SYSTEMCASS_INSTALLDIR}/lib
+SYSTEMCASS_DOCDIR     = ${SYSTEMCASS_INSTALLDIR}/docs
+
+INSTALLDIR_OK = $(shell (test -d ${SYSTEMCASS_INSTALLDIR}/) ; echo $$?)
+ifneq (${INSTALLDIR_OK},0)
+$(shell (mkdir ${SYSTEMCASS_INSTALLDIR}/))
+endif
+
+INCLUDEDIR_OK = $(shell (test -d ${SYSTEMCASS_INCLUDEDIR}/) ; echo $$?)
+ifneq (${INCLUDEDIR_OK},0)
+$(shell (mkdir ${SYSTEMCASS_INCLUDEDIR}))
+endif
+
+DOCDIR_OK = $(shell (test -d ${SYSTEMCASS_DOCDIR}/) ; echo $$?)
+ifneq (${DOCDIR_OK},0)
+$(shell (mkdir ${SYSTEMCASS_DOCDIR}))
+endif
+
+##################################
+#### FLAGS
+##################################
+#SYSTEMC  = /users/outil/systemc/systemcass/systemcass/latest
+#SYSTEMCASS  = $(SYSTEMC)/latest
+#ALLIANCE    = /asim/alliance
+
+PROF_ARG     = -pg # gcc
+#PROF_ARG     = -qp # icc
+OPT         = -O2 -DCFLAGS="\"-O2 \"" $(NETLIST_DEBUGGING) $(SCHEDULING_OPTIONS) $(OTHERS)
+DEBUG       = -g  -DCFLAGS="\"-g \"" $(NETLIST_DEBUGGING-d) $(SCHEDULING_OPTIONS-d) $(OTHERS-d) -Wunused -Werror
+PROF        = -O2 ${PROF_ARG} -DCFLAGS="\"-O2 ${PROF_ARG} \"" $(NETLIST_DEBUGGING) $(SCHEDULING_OPTIONS) $(OTHERS)
+
+#-Wall disable using icc instead of g++
+
+#CXX         = g++
+#CXX         = icc -w1
+CFLAGS      = -I./internal_include        \
+              -I${SYSTEMCASS_INCLUDEDIR}  \
+              -I${ALLIANCE}/include       \
+              -ansi                       \
+              -pedantic                   \
+              -Wno-long-long              \
+              -D${TARGET_PLATFORM}        \
+              -D${TARGET_KERNEL}          \
+              -Wunused-function  # to clean up the code \
+
+#-D${TARGET_ARCH}  # disabled because that macro name gets error messages
+
+LDFLAGS     = -L.                     \
+              -L${SYSTEMCASS}/lib-${TARGET_PLATFORM}-${TARGET_OS} \
+              -L${ALLIANCE}/lib       \
+
+##################################
+## DOCUMENTATION
+##################################
+
+FIGURES     = figures/SystemeType.fig \
+              figures/Automate.fig
+
+tex_files   = SystemCASS.tex
+pdf_files   = $(tex_files:.tex=.pdf)
+ps_files    = $(tex_files:.tex=.ps)
+eps_figures = $(FIGURES:.fig=.eps)
+dvi_files   = $(tex_files:.tex=.dvi)
+log_files   = $(tex_files:.tex=.log)
+aux_files   = $(tex_files:.tex=.aux)
+out_files   = $(tex_files:.tex=.out)
+blg_files   = $(tex_files:.tex=.blg)
+bbl_files   = $(tex_files:.tex=.bbl)
+
+DOCS        = \
+              ${SYSTEMCASS_DOCDIR}/SystemCASS.ps  \
+              ${SYSTEMCASS_DOCDIR}/SystemCASS.pdf \
+              ${SYSTEMCASS_DOCDIR}/How-to-Use.txt
+
+##################################
+## OBJECTS
+##################################
+OBJECTS     = \
+		alias.o \
+		bit2string.o \
+    dump_dot.o \
+    dump_used_env.o \
+    dump_used_options.o \
+		entity.o   \
+    gen_code.o \
+    global_functions.o \
+		graph.o \
+		graph_cass.o \
+		graph_signals.o \
+		hex2string.o \
+    methodprocess_dependency.o \
+    module_hierarchy.o \
+    module_hierarchy2dot.o \
+    mouchard_scheduling.o \
+    port_dependency.o \
+    process_dependency.o \
+    sc_clock.o            \
+		sc_event.o \
+		sc_event_finder.o \
+		sc_interface.o \
+		sc_logic.o \
+    sc_main.o \
+    sc_module.o \
+		sc_numrep.o \
+		sc_object.o \
+		sc_pat_trace.o \
+    sc_port.o \
+    sc_sensitive.o \
+    sc_time.o \
+		sc_trace.o \
+		sc_uint_subref_r.o \
+    sc_vcd_trace.o \
+    sc_ver.o \
+    schedulers.o \
+    serialization.o \
+    signal_dependency.o \
+    simplify_string.o \
+
+
+OBJECTS-d   = $(OBJECTS:.o=-d.o)
+OBJECTS-prof= $(OBJECTS:.o=-prof.o)
+
+##################################
+## LIBRARIES
+##################################
+SYSTEMCASS_LIB        = ${SYSTEMCASS_LIBDIR}/libsystemc_$(firstword $(CXX)).a
+SYSTEMCASS-d_LIB      = ${SYSTEMCASS_LIBDIR}/libsystemc_$(firstword $(CXX))-d.a
+SYSTEMCASS-prof_LIB   = ${SYSTEMCASS_LIBDIR}/libsystemc_$(firstword $(CXX))-prof.a
+
+## PAT trace output is enable when ALLIANCE is defined
+EXT_TMP_DIR = $(if ${ALLIANCE}, \
+              libPgn.temp       \
+              libMut.temp       \
+              libPpt.temp       \
+              libPat.temp       \
+              )
+
+EXT_OBJ     = $(EXT_TMP_DIR:.temp=.temp/*.o)
+
+##################################
+## SOURCES
+##################################
+LINKS       = $(OBJECTS-d:.o=.cc) $(OBJECTS-prof:.o=.cc)
+
+EXTERNAL_INCLUDES = \
+              ${SYSTEMCASS_INCLUDEDIR}/systemc.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_fwd.h\
+              ${SYSTEMCASS_INCLUDEDIR}/global_functions.h \
+              ${SYSTEMCASS_INCLUDEDIR}/serialization_ext.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_time.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_nbdefs.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_ver_ext.h\
+              ${SYSTEMCASS_INCLUDEDIR}/systemcass_version_ext.h\
+              ${SYSTEMCASS_INCLUDEDIR}/sc_module_ext.h \
+              ${SYSTEMCASS_INCLUDEDIR}/module_hierarchy_ext.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_module_name.h \
+              ${SYSTEMCASS_INCLUDEDIR}/internal_ext.h \
+              ${SYSTEMCASS_INCLUDEDIR}/casc.h \
+              ${SYSTEMCASS_INCLUDEDIR}/fsm_rules.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_object.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_sensitive.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_event.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_interface.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_port_ext.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_event_finder.h \
+              ${SYSTEMCASS_INCLUDEDIR}/port_dependency_ext.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_signal.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_clock_ext.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_unit.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_bit.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_logic.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_bv.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_unsigned.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_signed.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_uint.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_numrep.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_string.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_int.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_lv.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_biguint.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_bigint.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_trace_ext.h \
+              ${SYSTEMCASS_INCLUDEDIR}/alias.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_localvar.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_vcd_trace.h \
+              ${SYSTEMCASS_INCLUDEDIR}/sc_pat_trace.h \
+              ${SYSTEMCASS_INCLUDEDIR}/endianness.h \
+              ${SYSTEMCASS_INCLUDEDIR}/data_field.h \
+
+##################################
+## RULES  
+##################################
+.SECONDARY:
+.PHONY: help figures debug opt prof docs path all clean realclean
+
+##########
+#### RULES
+help :
+	@echo "rules         Description"
+	@echo "---------     ------------------------------"
+	@echo "debug         Create debug library"
+	@echo "opt           Create optimized library"
+	@echo "prof          Create a library for profiling"
+	@echo "docs          Create PDF documentation"
+	@echo "path          Print the path to libraries, documentation..."
+	@echo "all           Create all the libraries and documentation files"
+	@echo "clean         Delete temporary files"
+	@echo "realclean     Delete libraries,  documentation files and temporary files."
+
+#@echo "nolib         Compile only source files and don't generate any library" => this rules is not possible because we need to overwrite external includes
+
+path :
+	@echo "debug library : ${SYSTEMCASS_LIB}"
+	@echo "optimized library : ${SYSTEMCASS-d_LIB}"
+	@echo "profiling library : ${SYSTEMCASS-prof_LIB}"
+	@echo "PDF documentation : ${SYSTEMCASS_DOCDIR}"
+
+all : debug opt prof
+	@echo Type make docs
+
+opt : ${EXTERNAL_INCLUDES} systemc
+
+debug : ${EXTERNAL_INCLUDES} systemc-d
+
+prof : ${EXTERNAL_INCLUDES} systemc-prof
+
+cvs : recent_changes
+	gvim recent_changes &
+	cvs ci
+
+recent_changes : ${SYSTEMCASS_LIB} ${SYSTEMCASS-d_LIB}
+	make clean	
+	echo -n '#define SYSTEMC_VERSION "SystemCASS : ' > systemcass_version_ext.h
+	date | head -c 28 >> systemcass_version_ext.h
+	echo '"' >> systemcass_version_ext.h
+	-cvs diff > recent_changes
+
+docs : ${DOCS}
+
+includes : ${EXTERNAL_INCLUDES}
+
+###########################
+#### EXPORTING FILES
+${SYSTEMCASS_INCLUDEDIR}/%.h: %.h
+	cp $*.h ${SYSTEMCASS_INCLUDEDIR}/$*.h
+
+${SYSTEMCASS_DOCDIR}/%.pdf: %.pdf
+	cp $*.pdf ${SYSTEMCASS_DOCDIR}/$*.pdf
+
+${SYSTEMCASS_DOCDIR}/%.ps: %.ps
+	cp $*.ps ${SYSTEMCASS_DOCDIR}/$*.ps
+
+${SYSTEMCASS_DOCDIR}/%.txt: %.txt
+	cp $*.txt ${SYSTEMCASS_DOCDIR}/$*.txt
+
+########################
+#### COMPILING & LINKING
+systemc: ${SYSTEMCASS_LIB}
+
+systemc-d: ${SYSTEMCASS-d_LIB}
+
+systemc-prof: ${SYSTEMCASS-prof_LIB}
+
+${SYSTEMCASS_LIB} : $(OBJECTS) ${EXT_OBJ}
+	mkdir -p ${SYSTEMCASS_LIBDIR}
+	ar -rv ${SYSTEMCASS_LIB} $(OBJECTS) $(EXT_OBJ)
+	ranlib ${SYSTEMCASS_LIB}
+
+${SYSTEMCASS-d_LIB}: $(OBJECTS-d) ${EXT_OBJ}
+	mkdir -p ${SYSTEMCASS_LIBDIR}
+	ar -rv ${SYSTEMCASS-d_LIB} $(OBJECTS-d) $(EXT_OBJ)
+	ranlib ${SYSTEMCASS-d_LIB}
+
+${SYSTEMCASS-prof_LIB}: $(OBJECTS-prof) ${EXT_OBJ}
+	mkdir -p ${SYSTEMCASS_LIBDIR}
+	ar -rv ${SYSTEMCASS-prof_LIB} $(OBJECTS-prof) $(EXT_OBJ)
+	ranlib ${SYSTEMCASS-prof_LIB}
+
+%-d.cc : %.cc
+	ln -s $*.cc $*-d.cc
+
+%-prof.cc : %.cc
+	ln -s $*.cc $*-prof.cc
+
+%-d.o : %-d.cc
+	$(CXX) $(CFLAGS) -MM $*-d.cc >> Makefile.deps
+	$(CXX) $(CFLAGS) $(DEBUG) -c $< -o $@
+
+%-prof.o : %-prof.cc
+	$(CXX) $(CFLAGS) -MM $*-prof.cc >> Makefile.deps
+	$(CXX) $(CFLAGS) $(PROF) -c $< -o $@
+
+%.o : %.cc 
+	$(CXX) $(CFLAGS) -MM $*.cc >> Makefile.deps
+	$(CXX) $(CFLAGS) $(OPT) -c $< -o $@
+
+lib%.temp/*.o : ${ALLIANCE}/lib/lib%.a
+	(mkdir lib$*.temp ; cd lib$*.temp ; ar -x ${ALLIANCE}/lib/lib$*.a)
+
+guess_endianness.x : guess_endianness.cc
+	${CXX} -o guess_endianness.x guess_endianness.cc
+
+${SYSTEMCASS_INCLUDEDIR}/endianness.h : guess_endianness.x
+	./guess_endianness.x > ${SYSTEMCASS_INCLUDEDIR}/endianness.h
+
+include Makefile.deps
+
+##################
+#### DOCUMENTATION
+%.dvi : %.tex
+
+%.pdf : %.ps
+	ps2pdf $*.ps	
+
+%.ps: %.dvi
+	dvips -o $*.ps $*.dvi                                                                                
+%.dvi %.bbl : %.tex %.bib $(eps_figures)
+	latex $*.tex
+	bibtex $*
+	latex $*.tex
+	latex $*.tex
+
+figures : $(eps_figures)
+	@echo OK
+
+%.eps : %.fig
+	fig2dev -L eps $*.fig $*.eps
+
+##################
+#### CLEANING
+clean :
+	echo > Makefile.deps
+	rm -f *~
+	rm -f $(OBJECTS)
+	rm -f $(OBJECTS-d)
+	rm -f $(OBJECTS-prof)
+	rm -rf $(EXT_TMP_DIR)
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	rm -f $(eps_figures)
+	rm -f $(dvi_files) $(log_files) 
+	rm -f $(out_files) $(aux_files) $(blg_files) $(bbl_files)
+	rm -f $(pdf_files) $(ps_files)
+
+realclean: clean
+	rm -f ${EXTERNAL_INCLUDES}
+	rm -rf ${SYSTEMCASS_LIBDIR}
+	rm -f ${SYSTEMCASS_LIB} ${SYSTEMCASS-d_LIB} ${SYSTEMCASS-prof_LIB}
+	#rm -f $(DOCS) # DONT do it. ${DOCS} includes txt files...
Index: /latest/src/Makefile.deps
===================================================================
--- /latest/src/Makefile.deps	(revision 1)
+++ /latest/src/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/src/Options.def
===================================================================
--- /latest/src/Options.def	(revision 1)
+++ /latest/src/Options.def	(revision 1)
@@ -0,0 +1,99 @@
+##################################
+#### MACRO DEFINTIONS AVAILABLE
+##################################
+
+#
+# -U to disable
+# -D to enable
+#
+
+ifdef ALLIANCE
+ALLIANCE_OK = $(shell (test -d ${ALLIANCE}) ; echo $$?)
+ifneq (${ALLIANCE_OK},0)
+$(warning "ALLIANCE directory is not valid. So, PAT file format is not supported.")
+ALLIANCE=
+endif
+endif
+
+ALLIANCE_DEF=$(if ${ALLIANCE},-DPAT_TRACE_FORMAT,-UPAT_TRACE_FORMAT)
+
+
+# ### FOR LIBRARY (OPT)
+#
+# netlist debugging
+#
+
+NETLIST_DEBUGGING = \
+  -UDUMP_NETLIST_INFO                \
+  -UDUMP_SIGNAL_STATS                \
+  -UDUMP_FUNCLIST_INFO               \
+  ${ALLIANCE_DEF}                    \
+#
+
+#
+# scheduling options
+#
+
+SCHEDULING_OPTIONS = \
+  -UUSE_PORT_DEPENDENCY  \
+  -UDUMP_PORT_DEPENDENCY \
+  -UDUMP_SCHEDULE_STATS  \
+  -UNO_STATIC_SCHEDULE   \
+  -UKEEP_GENERATED_CODE  \
+  -UDUMP_COMBINATIONAL_LIST2DOT \
+  -UPRINT_SCHEDULE       \
+
+#
+# others
+#
+
+OTHERS = \
+  -UDUMP_STAGE            \
+  -UCHECK_FSM_RULES       \
+  -UCOMPIL_DEBUG          \
+  -UDEBUG                 \
+  -UUINT64                \
+  -DINIT_SIGNALS_TO_ZERO  \
+#  -UCHECK_MULTIWRITING2PORT      \
+#  -UCHECK_MULTIWRITING2REGISTER  \
+
+#
+# ### FOR LIBRARY (DEBUG)
+#
+
+NETLIST_DEBUGGING-d = \
+  -UDUMP_NETLIST_INFO                \
+  -UDUMP_SIGNAL_STATS                \
+  -UDUMP_FUNCLIST_INFO               \
+  ${ALLIANCE_DEF}                    \
+#
+
+SCHEDULING_OPTIONS-d= \
+  -UUSE_PORT_DEPENDENCY  \
+  -DDUMP_PORT_DEPENDENCY \
+  -UDUMP_SCHEDULE_STATS  \
+  -UNO_STATIC_SCHEDULE   \
+  -DKEEP_GENERATED_CODE  \
+  -UDUMP_COMBINATIONAL_LIST2DOT \
+  -UPRINT_SCHEDULE       \
+
+OTHERS-d = \
+  -UDUMP_STAGE            \
+  -DCHECK_FSM_RULES       \
+  -DCOMPIL_DEBUG          \
+  -DDEBUG                 \
+  -UUINT64                \
+  -DINIT_SIGNALS_TO_ZERO  \
+  -DCHECK_MULTIWRITING2PORT     \
+  -DCHECK_MULTIWRITING2REGISTER \
+
+# bug in UINT64 to fix
+
+#
+# ### FOR USERS
+#
+
+USERS_OPTIONS = \
+  -UCHECK_FSM_RULES        \
+  -UDUMP_READ -UDUMP_WRITE \
+
Index: /latest/src/SystemCASS.bib
===================================================================
--- /latest/src/SystemCASS.bib	(revision 1)
+++ /latest/src/SystemCASS.bib	(revision 1)
@@ -0,0 +1,544 @@
+@inproceedings{ panda01systemc,
+    author = "Preeti Ranjan Panda",
+    title = "SystemC",
+    booktitle = "{ISSS}",
+    pages = "75-80",
+    year = "2001",
+    url = "citeseer.nj.nec.com/panda01systemc.html" }
+
+@inproceedings{ french95general,
+  author = "Robert S. French and Monica S. Lam and Jeremy R. Levitt and Kunle Olukotun", title = "A General Method for Compiling Event-Driven Simulations", 
+  booktitle = "Design Automation Conference", 
+  pages = "151-156", 
+  year = "1995", 
+  url = "citeseer.nj.nec.com/french95general.html" }
+
+@article{ badros00javaml, author = "Greg J. Badros", title = "Java{ML}: a markup language for {Java} source code", journal = "Computer Networks (Amsterdam, Netherlands: 1999)", volume = "33", number = "1--6", pages = "159--177", year = "2000", url = "citeseer.nj.nec.com/badros00javaml.html" }
+
+@inproceedings{ eventvsstatic, 
+	author       = "Buchmann Richard and Petrot Frederic and Greiner Alain",
+	title        = "Pilotage evenementiel versus ordonnancement statique",
+	organization = "ASIM/LIP6/UPMC",
+	booktitle    = "{Troisième colloque du GDR CAO de circuits et systèmes integres, Paris, France}",
+  year         = "2002",
+	pages        = "151-154",
+	date         = "Mai 2002" }
+
+@INPROCEEDINGS{simu97-3,
+   author       = "Frederic Petrot and Denis Hommais and Alain Greiner",
+   title        = "Cycle Precise Core Based Hardware/Software System
+                   Simulation with Predictable Event Propagation",
+   organization = "ASIM/LIP6/UPMC",
+   booktitle    = "Proceeding of the $23^{\mathrm{rd}}$ Euromicro Conference",
+   address      = "Budapest, Hungary",
+   pages        = "182--187",
+   publisher    = "IEEE",
+   month        = sep,
+   year         = 1997 
+}  
+
+@article{ chang01fast,
+    author = "Felix Sheng-Ho Chang and Alan J. Hu",
+    title = "Fast Specification of Cycle-Accurate Processor Models",
+    booktitle = "Proc. International Conf. Computer Design ({ICCD})",
+    publisher = "IEEE Computer Society Press",
+    pages = "488--492",
+    year = "2001",
+    url = "citeseer.nj.nec.com/chang01fast.html" }
+
+@manual{program_transform,
+	title = "The Program Transformation Wiki",
+	note  = "http://www.program-transformation.org"}
+
+@misc{olmos-visser, 
+	author = "Karina Olmos and Eelco Visser",
+	title = "Strategies for Source-to-Source Constant Propagation",
+	year = "2002",
+	url = "citeseer.nj.nec.com/olmos02constant.html" }
+
+@manual{systemc_osci,
+	title = "OSCI",
+	note  = "http://www.systemc.org"}
+
+@manual{GCCXML,
+	title = "GCC\_XML",
+	note  = "http://www.gccxml.org"}
+
+@misc{for-lukai, 
+        author = "Mar Center For", 
+        title = "Lukai Cai and Daniel Gajski", 
+	url = "citeseer.nj.nec.com/561051.html" }
+
+@manual{SystemC-2.0.1-LRM,
+	title = "SystemC 2.0.1 Language Reference Manual",
+        author = "OSCI", 
+        year = "2003",
+	note  = "http://www.systemc.org"}
+
+@INPROCEEDINGS{TLM-SoC-SC2.0,
+	Author = "Sudeep Pasricha", 
+	organization = "STMicrolectronics",
+	title      = "Transaction level modeling of SoC with SystemC 2.0",
+	year     = "2002"
+}
+
+@INPROCEEDINGS{Empirical-Study-SC,
+	Author       = "Ando Ki", 
+	organization = "R\&D Center,Dynalith Systems, Korea",
+	title        = "Internal Report",
+	booktitle    = "Empirical Study of SystemC",
+	year         = "2003",
+	url          = "http://www.dynalith.com"
+}
+
+@misc{SOCLIB,
+	Author = "SoCLIB", 
+	title      = "A modelisation \& simulation plat-form for system on
+chip",
+	year     = "2003",
+	note = "http://soclib.lip6.fr"
+}
+
+@misc{DISYDENT,
+	author = "LIP6",
+	title = "Digital System Design Environment",
+	note = "http://www-asim.lip6.fr/recherche/disydent"
+}
+
+@manual{vci_specifications,
+	title = "Virtual Component Interface Standard",
+	note  = "http://www.vsi.org"}
+
+@inproceedings{ date04-mouchard,
+                author = "Daniel Gracia Perez and Gilles Mouchard and Olivier Temam",
+                title  = "A New Optimized Implemention of the SystemC Engine Using Acyclic Scheduling",
+                booktitle    = "Design, Automation and Test in Europe Conference and Exhibition Volume I (DATE'04)",
+                year         = "2004",
+                address      = "Paris, France",
+                organization = "ALCHEMY INRIA Futurs \& LRI, Paris South University",
+                publisher    = "IEEE",
+                pages        =  "10552" }
+
+@misc{ bjrklund02language,
+  author = "D. Bjrklund and J. Lilius",
+  title = "A language for multiple models of computation",
+  text = "Dag Bjrklund and Johan Lilius. A language for multiple models of
+computation.
+    In Symposium on Hardware/Software Codesign 2002. ACM, 2002.",
+  year = "2002",
+  url = "citeseer.ist.psu.edu/bjrklund02language.html" }
+
+@inproceedings{989013,
+ author = {Hiren D. Patel and Sandeep K. Shukla},
+ title = {Towards a heterogeneous simulation kernel for system level models: a SystemC kernel for synchronous data flow models},
+ booktitle = {GLSVLSI '04: Proceedings of the 14th ACM Great Lakes symposium on VLSI},
+ year = {2004},
+ isbn = {1-58113-853-9},
+ pages = {248--253},
+ location = {Boston, MA, USA},
+ doi = {http://doi.acm.org/10.1145/988952.989013},
+ publisher = {ACM Press},
+ address = {New York, NY, USA},
+ }
+
+@inproceedings{74398,
+ author = {Z. Wang and P. M. Maurer},
+ title = {Scheduling high-level blocks for functional simulation},
+ booktitle = {DAC '89: Proceedings of the 26th ACM/IEEE conference on Design automation},
+ year = {1989},
+ isbn = {0-89791-310-8},
+ pages = {87--90},
+ location = {Las Vegas, Nevada, United States},
+ doi = {http://doi.acm.org/10.1145/74382.74398},
+ publisher = {ACM Press},
+ address = {New York, NY, USA},
+ }
+
+@inproceedings{217522,
+ author = {Robert S. French and Monica S. Lam and Jeremy R. Levitt and Kunle Olukotun},
+ title = {A general method for compiling event-driven simulations},
+ booktitle = {DAC '95: Proceedings of the 32nd ACM/IEEE conference on Design automation},
+ year = {1995},
+ isbn = {0-89791-725-1},
+ pages = {151--156},
+ location = {San Francisco, California, United States},
+ doi = {http://doi.acm.org/10.1145/217474.217522},
+ publisher = {ACM Press},
+ address = {New York, NY, USA},
+ }
+
+@inproceedings{kahn3,
+ author = {G. Kahn},
+ title = {The Semantics of a simple language for parallel programming},
+ booktitle = {IFIP Congress : Information Processing},
+ year = {1974},
+ publisher = {North-Holland Publishing Co.},
+ }
+
+@manual{VSIAAD,
+	title = "VSIA Architecture Document",
+        author = "VSI Alliance", 
+        year = "1997",
+	note  = "http://www.vsia.org"}
+
+@inproceedings{ludo99,
+ author = { Jacomme Ludovic, Pétrot Frédéric, Bawa Rajesh K. },
+ title = {Formal Analysis of Single Wait VHDL processes for Semantic Based Synthesis},
+ booktitle = {12th IEEE International Conference on VLSI Design},
+ year = {1999},
+ location = {Goa, India},
+ pages = {151-156}}
+
+@inproceedings{ iceec04-buch,
+  author = "R. Buchmann and F. Petrot and A. Greiner",
+  title  = "Fast Cycle Accurate Simulator to simulate Event-Driven Behavior",
+  booktitle    = "Proceeding of The 2004 International Conference on Electrical, Electronic and Computer Engineering (ICEEC'04)",
+  year         = "2004",
+  address      = "Cairo, Egypt",
+  organization = "ASIM/LIP6/UPMC",
+  publisher    = "IEEE",
+  pages        =  "35-39" }
+
+@phdthesis{hommais,
+  author= {Hommais Denis},
+  title= {Une méthode d'évaluation et de synthèse des communications dans les systèmes intégrés matériel-logiciel},
+  year = {2001},
+  organization = "ASIM/LIP6/UPMC",
+  location = {Paris, France}
+}
+
+@phdthesis{jacomme,
+  author= {Jacomme Ludovic},
+  title = {Analyse sémantique de descriptions VHDL synchrones en vue de la
+synthèse},
+  year = {1999},
+  organization = "ASIM/LIP6/UPMC",
+  location = {Paris, France}
+}
+
+@book{mips_goodman,
+  title = {A programmer's view of computer architecture: with examples from the
+MIPS RISC architecture},
+  author = {James Goodman},
+  edition = {Fort Worth: Saunders College Pub.},
+  year = {1992},
+  isbn = {0030972213}
+}
+
+@book{mips_gerry,
+  title = {MIPS RISC architecture},
+  author = {Gerry Kane},
+  publisher = {Englewood Cliffs, NJ : Prentice-Hall},
+  year = {1988},
+  isbn = {0135847494}
+}
+
+@inproceedings{webmips,
+  title="WebMIPS: A New Web-Based MIPS Simulation Environment for Computer
+Architecture Education",
+  author = {Irina Branovic, Roberto Giorgi, Enrico Martinelli},
+  organization = {University of Siena, Italy}
+}
+
+ 
+@inproceedings{early_pipeline,
+  title="Fast Cycle-accurate Behavioral Simulation for Pipelined Processors
+Using Early Pipeline Evaluation",
+  booktitle= "Proceedings of ICCAD'03 conference",
+  author = {In-Cheol Park, Sehyeon Kang, Yongseok Yi},
+  year = "2003", 
+  address = {San Jose, California USA} 
+}
+
+@misc{visual_fastc,
+  title = "Visual Elite FastC",
+  organization = "Summit Design Inc."
+}
+
+@article{mealy,
+  title = "A method for synthesizing sequential circuits",
+  author= "G. Mealy",
+  booktitle="Bell System Technical J. 34",
+  year  = "1955",
+  pages = "1045-1079"
+}
+
+@article{moore,
+  author = "E. Moore",
+  title  = "Gedanken experiments on sequential machines",
+  booktitle = "Automata Studies",
+  edition = "C. Shannon et J. McCarthy",
+  publisher = "Princeton University Press",
+  address = "Princeton, New Jersey",
+  year = "1956",
+  pages = "129-153"
+}
+
+@article{rabin,
+  author = "M. Perles, M. Rabin et E. Shamir",
+  title = "The theory of definite automata",
+  publisher = "IEEE.",
+  booktitle = "Trans. Electron. Comput. 12",
+  year = "1963",
+  pages = "233-243"
+}
+
+@article{rabin2,
+  author = "M. O. Rabin et D. Scott",
+  title  = "Sequential Machines",
+  edition = "E. F. Moore",
+  publisher = "Addison-Wesley",
+  address   = "Massachussetts",
+  year = "1964",
+  pages = "63-91"
+}
+
+@article{358613,
+ author = {K. M. Chandy and J. Misra},
+ title = {Asynchronous distributed simulation via a sequence of parallel
+computations},
+ journal = {Commun. ACM},
+ volume = {24},
+ number = {4},
+ year = {1981},
+ issn = {0001-0782},
+ pages = {198--206},
+ doi = {http://doi.acm.org/10.1145/358598.358613},
+ publisher = {ACM Press},
+ address = {New York, NY, USA}
+}
+
+
+@inproceedings{37915,
+ author = {S. P. Smith and M. R. Mercer and B. Brodk},
+ title = {Demand driven simulation: BACKSIM},
+ booktitle = {DAC '87: Proceedings of the 24th ACM/IEEE conference on Design
+automation},
+ year = {1987},
+ isbn = {0-8186-0781-5},
+ pages = {181--187},
+ location = {Miami Beach, Florida, United States},
+ doi = {http://doi.acm.org/10.1145/37888.37915},
+ publisher = {ACM Press},
+ address = {New York, NY, USA}
+ }
+
+@inproceedings{123349,
+ author = {Zhicheng Wang and Peter M. Maurer},
+ title = {LECSIM: a levelized event driven compiled logic simulation},
+ booktitle = {DAC '90: Proceedings of the 27th ACM/IEEE conference on Design
+automation},
+ year = {1990},
+ isbn = {0-89791-363-9},
+ pages = {491--496},
+ location = {Orlando, Florida, United States},
+ doi = {http://doi.acm.org/10.1145/123186.123349},
+ publisher = {ACM Press},
+ address = {New York, NY, USA}
+ }
+
+@inproceedings{hadamard,
+  title = {Design of the Hadamard Coprocessor with the Alliance CAD System carried by Post-Graduating Students},
+  author = {Zerrouki Amal and Dunoyer Julien and Wajsbürt Franck and Derieux Anne},
+  booktitle = {3rd European Workshop on Microelectronics Education (EWME)},
+  location = {Aix En Provence, France},
+  year = {2000},
+  pages = {265-268}
+}
+
+@inproceedings{reuse,
+  author = {N. Agliada, A. Fin. and F. Fummi and M. Martignano and G. Pravadelli},
+  title  = {On the Reuse of VHDL Modules into SystemC Designs},
+  booktitle = {Proceedings IEEE Forum on Design Languages (FDL)},
+  location = {Lyon, France},
+  year = {2001}
+}
+
+@phdthesis{sidd,
+  author = {Siddhartha Devalapalli},
+  title = {Development of SystemC Modules from HDL for System-on-Chip
+Applications},
+  year = {2004},
+  school = {University of Tennessee},
+  location = {Knoxville}
+}
+
+@inproceedings{verilog2sc,
+  author = {L. Mahmoudi Ayough, A. Haj Abutalebi, O. F. Nadjarbashi and S. Hessabi},
+  title  = {Verilog2SC: A Methodology for Converting Verilog. HDL to SystemC},
+  booktitle = {Proceedings of the 11th International HDL Conference (HDL Con 2002)},
+  pages =  {211-217},
+  location = {San Jose, California, USA},
+  year = {2002}
+}
+
+@report{verilator,
+  author = {W. Snyder},
+  title  = {Verilator Environment},
+  note = {in NASCUG},
+  year = {2004}
+}
+
+@inproceedings{AIRE,
+  author = {J. C. Willis and P. A. Wilsey and G. D. Peterson and J. Hines and A. Zamfirescu and D. E. Martin and R. N. Newshutz},
+  title = "Advanced Intermediate Representation with Extensibility (AIRE)",
+  booktitle = "VHDL Users' Group Fall 1996 Conference",
+  pages = {33-40},
+  year = {1996}
+}
+
+@inproceedings{savant,
+  author = {D. E. Martin and P. A. Wilsey and P. Chawla},
+  title  = {SAVANT: An Extensible Object-Oriented Intermediate for VHDL},
+  booktitle = "VHDL Users' Group",
+  year = {1996},
+  pages = {275-281}
+}
+
+@inproceedings{Sil,
+  author = {E. Molenkamp and G. E. Mekenkamp},
+  title = {Sil: an intermediate for syntax based VHDL synthesis},
+  booktitle = {VHDL International Users Forum},
+  pages = {5.1-5.9},
+  year = {1995}
+}
+
+@report{qualitative_subset,
+  author = {D. Déharbe and D. Borrione},
+  title = {A qualitative finite subset of VHDL and semantics},
+  organization = {IMAG Institute},
+  year = {1993}
+}
+
+@inproceedings{doh94,
+  author = {G. Döhmen},
+  title = {Petri Nets as Intermediate Representation Between VHDL and Symbolic
+Transition Systems},
+  booktitle = {EURO-VHDL},
+  pages = {572-577},
+  location = {Grenoble, France},
+  year = {1994}
+}
+
+@inproceedings{OC93,
+  author = {S. Olcoz and J.M. Colom},
+  title  = {A Petri Net Approach for the Analysis of VHDL Descriptions},
+  booktitle = {CHARME},
+  pages  = {15-26},
+  year   = {1993}
+}
+
+@inproceedings{semantics,
+  author = {L. Jacomme and F. Pétrot and R.K. Bawa},
+  title  = {Formal Analysis of Single Wait VHDL Processes for Semantic Based
+Synthesis},
+  booktitle = {12th International Conference on VLSI Design},
+  pages = {151-156},
+  location = {Goa, India},
+  year = {1999}
+}
+
+@inproceedings{EE95,
+  author = {A. Evans and E. Encrenaz},
+  title  = {An Approach to the Synthesis of VHDL Concurrent Processes as a
+FSM},
+  booktitle = {IFIP WG 10.5 Workshop on Logic and Architecture Synthesis},
+  pages = {115-124},
+  location = {Grenoble, France},
+  year = {1995}
+}
+
+@inproceedings{ALLIANCE,
+  author = {A. Greiner and F. Pêcheux},
+  title  = {ALLIANCE : A Complete Set of CAD Tools for Teaching VLSI Design},
+  booktitle = {The 3rd Eurochip Workshop on VLSI Design Training},
+  pages = {230-37},
+  location = {Grenoble, France},
+  year = {1992}
+}
+
+@inproceedings{RTL2CASS,
+  author = {R.K. Bawa and P. Guerrier and L. Jacomme and P. Bazargan-Sabet.},
+  title  = {An approach to behavioral synthesis from a formal model of vhdl},
+  booktitle = {VHDL International Users Forum},
+  pages = {117-126},
+  location = {Durham, Caroline du Nord, USA},
+  year = {1996}
+}
+
+@phdthesis{thesis_mouchard,
+  author= {Mouchard Gilles},
+  title = {Modélisation de Processeurs et de Systèmes},
+  year = {2004},
+  organization = "LRI"
+}
+
+@conference{PAPR1,
+  title = {Modular on chip multi processor for routing applications},
+  author = {E. Faure and D. Genius and F. Pétrot and S. Berrayana},
+  year = {2004},
+  month = september,
+  location = {Pise, Italie},
+  booktitle = {EUROPAR 04},
+  pages = {847-855}
+}
+
+@conference{PAPR2,
+  title = {Application télécom pour processeur réseau},
+  author = {E. Faure and S. Berrayana and D. Genius and F. Pétrot},
+  booktitle = {Sciences Electroniques Technologies de l'Information et des Télécommunications (SETIT'04)},
+  location = {Sousse, Tunisie},
+  month = {mars},
+  year = 2004
+}
+
+@conference{ROBDD1,
+	title = {Efficient implementation of a bdd package},
+  booktitle = {27th ACM/IEEE Design Automation Conference},
+  author = {Karl Brace and Richard Rudell and Randal Bryant},
+  pages = {677-691},
+  month = {August},
+  year = {1986}
+}
+
+@article{ROBDD2,
+	title = {Graph-based algorithms for boolean function manipulation},
+  author = {Randal Bryant},
+  booktitle = {IEEE Transaction on Computers},
+  pages = {677-691},
+  month = {August},
+  year = {1986}
+}
+
+@inproceedings{VHDL2SC,
+  title = {On the Reuse of VHDL Modules into SystemC Designs},
+  author = {N. Agliada and A. Fin and F. Fummi and M. Martignano and G. Pravdelli},
+  booktitle = {Forum on Design Languages (FDL01)},
+  year = {2001}
+}
+
+@inproceedings{stereovision,
+  title = "Mapping an Obstacles Detection, Stereo Vision-based, Software Application on a Multi-Processor System-on-chip",
+  author = {A. Greiner and F. Petrot and M. Carrier and M. Benabdenbi and R. Chotin-avot and R. Labayrade},
+  booktitle = {Proceedings of Intelligent Vehicles Symposium 2006},
+  publisher = {IEEE},
+  year = 2006,
+  month = June,
+  pages = {370-376}
+}
+
+@article{shannon,
+ author = {Bernard M. E. Moret},
+ title = {Decision Trees and Diagrams},
+ journal = {ACM Comput. Surv.},
+ volume = {14},
+ number = {4},
+ year = {1982},
+ issn = {0360-0300},
+ pages = {593--623},
+ doi = {http://doi.acm.org/10.1145/356893.356898},
+ publisher = {ACM Press},
+ address = {New York, NY, USA},
+ }
+
+
Index: /latest/src/SystemCASS.tex
===================================================================
--- /latest/src/SystemCASS.tex	(revision 1)
+++ /latest/src/SystemCASS.tex	(revision 1)
@@ -0,0 +1,273 @@
+%%%%%%%%%%
+%
+%$Log: SystemCASS.tex,v $
+%Revision 1.3  2005/03/25 14:33:01  buchmann
+%Typo :
+%-  dependAncy -> dependEncy
+%
+%sc_initialize :
+%-  Use a hash table to speed up elaboration step. (x40 faster)
+%
+%Tracing :
+%-  check for modification BEFORE building bit string.
+%-  use sprintf instead std string concatenation.
+%
+%Revision 1.2  2005/02/22 11:36:58  buchmann
+%Generate correctly documentations.
+%Add special flag to disable PAT tracing support.
+%
+%Revision 1.1  2005/01/20 09:15:12  buchmann
+%add following functions to sc_uint classes :
+%- operator []
+%- range (left,right)
+%
+%support to port dependency declarations.
+%print used precompiled options in verbose mode.
+%use pedantic flag.
+%add some rules to generate documentations.
+%
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\documentclass{report}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{a4wide}
+\usepackage{charter}
+\usepackage{helvet}
+\usepackage{graphicx}
+\usepackage{amsmath}
+\usepackage{moreverb}
+\usepackage{longtable}
+\usepackage{calc}
+\usepackage{alltt}
+\usepackage{makeidx}
+\usepackage{xspace}
+\renewcommand{\rmdefault}{phv}
+\renewcommand{\sfdefault}{phv}
+\renewcommand{\ttdefault}{pcr}
+\newcommand{\SYSTEMCASS}{\textsc{SystemCASS}\xspace}
+\newcommand{\SYSTEMC}{\textsc{SystemC}\xspace}
+\newcommand{\SOCLIB}{\textsc{SoCLIB}\xspace}
+
+\ifx\pdfoutput\undefined
+\else
+    \pdfpagewidth  21.0cm
+    \pdfpageheight 29.7cm
+\fi
+\usepackage{hyperref}
+
+\voffset   -1in
+\hoffset   -1in
+\headheight 0pt
+\headsep    0pt
+\topmargin     25mm
+\oddsidemargin 29mm
+
+\textwidth     150mm
+\textheight    240mm
+\flushbottom
+\sloppy
+
+\tabcolsep 4pt
+\makeatletter
+\renewcommand{\section}
+   {\@startsection
+   {section}%
+   {1}%
+   {0mm}%
+   {-.5\baselineskip}%
+   {0.5\baselineskip}%
+   {\newpage\flushleft\normalfont\Large\scshape}}
+
+\renewcommand{\subsection}
+   {\@startsection
+   {subsection}%
+   {1}%
+   {0mm}%
+   {-.5\baselineskip}%
+   {0.5\baselineskip}%
+   {\flushleft\normalfont\large\scshape}}
+
+\renewcommand{\@seccntformat}[1]{{\csname the#1\endcsname}.\hspace{0.25em}}
+\makeatother
+\renewcommand{\thesection}{\arabic{section}}
+
+\renewcommand{\listinglabel}[1]{\rlap{\footnotesize\rmfamily\the#1}\hskip2em}
+
+%%%%%%%%%%%%%%%%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{document}
+\thispagestyle{empty}
+~\vfill
+\begin{center}
+{\LARGE SystemCASS\\ SystemC Cycle Accurate System Simulator\\}
+\vfill
+\vfill
+%{\Large Documentation by Richard \textsc{Buchmann}}
+\vfill
+
+{\Large \today}
+
+\end{center}
+~\vfill
+
+%%%%%%%%%%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{\SYSTEMCASS Overview}
+\label{SystemCass-overview}
+
+\SYSTEMCASS is a simulator that executes models described in \textbf{SystemC}.
+Its goal is to provide cycle precise simulation of systems build with
+hardware and software components, in order to evaluate performances
+for \emph{i.e.} hardware/software partitioning, system validation, early
+software development.
+
+An example of system is present Figure~\ref{system}.
+
+\begin{figure}[hbtp]\center\leavevmode
+\includegraphics[width=.7\textwidth,angle=270]{figures/SystemeType}
+\caption{Typical embedded system build around VCI interfaces.}
+\label{system}
+\end{figure}
+
+The simulator simulates a \textbf{SystemC} netlist of predefined and/or
+user defined components.
+The components used to validate the methodology\cite{iceec04-buch} are a part of \SOCLIB library.
+Those models are VCI, bit and cycle accurate using the finite state machine with datapath modeling (Figure~\ref{Automate}).
+
+\begin{figure}[hbtp]\center\leavevmode
+\includegraphics[width=.6\linewidth]{figures/Automate}
+\caption{Finite State Machine Modeling}
+\label{Automate}
+\end{figure}
+
+SystemCASS is a SystemC subset including~:
+\begin{itemize}
+\item
+core class~: sc\_module, sc\_signal, sc\_in, sc\_out, sc\_inout...
+\item
+core functions~: sc\_start, sc\_stop, sc\_simulation\_time...
+\item
+basic data types~: sc\_i[u]nt, sc\_big[u]int...
+\end{itemize}
+
+But SystemCASS doesn't include standard channels, 
+methodology-specific channels (master/slave library, verification library) 
+and elementary channels (timer, mutex, semaphore, fifo, etc.).
+
+This cycle accurate engine gives higher simulation speed 
+more suitable for embedded software development,
+and architectural exploration.
+
+%%%%%%%%%%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Installation}
+
+Set \textbf{SYSTEMC} environment variable to the \textbf{SystemCASS} base directory.\\
+Change the current directory to \textbf{\$(SYSTEMC)/src}.\\
+Run the Makefile.\\
+
+The distribution is as follow~:
+\begin{itemize} \itemsep=-0.8ex
+\item
+\emph{src}~: 
+Source files
+\item
+\emph{includes}~:
+Header files
+\item
+\emph{lib-linux}~:
+Debug and optimized libraries for linux distribution
+\item
+\emph{docs}~:
+Documentation
+\item
+\emph{examples}~:
+
+\begin{itemize} \itemsep=-0.8ex
+\item
+\emph{soclib\_date04}~:
+An hardware timer raises some interruptions on 4 Mips R3000 periodically.
+Whenever an interruption occurs, the application running on each CPU prints a "hello" message to its own output window.
+\item
+\emph{soclib\_spg}~:
+An specific hardware configures a DMA. The DMA copies some data into the
+a simple RAM component.
+\end{itemize}
+
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ù
+\section{Simulator Execution}
+\label{debbuger-usage}
+To use SystemCASS simulator, you just need to include the SystemCASS headers
+and link to SystemCASS library.
+
+To debug, two ways are available~:
+\begin{itemize}
+\item
+link to the debug library and use a debugger.
+\item
+generate a trace file by using dedicated functions and use a VCD viewer.
+\end{itemize}
+
+%%%%%%%%%%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Simulator Compilation}
+
+Some macro definitions are available 
+to accelerate the simulation, 
+to check the netlist, variable dependancies, the scheduling
+to help on debugging
+and so on.
+
+You need to modify the Options.def file and rebuild the libraries.
+
+\subsection{Scheduling}
+
+The best performance you can reach using \SYSTEMCASS is obtained by using
+static scheduling.
+
+\SYSTEMCASS has two ways to compute the scheduling~:
+
+\begin{itemize}
+\item
+from the static sensitivity list (default)~:
+\SYSTEMC compatibility is good
+\item
+from the port dependency graph\cite{date04-mouchard} (USE\_PORT\_DEPENDENCY defined)~:
+The component designer need to declare the port dependancies in the
+constructor.
+The signal dependency graph is complete and then it has no cycle.
+At initialization step, the engine checks sensitivity list coherence.\\
+\it{Syntax~: outPort(inPort);}\\
+DUMP\_COMBINATIONAL\_LIST2DOT definition generates some DOT files to check
+dependancies.
+\end{itemize}
+
+The generated scheduling is written in code-XXX.cc file.
+KEEP\_GENERATED\_CODE definition allows to keep the file after simulation execution.\\
+
+PRINT\_SCHEDULE definition prints the scheduling at execution time.\\
+DUMP\_SCHEDULE\_STATS prints some miscellanous statistics.\\
+NO\_STATIC\_SCHEDULE disables the static scheduling.
+
+%%%%%%%%%%%%%%%
+%\part{Creating new components for \SYSTEMCASS}
+%%%%%%%%%%%%%%%
+
+%\section{Component description}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\bibliography{./SystemCASS}
+\bibliographystyle{unsrt}
+\end{document}
+
Index: /latest/src/alias.cc
===================================================================
--- /latest/src/alias.cc	(revision 1)
+++ /latest/src/alias.cc	(revision 1)
@@ -0,0 +1,52 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 alias.cc                          |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include"alias.h"
+#include<string>
+#include<stdarg.h>
+#include<stdio.h>
+#include<iostream>
+
+const char * alias ()
+{
+	static int i = 0;
+	char *buf = new char[4];	
+	buf[3] = '\0';
+	buf[2] = 'a' + i % 26;
+	buf[1] = 'a' + (i / 26) % 26;
+	buf[0] = 'a' + ((i / 26) / 26) % 26;
+	i++;	
+	return buf;
+}
+
Index: /latest/src/alias.h
===================================================================
--- /latest/src/alias.h	(revision 1)
+++ /latest/src/alias.h	(revision 1)
@@ -0,0 +1,17 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 alias.h                           |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef ALIAS_H
+#define ALIAS_H
+
+extern const char * alias();
+
+#endif
Index: /latest/src/assert.h
===================================================================
--- /latest/src/assert.h	(revision 1)
+++ /latest/src/assert.h	(revision 1)
@@ -0,0 +1,30 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 assert.h                          |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   26_05_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __ASSERT_H__
+#define __ASSERT_H__
+
+#if defined(DEBUG)
+/////////// DEBUG
+#define ASSERT(x) { if (!(x)) { \
+                      cerr << "ASSERT : " #x \
+                           << " in function '" << __FUNCTION__  \
+                           << "'\n"; exit (-1); \
+                    } \
+                  }
+
+#else
+/////////// _RELEASE (NOT DEBUG)
+#define ASSERT(x)
+
+#endif
+#endif
+
Index: /latest/src/bit2string.cc
===================================================================
--- /latest/src/bit2string.cc	(revision 1)
+++ /latest/src/bit2string.cc	(revision 1)
@@ -0,0 +1,113 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 bit2string.cc                     |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "bit2string.h"
+#include "sc_unit.h"
+#include <string>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <iostream>
+	
+using namespace std;
+
+namespace sc_core {
+
+static
+void bit2string_64 (char *buf, tab_t *val,int size)
+{
+	typedef sc_dt::s_uint_type<64>::uint_type data_type;
+  data_type tmp=*((data_type*)val);
+       	//cout << "tmp = " << tmp << "\n";	
+	buf[size]='\0';
+	for (int i=size-1; i>=0;--i) 
+	{
+		buf[i]=(tmp&1)?'1':'0';
+		tmp>>=1;
+	}
+#if 0
+  cout << buf << "\n";	
+#endif
+}
+
+static
+void bit2string_32 (char *buf, tab_t *val,int size)
+{
+	typedef sc_dt::s_uint_type<32>::uint_type data_type;
+  data_type tmp=*((data_type*)val);
+       	//cout << "tmp = " << tmp << "\n";	
+	buf[size]='\0';
+	for (int i=size-1; i>=0;--i) 
+	{
+		buf[i]=(tmp&1)?'1':'0';
+		tmp>>=1;
+	}
+#if 0
+  cout << buf << "\n";	
+#endif
+}
+
+void bit2string(char *buf, tab_t *val,int bit_number)
+{
+  if (bit_number > 32)
+  {
+    bit2string_64 (buf, (tab_t*)val, bit_number);
+    return;
+  } else if (bit_number > 16) 
+  {
+    bit2string_32 (buf, (tab_t*)val, bit_number);
+    return;
+  }
+	tab_t tmp=*((tab_t*)val);
+       	//cout << "tmp = " << tmp << "\n";	
+	buf[bit_number]='\0';
+	for (int i=bit_number-1; i>=0;--i) 
+	{
+		buf[i]=(tmp&1)?'1':'0';
+		tmp>>=1;
+	}
+	
+}
+
+char * strip (char * buf)
+{
+	int cpt=0;
+	while ( (buf[cpt] == '0') && (buf[cpt+1] != '\0') ) //tant que bit == 0
+		cpt++;
+	return (buf+cpt);
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/bit2string.h
===================================================================
--- /latest/src/bit2string.h	(revision 1)
+++ /latest/src/bit2string.h	(revision 1)
@@ -0,0 +1,24 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 bit2string.h                      |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef BIT2STRING_H
+#define BIT2STRING_H
+
+#include "internal.h"
+
+namespace sc_core {
+
+extern void  bit2string (char *buf,tab_t *val,int bit_number);
+extern char *strip      (char *bitstring);	
+
+} // end of sc_core namespace
+
+#endif
Index: /latest/src/casc.h
===================================================================
--- /latest/src/casc.h	(revision 1)
+++ /latest/src/casc.h	(revision 1)
@@ -0,0 +1,71 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 casc.h                            |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __CASC_H__
+#define __CASC_H__
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+#else
+#define EXTERN extern
+#endif
+
+EXTERN char unstable;
+EXTERN unsigned int pending_write_vector_nb;
+
+namespace sc_core {
+
+struct sc_module;
+
+inline void transition        (void);
+EXTERN void update            (void);
+inline void moore_generation  (void);
+EXTERN void mealy_generation  (void);
+EXTERN bool casc_check_version(const char*);
+}
+
+#ifdef SCHEDULING_BY_CASC
+#include <systemcass_version_ext.h>
+#include <fsm_rules.h>
+
+namespace sc_core {
+
+EXTERN void initialize        ()
+{
+  casc_check_version (SYSTEMC_VERSION);
+}
+
+EXTERN void simulate_1_cycle (void) 
+{
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = TRANSITION;
+#endif
+  transition ();
+  update     ();
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = GEN_MOORE;
+#endif
+  moore_generation ();
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = GEN_MEALY;
+#endif
+  mealy_generation (); 
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = STIMULI;
+#endif
+}
+} // end of sc_core namespace
+
+#endif
+
+
+#endif
+
Index: /latest/src/data_field.h
===================================================================
--- /latest/src/data_field.h	(revision 1)
+++ /latest/src/data_field.h	(revision 1)
@@ -0,0 +1,41 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 data_field.h                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   03_05_2006                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __DATA_FIELD_H__
+#define __DATA_FIELD_H__
+
+#include <endianness.h>
+
+template<int      WIDTH,
+         int      PADDING,
+         typename data_type>
+struct val_field { /* try to work with little endianess */
+#if defined(little_endian)
+  /* little endian */
+//  data_type pad:PADDING;
+  data_type valW:WIDTH;
+#elif defined(big_endian)
+  /* big endian */
+  data_type pad:PADDING;
+  data_type valW:WIDTH;
+#else
+#error You must define endianness.
+#endif
+};
+
+template<int      WIDTH,
+         typename data_type>
+struct val_field<WIDTH,0,data_type> {
+  data_type valW:WIDTH;
+};
+
+#endif
+
Index: /latest/src/dump_dot.cc
===================================================================
--- /latest/src/dump_dot.cc	(revision 1)
+++ /latest/src/dump_dot.cc	(revision 1)
@@ -0,0 +1,168 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  dump_dot.cc                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <fstream>
+#include "dump_dot.h"
+#include "sc_module.h"
+#include "sc_port.h"
+#include "simplify_string.h"
+#include "sc_ver.h" // sc_version
+
+typedef std::list<sc_port_base*> port_list_t;
+using namespace std;
+
+namespace sc_core {
+
+// Build a port list owned by the module mod
+static void
+get_out_port_list (const sc_module &mod, port_list_t &pl)
+{
+	port2module_t::iterator i;
+	for (i = port2module.begin (); i != port2module.end (); ++i) {
+		if ((i->second == &mod) && (i->first)) {
+			pl.push_back ((sc_port_base*)(i->first));
+		}
+	}
+}
+
+static void
+dump_dot (ofstream &o, method_process_t &m)
+{
+	port_list_t port_list;
+	get_out_port_list (*(m.module),port_list);
+	port_list_t::iterator op;
+	for (op = port_list.begin (); op != port_list.end (); ++op)
+  {
+		sensitivity_list_t::iterator ip;
+		for (ip = m.sensitivity_list.begin(); ip != m.sensitivity_list.end();++ip)
+		{	
+			if (is_clock (ip->get_interface()))
+				continue;
+			const char *in = get_name (ip->get_interface().get_pointer());
+			const char *out = (*op)->name ();
+			string s;
+			o << simplify_name(in,s); 
+      o << "->";
+      o << simplify_name(out,s);
+      o << ";\n";
+		}		
+	}
+}
+
+static void
+dump_all (ofstream &o, method_process_list_t &lm)
+{
+	method_process_list_t::iterator it;
+	for (it = lm.begin (); it != lm.end (); ++it)
+		dump_dot (o,**it);
+}
+
+static void
+dump_all (ofstream &o, const Vertex & v)
+{
+  if (v.arcs == NULL)
+	  return;
+  Arc *a;
+  for (a = v.arcs; a; a = a->next)
+	{
+    method_process_t *m  = (method_process_t*)v.data;
+    method_process_t *m2 = (method_process_t*)a->tip->data;
+		o << m->module->name ();
+	  o << " -> "
+		  << m2->module->name () 
+      << "\n";
+	}
+}
+
+static void
+dump_all (ofstream &o, Graph &g)
+{
+	Vertex *v;
+  for (v = g.vertices; v < g.vertices + g.n; v++) 
+	{
+		dump_all (o,*v);
+  }
+}
+
+bool
+SignalDependancyGraph2dot (const char *name, method_process_list_t &lm)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "// Signal dependency graph\n"
+             "// Generated by "
+          << sc_version () << "\n";
+	o << "strict digraph " << name << " {\n";
+	dump_all (o,lm);
+	o << "}\n";
+	o.close ();
+	return true;
+}
+
+
+
+bool
+FctDependancyGraph2dot (const char *name, Graph *g)
+{
+	if (!name)
+		return false;
+	if (!g)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "// Function dependency graph\n"
+             "// Generated by "
+          << sc_version () << "\n";
+	o << "digraph " << name << " {\n";
+	dump_all (o,*g);
+	o << "}\n";
+	o.close ();
+	return true;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/dump_dot.h
===================================================================
--- /latest/src/dump_dot.h	(revision 1)
+++ /latest/src/dump_dot.h	(revision 1)
@@ -0,0 +1,24 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  dump_dot.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef DUMP_DOT_H
+#define DUMP_DOT_H
+
+#include <list>
+#include "sc_fwd.h"
+#include "graph.h"
+
+namespace sc_core {
+extern bool SignalDependancyGraph2dot (const char *name, method_process_list_t &lm);
+extern bool FctDependancyGraph2dot (const char *name, Graph*);
+}
+
+#endif
Index: /latest/src/dump_used_env.cc
===================================================================
--- /latest/src/dump_used_env.cc	(revision 1)
+++ /latest/src/dump_used_env.cc	(revision 1)
@@ -0,0 +1,58 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  dump_used_env.cc                 |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   10_MAY_2005                     |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "dump_used_env.h"
+
+std::string
+sc_core::get_used_env()
+{
+  const char *compiler = getenv ("GCC");
+  const char *systemc_dir = getenv ("SYSTEMCASS");
+  const char *target_arch = getenv ("TARGET_ARCH");
+  if (compiler == NULL)
+    compiler = "undefined";
+  if (systemc_dir == NULL)
+    systemc_dir = "undefined";
+  if (target_arch == NULL)
+    target_arch = "undefined";
+  std::string used_env;
+  used_env +=   "GCC         = ";
+  used_env += compiler;
+  used_env += "\nSYSTEMCASS  = ";
+  used_env += systemc_dir;
+  used_env += "\nTARGET_ARCH = ";
+  used_env += target_arch;
+  return used_env;
+}
Index: /latest/src/dump_used_env.h
===================================================================
--- /latest/src/dump_used_env.h	(revision 1)
+++ /latest/src/dump_used_env.h	(revision 1)
@@ -0,0 +1,24 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  dump_used_env.h                  |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   10_MAY_2005                     |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef DUMP_USED_ENV_H
+#define DUMP_USED_ENV_H
+
+#include <string>
+
+namespace sc_core {
+
+extern std::string get_used_env ();
+
+}
+
+#endif
+
Index: /latest/src/dump_used_options.cc
===================================================================
--- /latest/src/dump_used_options.cc	(revision 1)
+++ /latest/src/dump_used_options.cc	(revision 1)
@@ -0,0 +1,91 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  dump_used_options.cc             |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   04_JAN_2005                     |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "dump_used_options.h"
+
+namespace sc_core {
+
+static 
+const char used_options[] =
+  "Used Options :\n"
+#ifdef USE_PORT_DEPENDENCY
+  "USE_PORT_DEPENDENCY, "
+#endif
+#ifdef DUMP_PORT_DEPENDENCY
+  "DUMP_PORT_DEPENDENCY, "
+#endif
+#ifdef DUMP_SCHEDULE_STATS
+  "DUMP_SCHEDULE_STATS, "
+#endif
+#ifdef NO_STATIC_SCHEDULE
+  "NO_STATIC_SCHEDULE, "
+#endif
+#ifdef KEEP_GENERATED_CODE
+  "KEEP_GENERATED_CODE, "
+#endif
+#ifdef DUMP_COMBINATIONAL_LIST2DOT
+  "DUMP_COMBINATIONAL_LIST2DOT, "
+#endif
+#ifdef PRINT_SCHEDULE
+  "PRINT_SCHEDULE, "
+#endif
+#ifdef DUMP_STAGE
+  "DUMP_STAGE, "
+#endif
+#ifdef CHECK_FSM_RULES     
+  "CHECK_FSM_RULES, "
+#endif
+#ifdef COMPIL_DEBUG  
+  "COMPIL_DEBUG,"       
+#endif
+#ifdef DEBUG
+  "DEBUG, "          
+#endif
+#ifdef UINT64              
+  "UINT64, "
+#endif
+#ifdef INIT_SIGNALS_TO_ZERO
+  "INIT_SIGNALS_TO_ZERO, "
+#endif
+  "...";
+
+const char*
+get_used_options()
+{
+    return used_options;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/dump_used_options.h
===================================================================
--- /latest/src/dump_used_options.h	(revision 1)
+++ /latest/src/dump_used_options.h	(revision 1)
@@ -0,0 +1,22 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  dump_used_options.h              |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   04_JAN_2005                     |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef DUMP_USED_OPTIONS_H
+#define DUMP_USED_OPTIONS_H
+
+namespace sc_core {
+
+extern const char *get_used_options ();
+
+}
+
+#endif
+
Index: /latest/src/entity.cc
===================================================================
--- /latest/src/entity.cc	(revision 1)
+++ /latest/src/entity.cc	(revision 1)
@@ -0,0 +1,671 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   entity.cc                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include<iomanip>
+#include<list>
+#include<map>
+#include<vector>
+
+#include"assert.h"
+#include"entity.h"
+#include"sc_port.h"
+#include"sc_signal.h"
+#include"sc_module.h"
+
+using namespace std;
+
+namespace sc_core {
+  equi_list_t equi_list;
+  equi_table_t equi_table = NULL;
+
+  ostream& operator << (ostream &, const entity &);
+  ostream& operator << (ostream &, const equi_t &);
+
+  struct predic4entity2equi_t_t
+  {
+    bool operator()(const entity &e1, const entity &e2) const
+    {
+      return e1.interface < e2.interface;
+    }
+  };
+
+  typedef std::map<entity,equi_list_t::iterator,predic4entity2equi_t_t> entity2equi_it_t;
+
+  ostream& operator << (ostream& o, const entity2equi_it_t &m)
+  {
+    entity2equi_it_t::const_iterator i;
+    for (i = m.begin(); i != m.end(); ++i)
+    {
+      o << (i->first) << " : " << *(i->second) << "\n";
+    }
+    return o;
+  }
+  entity2equi_it_t equi_map;
+	
+  const equi_list_t& get_equi_list ()
+	{
+    return equi_list;
+  }
+
+  unsigned int
+  max (unsigned int a, unsigned int b)
+  {
+  	return (a > b)?a:b;
+  }
+
+  static
+  int get_signal_table_size (const equi_list_t &e)
+  {
+		// bug fix : remove the 0x0 equi from the list
+    equi_list_t::const_iterator i;
+    int capacity = 0;
+    for (i = e.begin (); i != e.end (); ++i) {
+//cerr << i->begin()->object->name ();
+      const entity &ent = *(i->begin());
+      int     data_size = ent.data_size_in_bytes();
+      int     number_of_part = ((data_size - 1) / sizeof(tab_t)) + 1;
+      capacity += number_of_part;
+    }
+    return capacity;
+  }
+
+  int get_signal_table_size ()
+  {
+    return get_signal_table_size (equi_list);
+  }
+
+	sc_port_base*
+	get_out_port (const equi_t &eq)
+	{
+		equi_t::const_iterator i;
+		for (i = eq.begin (); i != eq.end (); ++i) {
+			const char *type = i->kind ();
+			if ((type == sc_core::sc_out_string)||(type == sc_core::sc_inout_string))
+				return i->port;
+		}
+		/*
+		cerr << "Internal error : can't find out port in "
+			<< eq << ".\n";
+		exit(32);
+		*/
+		return NULL;
+	}
+	
+	static
+	sc_port_base*
+	get_localvar (equi_t &eq)
+	{
+		equi_t::iterator i;
+		for (i = eq.begin (); i != eq.end (); ++i) {
+			const char *type = i->kind ();
+			if (strcmp (type, "sc_localvar") == 0)
+				return i->port;
+		}
+		return NULL;
+	}
+
+	static
+	sc_port_base*
+	get_signal (equi_t &eq)
+	{
+		equi_t::iterator i;
+		for (i = eq.begin (); i != eq.end (); ++i) {
+			const char *type = i->kind ();
+			if (strcmp (type, "sc_signal") == 0)
+				return i->port;
+		}
+		return NULL;
+	}
+
+  equi_t& 
+  get_equi (const sc_interface &i)
+	{
+		return get_equi (i.get_pointer ());
+	}
+
+  struct predic4tab_t2equi_t_t
+  {
+    bool operator()(const tab_t *t1, const tab_t *t2) const
+    {
+      return t1 < t2;
+    }
+  };
+
+#define get_equi_SPEEDUP
+  equi_t& 
+  get_equi (const tab_t *pointer)
+	{
+    // result variable
+		equi_list_t::iterator i;
+#if defined(get_equi_SPEEDUP)
+    typedef std::map<const tab_t *,equi_list_t::iterator,predic4tab_t2equi_t_t> tab_t2equi_it_t;
+    static tab_t2equi_it_t tab2equi_map;
+    ASSERT(pointer != NULL);
+
+    // boost
+    tab_t2equi_it_t::/*const_*/iterator it = tab2equi_map.find (pointer);
+    if (it != tab2equi_map.end ())
+    {
+      i = it->second;
+      return *i;
+    }
+#endif
+    //
+		for (i = equi_list.begin (); i != equi_list.end (); ++i) {
+      const equi_t::iterator &j = i->begin();
+      const entity       &e = *j;
+      const sc_interface *f = e.interface;
+      const tab_t        *p = f->get_pointer ();
+			if (p == pointer)
+      {
+#if defined(get_equi_SPEEDUP)
+        tab2equi_map[pointer] = i;
+#endif
+				return *i;
+      }
+		}
+		cerr << "Internal error : get_equi(" << pointer << ")\n";		
+		exit (11);
+	}
+#undef get_equi_SPEEDUP
+
+  bool
+  has_equi (/*const*/ sc_port_base &port)
+	{
+    entity e(port);
+    entity2equi_it_t::/*const_*/iterator it = equi_map.find (e);
+    if (it == equi_map.end ())
+    {
+       return false;
+    }
+    return true;
+  }
+
+	static
+	bool
+	is_register (const equi_t &eq)
+	{
+		return eq.size () == 1;
+	}
+	
+	static 
+	int 
+	count_level (const char *s, char c)
+	{
+		int i;
+		int counter = 0;
+		for (i = 0; s[i] != '\0'; ++i) {
+			if (s[i] == c)
+				++counter;
+		}
+		return counter;
+	}
+	
+	const char* 
+  get_name (const equi_t& e)
+	{
+		equi_t::const_iterator top_iter = e.begin ();
+#ifdef DEBUG
+		if (top_iter == e.end ()) {
+			cerr << "Internal error : no signal in " << e << endl;
+			exit (25);
+		}
+		if (top_iter->object == NULL) {
+			cerr << "Internal error : no object bound to ";
+			cerr << *top_iter;
+			cerr << endl;
+			exit (26);
+		}
+		if (top_iter->object->name () == NULL) {
+			cerr << "Internal error : signal has no name.\n";
+			cerr << *top_iter;
+			cerr << endl;
+		}
+#endif
+		int top_level = count_level (top_iter->object->name (),'.');
+		equi_t::const_iterator i;
+		for (i = ++(e.begin ()); i != e.end (); ++i) {
+			int current_level = count_level (i->object->name (),'.');
+			if (current_level < top_level) {
+				top_iter = i;
+				top_level = current_level;
+			}
+		}
+#if 0
+		cerr << "get_name of " << e;
+		cerr << " return " << top_iter->object->name () << endl;
+#endif
+		return top_iter->object->name ();
+	}
+	
+	const char* 
+  get_name (const tab_t *pointer)
+	{
+		return get_name (get_equi (pointer));
+	}
+
+	static 
+  const sc_module& 
+  get_module (const string &s)
+	{
+	  instances_set_t::iterator i;
+  	for (i = instances_set.begin (); i != instances_set.end (); ++i) {
+    	if (strcmp ((*i)->name (), s.c_str ()) == 0)
+				return **i;
+		}
+		cerr << "Internal error : get_module\n";
+		exit (27);
+	}
+		
+  template<typename T> static 
+	equi_list_t::iterator get_equi (T &e)
+  {
+    entity2equi_it_t::iterator it = equi_map.find (entity(e));
+    if (it == equi_map.end())
+    {
+//      cerr << "Internal error : get_equi (T &)";
+      return equi_list.end ();         
+    }
+    return it->second;
+  }
+
+  template<typename T> static
+  void 
+  add_equi (equi_list_t::iterator &x, T &y)
+  {
+    entity e(y);
+    x->push_back (e);
+    equi_map[e] = x;
+  }
+ 
+  template<typename T> static
+  equi_list_t::iterator 
+  new_equi (T &x) /* parameter is not 'const' because we need to modify pointer port/signal at end of elaboration step */
+  {
+    equi_list_t::iterator it = equi_list.insert (equi_list.begin (),equi_t(1,entity(x)));
+    equi_map[entity(x)] = it;
+    return it;
+  }
+
+  // sort by number of connected ports	bound to the signal
+	static
+	int 
+  operator<(const equi_t &e1, const equi_t &e2) 
+	{ 
+		return (e1.size() < e2.size ());
+	}
+
+	// sort by data size
+/*	
+	int operator<(const equi_t &e1, const equi_t &e2) 
+	{ 
+		return (e1.begin()->data_size () < e2.begin()->data_size ());
+	}
+*/	
+	// random sort
+/*	
+	int operator<(const equi_t &e1, const equi_t &e2) 
+	{ 
+	typedef std::map<const equi_t*,int> m_t;
+	static m_t m;
+		if (m[&e1] == 0)
+			m[&e1] = rand ();
+		if (m[&e2] == 0)
+			m[&e2] = rand ();
+		return m[&e1] < m[&e2]; 
+	}
+*/
+  void sort_equi_list ()
+  {
+		//load ();
+    equi_list.sort ();
+    //equi_list.reverse ();
+	}
+	
+#if defined(DUMP_SIGNALS_STATS)
+	static unsigned int equi_real_size;
+#endif
+
+  unsigned int 
+  get_sizeof_signals_table ()
+  {
+    equi_list_t::iterator i;
+    int table_size = 0;
+		//cerr << "external table includes :\n";
+    for (i = equi_list.begin (); i != equi_list.end (); ++i) {
+			if (get_out_port (*i))
+				continue;
+			if (get_signal (*i))
+				continue;
+			//cerr << get_name (*i) << " ";
+      const entity &ent = *(i->begin());
+      int     data_size = ent.data_size_in_bytes();
+      int     number_of_part = ((data_size - 1) / sizeof(tab_t)) + 1;
+			table_size += number_of_part;
+		}
+    return table_size;
+  }
+
+  void 
+  create_signals_table ()
+  {
+    if (dump_stage)
+  		cerr << "Allocating signals table.\n";
+		//cerr << "\n";
+    unsigned int table_size = get_sizeof_signals_table ();
+		equi_table = new tab_t[table_size]; //(0xCD);
+#if defined(DUMP_SIGNALS_STATS)
+		equi_real_size = table_size;
+#endif
+#if defined(INIT_SIGNALS_TO_ZERO)
+		memset (equi_table, 0, sizeof (tab_t) * table_size);
+#else
+		memset (equi_table, 0xCD, sizeof (tab_t) * table_size);		
+#endif
+  }
+
+	static
+  void 
+  bind_equi_to_table (equi_t &e, tab_t * const pointer)
+  {
+    ASSERT(pointer != NULL);
+    equi_t::iterator i;
+    for (i = e.begin (); i != e.end (); ++i) {
+      sc_interface *const inter = i->interface;
+      inter->set_pointer (pointer);
+      // We can't initialize data to zero there 
+      // because we can't write the right amount of bits.
+      // It may produce some segmentation fault errors.
+      // The pointer is aligned to 32 bits.
+    }
+  }
+  
+  void 
+  bind_to_table ()
+  {
+    if (dump_stage)
+  		cerr << "Binding ports/signals to the table.\n";
+    equi_list_t::iterator i;
+    int index = 0;
+    for (i = equi_list.begin (); i != equi_list.end (); ++i) 		{
+			sc_interface *out = get_out_port (*i);
+			if (out) {
+				bind_equi_to_table (*i, out->get_pointer ());
+			} else {
+				sc_interface *reg = get_signal (*i);
+				if (reg == NULL)
+          reg = get_localvar (*i);
+			 	if (reg) {
+          bind_equi_to_table (*i, reg->get_pointer ());
+				} else {
+	      	bind_equi_to_table (*i, &(equi_table[index]));
+				  index += (i->begin()->data_size_in_bytes() - 1) / sizeof(tab_t) + 1;
+				}
+			}
+    }
+  }
+
+  ostream& 
+  operator << (ostream &o, const entity &e)
+  {
+#if 0
+    o << "entity (";
+    if (e.object)
+      o << e.object->name ();
+    else
+      o << "no object";
+    if (e.interface)
+      o << ", pointer = 0x" << hex << e.interface->get_pointer ();
+    else
+      o << ", no interface";
+    o << ")";
+#else
+   ASSERT(e.object != NULL); 
+   o << e.object->name ();
+#endif
+    return o;
+  }
+  
+  ostream& 
+  operator << (ostream &o, const equi_t &e)
+  {
+    bool nb = 0;
+    equi_t::const_iterator i;
+    for (i = e.begin (); i != e.end (); ++i) {
+      const entity &ity = *i;
+      o << ((nb++)?" = ":"") << ity;
+    }	  
+    return o;
+  }
+  
+  void 
+  print_table (ostream &o)
+  {
+    o << "Signal list\n"
+      << "-----------\n";
+    equi_list_t::const_iterator i;
+    for (i = equi_list.begin (); i != equi_list.end (); ++i) {
+      const equi_t &eq = *i;
+#if 0
+      o << i->begin()->interface->get_pointer () << " : ";
+	    o << (*i);
+	    o << "\n";
+#else
+      o << "(" << get_name (eq) << ") <=> " << eq << ".\n";
+#endif
+    }
+	}
+
+	void
+  print_table_stats (ostream &o)
+  {
+#if defined(DUMP_SIGNALS_STATS)
+		int nb_reg = 0;
+		int nb_sig = 0;
+		int real_size = 0;
+		
+		// count
+    equi_list_t::const_iterator i;
+		int num;
+    for (num = 0, i = equi_list.begin (); i != equi_list.end (); ++num, ++i) {
+	    if (is_register (*i))
+				++nb_reg;
+			else
+				++nb_sig;
+    }
+		
+		// print results
+		o << "Statistics :\n";
+		o << "#registers : " << nb_reg << endl;
+		o << "#signals : " << nb_sig << endl;
+		o << "current table size : " << equi_real_size << endl;
+#endif
+	}
+
+#ifdef DUMP_SIGNAL_STATS
+typedef map<tab_t*,long long int> counter_t;
+static counter_t  counter;
+long long int unnecessary = 0;
+long long int total_assig = 0;
+#endif
+
+const char* 
+get_module_name (const equi_t &eq)
+{
+	if (!is_register (eq)) {
+	/*
+		cerr << "get_module_name doesn't work yet upon non-register.\n";
+		
+	const sc_port_base &port = *(i->port);
+	const sc_module &module = port.get_module ();
+	*/
+		return "top_level";
+	}
+	const entity &ent = *(eq.begin ());
+#ifdef DEBUG
+	if (ent.type != sc_core::entity::SIGNAL)
+		exit(28);
+#endif
+	// get module name from sc_signal used like a register
+	const char *sig_name = ent.object->name ();
+	const char *sep  = strchr (sig_name,'.');
+#ifdef DEBUG
+	if (sep == NULL) {
+		exit (30);
+	}
+#endif
+	int end_pos = sep - sig_name;
+	string module_name (sig_name, end_pos);
+	// can't return the char* pointer from string since it will be invalid.
+	return get_module (module_name).name ();
+}
+
+static 
+void 
+merge_equi (equi_list_t::iterator &x, equi_list_t::iterator &y)
+{
+  equi_t::iterator i;
+  equi_t &y2 = *y;
+  for (i = y2.begin(); i != y2.end(); ++i)
+  {
+    entity &e = *i;
+    equi_map[e] = x;
+  }
+
+  x->merge  (*y);
+  equi_list.erase (y);
+}
+ 
+// sort by data size
+#ifdef DATASIZE_SORT
+int 
+operator<(const equi_t &e1, const equi_t &e2) 
+{ 
+	return (e1.begin()->data_size () < e2.begin()->data_size ());
+}
+#endif
+
+// random sort
+#ifdef RANDOM_SORT
+int 
+operator<(const equi_t &e1, const equi_t &e2) 
+{ 
+typedef std::map<const equi_t*,int> m_t;
+static m_t m;
+	if (m[&e1] == 0)
+		m[&e1] = rand ();
+	if (m[&e2] == 0)
+		m[&e2] = rand ();
+	return m[&e1] < m[&e2]; 
+}
+#endif
+
+#if defined(DUMP_SIGNALS_STATS)
+static unsigned int equi_real_size;
+#endif
+
+void 
+bind (sc_signal_base &x)
+{
+#if 0 
+//defined(DEBUG)
+  equi_list_t::iterator x_equi = get_equi (x);
+  if ((x_equi != equi_list.end())) {
+    cerr << "Internal error : Signal already in the table\n";
+    return;
+  }
+#endif
+  new_equi (x);
+}
+
+void 
+bind (sc_port_base &x)
+{
+  new_equi (x);
+}
+
+template <typename T> static
+void 
+test_before_bind (sc_port_base& p1,T& p2)
+{
+	bool t1 = (p1.kind () != NULL);
+	bool t2 = (p2.kind () != NULL);
+	if (t1 && t2)
+		return;
+	if (t1 == true)
+		cerr << "Trying to bind '" << p1.name() << "' to an unknown type.\n";
+	else if (t2 == true)
+		cerr << "Trying to bind '" << p2.name() << "' to an unknown type.\n";
+	else
+		cerr << "Binding failed. Please check the netlist description.\n";
+	exit (20040525);
+}
+
+template <typename T> static
+void 
+tbind (sc_port_base &x,T &y)
+{
+//  ASSERT(x.get_pointer () != NULL); // x pointer may be NULL
+//  ASSERT(y.get_pointer () != NULL); // y pointer may be NULL
+  equi_list_t::iterator x_equi = get_equi (x);
+  equi_list_t::iterator y_equi = get_equi (y);
+  if ((x_equi != equi_list.end()) && (y_equi != equi_list.end())) {
+    // 2 equipotentials are equals
+    merge_equi (x_equi, y_equi);
+  } else if ((x_equi != equi_list.end())) {
+    // add y
+    add_equi (x_equi,y);
+  } else if ((y_equi != equi_list.end())) {
+    // add y
+    add_equi (y_equi,x);
+  } else {
+    // add a new equi
+    x_equi = new_equi (x);
+    add_equi (x_equi, y);
+  }
+}
+
+void 
+bind (sc_port_base& p1,sc_port_base& p2)
+{ test_before_bind (p1, p2); tbind (p1, p2); }
+
+void 
+bind (sc_port_base& p1,sc_signal_base& s1)
+{ test_before_bind (p1, s1); tbind (p1, s1); }
+
+
+} // end of sc_core namespace
+
Index: /latest/src/entity.h
===================================================================
--- /latest/src/entity.h	(revision 1)
+++ /latest/src/entity.h	(revision 1)
@@ -0,0 +1,76 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   entity.h                        |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __ENTITY_H__
+#define __ENTITY_H__
+
+#include<iostream>
+#include<list>
+#include"sc_fwd.h"
+#include"sc_port.h"
+#include"sc_signal.h"
+
+namespace sc_core {
+
+  // Entity class
+  struct entity {
+    enum { SIGNAL, PORT } type;
+    union { // port & signal aren't const because we need to modify
+            // some fields in elaboration step.
+      sc_port_base   *port;
+      sc_signal_base *signal;
+		};
+    sc_object      *object;
+    sc_interface   *interface;
+//    tab_t          *pointer;
+    bool operator == (const sc_port_base &port_)
+    { return (type == PORT) && (&port_ == port); }
+    bool operator == (const sc_signal_base &signal_)
+    { return (type == SIGNAL) && (&signal_ == signal); }
+    bool operator < (const entity &e_) const
+    { return (void*) this < (void*) &e_; } // casting to "unsigned int" causes warnings
+		const char *kind () const
+		{ return object->kind (); }
+		size_t      data_size_in_bytes () const
+		{ return interface->data_size_in_bytes (); }
+    entity (/*const*/ sc_port_base &port_)
+    { type = PORT; port = &port_; object = &port_; interface = &port_; }
+    entity (/*const*/ sc_signal_base &signal_)
+    { type = SIGNAL; signal = &signal_; object = &signal_; interface = &signal_; }
+  };
+
+  // list
+  typedef std::list<entity>   equi_t;
+  typedef std::list<equi_t>   equi_list_t;
+
+  // Miscellanous functions
+  equi_t&     get_equi        (const sc_interface &);
+	equi_t&     get_equi        (const tab_t *pointer);
+	bool        has_equi        (/*const*/ sc_port_base &);
+	equi_t&     merge_equi      (const tab_t *pointer);
+	sc_port_base *get_out_port  (const equi_t&);
+	const char *get_name        (const equi_t&);
+  const char* get_module_name (const equi_t &);
+  std::ostream& operator <<   (std::ostream &, const equi_t &);
+  std::ostream& operator <<   (std::ostream &, const entity &);
+
+  const equi_list_t &get_equi_list           ();
+  int                get_signal_table_size   ();
+
+  // Bind functions
+  void bind (sc_port_base& p1,sc_port_base& p2);
+  void bind (sc_port_base& p1,sc_signal_base& s1);
+
+} // end of sc_core namespace
+ 
+#endif /* __ENTITY_H__ */
+
Index: /latest/src/figures/Automate.fig
===================================================================
--- /latest/src/figures/Automate.fig	(revision 1)
+++ /latest/src/figures/Automate.fig	(revision 1)
@@ -0,0 +1,65 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+6 1725 1050 7650 6450
+1 2 0 1 0 0 51 -1 20 0.000 1 0.0000 4725 2400 1125 487 3600 2400 5850 2400
+1 2 0 1 0 7 50 -1 20 0.000 1 0.0000 4696 2349 1125 487 3571 2349 5821 2349
+1 2 0 1 0 7 50 -1 20 0.000 1 0.0000 3150 5137 1125 487 2025 5137 4275 5137
+1 2 0 1 0 7 50 -1 20 0.000 1 0.0000 6225 5137 1125 487 5100 5137 7350 5137
+1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 3150 1425 60 60 3150 1425 3210 1425
+1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 4650 1425 60 60 4650 1425 4710 1425
+1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 4650 5100 30 30 4650 5100 4680 5100
+1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 3150 6075 60 60 3150 6075 3210 6075
+1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 6225 6075 60 60 6225 6075 6285 6075
+1 2 0 1 0 0 51 -1 20 0.000 1 0.0000 6225 5175 1125 487 5100 5175 7350 5175
+1 2 0 1 0 0 51 -1 20 0.000 1 0.0000 3163 5176 1125 487 2038 5176 4288 5176
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 60.00 120.00
+	 4650 5100 5100 5100
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 60.00 120.00
+	 6225 5625 6225 6075
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 60.00 120.00
+	 3150 5625 3150 6075
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 60.00 120.00
+	 4650 1425 4650 1875
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3
+	1 1 1.00 60.00 120.00
+	 4650 3900 4650 5100 4275 5100
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 60.00 120.00
+	 3150 1425 3150 4650
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 60.00 120.00
+	 4650 2850 4650 3300
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 4
+	1 1 1.00 60.00 120.00
+	 5250 3600 6450 3600 6450 2325 5775 2325
+2 3 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 4
+	 4050 3300 4200 3600 4050 3900 4050 3300
+2 2 0 1 0 11 50 -1 20 0.000 0 0 -1 0 0 5
+	 4050 3300 5250 3300 5250 3900 4050 3900 4050 3300
+2 2 0 1 0 0 51 -1 20 0.000 0 0 -1 0 0 5
+	 4125 3375 5325 3375 5325 3975 4125 3975 4125 3375
+2 4 0 2 0 30 52 -1 20 0.000 0 0 7 0 0 5
+	 7575 6075 1800 6075 1800 1425 7575 1425 7575 6075
+4 0 0 50 -1 0 12 0.0000 4 135 825 4275 6450 OUTPUTS\001
+4 0 0 50 -1 0 12 0.0000 4 135 645 3525 1200 INPUTS\001
+4 0 0 50 -1 0 12 0.0000 4 135 660 2625 4950 MEALY\001
+4 0 0 50 -1 0 12 0.0000 4 135 1200 2625 5175 GENERATION\001
+4 0 0 50 -1 0 12 0.0000 4 135 930 2625 5400 FUNCTION\001
+4 0 0 50 -1 0 12 0.0000 4 135 1200 5775 5175 GENERATION\001
+4 0 0 50 -1 0 12 0.0000 4 135 675 5775 4950 MOORE\001
+4 0 0 50 -1 0 12 0.0000 4 135 930 5775 5400 FUNCTION\001
+4 0 0 50 -1 0 12 0.0000 4 135 1095 4200 2325 TRANSITION\001
+4 0 0 50 -1 0 12 0.0000 4 135 930 4200 2550 FUNCTION\001
+4 0 0 50 -1 0 12 0.0000 4 135 675 4350 3675 STATES\001
+-6
Index: /latest/src/figures/SystemeType.fig
===================================================================
--- /latest/src/figures/SystemeType.fig	(revision 1)
+++ /latest/src/figures/SystemeType.fig	(revision 1)
@@ -0,0 +1,82 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 3075 1800 3075 2325
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 4650 1800 4650 2325
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 6300 1800 6300 2325
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 7950 1800 7950 2325
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 7950 2775 7950 3300
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 6300 2775 6300 3300
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 4650 2775 4650 3300
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 3075 2775 3075 3300
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 1500 2775 1500 3300
+2 2 0 2 0 30 50 -1 20 0.000 0 0 -1 0 0 5
+	 2550 750 3675 750 3675 1800 2550 1800 2550 750
+2 2 0 2 0 30 50 -1 20 0.000 0 0 -1 0 0 5
+	 4125 750 5250 750 5250 1800 4125 1800 4125 750
+2 2 0 2 0 30 50 -1 20 0.000 0 0 -1 0 0 5
+	 5775 750 6900 750 6900 1800 5775 1800 5775 750
+2 2 0 2 0 2 50 -1 20 0.000 0 0 -1 0 0 5
+	 7425 750 8475 750 8475 1800 7425 1800 7425 750
+2 2 0 2 0 5 50 -1 20 0.000 0 0 -1 0 0 5
+	 7425 3300 8550 3300 8550 4350 7425 4350 7425 3300
+2 2 0 2 0 3 50 -1 20 0.000 0 0 -1 0 0 5
+	 5775 3300 6900 3300 6900 4350 5775 4350 5775 3300
+2 2 0 2 0 3 50 -1 20 0.000 0 0 -1 0 0 5
+	 4125 3300 5250 3300 5250 4350 4125 4350 4125 3300
+2 2 0 2 0 3 50 -1 20 0.000 0 0 -1 0 0 5
+	 2550 3300 3675 3300 3675 4350 2550 4350 2550 3300
+2 2 0 2 0 3 50 -1 20 0.000 0 0 -1 0 0 5
+	 975 3300 2100 3300 2100 4350 975 4350 975 3300
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 1500 1800 1500 2325
+2 4 0 2 0 31 50 -1 20 0.000 0 0 7 0 0 5
+	 9075 2775 600 2775 600 2325 9075 2325 9075 2775
+2 2 0 2 0 30 50 -1 20 0.000 0 0 -1 0 0 5
+	 975 750 2100 750 2100 1800 975 1800 975 750
+4 0 0 50 -1 2 20 0.0000 4 195 930 1050 1350 MIPS 0\001
+4 0 0 50 -1 2 20 0.0000 4 195 930 2625 1350 MIPS 1\001
+4 0 0 50 -1 2 20 0.0000 4 195 930 4200 1350 MIPS 2\001
+4 0 0 50 -1 2 20 0.0000 4 195 930 5850 1350 MIPS 3\001
+4 0 0 50 -1 2 20 0.0000 4 195 690 7575 1350 RAM\001
+4 0 0 50 -1 2 20 0.0000 4 195 1740 3600 2625 MicroNetwork\001
+4 0 0 50 -1 2 20 0.0000 4 195 975 7500 3900 TIMER\001
+4 0 0 50 -1 2 20 0.0000 4 195 810 5925 3900 TTY 3\001
+4 0 0 50 -1 2 20 0.0000 4 195 810 4275 3900 TTY 2\001
+4 0 0 50 -1 2 20 0.0000 4 195 810 2700 3900 TTY 1\001
+4 0 0 50 -1 2 20 0.0000 4 195 810 1125 3900 TTY 0\001
Index: /latest/src/fsm_rules.h
===================================================================
--- /latest/src/fsm_rules.h	(revision 1)
+++ /latest/src/fsm_rules.h	(revision 1)
@@ -0,0 +1,30 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 fsm_rules.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   10_05_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __FSM_RULES_H__
+#define __FSM_RULES_H__
+
+#ifdef CHECK_FSM_RULES
+
+namespace sc_core {
+
+typedef enum { TRANSITION, GEN_MOORE, GEN_MEALY, STIMULI, ELABORATION} casc_fsm_step_t;
+extern casc_fsm_step_t casc_fsm_step;
+
+inline const char *get_step_name   () 
+{ const char *s[] = {"TRANSITION", "MOORE GENERATION", "MEALY GENERATION", "SIMULATION LOOP", "ELABORATION"}; return s[casc_fsm_step]; }
+
+} // end of sc_core namespace
+
+#endif
+
+#endif
+
Index: /latest/src/gen_code.cc
===================================================================
--- /latest/src/gen_code.cc	(revision 1)
+++ /latest/src/gen_code.cc	(revision 1)
@@ -0,0 +1,676 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 gen_code.cc                       |
+|                                                             |
+| Author  :                 Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<iostream>
+#include<fstream>
+
+#include"internal.h"
+#include"gen_code.h"
+#include"sc_module.h"
+#include"sc_ver.h"
+#include"process_dependency.h"
+
+#ifdef CHECK_FSM_RULES
+#define fsm_check_flag "-DCHECK_FSM_RULES"
+#else
+#define fsm_check_flag
+#endif
+
+#define casc_cflags CFLAGS " " fsm_check_flag
+
+#if defined(darwin)
+#define macosx
+#endif
+
+using namespace std;
+
+namespace sc_core {
+
+static void PrintCall(std::ostream&, const method_process_t &);
+static void open_temp(std::ofstream&, char *);
+typedef void (*CASC_ENTRY_FUNC) (void *);
+typedef union { unsigned long long int integer; SC_ENTRY_FUNC pmf; CASC_ENTRY_FUNC pf; } fct;
+  
+
+static
+ostream& operator << (ostream &o, const SC_ENTRY_FUNC &f)
+{
+	register fct p;
+	p.pmf = f;
+	return o << "0x" << hex << p.integer << "ULL";
+}
+
+static 
+void
+PrintCall         (std::ostream           &o,
+                   const method_process_t &m)
+{
+  SC_ENTRY_FUNC func	= m.func;
+  if (print_schedule)
+    o << "    fprintf(stderr,\"evaluation de "
+	  	<< m.module->name() << "->" << m.name << "()\\n\");\n";
+  o << " p.integer = " << func << ";\n";
+#if CPP_CALL
+  o << " (((sc_module*)(" << m.module << "))->*(p.pmf)) (); /* " 
+		<< m.module->name () << "->" << m.name << "() */\n";
+#else
+  o << " p.pf((void *)" 
+	  << m.module << "); /* " 
+		<< m.module->name () << "->" << m.name << "() */\n";
+#endif
+}
+
+static
+bool
+is_exist (const char *temp)
+{
+#if 0
+  cerr << "testing " << temp << "\n";
+#endif
+  ifstream o;
+  o.open (temp,ios::in);
+  if (o.is_open () == false)
+    return false;
+#if 0
+  cerr << "opened\n";
+  cerr << "peek : " << (int) o.peek() << endl;
+#endif
+  if (o.peek () == -1)
+    return false;
+  return true;
+}
+
+static 
+void
+open_temp          (ofstream &o,
+		                char     *temp)
+{
+/*
+	srand (time (NULL));
+		int r = rand () % 1000;
+*/
+  pid_t pid = getpid();
+  int r = -1;
+	do {
+		sprintf (temp, "%s/scheduling-%d-%x.cc", temporary_dir, pid, ++r);
+  } while (is_exist (temp));
+
+  o.open (temp,ios::out);
+	if (o.is_open () == false)
+  {
+		cerr << "Error : Unable to open a file to write scheduling code.\n";
+    exit (30032005);
+  }
+
+#ifdef DEBUG
+  cerr << "opened temporary filename : " << temp << "\n";
+#endif
+  
+  sprintf (temp, "scheduling-%d-%x", pid, r++);
+}
+
+static
+char *
+gen_transition (ofstream              &o,
+                method_process_list_t &transition_func_list)
+{
+	// transitions
+  o << "\ninline void transition(void)\n{\n";
+  if (transition_func_list.empty () == false) {
+    o << " /* fonctions de transition */\n"
+			<< " register fct p;\n";
+  	method_process_list_t::iterator mm;
+    for( mm = transition_func_list.begin(); mm != transition_func_list.end(); ++mm)
+    {
+      PrintCall (o, **mm);
+    }
+	}
+  o << "}\n";
+}
+
+static
+char *
+gen_moore (ofstream              &o,
+           method_process_list_t &moore_func_list)
+{
+	// Moore generations (sequential functions)
+  o << "\ninline void moore_generation (void)\n{\n";
+	if (moore_func_list.empty () == false) {
+		o << "  /* fonctions de generation de Moore */\n"
+		  << " register fct p;\n";
+  	method_process_list_t::reverse_iterator mm;
+    for( mm = moore_func_list.rbegin(); mm != moore_func_list.rend(); ++mm)
+    {
+      PrintCall (o, **mm);
+    }
+  }
+  o << " \n}\n";
+}
+
+static
+char *
+gen_mealy (ofstream                &o,
+           strong_component_list_t &strongcomponents)
+{
+	// Mealy generations (combinational functions only)
+  o << "\nextern void mealy_generation (void)\n{\n";
+	if (strongcomponents.empty ())
+    return NULL;
+ 	o << "  register fct p;\n"
+	  << "\n\n  /* fonctions de mealy */\n";
+#ifdef NO_STATIC_SCHEDULE
+  o << "\n  do {\n    unstable = 0;\n";
+#endif
+  strong_component_list_t::iterator ss;
+  for ( ss = strongcomponents.begin(); ss != strongcomponents.end(); ++ss) {
+    if ( (*ss)->size() == 1) {
+      /* un seul element dans le strong component */
+			method_process_t *m = (method_process_t*)(*((*ss)->begin ()));
+      PrintCall (o, *m);
+      continue;
+    } else {
+      /* plusieurs elements dans le strong component */
+#ifndef NO_STATIC_SCHEDULE
+      o << "\n  do {\n    unstable = 0;\n";
+#endif
+      component_list_t::reverse_iterator rev_mm;
+      for( rev_mm = (*ss)->rbegin(); rev_mm != (*ss)->rend(); ++rev_mm) {
+				method_process_t *m = (method_process_t*) *rev_mm;
+        PrintCall (o, *m);
+      }
+#ifndef NO_STATIC_SCHEDULE
+      o << "  } while ( unstable );\n\n";
+#endif
+    }
+  }
+#ifdef NO_STATIC_SCHEDULE
+  o << "  } while ( unstable );\n\n";
+#else
+  o << "\tunstable = 0;\n";
+#endif
+}
+
+static
+char *
+gen_mealy (ofstream                &o,
+           ProcessDependencyList   &mealy_func_list)
+{
+	// Mealy generations (combinational functions only)
+  o << "\nextern void mealy_generation (void)\n{\n";
+  o << "  register fct p;\n"
+	  << "\n\n  /* fonctions de mealy */\n";
+	ProcessDependencyList::iterator it;
+	for (it = mealy_func_list.begin(); it != mealy_func_list.end(); ++it)
+	{
+		const method_process_t *m = *it;
+	  PrintCall (o, *m);
+	}
+}
+
+char *
+gen_scheduling_code_for_dynamic_link (
+               method_process_list_t           &transition_func_list,
+               method_process_list_t           &moore_func_list,
+               strong_component_list_t         &strongcomponents)
+{
+  if (dump_stage)
+    cerr << "Generating C code for scheduling...\n";
+
+	// open temporary file
+	ofstream o;
+  char base_name[PATH_MAX];
+	open_temp (o, base_name);
+ 
+	if (! o.good ()) {
+    perror("scheduling: open file\n");
+    exit(-1);
+  }
+
+  o << "// generated by " << sc_version () << endl
+		<< "#include<casc.h>\n\n"
+		<< "#include<stdio.h>\n\n"
+//		<< "#include<iostream>\n\n"
+		<< "namespace sc_core {\n"
+    << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n"
+		<< " typedef void (*CASC_ENTRY_FUNC)(void *);\n";
+  const char *pmf_type = (sizeof (SC_ENTRY_FUNC) == 4)?
+                         // G4 pointer-to-member-function style
+                         "unsigned long int": 
+                         // PC pointer-to-member-function style
+                         "unsigned long long int";
+  o << " typedef union { " 
+    << pmf_type 
+    << " integer; SC_ENTRY_FUNC pmf; CASC_ENTRY_FUNC pf; } fct;\n"; 
+	
+	gen_transition (o, transition_func_list);	
+	gen_moore      (o, moore_func_list);	
+	gen_mealy      (o, strongcomponents);
+
+  o << " \n}\n";
+  o << "\n} // end of sc_core namespace\n";
+ 
+  o.flush ();
+	o.close ();
+
+	// add "cc" extension
+  char file_name[PATH_MAX];
+  strncpy(file_name, base_name, PATH_MAX);
+  file_name[strlen (base_name)] = '\0';
+  strcat(file_name, ".cc");
+  rename (base_name, file_name);
+  
+  if (edit_schedule)
+    run_schedule_editor (file_name);
+  
+  if (dump_stage)
+    cerr << "Generating C code for scheduling done.\n";
+
+  return strdup(base_name);
+}
+
+char *
+gen_scheduling_code_for_dynamic_link   (
+            method_process_list_t &transition_func_list,
+            method_process_list_t &moore_func_list,
+            ProcessDependencyList &mealy_func_list)
+{
+  if (dump_stage)
+    cerr << "Generating C code for scheduling...\n";
+
+	// open temporary file
+	ofstream o;
+  char base_name[PATH_MAX];
+	open_temp (o, base_name);
+ 
+	if (! o.good ()) {
+    perror("scheduling: open file\n");
+    exit(-1);
+  }
+
+  o << "// generated by " << sc_version () << endl
+		<< "#include<casc.h>\n\n"
+		<< "#include<stdio.h>\n\n"
+//		<< "#include<iostream>\n\n"
+		<< "namespace sc_core {\n"
+    << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n"
+		<< " typedef void (*CASC_ENTRY_FUNC)(void *);\n"
+    << " typedef union { unsigned long long int integer; SC_ENTRY_FUNC pmf; CASC_ENTRY_FUNC pf; } fct;\n"; 
+	
+	gen_transition (o, transition_func_list);	
+	gen_moore      (o, moore_func_list);	
+	gen_mealy      (o, mealy_func_list);
+
+  o << "\n}\n";
+  o << "\n} // end of sc_core namespace\n";
+ 
+  o.flush ();
+	o.close ();
+  
+	// add "cc" extension
+  char file_name[PATH_MAX];
+  strncpy(file_name, base_name, PATH_MAX);
+  file_name[strlen (base_name)] = '\0';
+  strcat(file_name, ".cc");
+  rename (base_name, file_name);
+
+  if (edit_schedule)
+    run_schedule_editor (file_name);
+
+  if (dump_stage)
+    cerr << "Generating C code for scheduling done.\n";
+  
+  return strdup(base_name);
+}
+
+/* base_name est la base du nom du fichier C++
+ * casc_cflags est une string qui correspond à $(INCLUDE) d'un Makefile
+ */
+void 
+compile_code          (const char *base_name, 
+                       const char *casc_cflags2) 
+{
+  if (dump_stage) 
+    cerr << "Compiling C code for scheduling...\n";
+  char compil_str[512];
+  const char *compiler = getenv ("GCC");
+  const char *systemc_dir = getenv ("SYSTEMCASS");
+//  const char *target_arch = getenv ("TARGET_ARCH");
+	const char *default_compiler =
+#if CPP_CALL
+		"g++";
+#else
+		"gcc";
+#endif
+
+  compiler = (compiler == NULL)?default_compiler:compiler;
+	if (systemc_dir == NULL) {
+    systemc_dir = getenv ("SYSTEMC");
+    if (systemc_dir == NULL) {
+  		cerr << "Error : set SYSTEMCASS or SYSTEMC environnement variable "
+              "to the SYSTEMCASS directory.\n";
+	  	exit (-1);
+    }
+	}
+  //target_arch = (target_arch == NULL)?"":target_arch;
+  
+  char target_name[128];
+  char source_name[128];
+  sprintf (target_name, "%s.o", base_name);
+  sprintf (source_name, "%s.cc", base_name);
+  
+  if (keep_generated_code)
+  { 
+    char lg_cde[256];
+    sprintf (lg_cde, "mkdir -p %s", generated_files_dir);
+    system(lg_cde);
+    sprintf(lg_cde, "cp %s/%s %s/", 
+            temporary_dir, source_name, generated_files_dir);
+    if (dump_stage) 
+      cerr << "$ " << lg_cde << "\n";
+    system(lg_cde);
+    sprintf(lg_cde, "(cd %s ; indent %s)", 
+            generated_files_dir, source_name);
+    if (dump_stage) 
+      cerr << "$ " << lg_cde << "\n";
+    system(lg_cde);
+  }
+  /* ******* */
+  /* COMPILE */
+  /* ******* */
+#if defined(macosx)
+    sprintf(compil_str, 
+				"(cd %s ; %s %s -DSCHEDULING_BY_CASC -I%s/include -fno-common -dynamic -o %s -c %s)",
+        temporary_dir,
+			 	compiler, 
+				casc_cflags, 
+				systemc_dir, 
+				target_name,
+				source_name);
+//    sprintf(compil_str,""); 
+#elif defined(linux)
+    sprintf(compil_str, 
+				"(cd %s ; libtool --mode=compile %s %s -DSCHEDULING_BY_CASC -I%s/include -shared -o %s -c %s)",
+        temporary_dir,
+			 	compiler, 
+				casc_cflags, 
+				systemc_dir, 
+				target_name,
+				source_name);
+#else
+    sprintf(compil_str, 
+				"(cd %s ; %s %s -DSCHEDULING_BY_CASC -I%s/include -dynamiclib -o %s -c %s)",
+        temporary_dir,
+			 	compiler, 
+				casc_cflags, 
+				systemc_dir, 
+				target_name,
+				source_name);
+#endif
+
+  if (dump_stage) 
+    cerr << "Executing command : " << compil_str << "\n";
+  
+  if (system(compil_str)) {
+    perror("compil : system");
+    exit(-1);
+  }
+
+  /* **** */
+  /* LINK */
+  /* **** */
+  sprintf (target_name, "%s.so", base_name);
+
+#if defined(linux)
+  sprintf (source_name, "%s.lo", base_name);
+  sprintf(compil_str, "(cd %s ; pwd ; libtool --mode=link %s %s -shared -rdynamic -o %s %s)", /* -L. -L%s/lib-%s */ 
+	   temporary_dir, compiler, casc_cflags, /*systemc_dir, target_arch,*/ 
+     target_name, source_name);
+#else
+  sprintf (source_name, "%s.o", base_name);
+  sprintf(compil_str, "(cd %s ; pwd ; libtool -dynamic -o %s %s)", 
+	   temporary_dir, target_name, source_name);
+#endif
+
+  if (dump_stage) 
+    cerr << "Executing command : " << compil_str << "\n";
+
+  if (system(compil_str)) {
+    perror("compil : system");
+    exit(-1);
+  }
+
+ /* 
+  sprintf(compil_str, "(cd %s ; rm -f %s.o %s.lo)", 
+          temporary_dir, base_name, base_name);
+  if (dump_stage) 
+    cerr << "$ " << compil_str << "\n";
+*/
+
+  system(compil_str);
+  if (dump_stage) 
+    cerr << "Compiling done.\n";
+}
+
+/* ********************************
+ * Function for static scheduling
+ */
+struct function_call {
+  fct      *function;
+  void    **instance;
+  int       func_number;
+};
+static function_call pf[3];
+
+void
+get_function_call (function_call         &pf, 
+                   method_process_list_t &func_list)
+{
+  pf.func_number = func_list.size ();
+  pf.function = (fct*)   malloc (sizeof (fct)   * pf.func_number);
+  pf.instance = (void**) malloc (sizeof (void*) * pf.func_number);
+  method_process_list_t::iterator mm;
+  int i;
+  for (mm = func_list.begin(), i = 0; mm != func_list.end(); ++mm, ++i)
+  {
+    const method_process_t *mp = *mm;
+    pf.function[i].pmf = (mp->func);
+    pf.instance[i] = (void*)(mp->module);
+  }
+}
+
+void
+get_function_call (function_call &pf, 
+                   ProcessDependencyList &func_list)
+{
+  pf.func_number = func_list.size ();
+  pf.function = (fct*)   malloc (sizeof (fct)   * pf.func_number);
+  pf.instance = (void**) malloc (sizeof (void*) * pf.func_number);
+	ProcessDependencyList::iterator it;
+  int i;
+	for (i = 0, it = func_list.begin(); it != func_list.end(); ++it, ++i)
+	{
+		const method_process_t *mp = *it;
+    pf.function[i].pmf = (mp->func);
+    pf.instance[i] = (void*)(mp->module);
+  }
+}
+
+void
+gen_scheduling_code_for_static_func (
+            method_process_list_t &transition_func_list,
+            method_process_list_t &moore_func_list,
+            ProcessDependencyList &mealy_func_list)
+{
+  if (dump_stage)
+    cerr << "Generating scheduling...\n";
+
+  get_function_call (pf[0], transition_func_list);
+  get_function_call (pf[1], moore_func_list);
+  get_function_call (pf[2], mealy_func_list);
+
+  if (dump_stage)
+    cerr << "Generating scheduling done.\n";
+}
+
+void
+call_functions (function_call &fc)
+{
+  int n = fc.func_number;
+  int i;
+  for (i = 0; i < n; ++i)
+  {
+#if 0 //defined(DEBUG)
+    sc_module *m = (sc_module*)(fc.instance[i]);
+    cerr << m->name () << endl;
+#endif
+    fc.function[i].pf (fc.instance[i]);
+  }
+}
+
+void static_mealy_generation ()
+{
+  call_functions (pf[2]);
+}
+
+void static_simulate_1_cycle (void) 
+{
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = TRANSITION;
+#endif
+  call_functions (pf[0]); // transition
+  update     ();
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = GEN_MOORE;
+#endif
+  call_functions (pf[1]); // moore generation
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = GEN_MEALY;
+#endif
+  call_functions (pf[2]); // mealy generation
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = STIMULI;
+#endif
+}
+
+/* ***************************************
+ * Function for quasi static scheduling
+ */
+
+static method_process_list_t   func_list[2];
+static strong_component_list_t quasistatic_list;
+
+static 
+void
+Call         (const method_process_t &m)
+{
+  sc_module        *mod  = m.module;
+  SC_ENTRY_FUNC     func = m.func;
+//  CASC_ENTRY_FUNC   func = reinterpret_cast<CASC_ENTRY_FUNC> (m.func);
+  (mod->*func) ();
+}
+void quasistatic_mealy_generation ()
+{
+  strong_component_list_t::iterator ss;
+  for ( ss = quasistatic_list.begin(); ss != quasistatic_list.end(); ++ss) {
+    if ( (*ss)->size() == 1) {
+      /* un seul element dans le strong component */
+			method_process_t *m = (method_process_t*)(*((*ss)->begin ()));
+      Call (*m);
+      continue;
+    } else {
+      /* plusieurs elements dans le strong component */
+      do {
+        unstable = 0;
+        component_list_t::reverse_iterator rev_mm;
+        for( rev_mm = (*ss)->rbegin(); rev_mm != (*ss)->rend(); ++rev_mm) {
+		 	 	method_process_t *m = (method_process_t*) *rev_mm;
+          Call (*m);
+        }
+      } while ( unstable );
+    }
+  }
+}
+
+void quasistatic_simulate_1_cycle (void) 
+{
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = TRANSITION;
+#endif
+  method_process_list_t::iterator mm;
+  for( mm = func_list[0].begin(); mm != func_list[0].end(); ++mm)
+  {
+    method_process_t &m    = **mm;
+    Call (m);
+  }
+  update     ();
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = GEN_MOORE;
+#endif
+  for( mm = func_list[1].begin(); mm != func_list[1].end(); ++mm)
+  {
+    method_process_t &m    = **mm;
+    Call (m);
+  }
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = GEN_MEALY;
+#endif
+  quasistatic_mealy_generation ();
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = STIMULI;
+#endif
+}
+
+void
+gen_scheduling_code_for_quasistatic_func (
+            method_process_list_t   &transition_func_list,
+            method_process_list_t   &moore_func_list,
+            strong_component_list_t &mealy_func_list)
+{
+  if (dump_stage)
+    cerr << "Generating quasi static scheduling...\n";
+
+  func_list[0]     = transition_func_list;
+  func_list[1]     = moore_func_list;
+  quasistatic_list = mealy_func_list;
+
+  if (dump_stage)
+    cerr << "Generating quasi static scheduling done.\n";
+}
+} // end of sc_core namespace
+
+
Index: /latest/src/gen_code.h
===================================================================
--- /latest/src/gen_code.h	(revision 1)
+++ /latest/src/gen_code.h	(revision 1)
@@ -0,0 +1,152 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 gen_code.h                        |
+|                                                             |
+| Author  :                 Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __GEN_CODE_H__
+#define __GEN_CODE_H__
+
+#include"internal.h"
+#include"global_functions.h"
+#include"graph.h"
+#include"sc_port.h"
+#include"sc_trace.h"
+#include"process_dependency.h"
+
+//-------------------------------------------------------------------
+#ifdef __GNUC__
+#define INLINE __attribute__((always_inline))
+#else
+#define INLINE
+#endif
+
+//-------------------------------------------------------------------
+namespace sc_core {
+
+extern strong_component_list_t *strong;
+
+/* compile scheduling code to link dynamically later */
+extern void compile_code(const char *base_name, const char *cflags2 = "");
+
+/* generate a scheduling code */
+extern void  gen_scheduling_code_for_quasistatic_func(
+                      method_process_list_t   &transition_list,
+                      method_process_list_t   &moore_list,
+	                    strong_component_list_t &mealy_list);
+extern void  gen_scheduling_code_for_static_func(
+                      method_process_list_t   &transition_list,
+                      method_process_list_t   &moore_list,
+	                    ProcessDependencyList   &mealy_list);
+extern char *gen_scheduling_code_for_dynamic_link(
+                      method_process_list_t   &transition_list,
+                      method_process_list_t   &moore_list,
+	                    ProcessDependencyList   &mealy_list);
+extern char *gen_scheduling_code_for_dynamic_link(
+                      method_process_list_t   &transition_list,
+                      method_process_list_t   &moore_list,
+	                    strong_component_list_t &strongcomponents);
+
+/* function when any dynamic link is impossible */
+#ifdef __cplusplus
+#define EXTERN extern "C"
+#else
+#define EXTERN extern
+#endif
+
+EXTERN void static_simulate_1_cycle ();
+EXTERN void static_mealy_generation ();
+EXTERN void quasistatic_simulate_1_cycle ();
+EXTERN void quasistatic_mealy_generation ();
+
+/* internal functions */
+inline void switch_to_moore () INLINE;
+inline void internal_sc_cycle2 () INLINE;
+inline void internal_sc_cycle1 (int number_of_cycles) INLINE;
+inline void internal_sc_cycle0( double duration )  INLINE;
+
+/* ***************** */
+/* inlined functions */
+/* ***************** */
+
+inline void
+internal_sc_cycle2 ()
+{
+#ifdef DUMP_STAGE
+  std::cerr << "begin of cycle #" << sc_simulation_time () << "\n";
+#endif
+  func_simulate_1_cycle ();  
+  ++nb_cycles;
+#ifdef DUMP_STAGE
+  std::cerr << "end of cycle\n";
+#endif
+}
+
+inline void
+internal_sc_cycle1 (int number_of_cycles)
+{  
+	//while ((! have_to_stop) && (number_of_cycles != 0)) {
+	while (!((have_to_stop) | (number_of_cycles == 0))) {
+  	trace_all  (false);
+		internal_sc_cycle2 ();
+  	trace_all  (true);
+		number_of_cycles = (number_of_cycles<0)?number_of_cycles:number_of_cycles-1;
+  }
+}
+
+inline
+void 
+internal_sc_cycle0( double duration )  // in default time units
+{
+#ifdef DEBUG
+	// Check dynamic linkage
+  if ((func_combinationals == NULL) || (func_simulate_1_cycle == NULL)) {
+    std::cerr << "Main execution loop is not yet generated.\n";
+  }
+
+	if (duration < -1)
+		std::cerr << "Invalid duration.\n";
+#endif
+	
+  if (is_posted_write ()) {
+		// update posted value to external signals		
+#if 0
+		std::cerr << "update\n";
+#endif
+  	update ();
+#ifdef CHECK_FSM_RULES
+		casc_fsm_step = GEN_MEALY;
+#endif
+    func_combinationals ();
+  }
+	
+	internal_sc_cycle1 ((int)duration);
+
+  // don't need to do func_combinationals since 'unstable' flag is now false
+  if (is_posted_write ()) {
+    update ();
+#ifdef CHECK_FSM_RULES
+		casc_fsm_step = GEN_MEALY;
+#endif
+    func_combinationals ();
+  }
+}
+
+//-------------------------------------------------------------------
+
+// sc_cycle is for internal purpose only.
+// sc_cycle is deprecated since 1.0
+//extern void sc_cycle( double duration );  // in default time units
+
+/* time_unit is worth a cycle in every cases */
+//extern void sc_cycle( double duration, sc_time_unit time_unit );
+
+} // end of sc_core namespace
+
+#endif /* __GEN_CODE_H__ */
Index: /latest/src/global_functions.cc
===================================================================
--- /latest/src/global_functions.cc	(revision 1)
+++ /latest/src/global_functions.cc	(revision 1)
@@ -0,0 +1,442 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 global_functions.cc               |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Nicolas Pouillon                  |
+|                                                             |
+| Date    :                   21_09_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include<iostream>
+#include<dlfcn.h>
+#include"schedulers.h" // get_scheduling & run_schedule_editor
+#include"sc_module.h" // check_all_method_process
+#include"gen_code.h"  // gen_scheduling_code_for_dynamic_link & gen_scheduling_code_for_static_func
+#include"sc_clock_ext.h" // clock list
+#include"usage.h"
+#include"module_hierarchy2dot.h"
+#include"assert.h"
+
+using namespace std;
+
+namespace sc_core {
+
+const char *temporary_dir = "/tmp";
+const char *generated_files_dir = "./generated_by_systemcass";
+
+static usage_t usage;
+
+/* ***************************** */
+/* Dumping functions (for debug) */
+/* ***************************** */
+
+template <typename T>
+ostream& operator << (ostream &o, const vector<T*> &v)
+{
+  typename vector<T*>::const_iterator i;
+  for (i = v.begin(); i != v.end(); ++i) {
+    o << **i << " ";
+  }
+  return o;
+}
+
+/* ************ */
+/*  clock list  */
+/****************/
+
+typedef std::set<const sc_clock*> clock_list_t;
+
+ostream& 
+operator << (ostream &o,
+             const clock_list_t &cl)
+{
+  clock_list_t::const_iterator i;
+  for (i = cl.begin(); i != cl.end(); ++i) {
+    o << (*i)->name () << " ";
+  }
+  return o;
+}
+
+// clock list
+void 
+create_clock_list (clock_list_t  &c,
+                   const equi_list_t &el)
+{
+	equi_list_t::const_iterator i;
+	for (i = el.begin (); i != el.end(); ++i) {
+		equi_t::const_iterator j;
+		for (j = i->begin (); j != i->end (); ++j) {
+			if (j->kind () == sc_clock::kind_string)
+				c.insert ((const sc_clock*)j->object);
+	  }
+	}
+}
+
+/* ************ */
+/*  functions   */
+/****************/
+
+// function pointer to the simulation core (compiled and linked dynamically)
+evaluation_fct_t func_simulate_1_cycle = NULL;
+evaluation_fct_t func_combinationals = NULL;
+
+/* ************ */
+/* dynamic link */
+/* ************ */
+
+static void *handle = NULL;
+
+static
+void 
+link (const char *lib)
+{
+  // chargement du code de simulate_1_cycle
+  handle = dlopen(lib, RTLD_GLOBAL | RTLD_NOW);
+  //handle = dlopen(lib, RTLD_LAZY | RTLD_GLOBAL | RTLD_NOW);
+  
+  if (handle == NULL) {
+    const char *error = dlerror ();
+    if (error)
+      fprintf (stderr, "dlopen: %s\n",error);
+    fprintf (stderr, 
+             "Is there -rdynamic option into your command line ? "
+             "If not, please do it.\n");
+    exit(18);
+  }
+
+  union uni_fct_t {
+    evaluation_fct_t fct_type;
+    void            *dl_pointer_type;
+  };
+  uni_fct_t        temp;  
+  temp.dl_pointer_type = dlsym (handle,"initialize");
+  if (temp.dl_pointer_type == NULL) {
+    const char *error = dlerror ();
+    if (error)
+      fprintf (stderr, "dlsym: %s\n",error);
+    exit(19);
+  }
+  evaluation_fct_t func_initialize;
+  func_initialize = temp.fct_type;
+  func_initialize ();
+
+  temp.dl_pointer_type = dlsym (handle,"simulate_1_cycle");
+  if (temp.dl_pointer_type == NULL) {
+    const char *error = dlerror ();
+    if (error)
+      fprintf (stderr, "dlsym: %s\n",error);
+    exit(20);
+  }
+  func_simulate_1_cycle = temp.fct_type;
+  
+  temp.dl_pointer_type = dlsym (handle,"mealy_generation");
+  if (temp.dl_pointer_type == NULL) {
+    const char *error = dlerror ();
+    if (error)
+      fprintf (stderr, "dlsym: %s\n",error);
+    exit(21);
+  }  
+  func_combinationals = temp.fct_type;
+
+  /*
+   *
+   */
+  if (dump_stage)
+    cerr << "dynamic link done\n";
+}
+
+static
+void
+unlink ()
+{
+  if (handle)
+  {
+    if (dlclose (handle) != 0)
+      cerr << "Warning : dlclose returns an error.\n" 
+           << dlerror () << endl;
+    handle = NULL;
+  }
+}
+
+/* ************ */
+/* initializing */
+/* ************ */
+
+bool  already_initialized = false;
+
+static
+void
+use_static_func ()
+{
+  if (dump_stage)
+    cerr << "Using static functions to schedule SystemC processes.\n";
+  if (scheduling_method == CASS_SCHEDULING)
+  {
+    func_simulate_1_cycle = (evaluation_fct_t)sc_core::quasistatic_simulate_1_cycle;
+    func_combinationals   = (evaluation_fct_t)sc_core::quasistatic_mealy_generation;
+  } else {
+    func_simulate_1_cycle = (evaluation_fct_t)sc_core::static_simulate_1_cycle;
+    func_combinationals   = (evaluation_fct_t)sc_core::static_mealy_generation;
+  }
+}
+
+static
+void
+compile_and_link (const char *base_name)
+{
+  if (dump_stage)
+    cerr << "Using dynamically loaded functions to schedule SystemC processes.\n";
+  // compilation du code de simulate_1_cycle
+  compile_code(base_name);
+   
+  char lib_absolutepath[256]; 
+#if defined(darwin) //macosx)
+  sprintf(lib_absolutepath, "/tmp/%s.so", base_name);
+#elif defined(linux)
+  sprintf(lib_absolutepath, "/tmp/%s.so", base_name);
+#else
+  cerr << "ERROR\n"; exit (126);
+#endif
+  
+	link (lib_absolutepath);
+}
+
+static
+void 
+internal_sc_initialize (void) 
+{
+	sort_equi_list ();
+
+  check_all_method_process ();
+
+  if (dump_netlist_info)
+    cerr << "Module instance list\n"
+         << "--------------------\n" 
+         << instances_set << endl;
+  
+  /*
+   * Initialize the signals table
+   */
+  create_signals_table ();
+  bind_to_table ();
+  if (dump_netlist_info)
+  {
+    print_table (cerr);
+    cerr << endl;
+    print_table_stats (cerr);
+    cerr << endl;
+  }
+  // Init variables to be able to run combinational functions
+#ifdef CHECK_FSM_RULES
+	casc_fsm_step = STIMULI;
+#endif
+
+  pending_write_vector_capacity = get_signal_table_size ();
+#if 0
+  cerr << "pending_write_vector_capacity = " << pending_write_vector_capacity
+<< "\n";
+#endif
+  if (pending_write_vector_capacity == 0)
+    pending_write_vector = NULL;
+  else
+		pending_write_vector = (pending_write_vector_t) realloc (pending_write_vector, sizeof (pending_write) * pending_write_vector_capacity);
+	
+  // create the clock list
+	clock_list_t clock_list;
+  create_clock_list (clock_list, get_equi_list ());
+  if (dump_netlist_info)
+    cerr << "Clock list\n"
+         << "----------\n"
+         << clock_list << "\n\n";
+
+  // Check if a clock exists in the system
+  if (clock_list.empty ()) {
+    cerr << "System need a clock.\n"
+         << "Please define system clock using special type \"sc_clock\".\n";
+    exit (22);
+  }
+
+	// Check if any constructor wrote into registers
+	if (pending_write_vector_nb != 0)
+	{
+		cerr << "Error : Register/Signal writing is not allowed before sc_initialize.\n"
+			"Move initializations from constructors/sc_main to module reset sequences.\n";
+		// we are unable to dump register(s) name(s) 
+		// because the table binding is not yet completed.
+		exit (24);
+	}
+ 
+  string base_name = get_scheduling (scheduling_method);
+
+  if (dynamic_link_of_scheduling_code)
+    compile_and_link (base_name.c_str());
+  else
+    use_static_func ();
+  
+	pending_write_vector_nb = 0;
+ 
+  check_all_ports ();
+  usage.start ();
+  if (dump_stage)
+    cerr << "sc_initialize () done.\n";
+  already_initialized = true;
+}
+
+inline
+void
+check_and_initialize ()
+{
+  if (already_initialized == false) {
+#if defined(SYSTEMC_VERSION_1_0)
+		std::cerr << "Warning : call sc_initialize before executiong simulation.\n";
+#endif
+    internal_sc_initialize ();
+    if (dump_module_hierarchy)
+      module_hierarchy2dot (dump_module_hierarchy);
+    if (nosimulation)
+    {
+      exit (0);
+    }
+	}
+}
+
+void sc_initialize(void) 
+{
+  cerr << "Warning : 'sc_initialize' function is deprecated since SystemC 2.1.\n"; 
+  cerr << "Use 'sc_start(0)' instead.\n"; 
+  check_and_initialize ();
+}
+
+/* ********** */
+/* simulating */
+/* ********** */
+
+inline 
+void 
+sc_cycle( double duration)
+{
+  check_and_initialize ();
+  sc_core::internal_sc_cycle0(duration);
+}
+
+inline
+void 
+sc_cycle( double       duration,
+          sc_time_unit time_unit )
+{
+  check_and_initialize ();
+  sc_core::internal_sc_cycle0(duration);
+}
+
+void 
+sc_start(double d_val) 
+{
+	sc_cycle (d_val);
+#ifdef DUMP_SIGNAL_STATS
+	print_registers_writing_stats (cerr);
+#endif
+#ifdef DUMP_SCHEDULE_STATS
+	print_schedule_stats (cerr);
+#endif
+}
+
+void
+sc_start (double       d_val,
+          sc_time_unit d_tu)
+{
+  sc_start (sc_time (d_val, d_tu));
+}
+
+void
+sc_start( const sc_time& duration )
+{
+	sc_start ((double)duration);
+}
+
+/* ****************** */
+/* stoping simulation */
+/* ****************** */
+
+bool         have_to_stop = false;
+sc_stop_mode stop_mode    = SC_STOP_FINISH_DELTA;
+
+void
+sc_stop ()
+{
+  switch (stop_mode)
+  {
+  case SC_STOP_IMMEDIATE    :
+    exit (54);
+    break;
+  case SC_STOP_FINISH_DELTA :
+  default :
+    have_to_stop = true;
+    break;
+  }
+}
+
+void
+sc_set_stop_mode (sc_stop_mode new_mode)
+{
+  if (new_mode == SC_STOP_IMMEDIATE)
+    stop_mode = SC_STOP_IMMEDIATE;
+}
+
+sc_stop_mode
+sc_get_stop_mode ()
+{
+  return stop_mode;
+}
+
+void
+close_systemcass ()
+{
+  unlink ();
+  if (print_user_resources)
+  {
+    usage.stop ();
+    unsigned int d = usage;
+    cerr << "Performances\n"
+            "------------\n";
+    cerr << "Time elapsed (sec) : " << d << endl;
+    cerr << "Cycles done        : " << nb_cycles << endl;
+    //sc_simulation_time () << endl;
+    if (d == 0)
+      cerr << "Performance (c/s)  : N/A" << endl;
+    else
+      cerr << "Performance (c/s)  : " << nb_cycles / d << endl;
+//    cerr << "Memory used        : " << usage.get_memory_size () << endl;
+  }
+}
+
+/////////////////////////
+
+} // end of sc_core namespace
+
Index: /latest/src/global_functions.h
===================================================================
--- /latest/src/global_functions.h	(revision 1)
+++ /latest/src/global_functions.h	(revision 1)
@@ -0,0 +1,65 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 global_functions.h                |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __GLOBAL_FUNCTIONS_H__
+#define __GLOBAL_FUNCTIONS_H__
+
+#include"sc_fwd.h"
+#include"sc_time.h"
+
+extern int sc_main(int, char **);
+
+namespace sc_core {
+
+/////////////////////////
+enum sc_stop_mode
+{
+  SC_STOP_FINISH_DELTA,
+  SC_STOP_IMMEDIATE
+};
+
+/////////////////////////
+
+
+extern int main(int argc, char *argv[]);
+
+extern void sc_initialize(void);
+
+//extern void next_cycle(void);
+extern void         sc_start         (double d_val = -1);
+extern void         sc_start         ( const sc_time& duration );
+extern void         sc_start         (double d_val, sc_time_unit d_tu);
+extern void         sc_stop          ();
+extern void         sc_set_stop_mode (sc_stop_mode);
+extern sc_stop_mode sc_get_stop_mode ();
+
+extern const char *sc_gen_unique_name (const char *basename_);
+
+/////////////////////////
+///// SYSTEMCASS_SPECIFIC
+extern void close_systemcass   ();
+extern bool run_schedule_editor (const char*);
+extern const char *temporary_dir;
+extern const char *generated_files_dir;
+
+/////////////////////////
+
+} // end of namespace sc_core
+
+using sc_core::sc_gen_unique_name;
+using sc_core::sc_initialize;
+using sc_core::sc_start;
+using sc_core::sc_stop;
+
+/////////////////////////
+
+#endif
+
Index: /latest/src/graph.cc
===================================================================
--- /latest/src/graph.cc	(revision 1)
+++ /latest/src/graph.cc	(revision 1)
@@ -0,0 +1,308 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 graph.cc                          |
+|                                                             |
+| Author  :                 Petrot Frédéric                   |
+|                           Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * $Log: graph.cc,v $
+ * Revision 1.10  2006/06/12 14:02:04  buchmann
+ * - Now sort transition and generation functions by fonction pointer
+ *   (Thank to Nicolas Pouillon)
+ * - Add Nicolas Pouillon as contributor into splash screen
+ * - Rename files and classes from "dependancy" to "dependency".
+ * - Add some references to bibliography file
+ * - Add licence note to every files
+ * - Rename "module graph" to "process graph"
+ * - Now dump module graph when using --t option and CASS scheduling at the same
+ *   time
+ *
+ * Bug fixes :
+ * - check user time ( != 0) before computing simulation performance
+ * - Remove reinterpret_cast (for pending write) because of unexpected results
+ * - Add ASSERT in trace functions
+ *
+ * Revision 1.9  2005/10/12 10:00:59  buchmann
+ * Bug fix :
+ * - test to avoid malloc(0)
+ *
+ * Remove :
+ * - unused variable
+ *
+ * Revision 1.8  2005/09/14 14:08:24  buchmann
+ * Add Werror flag to compile the debug library.
+ * Split sc_clock implementation from sc_port to sc_clock.
+ * Add a helper message to write mealy functions avoiding combinational cycle.
+ *
+ * Bug fix :
+ * - cvs rules is no longer circular
+ * - bit2string
+ * - port binding (sc_in to sc_out)
+ * - error message from FSM rules checker
+ * - sc_time copy operator
+ *
+ * Code cleaning :
+ * - remove duplicated code (entity.cc and sc_port.cc)
+ * - remove duplicated declarations (internal_ext.h and internal.h)
+ *
+ * Revision 1.7  2005/03/29 14:04:30  buchmann
+ * Bug fix :
+ * -  Evaluation order of Mealy functions
+ *
+ * Print more informations when DUMP_STAGE is defined.
+ *
+ * Revision 1.6  2005/01/20 09:15:12  buchmann
+ * add following functions to sc_uint classes :
+ * - operator []
+ * - range (left,right)
+ *
+ * support to port dependancy declarations.
+ * print used precompiled options in verbose mode.
+ * use pedantic flag.
+ * add some rules to generate documentations.
+ *
+ * Revision 1.5  2004/09/27 14:40:13  buchmann
+ * bug fix :
+ * - allow the use of user-defined structs in sc_signal/sc_in/sc_out/sc_inout
+ * - use sc_dt namespace like official SystemC engine
+ *
+ * add :
+ * - dump the signal/port/module dependancy graph in dot format
+ *
+ * Graph library is now splitted from the SystemCASS specific code.
+ *
+ */
+
+#include <stdio.h>
+#include <map>
+#include <string>
+
+#include "graph.h"
+#include "sc_sensitive.h"
+#include "sc_module.h"
+#include "sc_port.h"
+
+using namespace std;
+
+/* Sorry for that, Mr Knuth :-) */
+
+Graph *gb_new_graph(int n)
+{
+Graph *g;
+
+   g = (Graph *) malloc(sizeof(Graph));
+   g->n = n;
+   if (n)
+   {
+     g->vertices = (Vertex *) malloc(n * sizeof(Vertex));
+     (void)memset(g->vertices, 0, n * sizeof(Vertex));
+   } else {
+     g->vertices = NULL;
+   }
+   return g;
+}
+
+static void gb_new_arc(Vertex *u, Vertex *v, long l)
+{
+Arc *a;
+
+   a       = (Arc *) malloc(sizeof(Arc));
+   a->next = u->arcs;
+   u->arcs = a;
+   a->tip  = v;
+   a->len  = l;
+}
+
+/* end Sorry */
+
+#define VERTEX 220898
+
+#define type     u.I
+
+void new_arc(Vertex *u, Vertex *v)
+{
+Arc *a;
+#ifdef DEBUG
+	if ((u == NULL) || (v == NULL))
+		exit(29042004);
+#endif
+   for (a = u->arcs; a; a = a->next)
+      if (a->tip == v)
+         return;
+   gb_new_arc(u, v, 0L);
+}
+
+#define rank z.I
+#define parent y.V
+#define untagged x.A
+#define link w.V
+#define min v.V
+
+#define infinity g->n
+
+/* strong_component: extracts and topologically sorts the strong components of
+ * a graph.
+ * The returned data structure is a chain_list of chain_lists.
+ * The first list implicitely lists the components in order, and the pointed
+ * to ones list the components contents (one or more vertices) */
+
+extern strong_component_list_t *strong_component(Graph *g)
+{
+  long nn;
+  Vertex *active_stack;
+  Vertex *settled_stack;
+  Vertex *vv;
+  
+  register Vertex *v;
+  
+  strong_component_list_t *strongcomponents = new strong_component_list_t;
+	typedef std::vector<void*> void_list_t;
+  void_list_t *component;
+
+  if (g->vertices == NULL)
+    return strongcomponents;
+
+ /* Make all vertices unseen and all arcs untagged */
+ for (v = g->vertices + g->n - 1; v >= g->vertices; v--) {
+   v->rank = 0;
+   v->untagged = v->arcs;
+ }
+ nn = 0;
+ active_stack = settled_stack = NULL;
+
+ for (vv = g->vertices; vv < g->vertices + g->n; vv++)
+   if (vv->rank == 0) { /* vv is still unseen */
+     v = vv;
+     v->parent = NULL;
+     
+     v->rank = ++nn;
+     v->link = active_stack;
+     active_stack = v;
+     v->min = v;
+     
+     do { /* Eplore one step from the current vertex v, possibly moving to another vertex 
+	     and calling it v */
+       register Vertex *u;               /* a vertex adjacent to v */
+       register Arc *a = v->untagged;    /* v's first remaining untagged arc, if any */
+       if (a) {
+	 u = a->tip;
+	 v->untagged = a->next;    /* tag the arc from v to u */
+	 if (u->rank) {    /* we've seen u already */
+	   if (u->rank < v->min->rank) /* non-tree arc, jutt update v->min */
+	     v->min = u;
+	 } else {   /* u is presently unseen */
+	   u->parent = v; /* the arcfrom v to u is a new tree arc */
+	   v = u;         /* u will now be the currnt vertex */
+	   v->rank = ++nn;  /* make vertex v active */
+	   v->link = active_stack;
+	   active_stack = v;
+	   v->min = v;
+	 }
+       } else { /* all arcs from v are tagged, so v matures */
+	 u = v->parent; /* prepare to backtrack in the tree */
+	 if (v->min == v) {
+	   /* Remove v and all its successors on the activestack from the tree,
+	      and mark them as a strong component of the graph */
+	   register Vertex *t; /* runs though the vertices of the new strong component */
+	   
+	   t = active_stack;
+	   active_stack = v->link;
+	   v->link = settled_stack;
+	   settled_stack = t; /* we've moved the top of one stack to the other */
+	   component = new void_list_t;
+	   /* singe vetex */
+	   if (t != v) { /* NOT singe vetex */
+	     while (t != v) {
+	       component->push_back(t->data);
+	       t->rank = infinity; /* now t is settled */
+	       t->parent = v;  /* and v represents the new strong component */
+	       t = t->link;
+	     }
+	   }
+	   component->push_back(v->data);
+	   strongcomponents->push_back(component);
+	   v->rank = infinity; /* v too is settled */
+	   v->parent = v; /* and represents its own strong component */
+	 } else /* the arc from u to v has just matured, making v->min visible from u */
+	   if (v->min->rank < u->min->rank) u->min = v->min;
+	 v = u; /* the former parent of v is the new current vertex v */
+       }
+     } while (v != NULL);
+   }
+
+ return strongcomponents;
+}
+
+bool 
+has_cycle (const strong_component_list_t &l)
+{	
+	strong_component_list_t::const_iterator it;
+	for (it = l.begin (); it != l.end (); ++it)
+	{
+		if ((*it)->size() > 1)
+			return true;
+	}
+	return false;
+}
+
+#if 0
+const component_list_t*
+get_cycle (const strong_component_list_t &l)
+{	
+	strong_component_list_t::const_iterator it;
+	for (it = l.begin (); it != l.end (); ++it)
+	{
+    const component_list_t *c = *it;
+		if (c->size() > 1)
+			return c;
+	}
+	return NULL;
+}
+
+void
+print_cycle (std::ostream &o, 
+             const component_list_t *c)
+{
+  if (c == NULL)
+    return;
+  component_list_t::const_iterator it;
+  for (it = c->begin (); it != c->end (); ++it)
+  {
+    void *v = *it;
+    o << hex << (int) v << " ";
+  }
+  o << "\n";
+}
+#endif
+
Index: /latest/src/graph.h
===================================================================
--- /latest/src/graph.h	(revision 1)
+++ /latest/src/graph.h	(revision 1)
@@ -0,0 +1,78 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 graph.h                           |
+|                                                             |
+| Author  :                 Pétrot Frédéric                   |
+|                           Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __GRAPH_H__
+#define __GRAPH_H__
+
+#include "sc_fwd.h"
+#include <vector>
+
+/* Graph.h: translation of a netlist into a Stanford Graphbase graph.
+ * This structure is more natural than the bipartite graph for many
+ * algorithms that consider the relationship between components
+ * globally, not on a connectors per connector basis.
+ * It is very much inspired from Don Knuth Stanford Graph Base, but 
+ * is a real simplification. */
+
+enum vertex_type {
+   CONNECTOR = 0x0, INSTANCE = 0x4, STRONG_COMPONENT = 0x8
+};
+
+#define KEEP_ARC 240898
+
+typedef union {
+   struct vertex_struct *V;
+   struct arc_struct *A;
+   struct graph_struct *G;
+   char *S;
+   long I;
+} util;
+
+typedef struct vertex_struct {
+  struct arc_struct *arcs;
+	union {
+		void             *data;
+	};
+  util u, v, w, x, y, z;
+} Vertex;
+
+typedef struct arc_struct {
+   struct vertex_struct *tip;
+   struct arc_struct *next;
+   long len;
+   util a, b;
+} Arc;
+
+#define ID_FIELD_SIZE 161
+typedef struct graph_struct {
+   Vertex *vertices;
+   long n;
+   long m;
+   char *id;
+   util uu, vv, ww, xx, yy, zz;
+} Graph;
+
+extern Graph *gb_new_graph(int n);
+extern void new_arc(Vertex *u, Vertex *v);
+
+typedef std::vector<void *> component_list_t;
+typedef std::vector<component_list_t *> strong_component_list_t;
+extern strong_component_list_t *strong_component(Graph *g);
+
+extern bool                    has_cycle   (const strong_component_list_t&);
+#if 0
+extern const component_list_t* get_cycle   (const strong_component_list_t&);
+extern void                    print_cycle (std::ostream&,const component_list_t*);
+#endif
+
+#endif /* __GRAPH_H__ */
Index: /latest/src/graph_cass.cc
===================================================================
--- /latest/src/graph_cass.cc	(revision 1)
+++ /latest/src/graph_cass.cc	(revision 1)
@@ -0,0 +1,411 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 graph_cass.cc                     |
+|                                                             |
+| Author  :                 Petrot Frédéric                   |
+|                           Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * $Log: graph_cass.cc,v $
+ * Revision 1.5  2006/06/12 14:02:04  buchmann
+ * - Now sort transition and generation functions by fonction pointer
+ *   (Thank to Nicolas Pouillon)
+ * - Add Nicolas Pouillon as contributor into splash screen
+ * - Rename files and classes from "dependancy" to "dependency".
+ * - Add some references to bibliography file
+ * - Add licence note to every files
+ * - Rename "module graph" to "process graph"
+ * - Now dump module graph when using --t option and CASS scheduling at the same
+ *   time
+ *
+ * Bug fixes :
+ * - check user time ( != 0) before computing simulation performance
+ * - Remove reinterpret_cast (for pending write) because of unexpected results
+ * - Add ASSERT in trace functions
+ *
+ * Revision 1.4  2005/09/14 14:08:24  buchmann
+ * Add Werror flag to compile the debug library.
+ * Split sc_clock implementation from sc_port to sc_clock.
+ * Add a helper message to write mealy functions avoiding combinational cycle.
+ *
+ * Bug fix :
+ * - cvs rules is no longer circular
+ * - bit2string
+ * - port binding (sc_in to sc_out)
+ * - error message from FSM rules checker
+ * - sc_time copy operator
+ *
+ * Code cleaning :
+ * - remove duplicated code (entity.cc and sc_port.cc)
+ * - remove duplicated declarations (internal_ext.h and internal.h)
+ *
+ * Revision 1.3  2005/06/22 09:15:03  buchmann
+ * Add some *_ext.h files to split internal implementation from API interface.
+ *
+ * Add -Wunused to detect unused functions.
+ *
+ * Include directory now contains API interface file only.
+ *
+ * Declar all the implementation/interface inside sc_core namespace as LRM 2.1
+ * advices.
+ *
+ * Remove casc namespace.
+ *
+ * Clean up dead code segments.
+ *
+ * Add hexadecimal dumping support.
+ *
+ * Add empty implementation of functions for object hierarchy traversal. (LRM 2.1)
+ *
+ * Bug fixes :
+ * - reference return of the following functions : operators =, |=, &= and so on.
+ * - range functions now return an sc_int_subref instead of an int.
+ *
+ * Revision 1.2  2005/05/30 12:33:50  buchmann
+ * Makefile :
+ * - use ${...} form instead of $(...) one.
+ * - add entity file object and entity, sc_signal headers.
+ *
+ * Split sc_signal(s)/sc_port(s) into two separate files.
+ * Add some codes to check hex2string function.
+ * Add some informations about -rdynamic when there is an error using dlopen.
+ * Add some ASSERT(s) for debug library.
+ * Add module name into the warning printing.
+ * Minor changes for PAT traces.
+ *
+ * Revision 1.1  2004/09/27 14:40:13  buchmann
+ * bug fix :
+ * - allow the use of user-defined structs in sc_signal/sc_in/sc_out/sc_inout
+ * - use sc_dt namespace like official SystemC engine
+ *
+ * add :
+ * - dump the signal/port/module dependancy graph in dot format
+ *
+ * Graph library is now splitted from the SystemCASS specific code.
+ *
+ */
+
+#include <iostream>
+#include <fstream>
+#include <stdio.h>
+#include <map>
+#include <string>
+
+#include "graph_cass.h"
+#include "sc_sensitive.h"
+#include "sc_module.h"
+#include "sc_port.h"
+#include "entity.h"
+#include "simplify_string.h" // simplify_string
+#include "sc_ver_ext.h"      // sc_version for dumping to DOT
+
+using namespace std;
+
+namespace sc_core {
+
+#if 0
+static
+ostream& operator << (ostream& o,
+		      const Vertex & v)
+{
+#if 0
+      if (v.arcs == NULL)
+	o << v.name << "(" << v.module->ins_name << ")->(none)\n";
+      Arc *a;
+      for (a = v.arcs; a; a = a->next)
+	o << v.name << "(" << v.module->ins_name << ")->"
+		<< a->tip->name << "(" << a->tip->module << ")\n";
+  return o;
+#endif
+	method_process_t* m = (method_process_t*)(v.data);
+  if (v.arcs == NULL)
+	  o << *m << "\n";
+  Arc *a;
+  for (a = v.arcs; a; a = a->next) {
+	  method_process_t* m2 = (method_process_t*)(a->tip->data);
+    o << *m << "->"
+		  << *m2 << ")\n";
+	}
+  return o;
+
+}
+#endif
+
+#if 0
+static
+ostream& 
+operator << (ostream &o,
+		         const Graph &g)
+{
+  Vertex     *v;
+    for (v = g.vertices; v < g.vertices + g.n; v++) {
+	o << *v;
+    }
+    return o;
+}
+#endif
+
+std::map<const method_process_t*,Vertex*> m_v;
+
+/* Ajoute un arc */ 
+void add_arcs(const method_process_t &mp, const sc_module &module)
+{
+	std::map<const method_process_t*,Vertex*>::iterator i;
+  for (i =	m_v.begin ();	 i != m_v.end (); ++i) {
+	  if (i->first->module == &module)
+			new_arc (m_v[&mp],i->second);
+	}
+}
+
+/* Ajoute un arc */ 
+void add_arcs(const  method_process_t &mp,
+              tab_t *signal_pointer)
+{
+  equi_t &e = get_equi (signal_pointer);
+  equi_t::iterator i;
+  for (i = e.begin (); i != e.end (); ++i) {
+		const char *kind = i->kind ();
+    if (strstr (kind,"out")) {
+			const sc_port_base &port = *(i->port);
+		  const sc_module &module = port.get_module ();
+			if (&module == mp.module)
+				continue;
+			add_arcs (mp, module);
+      break;
+		}
+  }
+}
+
+void
+add_arcs(const method_process_t &mp)
+{
+  sensitivity_list_t::const_iterator port_bound;
+	for (port_bound = mp.sensitivity_list.begin(); port_bound != mp.sensitivity_list.end(); ++port_bound) {
+      // pour tous les ports/signaux p associés à la fonction au couple m
+      	/* si pp est un port de sortie d'une autre fonction de mealy,
+	   crée un arc entre m et mm */
+	/* on ne peut pas savoir si un port est la sortie d'une fonction de mealy. 
+	   on va donc chercher à savoir si c'est un port de sortie d'un automate de moore,
+	   sinon on considère que c'est une sortie de mealy.
+	*/
+
+      add_arcs(mp, port_bound->get_interface().get_pointer ());
+    }
+}
+
+/* Construit le graph de dépendance des signaux de Mealy */
+/* lm est la liste des fonctions de Mealy */
+/* -----
+   Graph
+   -----
+   node = module
+   edge = dependency
+
+   Vertex is an array of (method_process_t*)
+   Edge is a couple Vertex->Vertex.
+*/
+extern Graph*
+makegraph (const method_process_list_t *lm)
+{
+  method_process_list_t::const_iterator mp;
+
+  int         n = 0; /* Number of vertices */
+  Graph      *g;
+  Vertex     *v;
+  
+  /* Compute the number of vertices in the graph:
+   * The vertices set is the method set. */
+  
+/*  for (m = lm->begin(); m != lm->end(); m++)
+    n++;*/
+  n = lm->size ();
+  
+  /* Create the graph */
+  g = gb_new_graph(n);
+
+  /* Associate the netlist elements to the graph vertices, and vice-versa */
+  v = g->vertices;
+
+  /* initialisation des vertices */
+  for (mp = lm->begin(); mp != lm->end(); ++mp) {
+    v->data = *mp;
+    m_v[*mp] = v++;
+  }
+
+  for (mp = lm->begin(); mp != lm->end(); ++mp) { 
+    // pour tous couples m, instance module/function de la liste lm
+    add_arcs (**mp);
+  }
+
+  return g;
+}   
+
+/* 
+void 
+dot_write_edge (const  method_process_t &mp,
+                tab_t *signal_pointer)
+{
+  equi_t &e = get_equi (signal_pointer);
+  equi_t::iterator i;
+  for (i = e.begin (); i != e.end (); ++i) {
+		const char *kind = i->kind ();
+    if (strstr (kind,"out")) {
+			const sc_port_base &port = *(i->port);
+		  const sc_module &module = port.get_module ();
+			if (&module == mp.module)
+				continue;
+			add_arcs (mp, module);
+	    o << "edge [label="
+        << "];\n";
+      o	<< " -> ";
+      o << ";\n";
+		}
+  }
+}
+
+static
+bool
+dot_write_edge (ofstream &o,
+                const method_process_t &mp)
+{
+  sensitivity_list_t::const_iterator port_bound;
+	for (port_bound = mp.sensitivity_list.begin(); port_bound != mp.sensitivity_list.end(); ++port_bound)
+      dot_write_edge (o, mp, port_bound->get_interface().get_pointer ());
+}
+
+static
+bool
+dot_write (ofstream &o,
+           const method_process_list_t &lm)
+{
+  // Printing into dot file
+  string s;
+  method_process_list_t::const_iterator mp;
+  for (mp = lm.begin(); mp != lm.end(); ++mp) {
+    method_process_t *amp = *mp;
+    sc_module *module = amp->module;
+    o << "node [name="
+//      << simplify_name(module.get_name().c_str(),s)
+      << "];\n";
+  }
+  for (mp = lm->begin(); mp != lm->end(); ++mp)
+    dot_write (o, **mp);
+}
+*/
+
+static
+string&
+get_method_process_fullname (string &name, 
+                             const method_process_t &mp)
+{
+  sc_module *module = mp.module;
+  name = module->name ();
+  name += "_";
+  name += mp.name;
+  return name;
+}
+
+static
+bool
+dot_write (ofstream &o,
+           const Graph &g)
+{
+  string name1,name2,s;
+  // Printing into dot file
+  for (int i = 0; i < g.n; ++i)
+  { // Printing node list
+    Vertex *v = g.vertices + i;
+    method_process_t *mp     = (method_process_t*) (v->data);
+    get_method_process_fullname (name1,*mp);
+    const char *pname1 = name1.c_str();
+    o << "node [name=";
+    o.width (35);
+    o << simplify_name(pname1,s);
+    o << "];\n";
+  }
+  for (int i = 0; i < g.n; ++i)
+  { // Printing edge list
+    Vertex *v1 = g.vertices + i;
+    method_process_t *mp1     = (method_process_t*) (v1->data);
+    get_method_process_fullname (name1,*mp1);
+    const char *pname1 = name1.c_str();
+    for (Arc *a = v1->arcs; a != NULL; a = a->next)
+    {
+      Vertex *v2 = a->tip;
+      method_process_t *mp2 = (method_process_t*) (v2->data);
+      get_method_process_fullname (name2,*mp2);
+      const char *pname2 = name2.c_str();
+      o.width (35);
+      o << simplify_name(pname2,s);
+      o << " -> ";
+      o.width (35);
+      o << simplify_name(pname1,s);
+      o << ";\n";
+    }
+  }
+
+  return true;
+}
+
+extern bool
+graph2dot (const char *name,
+           const Graph &g)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "// Module dependency graph\n"
+       "// Generated by "
+    << sc_version () << "\n";
+	o << "strict digraph " << name << " {\n";
+  o << "node [shape=box];\n";
+//       "concentrate=true;\n";
+  o << left;
+	dot_write (o,g);
+  // Closing dot file
+	o << "}\n";
+	o.close ();
+  if (dump_stage)
+    cerr << "Module dependency graph written into '" 
+         << filename << "'.\n";
+	return true;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/graph_cass.h
===================================================================
--- /latest/src/graph_cass.h	(revision 1)
+++ /latest/src/graph_cass.h	(revision 1)
@@ -0,0 +1,28 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 graph_cass.h                      |
+|                                                             |
+| Author  :                 Pétrot Frédéric                   |
+|                           Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __GRAPH_CASS_H__
+#define __GRAPH_CASS_H__
+
+#include "graph.h"
+
+namespace sc_core {
+
+/* A unique exported function from all that */
+extern Graph *makegraph(const method_process_list_t *);
+extern bool   graph2dot(const char*,const Graph&);
+
+} // end of sc_core namespace
+
+#endif /* __GRAPH_CASS_H__ */
+
Index: /latest/src/graph_signals.cc
===================================================================
--- /latest/src/graph_signals.cc	(revision 1)
+++ /latest/src/graph_signals.cc	(revision 1)
@@ -0,0 +1,253 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 graph_signals.cc                  |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   22_09_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * $Log: graph_signals.cc,v $
+ * Revision 1.7  2006/06/12 14:02:04  buchmann
+ * - Now sort transition and generation functions by fonction pointer
+ *   (Thank to Nicolas Pouillon)
+ * - Add Nicolas Pouillon as contributor into splash screen
+ * - Rename files and classes from "dependancy" to "dependency".
+ * - Add some references to bibliography file
+ * - Add licence note to every files
+ * - Rename "module graph" to "process graph"
+ * - Now dump module graph when using --t option and CASS scheduling at the same
+ *   time
+ *
+ * Bug fixes :
+ * - check user time ( != 0) before computing simulation performance
+ * - Remove reinterpret_cast (for pending write) because of unexpected results
+ * - Add ASSERT in trace functions
+ *
+ * Revision 1.6  2005/10/12 10:01:00  buchmann
+ * Bug fix :
+ * - test to avoid malloc(0)
+ *
+ * Remove :
+ * - unused variable
+ *
+ * Revision 1.5  2005/09/14 14:08:24  buchmann
+ * Add Werror flag to compile the debug library.
+ * Split sc_clock implementation from sc_port to sc_clock.
+ * Add a helper message to write mealy functions avoiding combinational cycle.
+ *
+ * Bug fix :
+ * - cvs rules is no longer circular
+ * - bit2string
+ * - port binding (sc_in to sc_out)
+ * - error message from FSM rules checker
+ * - sc_time copy operator
+ *
+ * Code cleaning :
+ * - remove duplicated code (entity.cc and sc_port.cc)
+ * - remove duplicated declarations (internal_ext.h and internal.h)
+ *
+ * Revision 1.4  2005/06/22 09:15:03  buchmann
+ * Add some *_ext.h files to split internal implementation from API interface.
+ *
+ * Add -Wunused to detect unused functions.
+ *
+ * Include directory now contains API interface file only.
+ *
+ * Declar all the implementation/interface inside sc_core namespace as LRM 2.1
+ * advices.
+ *
+ * Remove casc namespace.
+ *
+ * Clean up dead code segments.
+ *
+ * Add hexadecimal dumping support.
+ *
+ * Add empty implementation of functions for object hierarchy traversal. (LRM 2.1)
+ *
+ * Bug fixes :
+ * - reference return of the following functions : operators =, |=, &= and so on.
+ * - range functions now return an sc_int_subref instead of an int.
+ *
+ * Revision 1.3  2005/03/25 14:33:01  buchmann
+ * Typo :
+ * -  dependAncy -> dependEncy
+ *
+ * sc_initialize :
+ * -  Use a hash table to speed up elaboration step. (x40 faster)
+ *
+ * Tracing :
+ * -  check for modification BEFORE building bit string.
+ * -  use sprintf instead std string concatenation.
+ *
+ * Revision 1.2  2005/01/20 09:15:12  buchmann
+ * add following functions to sc_uint classes :
+ * - operator []
+ * - range (left,right)
+ *
+ * support to port dependancy declarations.
+ * print used precompiled options in verbose mode.
+ * use pedantic flag.
+ * add some rules to generate documentations.
+ *
+ * Revision 1.1  2004/09/27 14:40:14  buchmann
+ * bug fix :
+ * - allow the use of user-defined structs in sc_signal/sc_in/sc_out/sc_inout
+ * - use sc_dt namespace like official SystemC engine
+ *
+ * add :
+ * - dump the signal/port/module dependancy graph in dot format
+ *
+ * Graph library is now splitted from the SystemCASS specific code.
+ *
+ */
+
+#include <stdio.h>
+#include <map>
+#include <string>
+
+#include "graph_signals.h"
+#include "signal_dependency.h"
+#include "sc_sensitive.h"
+#include "sc_module.h"
+#include "sc_port.h"
+
+using namespace std;
+
+namespace sc_core {
+
+#if 0
+static
+ostream& operator << (ostream&      o,
+                      const Vertex &v)
+{
+	equi_t* m = (equi_t*)(v.data);
+  if (v.arcs == NULL)
+	  o << get_name(*m) << "\n";
+  Arc *a;
+  for (a = v.arcs; a; a = a->next)
+	{
+	  equi_t* m2 = (equi_t*)(a->tip->data);
+	  o << get_name(*m) << "->"
+		  << get_name(*m2) << "\n";
+	}
+  return o;
+
+}
+
+static
+ostream& 
+operator << (ostream     &o,
+             const Graph &g)
+{
+  Vertex *v;
+  int     i = 1;
+  for (v = g.vertices; v < g.vertices + g.n; ++v) {
+    o << i++ << " : " << *v;
+  }
+  return o;
+}
+#endif
+
+typedef std::map<const equi_t*, Vertex*> nodes_set_t;
+
+void
+create_arcs (const SignalDependencyGraph& sig_g, nodes_set_t& s)
+{
+  SignalDependencyGraph::const_iterator j;
+  for (j = sig_g.begin(); j != sig_g.end(); ++j) { 
+    new_arc (s[j->source],s[j->destination]);
+  }
+}
+
+void
+create_vertices_list (Graph *g, nodes_set_t& s)
+{
+	Vertex *v = g->vertices;
+  if (v == NULL)
+    return;
+  nodes_set_t::iterator j;
+  for (j = s.begin(); j != s.end(); ++j) 
+  {
+		v->data   = (void*) (j->first);
+		j->second = v++;
+	}	
+}
+
+nodes_set_t*
+create_nodes_set (const SignalDependencyGraph& sig_g)
+{
+	/* Create a signal set */
+	nodes_set_t &s = *(new nodes_set_t);
+
+  SignalDependencyGraph::const_iterator j;
+  for (j = sig_g.begin(); j != sig_g.end(); ++j) 
+  {
+		s[j->source] = NULL;
+		s[j->destination] = NULL;
+  }
+	return &s;
+}
+
+/* Construit le graph de dépendance des signaux de Mealy */
+/* g = Mealy signal dependancy graph */
+Graph *makegraph(const SignalDependencyGraph& sig_g)
+{
+  int         n = 0; /* Number of vertices */
+  Graph      *g;
+  //Vertex     *v;
+  
+	/* Create node set */
+	nodes_set_t *sig_s = create_nodes_set (sig_g);
+
+  /* Compute the number of vertices in the graph */
+  n = sig_s->size();
+  
+  /* Create the graph */
+  g = gb_new_graph(n);
+
+  /* Associate the netlist elements to the graph vertices, and vice-versa */
+//  v = g->vertices;
+
+	/* Create the node set */
+  create_vertices_list (g,*sig_s);
+
+  /* initialisation des vertices */
+	create_arcs (sig_g,*sig_s);
+
+	delete sig_s;
+#if 0
+	cerr << *g << "\n";
+#endif
+  return g;
+}   
+
+} // end of sc_core namespace
+
Index: /latest/src/graph_signals.h
===================================================================
--- /latest/src/graph_signals.h	(revision 1)
+++ /latest/src/graph_signals.h	(revision 1)
@@ -0,0 +1,26 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 graph_signals.h                   |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   22_09_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __GRAPH_SIGNALS_H__
+#define __GRAPH_SIGNALS_H__
+
+#include "graph.h"
+#include "signal_dependency.h"
+
+/* A unique exported function from all that */
+namespace sc_core {
+
+extern Graph *makegraph(const SignalDependencyGraph&);
+
+} // end of sc_core namespace
+
+#endif /* __GRAPH_SIGNALS_H__ */
+
Index: /latest/src/guess_endianness.cc
===================================================================
--- /latest/src/guess_endianness.cc	(revision 1)
+++ /latest/src/guess_endianness.cc	(revision 1)
@@ -0,0 +1,35 @@
+// CODE FROM WIKIPEDIA
+
+#define LITTLE_ENDIAN 0
+#define BIG_ENDIAN    1
+
+int machineEndianness()
+{
+   int i = 1;
+   char *p = (char *) &i;
+   if (p[0] == 1) // Lowest address contains the least significant byte
+      return LITTLE_ENDIAN;
+   else
+      return BIG_ENDIAN;
+}
+
+#include <stdio.h>
+
+int
+main (int argc, char** argv)
+{
+  printf ("#define ");
+  switch (machineEndianness()) {
+  case LITTLE_ENDIAN : 
+    printf ("little_endian\n");
+    break;
+  case BIG_ENDIAN : 
+    printf ("big_endian\n");
+    break;
+  default:
+    printf ("unknown_endian\n");
+    break;
+  }
+  return 0;
+}
+
Index: /latest/src/guess_os.sh
===================================================================
--- /latest/src/guess_os.sh	(revision 1)
+++ /latest/src/guess_os.sh	(revision 1)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# --------------------------------------------------------------------
+# Function  :  `guess_os()'.
+
+ guess_os ()
+ {
+   case "`uname -sr`" in
+     Linux*2.4.9*)  echo "Linux.RH71";;
+     Linux*FC2*)    echo "Linux.FC2";;
+     Linux*EL*)     echo "Linux.SLA4x";;
+     SunOS\ 5*)     echo "Solaris";;
+     Darwin*)       echo "Darwin";;
+     *)             echo "`uname -sr`";;
+   esac
+ }
+
+
+echo `guess_os`
Index: /latest/src/hex2string.cc
===================================================================
--- /latest/src/hex2string.cc	(revision 1)
+++ /latest/src/hex2string.cc	(revision 1)
@@ -0,0 +1,70 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 hex2string.cc                     |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "hex2string.h"
+
+#include <string>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <iostream>
+	
+using namespace std;
+
+namespace sc_core {
+
+void 
+hex2string(char        *buf,
+           const tab_t *val,
+           int          bit_number)
+{
+	int tmp=*((const int*)val);
+ 	//cout << "tmp = " << tmp << "\n";	
+	buf[bit_number >> 2]='\0';
+	for (int i = (bit_number >> 2) - 1; i >= 0 ;i--) 
+	{
+		char value = tmp & 0x0F;
+		buf[i]=(value > 9)?('A' + value - 10):('0'+value);
+		tmp=tmp>>4;
+	}
+#if 0
+  sscanf (buf, "%X", &tmp);
+  if (atoi (buf) != *val)
+    cerr << "hex2string (0x" << hex << *val << ") returns 0x" << buf << "    KO !\n";
+#endif	
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/hex2string.h
===================================================================
--- /latest/src/hex2string.h	(revision 1)
+++ /latest/src/hex2string.h	(revision 1)
@@ -0,0 +1,23 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 hex2string.h                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef HEX2STRING_H
+#define HEX2STRING_H
+
+#include "internal_ext.h"
+
+namespace sc_core {
+
+extern void hex2string(char *buf,const tab_t *val,int bit_number);
+
+} // end of sc_core namespace
+
+#endif
Index: /latest/src/internal.h
===================================================================
--- /latest/src/internal.h	(revision 1)
+++ /latest/src/internal.h	(revision 1)
@@ -0,0 +1,69 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   internal.h                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __INTERNAL_H__
+#define __INTERNAL_H__
+
+#include "internal_ext.h"
+#include <map>
+
+namespace sc_core {
+
+// Method Process List
+extern method_process_t *method;
+extern method_process_list_t method_process_list;
+
+// Module Naming Stack
+typedef std::vector<std::string> module_name_stack_t;
+extern module_name_stack_t module_name_stack;
+
+// Hash Table Port -> Module
+typedef std::map</*const */sc_port_base*, const sc_module*> port2module_t;
+extern port2module_t port2module;
+
+// Functions for Elaboration step
+void sort_equi_list ();
+void create_signals_table ();
+void bind_to_table ();
+
+// Debug Functions
+void print_table (std::ostream&);
+void print_table_stats (std::ostream&);
+void print_registers_writing_stats (std::ostream&);
+
+extern bool   is_clock (const sc_interface &inter);
+
+// Flags
+extern bool        check_port_dependencies;
+extern bool        dump_all_graph;
+extern const char* dump_module_hierarchy;
+extern bool        dump_netlist_info;
+extern bool        dump_funclist_info;
+extern bool        dynamic_link_of_scheduling_code;
+extern bool        keep_generated_code;
+extern bool        nosimulation;
+extern bool        notrace;
+extern bool        print_user_resources;
+extern char*       save_on_exit;
+extern int         scheduling_method;
+extern bool        use_port_dependency;
+
+#define NO_SCHEDULING          0
+#define BUCHMANN_SCHEDULING    1
+#define MOUCHARD_SCHEDULING    2
+#define CASS_SCHEDULING        4
+
+// More
+extern uint64 trace_start;
+}
+
+#endif
+
Index: /latest/src/internal_ext.h
===================================================================
--- /latest/src/internal_ext.h	(revision 1)
+++ /latest/src/internal_ext.h	(revision 1)
@@ -0,0 +1,86 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   internal_ext.h                  |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __INTERNAL_EXT_H__
+#define __INTERNAL_EXT_H__
+
+#include <list>
+#include "sc_fwd.h"
+#include "sc_nbdefs.h"
+#include "casc.h"
+
+/*
+ * not a boolean for a C-ANSI dynamic link (not C++ !)
+ * not in casc namespace because dynamic link support C linkage only
+ * */
+//extern "C" char unstable;
+
+// options
+//#define KEEP_GENERATED_CODE
+//#define NO_STATIC_SCHEDULE
+namespace sc_core {
+
+// Method Type
+typedef int  (*evaluation_fct_t) ();
+
+extern evaluation_fct_t func_combinationals;
+extern evaluation_fct_t func_simulate_1_cycle;
+
+// Sensitivity List
+typedef std::list<sc_event> sensitivity_list_t;
+
+// Flags for sc_initialize, sc_start, sc_stop
+extern bool have_to_stop;
+extern bool already_initialized;
+
+// Granularity of the posted write stack
+#ifdef UINT64
+	typedef uint64        tab_t;
+#else
+	typedef uint32        tab_t;
+//	typedef smallest_uint tab_t; // signals of 64 bits are wrong in trace file
+#endif
+typedef tab_t       *equi_table_t;
+extern equi_table_t  equi_table;
+
+// Flags
+extern bool   dump_stage;
+extern bool   print_schedule;
+extern bool   edit_schedule;
+
+}
+
+#endif
+
Index: /latest/src/methodprocess_dependency.cc
===================================================================
--- /latest/src/methodprocess_dependency.cc	(revision 1)
+++ /latest/src/methodprocess_dependency.cc	(revision 1)
@@ -0,0 +1,130 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :           methodprocess_dependency.cc             |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   22_11_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "assert.h"
+#include "methodprocess_dependency.h"
+#include "simplify_string.h"
+#include "sc_module.h"
+#include <iostream>
+#include <fstream>
+
+using namespace std;
+namespace sc_core {
+
+string
+get_name (const method_process_t *method)
+{
+  ASSERT(method != NULL);
+  const sc_module *module = method->module;
+  ASSERT(module != NULL);
+  const char *module_name = module->name ();
+  const char *function_name = method->name;
+  
+  string name = module_name;
+  name += "_";
+  name += function_name;
+  return name;
+}
+
+static
+bool
+dot_write (ofstream &o,
+           const SignalDependencyGraph &sig)
+{
+  // Preparing data
+  typedef map<const equi_t *, const method_process_t *> table_t;
+  table_t table;
+  
+  // For each arrow, add destination node into table
+	SignalDependencyGraph::const_iterator sig_it;
+	for (sig_it = sig.begin (); sig_it != sig.end (); ++sig_it)
+  {
+    const SignalDependency &sd     = *sig_it;
+    const equi_t           *equi   = sd.destination;
+	  const method_process_t *method = sd.method;
+    table[equi] = method;
+  }
+
+  // Printing into dot file
+	string s;
+  SignalDependencyGraph::const_iterator it;
+  for (it = sig.begin (); it != sig.end (); ++it)
+  {
+    const SignalDependency &sd = *it;
+    const equi_t           *source_equi     = sd.source;
+    ASSERT(source_equi != NULL);
+	  const method_process_t *source_method   = table[source_equi];
+    if (source_method == NULL)
+      continue;
+    string                  source_method_name = get_name (source_method);
+    string                  source_equi_name = get_name (*source_equi);
+	  const method_process_t *destination_method = sd.method;
+    string                  destination_method_name = get_name (destination_method);
+		o << "edge [label="
+      << simplify_name(source_equi_name.c_str(),s)
+      << "];\n";
+		o << simplify_name(source_method_name.c_str(),s);
+		o	<< " -> ";
+		o << simplify_name(destination_method_name.c_str(),s);
+	  o << ";\n";
+  }
+}
+
+bool 
+MethodProcessDependencyGraph2dot (const char *name,
+                                  const SignalDependencyGraph& sig)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "strict digraph " << name << " {\n";
+	dot_write (o,sig);
+  // Closing dot file
+	o << "}\n";
+	o.close ();
+  if (dump_stage)
+    cerr << "MethodProcess dependency graph written into '" 
+         << filename << "'.\n";
+	return true;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/methodprocess_dependency.h
===================================================================
--- /latest/src/methodprocess_dependency.h	(revision 1)
+++ /latest/src/methodprocess_dependency.h	(revision 1)
@@ -0,0 +1,23 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :           methodprocess_dependency.h              |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   22_11_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef METHODPROCESS_DEPENDENCY_H
+#define METHODPROCESS_DEPENDENCY_H
+
+#include "signal_dependency.h"
+
+namespace sc_core {
+// Dump to dot file
+extern bool MethodProcessDependencyGraph2dot (const char *name, const SignalDependencyGraph&);
+}
+
+#endif
+
Index: /latest/src/module_hierarchy.cc
===================================================================
--- /latest/src/module_hierarchy.cc	(revision 1)
+++ /latest/src/module_hierarchy.cc	(revision 1)
@@ -0,0 +1,121 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 module_hierarchy.cc               |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   15_12_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "module_hierarchy.h"
+#include "sc_module.h"
+#include "assert.h"
+#include <map>
+
+using namespace std;
+
+namespace sc_core {
+
+typedef vector<sc_object*> sc_object_list_t;
+typedef map<const sc_object*,sc_object_list_t> sc_object2sc_object_list_t;
+typedef map<const sc_object*,sc_object *>      sc_object2sc_object_t;
+
+sc_object_list_t            top_level_objects;
+sc_object2sc_object_list_t  object2childs;
+sc_object2sc_object_t       object2parent;
+
+void
+set_parent (sc_module &mod, sc_module *parent)
+{
+  object2parent[&mod] = parent; 
+  sc_object_list_t &obj_list = (parent == NULL)?top_level_objects:object2childs[parent];
+  obj_list.push_back (&mod);
+}
+
+void
+add_child (sc_object &obj)
+{
+  sc_object_list_t *obj_list;
+  if (modules_stack.empty ())
+  {
+    obj_list = &top_level_objects;
+  } else {
+    const sc_module *parent    = modules_stack.top ();
+    if (parent == NULL)
+      return; //obj_list = &top_level_objects;
+    else {
+      ASSERT(parent != &obj);
+      const sc_object *pobj      = (const sc_module *) parent;
+      obj_list = &(object2childs[pobj]);
+    }
+  }
+  obj_list->push_back (&obj);
+}
+
+const std::vector<sc_object*>& 
+sc_get_top_level_objects()
+{
+  return top_level_objects;
+}
+
+const sc_object*
+sc_find_object (const char* name)
+{
+  sc_object2sc_object_list_t::iterator i = object2childs.begin ();
+  while (i != object2childs.end ())
+  {
+    const sc_object *obj = i->first;
+    const char      *n   = obj->name ();
+    if (strcmp (name, n) == 0)
+      return obj;
+    ++i;
+  }
+  return NULL;
+}
+ 
+const std::vector<sc_object*>& 
+get_child_objects (const sc_object &obj)
+{
+  sc_object_list_t &l = object2childs[&obj];
+  /* 
+   * If the object is not in the objects list,
+   * get_child_objects returns an empty list.
+   */
+  return l;    
+}
+
+sc_object*
+get_parent_object (const sc_object &obj)
+{
+  return object2parent[&obj];
+}
+
+} // end of namespace sc_core
+
+
Index: /latest/src/module_hierarchy.h
===================================================================
--- /latest/src/module_hierarchy.h	(revision 1)
+++ /latest/src/module_hierarchy.h	(revision 1)
@@ -0,0 +1,27 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 module_hierarchy.h                |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   15_12_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __MODULE_HIERARCHY_H__
+#define __MODULE_HIERARCHY_H__
+
+#include "module_hierarchy_ext.h"
+
+namespace sc_core {
+
+void add_child                      (sc_object &);
+void set_parent                     (sc_module &child, sc_module *parent);
+const std::vector<sc_object*>& get_child_objects (const sc_object &);
+sc_object*                     get_parent_object (const sc_object &);
+
+} // end of namespace sc_core
+
+#endif // __MODULE_HIERARCHY_H__
+
Index: /latest/src/module_hierarchy2dot.cc
===================================================================
--- /latest/src/module_hierarchy2dot.cc	(revision 1)
+++ /latest/src/module_hierarchy2dot.cc	(revision 1)
@@ -0,0 +1,180 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  module_hierarchy2dot.cc          |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   26_01_2006                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <vector>
+#include <map>
+#include <set>
+#include <fstream>
+#include "module_hierarchy.h"
+#include "module_hierarchy2dot.h"
+#include "sc_fwd.h"
+#include "sc_signal.h"
+#include "entity.h"
+#include "assert.h"
+#include "internal.h"
+
+using namespace std;
+
+namespace sc_core {
+
+/*
+static
+const char*
+get_parent_name (const sc_object &obj)
+{
+  const sc_object *parent = NULL;//get_parent_object (obj);
+  if (parent == NULL)
+    return "";
+  return parent->basename ();
+}
+*/
+
+typedef set<const char*> node_set_t;
+node_set_t node_set;
+
+static
+void
+print_edge (ostream &o)
+{
+  typedef map<const char*, const char*> edge_t;
+  edge_t edges;
+  const equi_list_t &eq_list = get_equi_list ();
+  equi_list_t::const_iterator jt;
+  for (jt = eq_list.begin (); jt != eq_list.end (); ++jt)
+  {
+    const equi_t &eq = (*jt);
+    sc_port_base *out   = get_out_port (eq);
+    if (out == NULL)
+      continue;
+    if (is_clock (*out))
+      continue;
+    const sc_module &out_mod = out->get_module ();
+    const char *out_mod_name = out_mod.basename ();
+    equi_t::const_iterator it;
+    for (it = eq.begin (); it != eq.end (); ++it)
+    {
+      const entity &in_entity  = *it;
+      sc_object    *in_obj     = in_entity.object;
+      ASSERT(in_obj != NULL);
+      const sc_module *in_parent = NULL;
+      switch (in_entity.type) {
+      case entity::PORT :
+        in_parent = &(in_entity.port->get_module ());
+        if (&out_mod == in_parent)
+          continue;
+        break;
+      case entity::SIGNAL :
+      default :
+        continue;
+      }
+      edges[out_mod_name] = in_parent->basename ();
+      node_set.insert(out_mod_name);
+      node_set.insert(in_parent->basename ());
+    }
+  }
+#if 0
+  const equi_t &signal_eq = *(eq_list.begin ());
+  const char *signal_name = get_name (signal_eq);
+  o << "edge [label=\"" << signal_name << "\"]\n";
+#endif
+  edge_t::const_iterator i;
+  for (i = edges.begin (); i != edges.end (); ++i)
+  {
+    o << i->first
+      << " -> " 
+      << i->second 
+      << ";\n";
+  }
+}
+
+static void print_node (ostream&, const vector<sc_object*>&);
+
+static
+void
+print_node (ostream         &o,
+            const sc_object &obj)
+{
+  const vector<sc_object*> &obj_list = get_child_objects (obj);
+  bool subgraph = (obj_list.empty() == false);
+//                  && (get_parent_object (obj) != NULL);
+  if (subgraph) {
+    const char *name = obj.basename ();
+    o << "subgraph \"cluster" << name << "\" {\n"
+      << "label=\"" << name << "\";\n";
+    print_node (o, obj_list);
+    o << "}\n";
+  } /*else*/ {
+//    if (obj.kind () == sc_module::kind_string)
+    if (node_set.find (obj.basename ()) != node_set.end())
+      o << obj.basename () << endl;
+  }
+}
+
+static
+void
+print_node (ostream                  &o,
+            const vector<sc_object*> &obj_list)
+{
+  vector<sc_object*>::const_iterator it;
+  for (it = obj_list.begin(); it != obj_list.end(); ++it)
+  {
+    sc_object *obj = *it;
+    print_node (o, *obj);
+  }
+}
+
+bool
+module_hierarchy2dot (const char *name)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "strict digraph " << name << " {\n";
+  o << "node [shape=box];\n";
+  print_edge (o);
+	print_node (o,sc_get_top_level_objects ());
+	o << "}\n";
+	o.close ();
+	return true;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/module_hierarchy2dot.h
===================================================================
--- /latest/src/module_hierarchy2dot.h	(revision 1)
+++ /latest/src/module_hierarchy2dot.h	(revision 1)
@@ -0,0 +1,24 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 module_hierarchy2dot.h            |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   26_01_2006                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __MODULE_HIERARCHY2DOT_H__
+#define __MODULE_HIERARCHY2DOT_H__
+
+#include "module_hierarchy_ext.h"
+
+namespace sc_core {
+
+extern bool module_hierarchy2dot (const char *name);
+
+} // end of namespace sc_core
+
+#endif // __MODULE_HIERARCHY2DOT_H__
+
Index: /latest/src/module_hierarchy_ext.h
===================================================================
--- /latest/src/module_hierarchy_ext.h	(revision 1)
+++ /latest/src/module_hierarchy_ext.h	(revision 1)
@@ -0,0 +1,51 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 module_hierarchy_ext.h            |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   15_12_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __MODULE_HIERARCHY_EXT_H__
+#define __MODULE_HIERARCHY_EXT_H__
+
+#include "sc_module_ext.h"
+#include "sc_object.h"
+#include <vector>
+
+namespace sc_core {
+
+extern const std::vector<sc_object*>&   sc_get_top_level_objects();
+extern const sc_object*                 sc_find_object (const char* name);
+
+} // end of namespace sc_core
+
+#endif // __MODULE_HIERARCHY_H__
+
Index: /latest/src/mouchard_scheduling.cc
===================================================================
--- /latest/src/mouchard_scheduling.cc	(revision 1)
+++ /latest/src/mouchard_scheduling.cc	(revision 1)
@@ -0,0 +1,131 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  mouchard_scheduling.cc           |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   20_12_2006                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <set>
+#include <iostream>
+#include <fstream>
+#include "assert.h"
+#include "process_dependency.h"
+#include "methodprocess_dependency.h"
+#include "mouchard_scheduling.h"
+#include "simplify_string.h"
+#include "sc_fwd.h"
+#include "sc_module.h"
+#include "sc_ver.h"
+
+using namespace std;
+
+namespace sc_core {
+
+typedef set<SignalDependency> signalDependencySet;
+typedef set<const method_process_t*> processSet;
+
+static
+void
+getSource (signalDependencySet        &ss,
+           const SignalDependencyGraph &sig_g)
+{
+  typedef set<const equi_t *> nonSource_t;
+  nonSource_t nonSource;
+  SignalDependencyGraph::iterator it;
+  for (it = sig_g.begin(); it != sig_g.end(); ++it)
+  {
+    const SignalDependency &sigDep = *it;
+    const equi_t           *dest   = sigDep.destination;
+    nonSource.insert(dest);
+  }
+  for (it = sig_g.begin(); it != sig_g.end(); ++it)
+  {
+    const SignalDependency &sigDep = *it;
+    const equi_t           *src    = sigDep.source;
+    if (nonSource.find(src) == nonSource.end())
+      ss.insert(sigDep);
+  }
+}
+
+static
+void
+removeSignals (SignalDependencyGraph &sig_g,
+               signalDependencySet   &ss)
+{
+  SignalDependencyGraph::iterator it = sig_g.begin();
+  while (it != sig_g.end())
+  {
+    const SignalDependency &sigDep = *it;
+    if (ss.find(sigDep) != ss.end())
+    {
+      SignalDependencyGraph::iterator jt = it++;
+      sig_g.erase (jt);
+    } else
+      ++it;
+  }
+}
+
+ProcessDependencyList* 
+MakeMouchardScheduling (const SignalDependencyGraph  & _sig_g)
+{
+  if (dump_stage)
+    cerr << "Making process dependency list...\n";
+	ProcessDependencyList *mod_l = new ProcessDependencyList ();
+	SignalDependencyGraph sig_g = _sig_g;
+	while (!sig_g.empty ())
+	{
+		signalDependencySet ss;
+    getSource (ss, sig_g);
+    removeSignals (sig_g, ss);
+    processSet ps;
+    signalDependencySet::iterator sit;
+    for (sit = ss.begin(); sit != ss.end(); ++sit)
+    {
+		  const SignalDependency &sigdep  = *sit;
+		  const method_process_t *process = sigdep.method;
+      ps.insert(process);
+    }
+    processSet::iterator pit;
+    for (pit = ps.begin(); pit != ps.end(); ++pit)
+    {
+      const method_process_t *process = *pit;
+	    mod_l->push_back(process);
+#if 1
+   		cerr << "Process found : " << *process << "\n";
+#endif
+    }
+  }
+    
+	return mod_l;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/mouchard_scheduling.h
===================================================================
--- /latest/src/mouchard_scheduling.h	(revision 1)
+++ /latest/src/mouchard_scheduling.h	(revision 1)
@@ -0,0 +1,24 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 mouchard_scheduling.h             |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   20_12_2006                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef MOUCHARD_SCHEDULING_H
+#define MOUCHARD_SCHEDULING_H
+
+#include "process_dependency.h"
+
+namespace sc_core {
+
+ProcessDependencyList* MakeMouchardScheduling (const SignalDependencyGraph &);
+
+} // end of sc_core namespace
+
+#endif
+
Index: /latest/src/port_dependency.cc
===================================================================
--- /latest/src/port_dependency.cc	(revision 1)
+++ /latest/src/port_dependency.cc	(revision 1)
@@ -0,0 +1,169 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  port_dependency.cc               |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   21_09_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <list>
+#include <iostream>
+#include <fstream>
+#include "port_dependency.h"
+#include "simplify_string.h"
+#include "sc_fwd.h"
+#include "sc_object.h"
+#include "sc_module.h"
+#include "sc_port.h"
+#include "sc_ver_ext.h"
+
+using namespace std;
+
+namespace sc_core {
+
+static PortDependencyGraph aPortDependencyGraph;
+
+const PortDependencyGraph& 
+get_port_dependency_graph ()
+{
+	return aPortDependencyGraph;
+}
+
+static
+void
+check_port_dependency_declaration (const sc_port_base* a, 
+                                   const sc_port_base& b)
+{
+  const sc_module &moduleA = a->get_module ();
+  const sc_module &moduleB = b.get_module  ();
+  if (check_port_dependencies && (&moduleA != &moduleB))
+  {
+    const char *module_nameA = moduleA.basename ();
+    const char *module_nameB = moduleB.basename ();
+    if (strlen (module_nameA) == 0)
+      module_nameA = "<top level>";
+    cerr << "Error : Port dependency declaration in '"
+         << module_name_stack.back () << "' constructor is wrong.\n" 
+         << "'" << a->name () << "' and '" << b.name ()
+         << "' are ports of two differents modules ("
+         << module_nameA << " and " 
+         << module_nameB << "). "
+         << "You can't declare any port dependency like that.\n";
+    exit (37); //15092005);
+  }
+  if (module_name_stack.empty ())
+  {
+    cerr << "Error : Port dependency declaration is wrong.\n" 
+         << "The dependency declaration of '" 
+         << a->name () << "' and '" << b.name ()
+         << "' is not in any sc_module constructor.\n";
+    exit (16092005);
+  }
+  if (method_process_list.empty ())
+  {
+    cerr << "Error : Port dependency declaration in '"
+         << module_name_stack.back () << "' constructor is wrong.\n" 
+         << "The dependency of '" << a->name () << "' and '" << b.name ()
+         << "' should be linked to a SC_METHOD.\n";         
+    exit(165); //17092005);
+  }
+}
+
+void 
+set_port_dependency          (const sc_port_base* a, 
+                              const sc_port_base& b)
+{
+  check_port_dependency_declaration (a,b);
+	PortDependency p;
+	p.method = method_process_list.back();
+	p.source = a;
+	p.destination = &b;
+	aPortDependencyGraph.push_back (p);
+#if DUMP_PORT_DEPENDENCY
+	if (a) {
+		cerr << "'" << ((sc_object&)b).name()
+  	     << "' depends on '" 
+			   << ((sc_object*)a)->name () 
+         << "' in '" << p.method->name << "' function.\n";
+	} else
+		cerr << "'" << ((sc_object&)b).name()
+  	     << "' doesn't depend on anything"
+         << " in '" << p.method->name << "' function.\n";
+#endif
+}
+
+static
+void
+dot_write (ofstream &o, const PortDependencyGraph &g)
+{
+	string s;
+	PortDependencyGraph::const_iterator it;
+	for (it = g.begin (); it != g.end (); ++it)
+	{
+		if (it->source == NULL)
+			continue;
+		const char *name;
+		name = ((sc_object*)it->source)->name();
+		o << simplify_name(name,s);
+		o	<< " -> ";
+		name = ((sc_object*)it->destination)->name();
+		o << simplify_name(name,s);
+	  o << "\n";
+	}
+}
+
+bool
+PortDependencyGraph2dot (const char *name,
+                         const PortDependencyGraph& g)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "// Port dependency graph\n"
+       "// Generated by "
+    << sc_version () << "\n";
+	o << "strict digraph " << name << " {\n";
+	dot_write (o,g);
+	o << "}\n";
+	o.close ();
+  if (dump_stage)
+    cerr << "Port Dependency Graph written into '" 
+         << filename << "'.\n";
+	return true;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/port_dependency.h
===================================================================
--- /latest/src/port_dependency.h	(revision 1)
+++ /latest/src/port_dependency.h	(revision 1)
@@ -0,0 +1,39 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  port_dependency.h                |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef PORT_DEPENDENCY_H
+#define PORT_DEPENDENCY_H
+
+#include "sc_fwd.h"
+#include <list>
+
+#include "port_dependency_ext.h"
+
+namespace sc_core {
+
+// Port Dependency Graph
+struct PortDependency {
+	const method_process_t *method;
+	const sc_port_base     *source;
+	const sc_port_base     *destination;
+};
+typedef std::list<PortDependency> PortDependencyGraph;
+
+// Accessor
+extern const PortDependencyGraph& get_port_dependency_graph ();
+
+// Dump to dot file
+extern bool PortDependencyGraph2dot (const char *name, const PortDependencyGraph& = get_port_dependency_graph());
+
+} // end of sc_core namespace
+
+#endif
+
Index: /latest/src/port_dependency_ext.h
===================================================================
--- /latest/src/port_dependency_ext.h	(revision 1)
+++ /latest/src/port_dependency_ext.h	(revision 1)
@@ -0,0 +1,64 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  port_dependancy_ext.h            |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   12_08_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef PORT_DEPENDENCY_EXT_H
+#define PORT_DEPENDENCY_EXT_H
+
+namespace sc_core {
+
+// Declare dependancy
+extern void set_port_dependency (const sc_port_base* source,const sc_port_base& destination);
+
+template<typename T, size_t N1, size_t N2>
+inline
+void
+set_port_dependency (sc_in<T>  (&source)[N1],
+                     sc_out<T> (&destination)[N2])
+{
+  int i;
+  for (i = 0; i < N1; ++i)
+  {
+    int j;
+    for (j = 0; j < N2; ++j)
+    {
+      set_port_dependency ((const sc_port_base*) &(source[i]), (const
+sc_port_base&) (destination[j]));
+    }
+  }
+}
+
+} // end of namespace
+
+#endif
Index: /latest/src/process_dependency.cc
===================================================================
--- /latest/src/process_dependency.cc	(revision 1)
+++ /latest/src/process_dependency.cc	(revision 1)
@@ -0,0 +1,399 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  process_dependancy.cc            |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   21_09_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <set>
+#include <iostream>
+#include <fstream>
+#include "assert.h"
+#include "process_dependency.h"
+#include "methodprocess_dependency.h"
+#include "simplify_string.h"
+#include "sc_fwd.h"
+#include "sc_module.h"
+#include "sc_ver.h"
+
+using namespace std;
+
+namespace sc_core {
+
+bool 
+ProcessDependency::operator < (const ProcessDependency &a) const
+{
+	if (a.source < source)
+		return false;
+	if (a.destination < destination)
+		return false;
+	return true;
+}
+
+static
+void
+dot_write (ofstream &o,
+           const ProcessDependencyGraph &g)
+{
+	string s;
+	ProcessDependencyGraph::const_iterator it;
+	for (it = g.begin (); it != g.end (); ++it)
+	{
+		string name;
+		name = it->source->module->name();
+		name += "_";
+		name += it->source->name;
+		o << simplify_name(name.c_str(),s);
+		o	<< " -> ";
+		name = it->destination->module->name();
+		name += "_";
+		name += it->destination->name;
+		o << simplify_name(name.c_str(),s);
+	  o << "\n";
+	}
+}
+
+static
+void
+dot_write (ofstream &o, 
+           const ProcessDependencyList &l)
+{
+	const method_process_t *old = NULL;
+	string s;
+	ProcessDependencyList::const_iterator it;
+	for (it = l.begin (); it != l.end (); ++it)
+	{
+		const method_process_t *current = *it;
+		if (old)
+		{
+			string name;
+			name = old->module->name();
+			name += "_";
+			name += old->name;
+			o << simplify_name(name.c_str(),s);
+			o	<< " -> ";
+			name = current->module->name();
+			name += "_";
+			name += current->name;
+			o << simplify_name(name.c_str(),s);
+		  o << "\n";
+		}
+		old = current;
+	}
+}
+
+bool
+ProcessDependencyGraph2dot (const char *name,
+                            const ProcessDependencyGraph& g)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "// Ordered process list\n"
+             "// Generated by "
+          << sc_version () << "\n";
+	o << "strict digraph " << name << " {\n";
+	dot_write (o,g);
+	o << "}\n";
+	o.close ();
+  if (dump_stage)
+    cerr << "Port Dependency Graph written into '" 
+         << filename << "'.\n";
+	return true;
+}
+
+bool
+ProcessDependencyList2dot (const char *name,
+                          const ProcessDependencyList& l)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "// Ordered process list\n"
+       "// Generated by "
+    << sc_version () << "\n";
+	o << "digraph " << name << " {\n";
+	dot_write (o,l);
+	o << "}\n";
+	o.close ();
+	return true;
+}
+
+#if 0
+ProcessDependencyGraph* 
+sc_core::MakeProcessDependencyGraph (const SignalDependencyGraph& g)
+{
+  if (dump_stage)
+	  cerr << "Making module dependency graph...\n";
+
+	ProcessDependencyGraph *mod_g = new ProcessDependencyGraph ();
+	SignalDependencyGraph::const_iterator it;
+	for (it = g.begin(); it != g.end(); ++it)
+	{
+		ProcessDependency s;
+		s.destination = it->method;
+	  SignalDependencyGraph::const_iterator it2;
+		for (it2 = g.begin(); it2 != g.end(); ++it2)
+	  {
+			if (it2->source == it->destination)
+			{
+	  		s.source = it2->method;
+  	    mod_g->insert(s);
+			}
+		}
+	}
+	return mod_g;
+}
+
+static
+const method_process_t*
+get_method (const equi_t &e, const SignalDependencyGraph &sig)
+{
+	SignalDependencyGraph::const_iterator it;
+	for (it = sig.begin (); it != sig.end (); ++it)
+	{
+		if (it->destination == &e)
+			return it->method;
+	}
+	return NULL;
+}
+#endif
+
+
+static
+bool
+is_leef (const SignalDependencyGraph &g,
+         const equi_t                *e)
+{
+	SignalDependencyGraph::const_iterator it;
+	for (it = g.begin (); it != g.end (); ++it)
+  {
+    if (it->source == e)
+      return false;
+  }
+  return true;
+}
+
+static
+bool
+has_all_leef (const SignalDependencyGraph &sig,
+              const method_process_t      *m)
+{
+	SignalDependencyGraph::const_iterator sig_it;
+	for (sig_it = sig.begin (); sig_it != sig.end (); ++sig_it)
+    if ((sig_it->method == m) 
+       && (!is_leef (sig, sig_it->destination)))
+      return false;
+  return true;
+}
+
+static
+const method_process_t*
+get_best_process (const SignalDependencyGraph &sig)
+{
+	SignalDependencyGraph::const_iterator sig_it;
+	for (sig_it = sig.begin (); sig_it != sig.end (); ++sig_it)
+  {
+    if (has_all_leef (sig, sig_it->method)) 
+      return sig_it->method;
+  }
+  return NULL;
+}
+
+/*
+ *   Remove signals
+ */
+static
+void
+remove_leefs (SignalDependencyGraph  &g,
+             const method_process_t &m)
+{
+	SignalDependencyGraph::iterator it;
+	it = g.begin (); 
+  while (it != g.end ())
+  {
+    const method_process_t *cur_m = it->method;
+    if ((cur_m == &m) && (is_leef (g,it->destination)))
+    {
+      SignalDependencyGraph::iterator x = it++;
+      g.erase (x);
+    }
+    else
+      ++it;
+  }	
+}
+
+#if defined(UNUSED)
+static
+void
+print_signals (ostream                      &o,
+               const SignalDependencyGraph  &sig,
+               const method_process_t       *method,
+               bool                          source)
+{
+  int count = 0;
+	SignalDependencyGraph::const_iterator it;
+	for (it = sig.begin (); it != sig.end (); ++it)
+  {
+    const SignalDependency &dep   = *it;
+    const method_process_t *cur_m = dep.method;
+    if (cur_m == method)
+    {
+      const equi_t *e = (source)?dep.source:dep.destination;
+      o << ((count++)?",":"") << get_name (*e);
+    }
+  }	
+}
+#endif
+
+static
+void
+print_leef_list (SignalDependencyGraph &sig)
+{
+  typedef map<const equi_t *, const method_process_t *> table_t;
+  table_t table;
+  
+  // For each arrow, add destination node into table
+	SignalDependencyGraph::const_iterator sig_it;
+	for (sig_it = sig.begin (); sig_it != sig.end (); ++sig_it)
+  {
+    const SignalDependency  sd     = *sig_it;
+    const equi_t           *equi   = sd.destination;
+	  const method_process_t *method = sd.method;
+    table[equi] = method;
+  }
+ 
+  // For each arrow, remove source node into table
+	for (sig_it = sig.begin (); sig_it != sig.end (); ++sig_it)
+  {
+    const SignalDependency  sd = *sig_it;
+    const equi_t           *e  = sd.source;
+    table_t::const_iterator tab_it = table.find (e);
+    if (tab_it != table.end ())
+      table.erase (e);
+  }
+
+  typedef multimap<const method_process_t *, const equi_t *> table2_t;
+  typedef pair<const method_process_t *, const equi_t *> table2_pair_t;
+  table2_t table2;
+
+  // Build table2
+  table_t::const_iterator it;
+  for (it = table.begin(); it != table.end(); ++it)
+  {
+    const method_process_t *method = it->second;
+    const equi_t           *equi   = it->first;
+    table2_pair_t           pair   = table2_pair_t(method,equi);
+    table2.insert(pair);
+  }
+
+  // Print leef list
+  cerr << "Please split following methods :";
+  table2_t::const_iterator low_it = table2.begin();
+  table2_t::const_iterator up_it;
+  while (low_it != table2.end ())
+  {
+    const method_process_t *method      = low_it->first;
+    const char             *method_name = method->name;
+    const sc_module        *module      = method->module;
+    const char             *module_name = module->name();
+    cerr << "\n\t - " << module_name << "::" << method_name;
+    cerr << "() to evaluate '";
+    int   count = 0;
+    up_it = table2.upper_bound(low_it->first);
+    table2_t::const_iterator it2;
+    for (it2 = low_it; it2 != up_it; ++it2)
+    {
+      const equi_t *equi         = it2->second;
+      const char   *signal_name  = get_name (*equi);
+      cerr << ((count++)?",":"") << signal_name;
+    }
+    cerr << "' signal(s) separetly";
+    low_it = up_it;
+  }
+  cerr << "\n";
+}
+
+static
+void
+help2resolve (SignalDependencyGraph &sig)
+{
+  print_leef_list (sig);
+  MethodProcessDependencyGraph2dot ("methodprocess_graph", sig);
+  cerr << "Please look at 'methodprocess_graph.dot' "
+          "to know how to get ride of circular dependencies.\n";
+  if (dump_all_graph)
+  {
+    SignalDependencyGraph2dot ("reduced_signal_graph", sig);
+  }
+}
+
+ProcessDependencyList* 
+MakeProcessDependencyList  (const SignalDependencyGraph  & _sig_g)
+{
+  if (dump_stage)
+    cerr << "Making process dependency list...\n";
+	ProcessDependencyList *mod_l = new ProcessDependencyList ();
+	SignalDependencyGraph sig_g = _sig_g;
+	while (!sig_g.empty ())
+	{
+		const method_process_t *process = get_best_process (sig_g);
+#if 1
+    if (process == NULL)
+    {
+      cerr << "Internal Error : Unable to select the best process to schedule.\n";
+      help2resolve (sig_g);
+      exit (31032005); // 197
+    }
+#endif
+	  mod_l->push_front(process);
+#if 0
+		cerr << "Process found : " << *process << "\n";
+#endif
+		remove_leefs (sig_g, *process);
+	}
+	return mod_l;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/process_dependency.h
===================================================================
--- /latest/src/process_dependency.h	(revision 1)
+++ /latest/src/process_dependency.h	(revision 1)
@@ -0,0 +1,40 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 process_dependency.h              |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef MODULE_DEPENDENCY_H
+#define MODULE_DEPENDENCY_H
+
+#include "signal_dependency.h"
+
+namespace sc_core {
+
+// Signal Dependency Graph
+struct ProcessDependency {
+	const method_process_t *source;
+	const method_process_t *destination;
+	bool operator < (const ProcessDependency &) const;
+};
+
+typedef std::set<ProcessDependency>        ProcessDependencyGraph;
+typedef std::list<const method_process_t*> ProcessDependencyList;
+
+// Convert Port Dependency Graph to Signal Dependency Graph
+extern ProcessDependencyGraph* MakeProcessDependencyGraph (const SignalDependencyGraph&);
+extern ProcessDependencyList* MakeProcessDependencyList (const SignalDependencyGraph&);
+
+// Dump to dot file
+extern bool ProcessDependencyGraph2dot (const char *name, const ProcessDependencyGraph&);
+extern bool ProcessDependencyList2dot (const char *name, const ProcessDependencyList&);
+
+} // end of sc_core namespace
+
+#endif
+
Index: /latest/src/sc_bigint.h
===================================================================
--- /latest/src/sc_bigint.h	(revision 1)
+++ /latest/src/sc_bigint.h	(revision 1)
@@ -0,0 +1,150 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_bigint.h                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_BIGINT_H__
+#define __SC_BIGINT_H__
+
+#include <sc_bit.h>
+#include <sc_logic.h>
+#include <sc_bv.h>
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_bigint<W>
+//
+// ----------------------------------------------------------------------------
+
+#include"sc_nbdefs.h"
+
+namespace sc_dt {
+
+//
+#define MASK32(W) ((~ (const uint32)0) >> (sizeof (uint32) * 8 - W))
+#define MASK64(W) ((~ (const uint64)0) >> (sizeof (uint64) * 8 - W))
+//
+
+template<int W> struct s_bigint_type { typedef uint64 uint_type;};
+#define DECLAR_BIGINT_TYPE(W) template<> struct s_bigint_type<W> { typedef uint16 uint_type; }// not declared as uint16 because << operator threats like a character
+DECLAR_BIGINT_TYPE( 1);
+DECLAR_BIGINT_TYPE( 2);
+DECLAR_BIGINT_TYPE( 3);
+DECLAR_BIGINT_TYPE( 4);
+DECLAR_BIGINT_TYPE( 5);
+DECLAR_BIGINT_TYPE( 6);
+DECLAR_BIGINT_TYPE( 7);
+DECLAR_BIGINT_TYPE( 8);
+#undef DECLAR_BIGINT_TYPE
+#define DECLAR_BIGINT_TYPE(W) template<> struct s_bigint_type<W> { typedef uint16 uint_type; }
+DECLAR_BIGINT_TYPE( 9);
+DECLAR_BIGINT_TYPE(10);
+DECLAR_BIGINT_TYPE(11);
+DECLAR_BIGINT_TYPE(12);
+DECLAR_BIGINT_TYPE(13);
+DECLAR_BIGINT_TYPE(14);
+DECLAR_BIGINT_TYPE(15);
+DECLAR_BIGINT_TYPE(16);
+#undef DECLAR_BIGINT_TYPE
+#define DECLAR_BIGINT_TYPE(W) template<> struct s_bigint_type<W> { typedef uint32 uint_type; }
+DECLAR_BIGINT_TYPE(17);
+DECLAR_BIGINT_TYPE(18);
+DECLAR_BIGINT_TYPE(19);
+DECLAR_BIGINT_TYPE(20);
+DECLAR_BIGINT_TYPE(21);
+DECLAR_BIGINT_TYPE(22);
+DECLAR_BIGINT_TYPE(23);
+DECLAR_BIGINT_TYPE(24);
+DECLAR_BIGINT_TYPE(25);
+DECLAR_BIGINT_TYPE(26);
+DECLAR_BIGINT_TYPE(27);
+DECLAR_BIGINT_TYPE(28);
+DECLAR_BIGINT_TYPE(29);
+DECLAR_BIGINT_TYPE(30);
+DECLAR_BIGINT_TYPE(31);
+DECLAR_BIGINT_TYPE(32);
+#undef DECLAR_BIGINT_TYPE
+
+template< int W /* = SC_INTWIDTH */>
+class sc_bigint
+{
+  typedef sc_bigint<W>                     this_type;
+  typedef typename s_int_type<W>::int_type  data_type;
+
+  typedef data_type sc_uint_subref;
+  typedef data_type sc_uint_subref_r;
+
+	union {
+	  data_type valW:W;
+    bool      valB[W];
+		data_type val;
+	};
+	void check () 
+	{ if (W > 64) { std::cerr << "sc_bigint with W > 64 is not supported.\n"; exit (20040528); } }
+public:
+  sc_bigint() { check (); val = 0; }
+  sc_bigint(data_type val_) { check (); val = 0; write (val_); }
+  template <int W2> explicit sc_bigint (const sc_bigint<W2> &val_) { write (val_.read());}
+
+  inline const data_type& read() const { return val; }
+  inline operator const data_type& () const { return read (); }
+//  inline void write(int64 val_) { val = val_ & MASK64(W); }
+//  inline void write(signed int val_)   { val = val_ & MASK32(W); }
+  inline void write(data_type val_)   { valW = val_; }
+  template <int W2> inline void write (const sc_bigint<W2> val_) { write (val_.read ()); }
+  inline void write (const sc_bigint<W> val_) { write (val_.read()); };
+	template <typename T> inline sc_bigint& operator = (const T& val_) { write (val_); return *this; }
+
+  inline uint32         to_uint   () const {return val & MASK32(W);};
+  inline int32          to_int    () const {return val & MASK32(W);};
+  inline uint64         to_uint64 () const {return val & MASK64(W);};
+  inline int64          to_int64  () const {return val & MASK64(W);};
+
+  template <typename T>
+  inline sc_bigint& operator <<= (T v)
+  { valW <<= v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator >>= (T v)
+  { valW >>= v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator += (T v)
+  { valW += v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator -= (T v)
+  { valW -= v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator *= (T v)
+  { valW *= v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator /= (T v)
+  { valW /= v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator %= (T v)
+  { valW %= v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator &= (T v)
+  { valW &= v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator |= (T v)
+  { valW |= v; return *this; }
+  template <typename T>
+  inline sc_bigint& operator ^= (T v)
+  { valW ^= v; return *this; }
+  inline sc_uint_bit_ref& operator [] (int v)
+  { return valB[v]; }
+  inline sc_uint_bit_ref_r& operator [] (int v) const
+  { return valB[v]; }
+  inline sc_uint_subref range (int left, int right)
+  { return (((~0) >> (sizeof (data_type) * 8 - left)) & val) >> right; }
+  inline sc_uint_subref_r range (int left, int right) const
+  { return (((~0) >> (sizeof (data_type) * 8 - left)) & val) >> right; }
+};
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_BIGINT_H__ */
Index: /latest/src/sc_biguint.h
===================================================================
--- /latest/src/sc_biguint.h	(revision 1)
+++ /latest/src/sc_biguint.h	(revision 1)
@@ -0,0 +1,146 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_biguint.h                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_BIGUINT_H__
+#define __SC_BIGUINT_H__
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_biguint<W>
+//
+// ----------------------------------------------------------------------------
+
+#include"sc_nbdefs.h"
+
+namespace sc_dt {
+
+//
+#define MASK32(W) ((~ (const uint32)0) >> (sizeof (uint32) * 8 - W))
+#define MASK64(W) ((~ (const uint64)0) >> (sizeof (uint64) * 8 - W))
+//
+
+template<int W> struct s_biguint_type { typedef uint64 uint_type;};
+#define DECLAR_BIGUINT_TYPE(W) template<> struct s_biguint_type<W> { typedef uint16 uint_type; }// not declared as uint16 because << operator threats like a character
+DECLAR_BIGUINT_TYPE( 1);
+DECLAR_BIGUINT_TYPE( 2);
+DECLAR_BIGUINT_TYPE( 3);
+DECLAR_BIGUINT_TYPE( 4);
+DECLAR_BIGUINT_TYPE( 5);
+DECLAR_BIGUINT_TYPE( 6);
+DECLAR_BIGUINT_TYPE( 7);
+DECLAR_BIGUINT_TYPE( 8);
+#undef DECLAR_BIGUINT_TYPE
+#define DECLAR_BIGUINT_TYPE(W) template<> struct s_biguint_type<W> { typedef uint16 uint_type; }
+DECLAR_BIGUINT_TYPE( 9);
+DECLAR_BIGUINT_TYPE(10);
+DECLAR_BIGUINT_TYPE(11);
+DECLAR_BIGUINT_TYPE(12);
+DECLAR_BIGUINT_TYPE(13);
+DECLAR_BIGUINT_TYPE(14);
+DECLAR_BIGUINT_TYPE(15);
+DECLAR_BIGUINT_TYPE(16);
+#undef DECLAR_BIGUINT_TYPE
+#define DECLAR_BIGUINT_TYPE(W) template<> struct s_biguint_type<W> { typedef uint32 uint_type; }
+DECLAR_BIGUINT_TYPE(17);
+DECLAR_BIGUINT_TYPE(18);
+DECLAR_BIGUINT_TYPE(19);
+DECLAR_BIGUINT_TYPE(20);
+DECLAR_BIGUINT_TYPE(21);
+DECLAR_BIGUINT_TYPE(22);
+DECLAR_BIGUINT_TYPE(23);
+DECLAR_BIGUINT_TYPE(24);
+DECLAR_BIGUINT_TYPE(25);
+DECLAR_BIGUINT_TYPE(26);
+DECLAR_BIGUINT_TYPE(27);
+DECLAR_BIGUINT_TYPE(28);
+DECLAR_BIGUINT_TYPE(29);
+DECLAR_BIGUINT_TYPE(30);
+DECLAR_BIGUINT_TYPE(31);
+DECLAR_BIGUINT_TYPE(32);
+#undef DECLAR_BIGUINT_TYPE
+
+template< int W /* = SC_INTWIDTH */>
+class sc_biguint
+{
+  typedef sc_biguint<W>                     this_type;
+  typedef typename s_int_type<W>::int_type  data_type;
+
+  typedef data_type sc_uint_subref;
+  typedef data_type sc_uint_subref_r;
+
+	union {
+	  data_type valW:W;
+    bool      valB[W];
+		data_type val;
+	};
+	void check () 
+	{ if (W > 64) { std::cerr << "sc_biguint with W > 64 is not supported.\n"; exit (20040528); } }
+public:
+  sc_biguint() { check (); val = 0; }
+  sc_biguint(data_type val_) { check (); val = 0; write (val_); }
+  template <int W2> explicit sc_biguint (const sc_biguint<W2> &val_) { write (val_.read());}
+
+  inline const data_type& read() const { return val; }
+  inline operator const data_type& () const { return read (); }
+//  inline void write(int64 val_) { val = val_ & MASK64(W); }
+//  inline void write(signed int val_)   { val = val_ & MASK32(W); }
+  inline void write(data_type val_)   { valW = val_; }
+  template <int W2> inline void write (const sc_biguint<W2> val_) { write (val_.read ()); }
+  inline void write (const sc_biguint<W> val_) { write (val_.read()); };
+	template <typename T> inline sc_biguint& operator = (const T& val_) { write (val_); return *this; }
+
+  inline uint32         to_uint   () const {return val & MASK32(W);};
+  inline int32          to_int    () const {return val & MASK32(W);};
+  inline uint64         to_uint64 () const {return val & MASK64(W);};
+  inline int64          to_int64  () const {return val & MASK64(W);};
+
+  template <typename T>
+  inline sc_biguint& operator <<= (T v)
+  { valW <<= v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator >>= (T v)
+  { valW >>= v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator += (T v)
+  { valW += v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator -= (T v)
+  { valW -= v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator *= (T v)
+  { valW *= v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator /= (T v)
+  { valW /= v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator %= (T v)
+  { valW %= v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator &= (T v)
+  { valW &= v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator |= (T v)
+  { valW |= v; return *this; }
+  template <typename T>
+  inline sc_biguint& operator ^= (T v)
+  { valW ^= v; return *this; }
+  inline sc_uint_bit_ref& operator [] (int v)
+  { return valB[v]; }
+  inline sc_uint_bit_ref_r& operator [] (int v) const
+  { return valB[v]; }
+  inline sc_uint_subref range (int left, int right)
+  { return (((~0) >> (sizeof (data_type) * 8 - left)) & val) >> right; }
+  inline sc_uint_subref_r range (int left, int right) const
+  { return (((~0) >> (sizeof (data_type) * 8 - left)) & val) >> right; }
+};
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_BIGUINT_H__ */
Index: /latest/src/sc_bit.h
===================================================================
--- /latest/src/sc_bit.h	(revision 1)
+++ /latest/src/sc_bit.h	(revision 1)
@@ -0,0 +1,194 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_bit.h                          |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   14_04_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_BIT_H__
+#define __SC_BIT_H__
+
+#include"sc_nbdefs.h"
+#include"sc_fwd.h"
+#include"sc_logic.h"
+#include"sc_string.h"
+#include"sc_numrep.h"
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_bit
+//
+// ----------------------------------------------------------------------------
+
+namespace sc_dt {
+
+class sc_bit
+{
+/////////////////////////
+///// SYSTEMCASS SPECIFIC
+  bool val;
+/////////////////////////
+public:
+  // constructors  & destructor 
+  sc_bit ()                             { val = false; }
+  explicit sc_bit (bool a)              { val = a; }
+  explicit sc_bit (int a)               { val = a > 0; }
+  explicit sc_bit (char a)              { val = (a == '1')?true:false; }
+  explicit sc_bit (const sc_logic & a)  { val = a.to_bool(); }
+  ~sc_bit ()                            { };
+  // copy constructor 
+  sc_bit (const sc_bit & a)             { val = a; }
+  // assignment operators 
+  sc_bit & operator = (const sc_bit & b)   { val = b.to_bool(); return *this; }
+  sc_bit & operator = (int b)              { val = b > 0; return *this; }
+  sc_bit & operator = (bool b)             { val = b; return *this; }
+  sc_bit & operator = (char b)             { val = (b == '1')?true:false; return *this; }
+  sc_bit & operator = (const sc_logic & b) { val = b.to_bool(); return *this; }
+
+  // bitwise assignment operators 
+  sc_bit & operator &= (const sc_bit & b)  { val &= b.to_bool(); return *this; }
+  sc_bit & operator &= (int b)             { val &= b > 0; return *this; }
+  sc_bit & operator &= (bool b)            { val &= b; return *this; }
+  sc_bit & operator &= (char b)            { val &= (b == '1')?true:false; return *this; }
+  sc_bit & operator |= (const sc_bit & b)  { val |= b.val; return *this; }
+  sc_bit & operator |= (int b)             { val |= b > 0; return *this; }
+  sc_bit & operator |= (bool b)            { val |= b; return *this; }
+  sc_bit & operator |= (char b)            { val |= (b == '1')?true:false; return *this; }
+  sc_bit & operator ^= (const sc_bit & b)  { val ^= b.val; return *this; }
+  sc_bit & operator ^= (int b)             { val ^= b > 0; return *this; }
+  sc_bit & operator ^= (bool b)            { val ^= b; return *this; }
+  sc_bit & operator ^= (char b)            { val ^= (b == '1')?true:false; return *this; }
+
+  // implicit conversion to bool 
+  operator bool () const    { return val;  }
+  bool operator ! () const  { return !val; }
+
+  // explicit conversion to character string 
+  const sc_string to_string       ( sc_numrep numrep = SC_DEC ) const 
+  { return sc_string ((val)?"1":"0"); }
+  const sc_string to_dec() const  { return to_string (SC_DEC); }
+  const sc_string to_bin() const  { return to_string (SC_BIN); }
+  const sc_string to_oct() const  { return to_string (SC_OCT); }
+  const sc_string to_hex() const  { return to_string (SC_HEX); }
+
+  // others explicit conversions 
+  bool to_bool () const     { return val;  }
+  char to_char () const     { return (val)?'1':'0'; }
+
+  // relational operators and functions 
+  friend bool operator == (const sc_bit & a, const sc_bit & b) { return a ==
+b; }
+  friend bool operator == (const sc_bit & a, int b);
+  friend bool operator == (const sc_bit & a, bool b);
+  friend bool operator == (const sc_bit & a, char b);
+  friend bool operator == (int a, const sc_bit & b);
+
+  friend bool operator == (bool a, const sc_bit & b);
+  friend bool operator == (char a, const sc_bit & b);
+  friend bool equal (const sc_bit & a, const sc_bit & b);
+  friend bool equal (const sc_bit & a, int b);
+  friend bool equal (const sc_bit & a, bool b);
+  friend bool equal (const sc_bit & a, char b);
+  friend bool equal (int a, const sc_bit & b);
+  friend bool equal (bool a, const sc_bit & b);
+  friend bool equal (char a, const sc_bit & b);
+  friend bool operator != (const sc_bit & a, const sc_bit & b);
+  friend bool operator != (const sc_bit & a, int b);
+  friend bool operator != (const sc_bit & a, bool b);
+  friend bool operator != (const sc_bit & a, char b);
+  friend bool operator != (int a, const sc_bit & b);
+  friend bool operator != (bool a, const sc_bit & b);
+  friend bool operator != (char a, const sc_bit & b);
+  friend bool not_equal (const sc_bit & a, const sc_bit & b);
+  friend bool not_equal (const sc_bit & a, int b);
+  friend bool not_equal (const sc_bit & a, bool b);
+  friend bool not_equal (const sc_bit & a, char b);
+  friend bool not_equal (int a, const sc_bit & b);
+  friend bool not_equal (bool a, const sc_bit & b);
+  friend bool not_equal (char a, const sc_bit & b);
+  // bitwise complement 
+  friend const sc_bit operator ~ (const sc_bit & a);
+    sc_bit & b_not ();
+  friend void b_not (sc_bit & r, const sc_bit & a);
+  friend const sc_bit b_not (const sc_bit & a);
+  // bitwise or 
+  friend const sc_bit operator | (const sc_bit & a, const sc_bit & b);
+  friend const sc_bit operator | (const sc_bit & a, int b);
+  friend const sc_bit operator | (const sc_bit & a, bool b);
+  friend const sc_bit operator | (const sc_bit & a, char b);
+  friend const sc_bit operator | (int a, const sc_bit & b);
+  friend const sc_bit operator | (bool a, const sc_bit & b);
+  friend const sc_bit operator | (char a, const sc_bit & b);
+  friend const sc_bit b_or (const sc_bit & a, const sc_bit & b);
+  friend const sc_bit b_or (const sc_bit & a, int b);
+  friend const sc_bit b_or (const sc_bit & a, bool b);
+  friend const sc_bit b_or (const sc_bit & a, char b);
+  friend const sc_bit b_or (int a, const sc_bit & b);
+  friend const sc_bit b_or (bool a, const sc_bit & b);
+
+  friend const sc_bit b_or (char a, const sc_bit & b);
+  friend void b_or (sc_bit & r, const sc_bit & a, const sc_bit & b);
+  friend void b_or (sc_bit & r, const sc_bit & a, int b);
+  friend void b_or (sc_bit & r, const sc_bit & a, bool b);
+  friend void b_or (sc_bit & r, const sc_bit & a, char b);
+  friend void b_or (sc_bit & r, int a, const sc_bit & b);
+  friend void b_or (sc_bit & r, bool a, const sc_bit & b);
+  friend void b_or (sc_bit & r, char a, const sc_bit & b);
+  // bitwise and 
+  friend const sc_bit operator & (const sc_bit & a, const sc_bit & b);
+  friend const sc_bit operator & (const sc_bit & a, int b);
+  friend const sc_bit operator & (const sc_bit & a, bool b);
+  friend const sc_bit operator & (const sc_bit & a, char b);
+  friend const sc_bit operator & (int a, const sc_bit & b);
+  friend const sc_bit operator & (bool a, const sc_bit & b);
+  friend const sc_bit operator & (char a, const sc_bit & b);
+  friend const sc_bit b_and (const sc_bit & a, const sc_bit & b);
+  friend const sc_bit b_and (const sc_bit & a, int b);
+  friend const sc_bit b_and (const sc_bit & a, bool b);
+  friend const sc_bit b_and (const sc_bit & a, char b);
+  friend const sc_bit b_and (int a, const sc_bit & b);
+  friend const sc_bit b_and (bool a, const sc_bit & b);
+  friend const sc_bit b_and (char a, const sc_bit & b);
+  friend void b_and (sc_bit & r, const sc_bit & a, const sc_bit & b);
+  friend void b_and (sc_bit & r, const sc_bit & a, int b);
+  friend void b_and (sc_bit & r, const sc_bit & a, bool b);
+  friend void b_and (sc_bit & r, const sc_bit & a, char b);
+  friend void b_and (sc_bit & r, int a, const sc_bit & b);
+  friend void b_and (sc_bit & r, bool a, const sc_bit & b);
+  friend void b_and (sc_bit & r, char a, const sc_bit & b);
+  // bitwise exor 
+  friend const sc_bit operator ^ (const sc_bit & a, const sc_bit & b);
+  friend const sc_bit operator ^ (const sc_bit & a, int b);
+  friend const sc_bit operator ^ (const sc_bit & a, bool b);
+  friend const sc_bit operator ^ (const sc_bit & a, char b);
+  friend const sc_bit operator ^ (int a, const sc_bit & b);
+
+  friend const sc_bit operator ^ (bool a, const sc_bit & b);
+  friend const sc_bit operator ^ (char a, const sc_bit & b);
+  friend const sc_bit b_xor (const sc_bit & a, const sc_bit & b);
+  friend const sc_bit b_xor (const sc_bit & a, int b);
+  friend const sc_bit b_xor (const sc_bit & a, bool b);
+  friend const sc_bit b_xor (const sc_bit & a, char b);
+  friend const sc_bit b_xor (int a, const sc_bit & b);
+  friend const sc_bit b_xor (bool a, const sc_bit & b);
+  friend const sc_bit b_xor (char a, const sc_bit & b);
+  friend void b_xor (sc_bit & r, const sc_bit & a, const sc_bit & b);
+  friend void b_xor (sc_bit & r, const sc_bit & a, int b);
+  friend void b_xor (sc_bit & r, const sc_bit & a, bool b);
+  friend void b_xor (sc_bit & r, const sc_bit & a, char b);
+  friend void b_xor (sc_bit & r, int a, const sc_bit & b);
+  friend void b_xor (sc_bit & r, bool a, const sc_bit & b);
+  friend void b_xor (sc_bit & r, char a, const sc_bit & b);
+/*
+  // other functions 
+  void print (std::ostream & os = std::cout) const;
+  void scan (std::istream & = std::cin);
+*/
+};
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_BIT_H__ */
Index: /latest/src/sc_bv.h
===================================================================
--- /latest/src/sc_bv.h	(revision 1)
+++ /latest/src/sc_bv.h	(revision 1)
@@ -0,0 +1,111 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_bv.h                           |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   14_04_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_BV_H__
+#define __SC_BV_H__
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_bv
+//
+// ----------------------------------------------------------------------------
+
+#include"sc_nbdefs.h"
+#include"sc_logic.h"
+#include"sc_unsigned.h"
+#include"sc_signed.h"
+#include"sc_uint.h"
+#include"sc_int.h"
+
+namespace sc_dt {
+
+class sc_bv_base
+{
+public:
+  // constructors 
+/*
+  explicit sc_bv_base (int length_ = sc_length_param ().len ());
+  explicit sc_bv_base (bool a, int length_ = sc_length_param ().len ());
+*/
+    sc_bv_base (const char *a);
+    sc_bv_base (const char *a, int length_);
+    template < class X > sc_bv_base (const sc_bv_base & a);
+    virtual ~ sc_bv_base ();
+  // assignment operators 
+    template < class X > sc_bv_base & operator = (const sc_bv_base & a);
+    sc_bv_base & operator = (const char *a);
+    sc_bv_base & operator = (const bool * a);
+    sc_bv_base & operator = (const sc_logic * a);
+    sc_bv_base & operator = (const sc_unsigned & a);
+    sc_bv_base & operator = (const sc_signed & a);
+/*
+    sc_bv_base & operator = (const sc_uint_base & a);
+    sc_bv_base & operator = (const sc_int_base & a);
+*/
+    sc_bv_base & operator = (unsigned long a);
+    sc_bv_base & operator = (long a);
+    sc_bv_base & operator = (unsigned int a);
+    sc_bv_base & operator = (int a);
+    sc_bv_base & operator = (uint64 a);
+    sc_bv_base & operator = (int64 a);
+
+  // methods 
+  int length () const;
+  bool is_01 () const;
+};
+
+
+template < int W > class sc_bv:public sc_bv_base
+{
+public:
+  // constructors 
+  sc_bv ();
+  explicit sc_bv (bool init_value);
+  explicit sc_bv (char init_value);
+    sc_bv (const char *a);
+    sc_bv (const bool * a);
+    sc_bv (const sc_logic * a);
+    sc_bv (const sc_unsigned & a);
+    sc_bv (const sc_signed & a);
+/*
+    sc_bv (const sc_uint_base & a);
+    sc_bv (const sc_int_base & a);
+*/
+    sc_bv (unsigned long a);
+    sc_bv (long a);
+    sc_bv (unsigned int a);
+    sc_bv (int a);
+    sc_bv (uint64 a);
+    sc_bv (int64 a);
+    sc_bv (const sc_bv_base & a);
+    sc_bv (const sc_bv < W > &a);
+  // assignment operators 
+    template < class X > sc_bv < W > &operator = (const sc_bv_base & a);
+    sc_bv < W > &operator = (const sc_bv < W > &a);
+    sc_bv < W > &operator = (const char *a);
+    sc_bv < W > &operator = (const bool * a);
+    sc_bv < W > &operator = (const sc_logic * a);
+    sc_bv < W > &operator = (const sc_unsigned & a);
+    sc_bv < W > &operator = (const sc_signed & a);
+/*
+    sc_bv < W > &operator = (const sc_uint_base & a);
+    sc_bv < W > &operator = (const sc_int_base & a);
+*/
+    sc_bv < W > &operator = (unsigned long a);
+    sc_bv < W > &operator = (long a);
+    sc_bv < W > &operator = (unsigned int a);
+    sc_bv < W > &operator = (int a);
+    sc_bv < W > &operator = (uint64 a);
+    sc_bv < W > &operator = (int64 a);
+};
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_BV_H__ */
Index: /latest/src/sc_clock.cc
===================================================================
--- /latest/src/sc_clock.cc	(revision 1)
+++ /latest/src/sc_clock.cc	(revision 1)
@@ -0,0 +1,106 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  sc_clock.cc                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_09_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include"sc_clock.h"
+#include"assert.h"
+
+using namespace std;
+
+namespace sc_core {
+
+const char *const sc_clock::kind_string = "sc_clock";
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_clock
+//
+// ----------------------------------------------------------------------------
+
+
+sc_clock::sc_clock(): base_type() 
+{
+	init ();
+  posedge_first = true;
+}
+
+sc_clock::sc_clock(const char *name_): base_type(name_)
+{
+	init ();
+  posedge_first = true;
+}
+
+sc_clock::sc_clock(const char *name_,
+	   const          sc_time& period_,
+	   double         duty_cycle_,
+	   const sc_time& start_time_,
+	   bool           posedge_first_) : base_type(name_)
+{
+	init ();
+  ASSERT(period_     == 1);
+  ASSERT(duty_cycle_ == 0.5);
+  ASSERT(start_time_ == SC_ZERO_TIME);
+  posedge_first = posedge_first_;
+}
+
+sc_clock::sc_clock(const char *name_,
+	   double         period_,
+	   double         duty_cycle_,
+	   double         start_time_,
+	   bool           posedge_first_) : base_type(name_)
+{
+	init ();
+  ASSERT(period_     == 1);
+  ASSERT(duty_cycle_ == 0.5);
+  ASSERT(start_time_ == SC_ZERO_TIME);
+  posedge_first = posedge_first_;
+}
+
+sc_clock::~sc_clock ()
+{
+}
+
+void
+sc_clock::init ()
+{
+	set_kind (kind_string);
+}
+
+sc_clock::this_type& sc_clock::operator = ( const data_type& value_) {
+  write(value_);
+  return *this;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/sc_clock.h
===================================================================
--- /latest/src/sc_clock.h	(revision 1)
+++ /latest/src/sc_clock.h	(revision 1)
@@ -0,0 +1,20 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  sc_clock.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_09_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_CLOCK_H__
+#define __SC_CLOCK_H__
+
+#include"sc_clock_ext.h"
+
+
+#endif /* __SC_CLOCK_H__ */
+
Index: /latest/src/sc_clock_ext.h
===================================================================
--- /latest/src/sc_clock_ext.h	(revision 1)
+++ /latest/src/sc_clock_ext.h	(revision 1)
@@ -0,0 +1,89 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  sc_clock_ext.h                   |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_09_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __SC_CLOCK_EXT_H__
+#define __SC_CLOCK_EXT_H__
+
+#include "sc_signal.h"
+
+namespace sc_core {
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_clock
+//
+// ----------------------------------------------------------------------------
+
+class sc_clock : public sc_signal<bool>
+{
+	//////
+	// Internal
+  void init ();
+	//////				 
+private:
+  typedef bool                            data_type;
+  typedef sc_signal<bool>                 base_type;
+  typedef sc_clock                        this_type;
+
+public:
+  sc_clock();
+	/*virtual */~sc_clock();
+  // Changes from LRM : 
+  // We use "const char *" instead of "sc_module_name" because we don't need
+  // to add a module name in the stack when constructing sc_clock !
+  explicit sc_clock(const char *name_); 
+  sc_clock(const char *name_,
+	   const          sc_time& period_,
+	   double         duty_cycle_ = 0.5,
+	   const sc_time& start_time_ = SC_ZERO_TIME,
+	   bool           posedge_first_ = true );
+  sc_clock(const char *name_,
+	   double         period_,
+	   double         duty_cycle_ = 0.5,
+	   double         start_time_ = 0.0,
+	   bool           posedge_first_ = true );
+
+  static const char *const kind_string;
+  //virtual const char *kind () const;
+  
+  /*inline*/ this_type& operator = ( const data_type& value_);
+
+  bool posedge_first;
+};
+
+} // end of sc_core namespace
+
+#endif /* __SC_CLOCK_EXT_H__ */
+
Index: /latest/src/sc_event.cc
===================================================================
--- /latest/src/sc_event.cc	(revision 1)
+++ /latest/src/sc_event.cc	(revision 1)
@@ -0,0 +1,76 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_event.cc                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include<iostream>
+#include"sc_event.h"
+#include"sc_interface.h"
+#include"sc_port_ext.h"
+
+using namespace std;
+
+namespace sc_core {
+// ----------------------------------------------------------------------------
+//  CLASS : sc_event
+//
+//  Static events.
+// ----------------------------------------------------------------------------
+
+ostream& operator << (ostream &o, const sc_event &s)
+{ 
+  o << get_name (s.get_interface().get_pointer()) << ".";
+  switch (s.get_flag ()) {
+	case sc_event::VAL:	return o << "val()";
+	case sc_event::NEG: return o << "neg()";
+	case sc_event::POS: return o << "pos()";
+	default:  
+	  cerr << "Internal error : unknown event flag.\n";
+		exit (13);
+	}
+}
+
+sc_event::sc_event (const sc_interface &inter_,
+		                flag_t flag_)
+	: interface (inter_)
+{
+	flag = flag_;
+}
+
+sc_event::~sc_event ()
+{
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/sc_event.h
===================================================================
--- /latest/src/sc_event.h	(revision 1)
+++ /latest/src/sc_event.h	(revision 1)
@@ -0,0 +1,50 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_event.h                        |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_EVENT_H__
+#define __SC_EVENT_H__
+
+#include"sc_fwd.h"
+
+namespace sc_core {
+
+class sc_event {
+public : typedef enum { POS, NEG, VAL } flag_t;
+private:
+	const sc_interface   &interface;
+	flag_t flag;
+public:
+	bool pos () const;
+  sc_event (const sc_interface &, flag_t);
+  ~sc_event ();
+
+  // methods
+  const sc_interface&  get_interface() const { return interface;}; // CASC specific
+  flag_t              get_flag () const { return flag;}; // CASC specific
+  
+  // operators
+
+  friend std::ostream& operator << (std::ostream &, const sc_event &);
+	
+  sc_event ();
+	/*
+	// LRM
+  sc_event ();
+private:
+  // disabled
+  sc_event (const sc_event &);
+  sc_event& operator = (const sc_event&);  
+	*/
+};
+
+} // end of sc_core namespace
+
+#endif /* __SC_EVENT_H__ */
Index: /latest/src/sc_event_finder.cc
===================================================================
--- /latest/src/sc_event_finder.cc	(revision 1)
+++ /latest/src/sc_event_finder.cc	(revision 1)
@@ -0,0 +1,53 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_event_finder.cc                |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include"sc_event_finder.h"
+
+sc_event_finder::sc_event_finder (/*const*/ sc_port_base &p)
+  : a_port (p)
+{
+}
+
+sc_event_finder::~sc_event_finder ()
+{
+}
+
+/*const*/ sc_port_base& 
+sc_event_finder::port () /*const*/
+{
+  return a_port;
+}
+
Index: /latest/src/sc_event_finder.h
===================================================================
--- /latest/src/sc_event_finder.h	(revision 1)
+++ /latest/src/sc_event_finder.h	(revision 1)
@@ -0,0 +1,35 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_event_finder.h                 |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_EVENT_FINDER_H__
+#define __SC_EVENT_FINDER_H__
+
+#include"sc_fwd.h"
+
+class sc_event_finder {
+  /*const*/sc_port_base &a_port;
+public:
+  sc_event_finder (/*const*/ sc_port_base&);
+  virtual ~sc_event_finder ();
+
+  // methods
+  /*const*/ sc_port_base& port () /*const*/;
+  
+  // operators
+
+private:
+  // disabled
+  sc_event_finder ();
+  sc_event_finder (const sc_event_finder &);
+  sc_event_finder& operator = (const sc_event_finder&);  
+};
+
+#endif /* __SC_EVENT_FINDER_H__ */
Index: /latest/src/sc_fwd.h
===================================================================
--- /latest/src/sc_fwd.h	(revision 1)
+++ /latest/src/sc_fwd.h	(revision 1)
@@ -0,0 +1,117 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_fwd.h                          |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_FWD_H__
+#define __SC_FWD_H__
+
+#include <vector>
+//#include <list>
+
+namespace sc_core {
+
+/////////////////////////////////////////////////
+// kernel
+//
+class method_process_t;
+class sc_port_base;
+class sc_object;
+class sc_interface;
+class sc_module;
+class sc_event;
+class sc_event_finder;
+class sc_sensitive;
+class sc_sensitive_pos;
+class sc_sensitive_neg;
+class sc_module_name;
+class sc_time;
+
+/////////////////////////////////////////////////
+// Ports & Signals
+//
+template <class T> class sc_in;
+template <class T> class sc_inout;
+template <class T> class sc_out;
+template <class T> class sc_signal;
+template < typename T > class sc_port_b;
+class sc_signal_base;
+class sc_clock;
+
+/////////////////////////////////////////////////
+// Tracing
+//
+class sc_trace_file;
+
+/////////////////////////////////////////////////
+// lists
+//
+typedef std::vector<method_process_t *> method_process_list_t;
+}
+
+using sc_core::method_process_t;
+using sc_core::sc_port_base;
+using sc_core::sc_object;
+using sc_core::sc_interface;
+using sc_core::sc_module;
+using sc_core::sc_module_name;
+using sc_core::sc_event;
+using sc_core::sc_event_finder;
+using sc_core::sc_sensitive;
+using sc_core::sc_sensitive_pos;
+using sc_core::sc_sensitive_neg;
+/////////////////////////////////////////////////
+// Ports & Signals
+//
+using sc_core::sc_time;
+
+using sc_core::sc_in;
+using sc_core::sc_inout;
+using sc_core::sc_out;
+using sc_core::sc_signal;
+using sc_core::sc_port_b;
+using sc_core::sc_signal_base;
+using sc_core::sc_clock;
+
+using sc_core::sc_trace_file;
+
+using sc_core::method_process_list_t;
+
+/////////////////////////////////////////////////
+// Data Types
+//
+namespace sc_dt {
+
+  template <int W> class sc_bigint;
+  template <int W> class sc_biguint;
+  template <int W> class sc_int;
+  template <int W> class sc_uint;
+  template <int W> class sc_bv;
+  template <int W> class sc_lv;
+  class sc_unsigned;
+  class sc_signed;
+  class sc_bit;
+  class sc_logic;
+}
+
+using sc_dt::sc_bit;
+using sc_dt::sc_bv;
+using sc_dt::sc_logic;
+using sc_dt::sc_lv;
+using sc_dt::sc_unsigned;
+using sc_dt::sc_signed;
+//using sc_dt::sc_int_base;
+using sc_dt::sc_int;
+using sc_dt::sc_uint;
+using sc_dt::sc_bigint;
+using sc_dt::sc_biguint;
+//using sc_dt::sc_uint_base;
+
+#endif
+
Index: /latest/src/sc_int.h
===================================================================
--- /latest/src/sc_int.h	(revision 1)
+++ /latest/src/sc_int.h	(revision 1)
@@ -0,0 +1,272 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_int.h                          |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_INT_H__
+#define __SC_INT_H__
+
+#include <data_field.h>
+#include <sc_numrep.h>
+#include <sc_bit.h>
+#include <sc_logic.h>
+#include <sc_bv.h>
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_int<W>
+//
+//  Template class sc_int<W> is the interface that the user sees. It is
+//  derived from sc_int_base and most of its methods are just wrappers
+//  that call the corresponding method in the parent class. Note that
+//  the width of sc_int datatype is specified as a template parameter.
+// ----------------------------------------------------------------------------
+
+#include"sc_nbdefs.h"
+
+namespace sc_dt {
+
+typedef sc_int<1> sc_int_bit_ref;
+typedef sc_int<1> sc_int_bit_ref_r;
+
+//
+#define MASK32(W) ((~ (const uint32)0) >> (sizeof (uint32) * 8 - W))
+#define MASK64(W) ((~ (const uint64)0) >> (sizeof (uint64) * 8 - W))
+//
+
+template<int W> struct s_int_type { typedef int64 int_type;};
+#define DECLAR_INT_TYPE(W) template<> struct s_int_type<W> { typedef smallest_int int_type; } // not declared as in8 because << operator threats like a character
+DECLAR_INT_TYPE( 1);
+DECLAR_INT_TYPE( 2);
+DECLAR_INT_TYPE( 3);
+DECLAR_INT_TYPE( 4);
+DECLAR_INT_TYPE( 5);
+DECLAR_INT_TYPE( 6);
+DECLAR_INT_TYPE( 7);
+DECLAR_INT_TYPE( 8);
+#undef DECLAR_INT_TYPE
+#define DECLAR_INT_TYPE(W) template<> struct s_int_type<W> { typedef int16 int_type; }
+DECLAR_INT_TYPE( 9);
+DECLAR_INT_TYPE(10);
+DECLAR_INT_TYPE(11);
+DECLAR_INT_TYPE(12);
+DECLAR_INT_TYPE(13);
+DECLAR_INT_TYPE(14);
+DECLAR_INT_TYPE(15);
+DECLAR_INT_TYPE(16);
+#undef DECLAR_INT_TYPE
+#define DECLAR_INT_TYPE(W) template<> struct s_int_type<W> { typedef int32 int_type; }
+DECLAR_INT_TYPE(17);
+DECLAR_INT_TYPE(18);
+DECLAR_INT_TYPE(19);
+DECLAR_INT_TYPE(20);
+DECLAR_INT_TYPE(21);
+DECLAR_INT_TYPE(22);
+DECLAR_INT_TYPE(23);
+DECLAR_INT_TYPE(24);
+DECLAR_INT_TYPE(25);
+DECLAR_INT_TYPE(26);
+DECLAR_INT_TYPE(27);
+DECLAR_INT_TYPE(28);
+DECLAR_INT_TYPE(29);
+DECLAR_INT_TYPE(30);
+DECLAR_INT_TYPE(31);
+DECLAR_INT_TYPE(32);
+#undef DECLAR_INT_TYPE
+
+// --------------------------------
+// CLASS : sc_int_subref_r
+//
+// Used for range, concat functions
+
+class sc_int_subref_r
+{
+  template <int W> friend class sc_dt::sc_int;
+  int       left, right;
+  public : int64    val;
+  sc_int_subref_r (int64 val_, int left_, int right_)
+  {
+    val = val_; left = left_; right = right_;
+  }
+  public:
+  inline int64 read () const { return val; }
+  inline const sc_int_subref_r& operator | (const sc_int_subref_r &v) const
+  { print_warning (); return *this; }
+
+  private :void print_warning () const;
+};
+
+//
+// to fix : propagation of the sign flag
+//
+
+class sc_int_subref_r;
+
+template< int W /* = SC_INTWIDTH */>
+class sc_int
+{
+  /***********************/
+  /* SYSTEMCASS SPECIFIC */
+  /***********************/
+  typedef sc_int<W>                         this_type;
+  typedef typename s_int_type<W>::int_type  data_type;
+
+  typedef data_type sc_int_subref;
+//typedef data_type sc_int_subref_r;
+    /* removed since "operator ," was going wrong */
+
+// internal
+	union {
+    val_field<W,(sizeof (data_type) * 8) - W,data_type> vf; /* To compute */
+		data_type val;          /* To return an int reference (read function) */
+//	  data_type valW:W; /* works with little endianess only */
+//  bool      valB[W]; /* removed since 1 bool takes 1 byte */
+	};
+
+  /***********************/
+  /*        L R M        */
+  /***********************/
+public:
+  sc_int()                 { val = 0; }
+//  sc_int(data_type val_)  { val = 0; write (val_); }
+  sc_int (const char *a)   { val = 0; write (atoi (a)); }
+  sc_int (unsigned short a){ val = 0; write (a); }
+  sc_int (short a)         { val = 0; write (a); }
+  sc_int (unsigned long a) { val = 0; write (a); }
+  sc_int (long a)          { val = 0; write (a); }
+  sc_int (unsigned int a)  { val = 0; write (a); }
+  sc_int (int a)           { val = 0; write (a); }
+  sc_int (int64 a)         { val = 0; write (a); }
+  sc_int (uint64 a)        { val = 0; write (a); }
+  sc_int (double a)        { val = 0; write (a); }
+
+  template <int W2> sc_int (const sc_int<W2> &val_) { val = 0; write (val_.read());}
+  /* this template doesn't redefine default copy constructor of sc_int.
+   * So, we define by this way 
+   */
+
+  sc_int (const sc_int &val_) { val = val_.val; }
+  sc_int (const sc_int_subref_r &a) { val = 0; write (a); } 
+    /* the user needs to cast explicitly result of range () method. */
+
+  /***********************/
+  /* SYSTEMCASS SPECIFIC */
+  /***********************/
+#if 0
+  bool is_negative () const {
+    return (valW >> (W-1)) == 1;
+  }
+#endif
+  // read/write
+  inline const data_type& read() const { return val; }
+  inline void write(data_type val_)    { vf.valW = val_; }
+  template <int W2> inline void write (const sc_int<W2> val_) { write (val_.read ()); }
+//inline void write (const sc_int<W> val_) { write (val_.read()); };
+  inline void write (const sc_int_subref_r& s) { write (s.read()); }
+
+  /***********************/
+  /*        L R M        */
+  /***********************/
+  // operators
+  inline operator const data_type& () const { return read (); }
+//  inline void write(int64 val_) { val = val_ & MASK64(W); }
+//  inline void write(signed int val_)   { val = val_ & MASK32(W); }
+	template <typename T> inline sc_int& operator = (const T& val_) 
+  { write (val_); return *this; }
+	inline sc_int& operator = (const sc_int_subref_r& a) 
+  { write (a); return *this; }
+
+  // explicit conversions
+  inline uint32         to_uint   () const {return val & MASK32(W);};
+  inline int32          to_int    () const {return val & MASK32(W);};
+  inline uint64         to_uint64 () const {return val & MASK64(W);};
+  inline int64          to_int64  () const {return val & MASK64(W);};
+
+  // explicit conversion to character string 
+  const sc_string to_string       ( sc_numrep numrep = SC_DEC ) const 
+  { return sc_dt::to_string (val, W, numrep); }
+  const sc_string to_dec() const  { return to_string (SC_DEC); }
+  const sc_string to_bin() const  { return to_string (SC_BIN); }
+  const sc_string to_oct() const  { return to_string (SC_OCT); }
+  const sc_string to_hex() const  { return to_string (SC_HEX); }
+
+  // arithmetic
+  template <typename T>
+  inline sc_int& operator <<= (T v)
+  { vf.valW <<= v; return *this; }
+  template <typename T>
+  inline sc_int& operator >>= (T v)
+  { vf.valW >>= v; return *this; }
+  template <typename T>
+  inline sc_int& operator += (T v)
+  { vf.valW += v; return *this; }
+  template <typename T>
+  inline sc_int& operator -= (T v)
+  { vf.valW -= v; return *this; }
+  template <typename T>
+  inline sc_int& operator *= (T v)
+  { vf.valW *= v; return *this; }
+  template <typename T>
+  inline sc_int& operator /= (T v)
+  { vf.valW /= v; return *this; }
+  template <typename T>
+  inline sc_int& operator %= (T v)
+  { vf.valW %= v; return *this; }
+  template <typename T>
+  inline sc_int& operator &= (T v)
+  { vf.valW &= v; return *this; }
+  template <typename T>
+  inline sc_int& operator |= (T v)
+  { vf.valW |= v; return *this; }
+  template <typename T>
+  inline sc_int& operator ^= (T v)
+  { vf.valW ^= v; return *this; }
+  inline sc_int_bit_ref& operator [] (int v)
+  { return (vf.valW >> v) & 1; }
+  inline sc_int_bit_ref_r& operator [] (int v) const
+  { return (vf.valW >> v) & 1; }
+
+  template <int W2> 
+  inline sc_int<W+W2> operator , (const sc_int<W2> &b) const
+  { sc_int<W+W2> res = read() << W2; res += b.read(); return res; }
+#if 0 
+std::cerr << "[" << to_bin() << "," << b.to_bin() << " = " << res.to_bin() << "]\n"; 
+#endif
+
+  inline sc_int<W+1> operator , (bool b) const
+  { sc_int<W+1> res = read(); res <<= 1; res += b; return res; }
+#if 0 
+std::cerr << "[" << to_bin() << "," << b.to_bin() << " = " << res.to_bin() << "]\n"; 
+#endif
+
+  template <int W2>
+  inline sc_int<W2> operator , (const sc_int_subref_r &v) const
+  { std::cerr << "Warning : \n"; return sc_int<W2> (v.read()); }
+
+  inline sc_int_subref range (int left, int right)
+  { return (data_type)((data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right; }
+
+  inline sc_int_subref_r range (int left, int right) const
+  { return sc_int_subref_r (((data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right, left, right); }
+#if 0
+std::cerr << "range(" << left << "," << right << ")\n";
+std::cerr << "val = " << val << "\n";
+std::cerr << "~0 >> " << (sizeof (data_type) * 8 - left - 1) << " = " << (data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) << "\n";
+std::cerr <<  ((data_type) ((((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right) << "\n";
+std::cerr << "data_type = " << sizeof (data_type) << "\n";
+#endif
+
+};
+
+inline std::ostream& operator << (std::ostream &o, const sc_int_subref_r& s)
+{ return o << s.val; }
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_INT_H__ */
+
Index: /latest/src/sc_interface.cc
===================================================================
--- /latest/src/sc_interface.cc	(revision 1)
+++ /latest/src/sc_interface.cc	(revision 1)
@@ -0,0 +1,128 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_interface.cc                   |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include"sc_interface.h"
+#include"sc_event.h"
+#include"assert.h"
+#include<iostream>
+#include<map>
+
+using namespace std;
+
+namespace sc_core {
+struct interface_infos_t {
+	size_t data_size_in_bytes;
+	sc_event default_event;
+	interface_infos_t ()
+	{
+		exit(12);
+	}
+	interface_infos_t (size_t s, sc_event e) 
+		: data_size_in_bytes(s), default_event (e)
+	{
+	}
+};
+typedef std::map<const sc_interface*,interface_infos_t> interface2infos_t;
+static interface2infos_t interface2infos;
+}
+
+using namespace sc_core;
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_interface
+//
+//  
+// ----------------------------------------------------------------------------
+
+#if 0
+static 
+ostream&
+operator << (ostream &o, 
+             const sc_interface &i)
+{
+	return o << hex << &i;
+}
+#endif
+
+/*
+void 
+sc_interface::register_port (sc_port_base & port_, const char *if_typename_)
+{
+}
+*/
+
+sc_interface::~sc_interface ()
+{}
+  
+// constructor 
+sc_interface::sc_interface ()
+{
+  pointer = NULL; // => not assigned
+}
+
+void
+sc_interface::init (size_t s) const
+{
+	interface2infos_t::value_type pair (this, 
+			interface_infos_t (s,sc_event (*this, sc_event::VAL)));
+	interface2infos.insert (pair);
+}
+
+size_t
+sc_interface::data_size_in_bytes () const
+{
+	interface2infos_t::iterator i = interface2infos.find (this);
+#ifdef DEBUG
+	if (i == interface2infos.end ()) {
+		cerr << "Internal error : can't find data size of " << this << "\n";
+		exit (90);
+	}
+#endif
+	return i->second.data_size_in_bytes;
+}
+
+const sc_event &
+sc_interface::default_event () const
+{
+	interface2infos_t::iterator i = interface2infos.find (this);
+#ifdef DEBUG
+	if (i == interface2infos.end ()) {
+		cerr << "Internal error : can't find default event of " << this << "\n";
+		exit (90);
+	}
+#endif
+	return i->second.default_event;
+}
+
Index: /latest/src/sc_interface.h
===================================================================
--- /latest/src/sc_interface.h	(revision 1)
+++ /latest/src/sc_interface.h	(revision 1)
@@ -0,0 +1,57 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_interface.h                    |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_INTERFACE_H__
+#define __SC_INTERFACE_H__
+
+#include"sc_fwd.h"
+#include"internal_ext.h"
+
+namespace sc_core {
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_interface
+//
+//  
+// ----------------------------------------------------------------------------
+class sc_interface
+{ 
+	///////////
+	// Internal
+	private:  tab_t              *pointer; // pointeur dans la table de signaux 
+                                         // NULL pour les sc_out/sc_inout
+  public:   inline tab_t       *get_pointer () const   { return pointer; }
+  public:   inline void         set_pointer (tab_t *i) { pointer = i; }
+	public:   size_t              data_size_in_bytes () const; /* nb of bytes */
+	protected:void                init        (size_t) const;
+	///////////
+					 
+	//////
+	// LRM
+public:
+					 /*
+  virtual void register_port (sc_port_base & port_, const char *if_typename_);
+	*/
+  /*virtual */const sc_event & default_event () const;
+  /*virtual */~ sc_interface ();
+protected:
+  // constructor 
+    sc_interface ();
+private:
+  // disabled 
+    sc_interface (const sc_interface &);
+    sc_interface & operator = (const sc_interface &);
+  //////
+};
+
+} // end of sc_core namespace
+
+#endif /* __SC_INTERFACE_H__ */
Index: /latest/src/sc_localvar.h
===================================================================
--- /latest/src/sc_localvar.h	(revision 1)
+++ /latest/src/sc_localvar.h	(revision 1)
@@ -0,0 +1,40 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_localvar.h                   |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   21_04_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+#ifndef SC_LOCALVAR_H
+#define SC_LOCALVAR_H
+
+#include "sc_fwd.h"
+#include "sc_signal.h"
+
+namespace sc_core {
+
+template <typename T>
+class sc_localvar : public sc_signal_base
+{
+
+  public: sc_localvar (const T& object)
+  { init (object); }
+
+  private: void init (const T& object)
+  {
+    set_pointer ((tab_t*) &object);
+    set_kind ("sc_localvar");
+    sc_interface::init (sizeof (object));
+    bind (*((sc_signal_base*)this));
+  }
+};
+
+} // end of sc_core namespace
+
+#endif
+
Index: /latest/src/sc_logic.cc
===================================================================
--- /latest/src/sc_logic.cc	(revision 1)
+++ /latest/src/sc_logic.cc	(revision 1)
@@ -0,0 +1,51 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_logic.cc                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   14_04_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_logic
+//
+// ----------------------------------------------------------------------------
+
+#include"sc_logic.h"
+
+namespace sc_dt {
+
+const sc_logic SC_LOGIC_0 (Log_0);
+const sc_logic SC_LOGIC_1 (Log_1);
+const sc_logic SC_LOGIC_Z (Log_Z);
+const sc_logic SC_LOGIC_X (Log_X);
+
+} /* end of sc_dt namespace */
+
Index: /latest/src/sc_logic.h
===================================================================
--- /latest/src/sc_logic.h	(revision 1)
+++ /latest/src/sc_logic.h	(revision 1)
@@ -0,0 +1,156 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_logic.h                        |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   14_04_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_LOGIC_H__
+#define __SC_LOGIC_H__
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_logic
+//
+// ----------------------------------------------------------------------------
+
+#include"sc_nbdefs.h"
+#include"sc_fwd.h"
+
+namespace sc_dt {
+
+// ----------------------------------------------------------------------------
+//  ENUM : sc_logic_value_t
+//
+//  Enumeration of logic values.
+// ----------------------------------------------------------------------------
+
+enum sc_logic_value_t
+{
+  Log_0 = 0,
+  Log_1,
+  Log_Z,
+  Log_X
+};
+
+class sc_logic
+{
+public:
+  // constructors & destructor 
+  sc_logic ();
+  sc_logic (const sc_logic & a);
+  sc_logic (sc_logic_value_t v);
+  explicit sc_logic (bool a);
+  explicit sc_logic (char a);
+  explicit sc_logic (int a);
+  explicit sc_logic (const sc_bit & a);
+  ~sc_logic ();
+  // assignment operators 
+   sc_logic & operator = (const sc_logic & a);
+   sc_logic & operator = (sc_logic_value_t v);
+   sc_logic & operator = (bool a);
+   sc_logic & operator = (char a);
+   sc_logic & operator = (int a);
+   sc_logic & operator = (const sc_bit & a);
+  // bitwise assignment operators 
+   sc_logic & operator &= (const sc_logic & b);
+   sc_logic & operator &= (sc_logic_value_t v);
+   sc_logic & operator &= (bool b);
+   sc_logic & operator &= (char b);
+   sc_logic & operator &= (int b);
+   sc_logic & operator |= (const sc_logic & b);
+   sc_logic & operator |= (sc_logic_value_t v);
+   sc_logic & operator |= (bool b);
+   sc_logic & operator |= (char b);
+   sc_logic & operator |= (int b);
+   sc_logic & operator ^= (const sc_logic & b);
+   sc_logic & operator ^= (sc_logic_value_t v);
+   sc_logic & operator ^= (bool b);
+   sc_logic & operator ^= (char b);
+   sc_logic & operator ^= (int b);
+  // bitwise complement 
+  const sc_logic operator ~ () const;
+    sc_logic & b_not ();
+  // bitwise and 
+  friend const sc_logic operator & (const sc_logic & a, const sc_logic & b);
+  friend const sc_logic operator & (const sc_logic & a, sc_logic_value_t b);
+  friend const sc_logic operator & (const sc_logic & a, bool b);
+  friend const sc_logic operator & (const sc_logic & a, char b);
+  friend const sc_logic operator & (const sc_logic & a, int b);
+  friend const sc_logic operator & (sc_logic_value_t a, const sc_logic & b);
+  friend const sc_logic operator & (bool a, const sc_logic & b);
+  friend const sc_logic operator & (char a, const sc_logic & b);
+  friend const sc_logic operator & (int a, const sc_logic & b);
+  // bitwise or 
+  friend const sc_logic operator | (const sc_logic & a, const sc_logic & b);
+  friend const sc_logic operator | (const sc_logic & a, sc_logic_value_t b);
+  friend const sc_logic operator | (const sc_logic & a, bool b);
+  friend const sc_logic operator | (const sc_logic & a, char b);
+  friend const sc_logic operator | (const sc_logic & a, int b);
+  friend const sc_logic operator | (sc_logic_value_t a, const sc_logic & b);
+  friend const sc_logic operator | (bool a, const sc_logic & b);
+  friend const sc_logic operator | (char a, const sc_logic & b);
+  friend const sc_logic operator | (int a, const sc_logic & b);
+  // bitwise xor 
+  friend const sc_logic operator ^ (const sc_logic & a, const sc_logic & b);
+  friend const sc_logic operator ^ (const sc_logic & a, sc_logic_value_t b);
+  friend const sc_logic operator ^ (const sc_logic & a, bool b);
+  friend const sc_logic operator ^ (const sc_logic & a, char b);
+  friend const sc_logic operator ^ (const sc_logic & a, int b);
+  friend const sc_logic operator ^ (sc_logic_value_t a, const sc_logic & b);
+  friend const sc_logic operator ^ (bool a, const sc_logic & b);
+  friend const sc_logic operator ^ (char a, const sc_logic & b);
+  friend const sc_logic operator ^ (int a, const sc_logic & b);
+  // relational operators and functions 
+  friend bool operator == (const sc_logic & a, const sc_logic & b);
+  friend bool operator == (const sc_logic & a,
+			   sc_logic_value_t b);
+  friend bool operator == (const sc_logic & a, bool b);
+  friend bool operator == (const sc_logic & a, char b);
+  friend bool operator == (const sc_logic & a, int b);
+  friend bool operator == (sc_logic_value_t a, const sc_logic & b);
+  friend bool operator == (bool a, const sc_logic & b);
+  friend bool operator == (char a, const sc_logic & b);
+  friend bool operator == (int a, const sc_logic & b);
+  friend bool operator != (const sc_logic & a, const sc_logic & b);
+  friend bool operator != (const sc_logic & a, sc_logic_value_t b);
+  friend bool operator != (const sc_logic & a, bool b);
+  friend bool operator != (const sc_logic & a, char b);
+  friend bool operator != (const sc_logic & a, int b);
+  friend bool operator != (sc_logic_value_t a, const sc_logic & b);
+  friend bool operator != (bool a, const sc_logic & b);
+  friend bool operator != (char a, const sc_logic & b);
+  friend bool operator != (int a, const sc_logic & b);
+  // explicit conversions 
+  sc_logic_value_t value () const;
+  bool is_01 () const;
+  bool to_bool () const;
+  char to_char () const;
+/*
+  // other methods 
+  void print (std::ostream & os = std::cout) const;
+  void scan (std::istream & is = std::cin);
+*/
+  // memory (de);allocation 
+  static void *operator new (size_t, void *p);	// placement new 
+  static void *operator new (size_t sz);
+  static void operator delete (void *p, size_t sz);
+  static void *operator new[] (size_t sz);
+  static void operator delete[] (void *p, size_t sz);
+private:
+  // disabled 
+    explicit sc_logic (const char *);
+    sc_logic & operator = (const char *);
+};
+
+extern const sc_logic SC_LOGIC_0;
+extern const sc_logic SC_LOGIC_1;
+extern const sc_logic SC_LOGIC_Z;
+extern const sc_logic SC_LOGIC_X;
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_LOGIC_H__ */
Index: /latest/src/sc_lv.h
===================================================================
--- /latest/src/sc_lv.h	(revision 1)
+++ /latest/src/sc_lv.h	(revision 1)
@@ -0,0 +1,171 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_lv.h                           |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   19_04_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_LV_H__
+#define __SC_LV_H__
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_lv
+//
+// ----------------------------------------------------------------------------
+
+#include"sc_nbdefs.h"
+#include"sc_logic.h"
+#include"sc_unsigned.h"
+#include"sc_signed.h"
+#include"sc_uint.h"
+#include"sc_int.h"
+
+
+namespace sc_dt {
+
+template<int W> struct s_lv_type { typedef uint64 lv_type;};
+#define DECLAR_LV_TYPE(W) template<> struct s_lv_type<W> { typedef smallest_uint lv_type; }// not declared as uint16 because << operator threats like a character
+DECLAR_LV_TYPE( 1);
+DECLAR_LV_TYPE( 2);
+DECLAR_LV_TYPE( 3);
+DECLAR_LV_TYPE( 4);
+DECLAR_LV_TYPE( 5);
+DECLAR_LV_TYPE( 6);
+DECLAR_LV_TYPE( 7);
+DECLAR_LV_TYPE( 8);
+#undef DECLAR_LV_TYPE
+#define DECLAR_LV_TYPE(W) template<> struct s_lv_type<W> { typedef uint16 lv_type; }
+DECLAR_LV_TYPE( 9);
+DECLAR_LV_TYPE(10);
+DECLAR_LV_TYPE(11);
+DECLAR_LV_TYPE(12);
+DECLAR_LV_TYPE(13);
+DECLAR_LV_TYPE(14);
+DECLAR_LV_TYPE(15);
+DECLAR_LV_TYPE(16);
+#undef DECLAR_LV_TYPE
+#define DECLAR_LV_TYPE(W) template<> struct s_lv_type<W> { typedef uint32 lv_type; }
+DECLAR_LV_TYPE(17);
+DECLAR_LV_TYPE(18);
+DECLAR_LV_TYPE(19);
+DECLAR_LV_TYPE(20);
+DECLAR_LV_TYPE(21);
+DECLAR_LV_TYPE(22);
+DECLAR_LV_TYPE(23);
+DECLAR_LV_TYPE(24);
+DECLAR_LV_TYPE(25);
+DECLAR_LV_TYPE(26);
+DECLAR_LV_TYPE(27);
+DECLAR_LV_TYPE(28);
+DECLAR_LV_TYPE(29);
+DECLAR_LV_TYPE(30);
+DECLAR_LV_TYPE(31);
+DECLAR_LV_TYPE(32);
+#undef DECLAR_LV_TYPE
+
+
+class sc_lv_base
+{
+public:
+  // constructors 
+/*
+  explicit sc_lv_base (int length_ = sc_length_param ().len ());
+  explicit sc_lv_base (bool a, int length_ = sc_length_param ().len ());
+*/
+    sc_lv_base () { } // SYSTEMCASS SPECIFIC
+    sc_lv_base (const char *a);
+    sc_lv_base (const char *a, int length_);
+    template < class X > sc_lv_base (const sc_lv_base & a);
+    virtual ~ sc_lv_base () {}
+  // assignment operators 
+    template < class X > sc_lv_base & operator = (const sc_lv_base & a);
+    sc_lv_base & operator = (const char *a);
+    sc_lv_base & operator = (const bool * a);
+    sc_lv_base & operator = (const sc_logic * a);
+    sc_lv_base & operator = (const sc_unsigned & a);
+    sc_lv_base & operator = (const sc_signed & a);
+/*
+    sc_lv_base & operator = (const sc_uint_base & a);
+    sc_lv_base & operator = (const sc_int_base & a);
+*/
+    sc_lv_base & operator = (unsigned long a);
+    sc_lv_base & operator = (long a);
+    sc_lv_base & operator = (unsigned int a);
+    sc_lv_base & operator = (int a);
+    sc_lv_base & operator = (uint64 a);
+    sc_lv_base & operator = (int64 a);
+
+  // methods 
+  int length () const;
+  bool is_01 () const;
+};
+
+
+template < int W > class sc_lv:public sc_lv_base
+{
+  /***********************/
+  /* SYSTEMCASS SPECIFIC */
+  /***********************/
+  typedef sc_lv<W>                         this_type;
+  typedef typename s_lv_type<W>::lv_type   data_type;
+  data_type val;
+public:
+  // constructors 
+  sc_lv ()                         { val = 0; }
+  explicit sc_lv (bool init_value) { val = 0; }
+  explicit sc_lv (char init_value) { val = 0; }
+    sc_lv (const char *a)          { val = 0; write (atoi (a)); }
+    sc_lv (const bool * a)         { val = 0; write (a); }
+    sc_lv (const sc_logic * a)     { val = 0; write (a); }
+    sc_lv (const sc_unsigned & a)  { val = 0; write (a); }
+    sc_lv (const sc_signed & a)    { val = 0; write (a); }
+/*
+    sc_lv (const sc_uint_base & a);
+    sc_lv (const sc_int_base & a);
+*/
+    sc_lv (unsigned long a)        { val = 0; write (a); }  
+    sc_lv (long a)                 { val = 0; write (a); }
+    sc_lv (unsigned int a)         { val = 0; write (a); }
+    sc_lv (int a)                  { val = 0; write (a); }
+    sc_lv (uint64 a)               { val = 0; write (a); }
+    sc_lv (int64 a)                { val = 0; write (a); }
+    sc_lv (const sc_lv_base & a)   { val = 0; write (a); }
+    sc_lv (const sc_lv < W > &a)   { val = 0; write (a); }
+  // assignment operators 
+#ifdef LRM
+  template < class X > sc_lv < W > &operator = (const sc_lv_base & a)
+  sc_lv < W > &operator = (const sc_lv < W > &a)
+  sc_lv < W > &operator = (const char *a)
+  sc_lv < W > &operator = (const bool * a)
+  sc_lv < W > &operator = (const sc_logic * a)
+  sc_lv < W > &operator = (const sc_unsigned & a)
+  sc_lv < W > &operator = (const sc_signed & a)
+#endif // LRM
+  template <typename T> inline sc_lv& operator = (const T& val_)
+  { write (val_); return *this; }
+/*
+    sc_lv < W > &operator = (const sc_uint_base & a);
+    sc_lv < W > &operator = (const sc_int_base & a);
+*/
+    sc_lv < W > &operator = (unsigned long a);
+    sc_lv < W > &operator = (long a);
+    sc_lv < W > &operator = (unsigned int a);
+    sc_lv < W > &operator = (int a) { val = a; return *this; }
+    sc_lv < W > &operator = (uint64 a);
+    sc_lv < W > &operator = (int64 a);
+  /***********************/
+  /* SYSTEMCASS SPECIFIC */
+  /***********************/
+  // read/write
+  inline void write(data_type val_)    { val = val_; }
+  template <int W2> inline void write (const sc_lv<W2> val_) { write (val_.read()); }
+
+};
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_LV_H__ */
Index: /latest/src/sc_main.cc
===================================================================
--- /latest/src/sc_main.cc	(revision 1)
+++ /latest/src/sc_main.cc	(revision 1)
@@ -0,0 +1,324 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_main.cc                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire UPMC/LIP6
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include<sstream>
+#include<string>
+#include<list>
+#include<set>
+#include"internal.h"
+#include"global_functions.h"
+#include"sc_ver.h"
+#include"sc_module.h"
+#include"sc_signal.h" // pending_write_vector
+#include"dump_dot.h"
+#include"dump_used_options.h"
+#include"dump_used_env.h"
+#include"assert.h"
+
+//
+using namespace std;
+//
+typedef list<sc_module* >         module_list_t;
+
+//
+namespace sc_core {
+
+bool        check_port_dependencies = false;
+bool        dynamic_link_of_scheduling_code = true;
+bool        dump_netlist_info       = false;
+bool        dump_funclist_info      = false;
+bool        dump_stage              = false;
+bool        dump_all_graph          = false;
+const char* dump_module_hierarchy   = NULL;
+bool        edit_schedule           = false;
+bool        keep_generated_code     = false;
+bool        nobanner                = false;
+bool        noinitialization        = false;
+bool        nosimulation            = false;
+bool        notrace                 = false;
+bool        print_schedule          = false;
+bool        print_user_resources    = false;
+char*       save_on_exit            = NULL;
+int         scheduling_method       = NO_SCHEDULING;
+bool        use_sensitivity_list    = false;
+bool        use_port_dependency     = false;
+
+static
+void 
+print_splash_screen ()
+{
+  // Display once
+  if (nobanner == false)
+  	cerr << get_splash_screen ();
+  nobanner = true;
+}
+
+static
+void
+check_parameters ()
+{
+  if (dump_all_graph) {
+    if (use_port_dependency)
+      cerr << "SystemCASS will dump signal dependency graph.\n";
+    else
+      cerr << "SystemCASS will dump module dependency graph.\n";
+  }
+  if (!use_port_dependency && check_port_dependencies)
+    cerr << "Warning : unable to check port dependencies.\n";
+  if (!use_port_dependency)
+  {
+    use_sensitivity_list = true;
+    scheduling_method = CASS_SCHEDULING;
+  }
+  switch (scheduling_method) {
+  case CASS_SCHEDULING :
+    ASSERT(use_port_dependency == false);
+    break;
+  case BUCHMANN_SCHEDULING :
+  case MOUCHARD_SCHEDULING :
+    if (!use_port_dependency) {
+    cerr << "Error : "
+            "The choosen scheduling needs port dependencies informations\n";
+    exit (31);
+    }
+    break;
+  default :
+    cerr << "Error : You need to choose one of the available scheduling :\n"
+         << "- Almost static scheduling like CASS (use sensitivity list)\n"
+         << "- Simple static scheduling (use port dependencies)\n"
+         << "- Entirely static scheduling (use port dependencies)\n";
+    exit (33);
+  }
+  ASSERT(use_port_dependency || use_sensitivity_list);
+}
+
+void
+apply_parameters (int &argc, char ** &argv)
+{
+#ifdef KEEP_GENERATED_CODE // supprimer scheduling-XXXXXX.cc
+  keep_generated_code = true;
+#endif
+#ifdef DUMP_NETLIST_INFO
+  dump_netlist_info = true;
+#endif
+#ifdef DUMP_FUNCLIST_INFO
+  dump_funclist_info = true;
+#endif
+#ifdef DUMP_STAGE
+  dump_stage = true;
+#endif
+#ifdef DUMP_COMBINATIONAL_LIST2DOT
+  dump_all_graph = true;
+#endif
+#ifdef PRINT_SCHEDULE
+  print_schedule = true;
+#endif    
+#ifdef USE_PORT_DEPENDENCY
+  use_port_dependency = true;
+#endif
+  // parse the command line
+  int i;
+  for (i = 1; i < argc; ++i)
+    {
+    if (argv[i][0] == '-')
+      {
+      if (argv[i][1] == '-')
+        {
+        switch (argv[i][2])
+          {
+          case 'h' : 
+            print_splash_screen ();
+            cerr << "Usage : " 
+                 << argv[0] << " [--c] [--edit] [--d] [--f] [--h] [--i] [--k] [--modules filename] [--nobanner] [--nodynamiclink] [--nosim] [--notrace] [--s] [--t] [--tracestart n] [--usage] [--v] [--p|m|a] [others parameters processed by sc_main]\n"
+                 << "Thoses options are processed by SystemCASS library. All the remaining options are passed to sc_main.\n"
+                 << "sc_main function retrieves last parameters.\n"
+                 << "a       : almost static scheduling (use sensitivity list instead of port dependency information)\n"
+                 << "c       : print schedule at simulation time (stderr)\n"
+                 << "d       : check port dependencies (stderr)\n"
+                 << "edit    : edit schedule before simulation (run $EDITOR or vim by default)\n"
+                 << "f       : print function list (stderr)\n"
+                 << "h       : display help screen and exit (stdout)\n"
+                 << "i       : print instances list, signals list and statistics if available (stderr)\n"
+                 << "k       : dump generated scheduling code (generated_by_systemcass/scheduling-xx.cc)\n"
+                 << "m       : Mouchard's static scheduling (use port dependency information instead of sensitivity list)\n"
+                 << "modules filename : dump module hierarchy graph into specified dot file (tons of bugs inside)\n"
+                 << "nobanner: do not print SystemCASS splash screen\n"
+                 << "nodynamiclink: do not link dynamically scheduling code\n"
+                 << "nosim   : run until elaboration stage. Don't simulate\n"
+                 << "notrace : disable all tracing functions\n"
+                 << "p       : entirely static scheduling (use port dependency information instead of sensitivity list)\n"
+                 << "s       : print stage (stderr)\n"
+                 << "save_on_exit <name> : save simulation state saved into <name> file when SystemCASS exits (SOCVIEW format)\n"
+            /* WARNING : we can't avoid destructors execution before saving */
+                 << "t       : dump either module graph, or signal dependency graph, signal order, and module evalutation order into dot files\n"
+                 << "tracestart n : start tracing functions at #n cycle\n"
+                 << "usage   : print user time elapsed (sec), simulation cycles done (cycles), and simulator performance (cycles/second) (stderr)\n"
+                 << "v       : print internal SystemCASS kernel options (stderr)\n";
+            noinitialization = true;
+            nosimulation = true;
+            continue;
+          case 'v' : 
+            print_splash_screen ();
+            cerr << get_used_options  () << "\n";
+            cerr << get_used_env () << "\n";
+            continue;
+          case 'u' : 
+            if (strcmp (argv[i]+2, "usage") == 0)
+              print_user_resources = true;
+            else
+              break;
+            continue;
+          case 'i' :
+            dump_netlist_info = true;
+            continue;
+          case 'f' :
+            dump_funclist_info = true;
+            continue;
+          case 's' :
+            if (strcmp (argv[i]+2, "save_on_exit") == 0)
+              save_on_exit = argv[++i];
+            else
+              dump_stage = true;
+            continue;
+          case 'c' :
+            print_schedule = true;
+            continue;
+          case 'e' :
+            if (strcmp (argv[i]+2, "edit") == 0)
+              edit_schedule = true;
+            else
+              break;
+            continue;
+          case 'k' :
+            keep_generated_code = true;
+            continue;
+          case 't' :
+            if (strcmp (argv[i]+2, "tracestart") == 0) {
+              ++i;
+              istringstream iss (argv[i]);
+              iss >> trace_start;
+              trace_start <<= 1;
+//              trace_start = strtoll (argv[i],0,10) << 1;
+//              trace_start = atoll (argv[i]) << 1;
+            } else {
+              dump_all_graph = true;
+            }
+            continue;
+          case 'm' :
+            if (strcmp (argv[i]+2, "modules") == 0) {
+              ++i;
+              dump_module_hierarchy = argv[i];
+              continue;
+            } else if (strcmp (argv[i]+2, "m") == 0) {
+              use_port_dependency = true;
+              scheduling_method = MOUCHARD_SCHEDULING;
+              continue;
+            }
+            break;
+          case 'n' :
+            if (strcmp (argv[i]+2, "nobanner") == 0) {
+              nobanner = true;
+            } else if (strcmp (argv[i]+2, "nodynamiclink") == 0) {
+              dynamic_link_of_scheduling_code = false;
+            } else if (strcmp (argv[i]+2, "nosim") == 0) {
+              nosimulation = true;
+            } else if (strcmp (argv[i]+2, "notrace") == 0) {
+              notrace = true;
+            } else
+              break;
+            continue;
+          case 'a' :
+            use_sensitivity_list = true;
+            scheduling_method = CASS_SCHEDULING;
+            continue;
+          case 'p' :
+            use_port_dependency = true;
+            scheduling_method = BUCHMANN_SCHEDULING;
+            continue;
+          case 'd' :
+            check_port_dependencies = true;
+            continue;
+          default :
+            break;
+          }
+        break;
+        }
+      } 
+      break;
+    }
+  
+  // erase SystemCASS options from the command line and give it to the sc_main
+  if (i != 1)
+    {
+    int j = 1;
+    while (i < argc)
+      {
+      argv[j++] = argv[i++];
+      }
+    argc = j;
+    }
+#if 0
+  cerr << "The user command line length is " << argc << ".\n";
+#endif
+}
+
+
+} // end of namespace
+
+using namespace sc_core;
+
+int 
+main(int   argc, 
+     char* argv[])
+{
+  apply_parameters    (argc, argv);
+  print_splash_screen ();
+  check_parameters ();
+  if (noinitialization)
+  {
+    return 255;
+  }
+  int ret = sc_main(argc, argv);
+	free (pending_write_vector);
+  close_systemcass ();
+  if (have_to_stop)
+  {
+    cerr << "'sc_stop' function was called. Exit code : 1\n";
+    return 1;
+  }
+  return ret;
+}
+
Index: /latest/src/sc_module.cc
===================================================================
--- /latest/src/sc_module.cc	(revision 1)
+++ /latest/src/sc_module.cc	(revision 1)
@@ -0,0 +1,574 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_module.cc                    |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include "sc_module.h"
+#include "sc_module_name.h"
+#include "sc_sensitive.h"
+#include "module_hierarchy.h"
+#include "serialization.h" // set_save_handler
+#include <stdarg.h>
+#include <vector>
+#include <string>
+#include <set>
+#include "sc_port.h"
+#include "sc_signal.h"
+#include "sc_clock.h" // is_clock
+#include "entity.h"
+#include "assert.h"
+
+//
+using namespace std;
+
+// ----------------------------------------------------------------------------
+//
+//                                               
+// ----------------------------------------------------------------------------
+
+namespace sc_core {
+instances_set_t instances_set;   
+instances_list_t temp_list;   
+method_process_list_t method_process_list;
+
+module_name_stack_t module_name_stack;
+
+modules_stack_t modules_stack;
+
+method_process_t       *method;
+
+void
+declare_method_process (const char *  name,
+                        SC_ENTRY_FUNC func,
+                        sc_module&    module)
+{
+  method = create_method_process (name, func, module);
+  method_process_list.push_back(method); 
+}
+
+
+ostream& 
+operator << (ostream &o, 
+             instances_set_t &l)
+{
+  instances_set_t::iterator i;
+  for (i = l.begin (); i != l.end (); ++i) {
+    o << (*i)->name () << " ";
+  };
+  return o << endl;
+}
+
+template <typename T>
+static 
+std::ostream& 
+operator << (std::ostream &o, 
+             const list<T> &l)
+{
+  typename list<T>::const_iterator i;
+  for (i = l.begin (); i != l.end (); ++i) {
+    o << (*i) << " ";
+  };
+  return o << endl;
+}
+
+template <typename T>
+static 
+std::ostream& 
+operator << (std::ostream &o, 
+             const list<T*> &l)
+{
+  typename list<T*>::const_iterator i;
+  for (i = l.begin (); i != l.end (); ++i) {
+    o << (**i) << " ";
+  };
+  return o << endl;
+}
+
+bool
+is_clock (const sc_interface &inter)
+{
+	equi_t &e = get_equi(inter);
+	equi_t::iterator i;
+	for (i = e.begin (); i != e.end (); ++i) {
+		if (i->kind () == sc_clock::kind_string)
+			return true;
+	}
+	return false;
+}
+
+
+// ----------------------------------------------------------------------------
+//  CLASS : method_process_t
+//                                               
+// ----------------------------------------------------------------------------
+method_process_t::method_process_t(const char* nm, SC_ENTRY_FUNC fn, sc_module& mod)
+{
+  name = nm;
+	func = fn; 
+  module = &mod;
+  dont_initialize = false;
+}
+
+static
+bool
+is_register (const sc_interface &inter)
+{
+	equi_t &e = get_equi (inter);
+	if (e.size () != 1)
+		return false;
+	sc_object &obj = *(e.begin ()->object);
+	if (obj.kind () != sc_signal_base::kind_string)
+		return false;
+	return true;
+}
+
+bool method_process_t::is_combinational(void)
+{
+	if (sensitivity_list.empty ())
+		return false;
+  sensitivity_list_t::iterator i;
+  for (i = sensitivity_list.begin (); i != sensitivity_list.end (); ++i) {
+#if defined(_DEBUG)
+    if (i->get_interface() == NULL)
+    {
+      cerr << "'" << i << "' is unbound.\n";
+      exit (121);
+    }
+#endif
+		if ((i->get_flag() == sc_event::VAL)
+				&& (!is_register (i->get_interface())))
+			return true;
+  }
+  return false;
+}
+
+bool method_process_t::is_transition(void)
+{
+	if (sensitivity_list.empty ())
+		return false;
+  sensitivity_list_t::iterator i;
+  for (i = sensitivity_list.begin (); i != sensitivity_list.end (); ++i) {
+		if (i->get_flag () != sc_event::POS)
+			return false;
+		// check if the port is a clock
+		if (is_clock (i->get_interface ()) == false)
+			return false;
+  }
+  return true;
+}
+
+bool method_process_t::is_genmoore(void)
+{
+	// sensitivity list of moore functions includes :
+	// - register (signal unconnected)
+	// - negative edge of port which is bound to a clock signal
+	if (sensitivity_list.empty ())
+		return false;
+  sensitivity_list_t::iterator i;
+  for (i = sensitivity_list.begin (); i != sensitivity_list.end (); ++i) {
+		if ((i->get_flag () == sc_event::VAL)
+				&& (is_register(i->get_interface ())))
+			continue;
+		if ((i->get_flag () == sc_event::NEG) 
+				&& (is_clock (i->get_interface ()) == true))
+			continue;
+		return false;
+  }
+  return true;
+}
+
+std::ostream& operator << (std::ostream &o, const method_process_t &m)
+{
+  return o << *(m.module) 
+           << "->" 
+           << m.name 
+           << "() when " 
+           << m.sensitivity_list;
+}
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_module
+//                                               
+// ----------------------------------------------------------------------------
+
+
+sc_module::sc_module(void)
+	: sc_object (NULL),
+	  sensitive (this)
+{
+#if 0
+  cerr << "sc_module constructor with no parameter\n";
+#endif
+  init ();
+}
+
+sc_module::sc_module(const char* nm)
+	: sc_object (NULL),
+	  sensitive (this)
+{
+  ASSERT(nm != NULL);
+#if 0
+  cerr << "sc_module constructor with const char * parameter\n";
+#endif
+  init ();
+}
+
+
+sc_module::sc_module(const sc_module_name &nm)
+	: sc_object (NULL),
+	  sensitive (this)
+{
+#if 0
+  cerr << "sc_module constructor by copy\n";
+#endif
+  init ();
+}
+
+void
+sc_module::init ()
+{
+  instances_set.insert (this);
+  temp_list.push_back (this);
+	modules_stack.top () = this;
+  set_save_handler (*this, NULL);
+#if 0
+  cout << "sc_module <- " << this->name () << endl;
+#endif
+}
+
+void
+sc_module::dont_initialize ()
+{
+  sc_core::valid_method_process ();
+}
+
+
+void
+declare_save_handler   (const char *  name,
+                        save_fct_t1   func,
+                        sc_module&    module)
+{
+  sc_core::set_save_handler (module, func);
+}
+
+typedef std::list<sc_port_base*> port_list_t;
+
+// Build a port list owned by the module mod
+static void
+get_port_list (const sc_module &mod, port_list_t &pl)
+{
+	port2module_t::iterator i;
+	for (i = port2module.begin (); i != port2module.end (); ++i) {
+		if (i->second == &mod) {
+			pl.push_back ((sc_port_base*)(i->first));
+		}
+	}
+}
+
+
+#define BIND(sig) bind(*this, p, port_list, sig)
+
+static void
+bind (sc_module &mod, 
+		port_list_t::iterator &port_it, 
+		port_list_t &port_list, 
+		sc_bind_proxy &sig)
+{
+	if (&sig == &SC_BIND_PROXY_NIL) { 
+		return;
+	}; 
+	if (port_it == port_list.end ()) {
+			cerr << "error : binding port in ";
+			cerr << mod.name ();
+			cerr << " module.\n";
+			exit (7);
+	};
+	bind (**(port_it++), sig);
+}
+
+void
+sc_module::operator () ( /* const */ sc_bind_proxy& p001,
+	       /* const */ sc_bind_proxy& p002,
+	       /* const */ sc_bind_proxy& p003,
+	       /* const */ sc_bind_proxy& p004,
+	       /* const */ sc_bind_proxy& p005,
+	       /* const */ sc_bind_proxy& p006,
+	       /* const */ sc_bind_proxy& p007,
+	       /* const */ sc_bind_proxy& p008,
+	       /* const */ sc_bind_proxy& p009,
+	       /* const */ sc_bind_proxy& p010,
+	       /* const */ sc_bind_proxy& p011,
+	       /* const */ sc_bind_proxy& p012,
+	       /* const */ sc_bind_proxy& p013,
+	       /* const */ sc_bind_proxy& p014,
+	       /* const */ sc_bind_proxy& p015,
+	       /* const */ sc_bind_proxy& p016,
+	       /* const */ sc_bind_proxy& p017,
+	       /* const */ sc_bind_proxy& p018,
+	       /* const */ sc_bind_proxy& p019,
+	       /* const */ sc_bind_proxy& p020,
+	       /* const */ sc_bind_proxy& p021,
+	       /* const */ sc_bind_proxy& p022,
+	       /* const */ sc_bind_proxy& p023,
+	       /* const */ sc_bind_proxy& p024,
+	       /* const */ sc_bind_proxy& p025,
+	       /* const */ sc_bind_proxy& p026,
+	       /* const */ sc_bind_proxy& p027,
+	       /* const */ sc_bind_proxy& p028,
+	       /* const */ sc_bind_proxy& p029,
+	       /* const */ sc_bind_proxy& p030,
+	       /* const */ sc_bind_proxy& p031,
+	       /* const */ sc_bind_proxy& p032,
+	       /* const */ sc_bind_proxy& p033,
+	       /* const */ sc_bind_proxy& p034,
+	       /* const */ sc_bind_proxy& p035,
+	       /* const */ sc_bind_proxy& p036,
+	       /* const */ sc_bind_proxy& p037,
+	       /* const */ sc_bind_proxy& p038,
+	       /* const */ sc_bind_proxy& p039,
+	       /* const */ sc_bind_proxy& p040,
+	       /* const */ sc_bind_proxy& p041,
+	       /* const */ sc_bind_proxy& p042,
+	       /* const */ sc_bind_proxy& p043,
+	       /* const */ sc_bind_proxy& p044,
+	       /* const */ sc_bind_proxy& p045,
+	       /* const */ sc_bind_proxy& p046,
+	       /* const */ sc_bind_proxy& p047,
+	       /* const */ sc_bind_proxy& p048,
+	       /* const */ sc_bind_proxy& p049,
+	       /* const */ sc_bind_proxy& p050,
+	       /* const */ sc_bind_proxy& p051,
+	       /* const */ sc_bind_proxy& p052,
+	       /* const */ sc_bind_proxy& p053,
+	       /* const */ sc_bind_proxy& p054,
+	       /* const */ sc_bind_proxy& p055,
+	       /* const */ sc_bind_proxy& p056,
+	       /* const */ sc_bind_proxy& p057,
+	       /* const */ sc_bind_proxy& p058,
+	       /* const */ sc_bind_proxy& p059,
+	       /* const */ sc_bind_proxy& p060,
+	       /* const */ sc_bind_proxy& p061,
+	       /* const */ sc_bind_proxy& p062,
+	       /* const */ sc_bind_proxy& p063,
+	       /* const */ sc_bind_proxy& p064 )
+{
+	port_list_t port_list;
+	get_port_list (*this,port_list);
+	cerr << "port list : " << port_list << endl;	
+	port_list_t::iterator p = port_list.begin ();
+  BIND( p001 );
+  BIND( p002 );
+  BIND( p003 );
+  BIND( p004 );
+  BIND( p005 );
+  BIND( p006 );
+  BIND( p007 );
+  BIND( p008 );
+  BIND( p009 );
+  BIND( p010 );
+  BIND( p011 );
+  BIND( p012 );
+  BIND( p013 );
+  BIND( p014 );
+  BIND( p015 );
+  BIND( p016 );
+  BIND( p017 );
+  BIND( p018 );
+  BIND( p019 );
+  BIND( p020 );
+  BIND( p021 );
+  BIND( p022 );
+  BIND( p023 );
+  BIND( p024 );
+  BIND( p025 );
+  BIND( p026 );
+  BIND( p027 );
+  BIND( p028 );
+  BIND( p029 );
+  BIND( p030 );
+  BIND( p031 );
+  BIND( p032 );
+  BIND( p033 );
+  BIND( p034 );
+  BIND( p035 );
+  BIND( p036 );
+  BIND( p037 );
+  BIND( p038 );
+  BIND( p039 );
+  BIND( p040 );
+  BIND( p041 );
+  BIND( p042 );
+  BIND( p043 );
+  BIND( p044 );
+  BIND( p045 );
+  BIND( p046 );
+  BIND( p047 );
+  BIND( p048 );
+  BIND( p049 );
+  BIND( p050 );
+  BIND( p051 );
+  BIND( p052 );
+  BIND( p053 );
+  BIND( p054 );
+  BIND( p055 );
+  BIND( p056 );
+  BIND( p057 );
+  BIND( p058 );
+  BIND( p059 );
+  BIND( p060 );
+  BIND( p061 );
+  BIND( p062 );
+  BIND( p063 );
+  BIND( p064 );
+}
+
+ostream& operator << (ostream &o, const sc_module &m)
+{
+  return o << m.name ();
+}
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_module_name
+//                                               
+// ----------------------------------------------------------------------------
+
+sc_module_name::sc_module_name( const char* name_ ) 
+  : m_pushed(true)
+{
+#if 0
+  cerr << "sc_module_name constructor with const char * parameter\n";
+#endif
+	m_name = name_;
+  init ();
+}
+
+sc_module_name::sc_module_name( const sc_module_name &module ) 
+  : m_pushed(false)
+{
+#if 0
+  cerr << "sc_module_name constructor by copy\n";
+#endif
+	m_name = module.m_name;
+  //init ();
+}
+
+void
+sc_module_name::init ()
+{
+	sc_core::module_name_stack.push_back (m_name);
+	modules_stack.push (NULL);
+#if 0
+  cout << "module_name <- " << m_name << endl;
+#endif
+}
+
+sc_module_name::~sc_module_name ()
+{
+  if (m_pushed == false)
+    return;
+  ASSERT(sc_core::module_name_stack.empty () == false);
+  sc_core::module_name_stack.pop_back ();
+	modules_stack.pop ();
+#if 0
+  cout << "~sc_module_name <- " << m_name << endl;
+#endif
+  ASSERT(temp_list.empty () == false);
+  sc_module *last1 = temp_list.back();
+  temp_list.pop_back();
+  sc_module *last2 = (temp_list.empty())?NULL:temp_list.back();
+  set_parent (*last1, last2);
+}
+
+std::ostream& 
+operator << (std::ostream&                  o, 
+             const sc_core::sc_module_name &n)
+{
+  return o << (const char*)n;
+}
+
+/////////////////////////////////////////:
+
+static
+void
+check_method_process (const method_process_t &m)
+{
+  if (m.dont_initialize == false)
+  {
+    ASSERT(m.module != NULL);
+#if DEBUG
+    std::cerr << "Warning : SystemCASS doesn't perform SC_METHOD(S) initializations.\n"
+              << "Please turn off automatic initialization for '" << m.name 
+              << "' method of '" << m.module->name () << "' module"
+                 " by calling 'dont_initialize()' function.\n"
+                 "Example :\n"
+                 "  SC_METHOD(transition);\n"
+                 "  sensitive << clk;\n"
+                 "  dont_initialize ();\n";
+#endif
+#if 0
+    exit (250405);
+#endif
+  }
+}
+
+void
+check_all_method_process ()
+{
+  method_process_list_t::const_iterator i;
+  for (i = sc_core::method_process_list.begin(); 
+       i != sc_core::method_process_list.end ();
+       ++i)
+  {
+    check_method_process (**i);
+  }
+}
+
+void
+valid_method_process ()
+{
+  method_process_t *m = sc_core::method_process_list.back();
+  m->dont_initialize = true;
+}
+
+method_process_t* 
+create_method_process (const char * name, 
+                      SC_ENTRY_FUNC func,
+                      sc_module&    module)
+{
+  return new method_process_t (name, func, module);
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/sc_module.h
===================================================================
--- /latest/src/sc_module.h	(revision 1)
+++ /latest/src/sc_module.h	(revision 1)
@@ -0,0 +1,82 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_module.h                     |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_MODULE_H__
+#define __SC_MODULE_H__
+
+#include "sc_module_ext.h"
+
+#include<list>
+#include<set>
+#include<stack>
+#include"sc_fwd.h"
+#include"internal.h"
+#include"sc_object.h"
+#include"sc_sensitive.h"
+
+namespace sc_core {
+
+class sc_port_base;
+class sc_signal_base;
+
+
+//
+// INTERNAL IMPLEMENTATION
+//
+typedef std::list<sc_signal_base* > signal_list_t; 
+
+typedef std::list<sc_module* > instances_list_t; 
+typedef std::set<sc_module* > instances_set_t; 
+extern instances_set_t instances_set;     // ensemble d'instances
+
+typedef std::stack<const sc_module*> modules_stack_t;
+extern modules_stack_t modules_stack;
+extern void check_all_method_process ();
+extern void valid_method_process ();
+
+extern std::ostream& operator << (std::ostream &o, instances_set_t&);
+
+// ----------------------------------------------------------------------------
+//  CLASS : method_process_t
+//
+//  Method process class.
+// ----------------------------------------------------------------------------
+class method_process_t
+{
+  // for debug
+public: const char *name; // function name
+#ifdef DUMP_SCHEDULE_STATS
+	long long int number_of_calls;
+#endif	
+public:
+  // data
+  sc_module          *module;
+  SC_ENTRY_FUNC       func;
+  sensitivity_list_t  sensitivity_list;
+  bool                dont_initialize;
+
+  // constructors
+  method_process_t(const char* nm, SC_ENTRY_FUNC fn, sc_module& mod );
+
+  // methods
+  friend std::ostream& operator << (std::ostream &, const method_process_t &);
+  
+  // accessors
+  bool is_combinational(void); 
+  bool is_transition(void);
+  bool is_genmoore(void);
+};
+
+
+} // end of namespace sc_core
+
+#endif /* __SC_MODULE_H__ */
Index: /latest/src/sc_module_ext.h
===================================================================
--- /latest/src/sc_module_ext.h	(revision 1)
+++ /latest/src/sc_module_ext.h	(revision 1)
@@ -0,0 +1,209 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_module_ext.h                 |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __SC_MODULE_EXT_H__
+#define __SC_MODULE_EXT_H__
+
+#include"sc_fwd.h"
+#include"internal_ext.h"
+#include"sc_object.h"
+#include"sc_sensitive.h"
+#include"serialization_ext.h"
+
+namespace sc_core {
+
+class method_process_t;
+class sc_module;
+class sc_module_name;
+class sc_port_base;
+class sc_signal_base;
+
+typedef void (sc_module::*SC_ENTRY_FUNC)();
+//typedef void (*SC_ENTRY_FUNC)(sc_module*);
+
+extern method_process_t* create_method_process (const char*, SC_ENTRY_FUNC, sc_module&);
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_module
+//
+//  Module class.
+// ----------------------------------------------------------------------------
+typedef sc_signal_base sc_bind_proxy;
+extern sc_bind_proxy SC_BIND_PROXY_NIL;
+
+struct sc_module : public sc_object
+{
+  //////////////////////
+  // SYSTEMCASS SPECIFIC
+private : void init ();
+public :
+//  friend std::ostream& operator << (std::ostream &o, const sc_module &m);
+ 
+  //////////////////////
+  // LRM (?)
+protected:
+  sc_module();
+  sc_module( const char* nm );
+//  sc_module( const sc_string& nm);
+  sc_module( const sc_module_name &nm);
+
+public:
+  ~sc_module() {};
+
+	/////////
+	//// LRM
+protected:  void dont_initialize ();
+public:  void operator () ( /* const */ sc_bind_proxy& p001,
+	       /* const */ sc_bind_proxy& p002 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p003 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p004 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p005 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p006 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p007 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p008 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p009 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p010 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p011 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p012 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p013 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p014 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p015 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p016 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p017 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p018 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p019 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p020 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p021 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p022 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p023 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p024 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p025 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p026 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p027 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p028 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p029 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p030 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p031 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p032 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p033 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p034 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p035 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p036 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p037 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p038 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p039 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p040 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p041 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p042 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p043 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p044 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p045 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p046 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p047 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p048 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p049 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p050 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p051 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p052 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p053 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p054 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p055 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p056 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p057 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p058 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p059 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p060 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p061 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p062 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p063 = SC_BIND_PROXY_NIL,
+	       /* const */ sc_bind_proxy& p064 = SC_BIND_PROXY_NIL );
+	
+	/////////
+  // These are protected so that user derived classes can refer to them.
+  sc_sensitive     sensitive;
+  sc_sensitive_pos sensitive_pos;
+  sc_sensitive_neg sensitive_neg;  
+};
+
+#define SC_MODULE(user_module_name) \
+       struct user_module_name : sc_module
+
+// the SC_HAS_PROCESS macro call must be followed by a ;
+#define SC_HAS_PROCESS(user_module_name)                         \
+   typedef user_module_name SC_CURRENT_USER_MODULE
+
+#define SC_CTOR(user_module_name)                                \
+   SC_HAS_PROCESS(user_module_name);                             \
+   user_module_name(sc_module_name)
+
+/* Converting `void (module_tag::*)()' to `void (sc_module::*)()' is OK as
+   long as the dynamic type is correct.  C++ Standard 5.4 "Explicit type
+   conversion", clause 7: a pointer to member of derived class type may be
+   explicitly converted to a pointer to member of an unambiguous non-virtual
+   base class type. */
+#define SC_MAKE_FUNC_PTR(module_tag, func) \
+    (/*static_cast<*/(sc_core::SC_ENTRY_FUNC)/*>*/ (&module_tag::func))
+
+extern void declare_method_process(const char*,SC_ENTRY_FUNC,sc_module&);
+
+#define DECLARE_METHOD_PROCESS(handle, name, module_tag, func) \
+  declare_method_process(name, \
+                        SC_MAKE_FUNC_PTR( module_tag, func ), \
+                        *this)
+
+#define SC_METHOD(func)     \
+  {                         \
+  DECLARE_METHOD_PROCESS(func ## _handle, #func, SC_CURRENT_USER_MODULE,func);\
+  }
+
+#define SC_MAKE_SAVE_PTR(module_tag, func) \
+    (/*static_cast<*/(sc_core::save_fct_t1)/*>*/ (&module_tag::func))
+
+extern void declare_save_handler(const char*,save_fct_t1,sc_module&);
+//extern void declare_save_handler(const char*,save_fct_t2,sc_module&);
+#define DECLARE_SAVE_HANDLER(handle, name, module_tag, func) \
+  declare_save_handler (name, \
+                        SC_MAKE_SAVE_PTR( module_tag, func ), \
+                        *this)
+
+#define SAVE_HANDLER(func)  \
+  {                         \
+  DECLARE_SAVE_HANDLER(func ## _handle, #func, SC_CURRENT_USER_MODULE,func);\
+  }
+} // end of namespace sc_core
+
+#endif /* __SC_MODULE_EXT_H__ */
+
Index: /latest/src/sc_module_name.h
===================================================================
--- /latest/src/sc_module_name.h	(revision 1)
+++ /latest/src/sc_module_name.h	(revision 1)
@@ -0,0 +1,53 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_module_name.h                  |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_MODULE_NAME_H__
+#define __SC_MODULE_NAME_H__
+
+#include"sc_fwd.h"
+
+namespace sc_core {
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_module_name
+//
+//  Module name class.
+// ----------------------------------------------------------------------------
+
+class sc_module_name
+{
+  /////////////////////////
+  // SYSTEMCASS SPECIFIC //
+  void init ();
+  /////////////////////////
+  
+  const char*     m_name;
+  bool            m_pushed;
+  friend class sc_module;
+//  friend class sc_object_manager;
+public:
+  sc_module_name( const char* );
+  sc_module_name( const sc_module_name & );
+  ~sc_module_name ();
+  operator const char*() const { return m_name; };
+private:
+  // disabled 
+    sc_module_name ();
+    sc_module_name & operator = (const sc_module_name &);
+};
+
+//std::ostream& operator << (std::ostream&, const sc_core::sc_module_name &);
+
+} // end of namespace sc_core
+
+#endif /* __SC_MODULE_NAME__ */
+
Index: /latest/src/sc_nbdefs.h
===================================================================
--- /latest/src/sc_nbdefs.h	(revision 1)
+++ /latest/src/sc_nbdefs.h	(revision 1)
@@ -0,0 +1,33 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_main.cc                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_DEFS_H__
+#define __SC_DEFS_H__
+
+#ifndef WIN32
+typedef signed long long   int64;
+typedef unsigned long long uint64;
+#else
+typedef signed __int64     int64;
+typedef unsigned __int64   uint64;
+#endif
+
+typedef long           int32;
+typedef unsigned long  uint32;
+typedef short          int16;
+typedef unsigned short uint16;
+typedef char           int8;
+typedef unsigned char  uint8;
+
+typedef uint16         smallest_uint;
+typedef int16          smallest_int;
+
+#endif
Index: /latest/src/sc_numrep.cc
===================================================================
--- /latest/src/sc_numrep.cc	(revision 1)
+++ /latest/src/sc_numrep.cc	(revision 1)
@@ -0,0 +1,63 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_numrep.cc                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   04_05_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <string>
+#include "sc_numrep.h"
+
+namespace sc_dt {
+
+const std::string numrep_name[] = {
+  "SC_DEC",
+  "SC_BIN",
+  "SC_BIN_US",
+  "SC_BIN_SM",
+  "SC_OCT",
+  "SC_OCT_US",
+  "SC_OCT_SM",
+  "SC_HEX",
+  "SC_HEX_US",
+  "SC_HEX_SM",
+  "SC_CSD"
+};
+
+const std::string 
+to_string (sc_numrep n)
+{
+  return numrep_name[n];
+}
+
+
+} // end of sc_dt namespace
+
Index: /latest/src/sc_numrep.h
===================================================================
--- /latest/src/sc_numrep.h	(revision 1)
+++ /latest/src/sc_numrep.h	(revision 1)
@@ -0,0 +1,98 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_numrep.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   04_05_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_NUMREP_H__
+#define __SC_NUMREP_H__
+
+#include <iostream>
+#include "sc_string.h"
+
+namespace sc_dt {
+
+typedef enum {
+  SC_NOBASE = 0,
+  SC_BIN    = 2,     // binary
+  SC_OCT    = 8,     // octal, two's complement
+  SC_DEC    = 10,    // decimal
+  SC_HEX    = 16,    // hexadecimal, two's complement
+  SC_BIN_US     ,    // binary, unsigned
+  SC_BIN_SM     ,    // binary, sign magnitude
+  SC_OCT_US     , 
+  SC_OCT_SM     ,
+  SC_HEX_US     ,
+  SC_HEX_SM     ,
+  SC_CSD             // canonical signed digit
+} sc_numrep;
+
+inline
+const unsigned int bitstring_to_uint (const char * val)
+{ 
+  unsigned int i, res = 0;
+  for (i = 0; val[i] != '\0'; ++i)
+  {
+    res <<= 1;
+    res |= (val[i] == '1')?1:0;
+  } 
+  return res;    
+}
+
+template <typename T>
+const sc_string to_string (T val, size_t nbits, sc_numrep n)
+{ 
+  sc_string s(nbits + 3,'0');
+  switch (n) {
+  case SC_HEX : {
+    char t[64];
+    char format[64];
+    sprintf (format, "0x0%%0%dx", nbits/4);
+    sprintf (t, format, val);
+    s = t;
+    break;
+  }
+  case SC_BIN : {
+    int i;
+    s[1] = 'b';
+    for (i = nbits - 1; i >= 0; --i)
+    {
+      s[i + 3] = (val & 1)?'1':'0';
+      val >>= 1;
+    } 
+    break;
+  }
+  default:
+    { std::cerr << "error\n"; return s; }
+  }
+#if 0
+  std::cerr << "\"" << s << "\"";
+#endif
+  return s;
+}
+
+const std::string to_string (sc_numrep);
+
+} // end of sc_dt namespace
+
+using sc_dt::sc_numrep;
+using sc_dt::SC_BIN;
+using sc_dt::SC_HEX;
+using sc_dt::SC_OCT; 
+using sc_dt::SC_DEC;
+using sc_dt::SC_HEX;
+using sc_dt::SC_BIN_US;
+using sc_dt::SC_BIN_SM;
+using sc_dt::SC_OCT_US;
+using sc_dt::SC_OCT_SM;
+using sc_dt::SC_HEX_US;
+using sc_dt::SC_HEX_SM;
+using sc_dt::SC_CSD;
+
+#endif
+
Index: /latest/src/sc_object.cc
===================================================================
--- /latest/src/sc_object.cc	(revision 1)
+++ /latest/src/sc_object.cc	(revision 1)
@@ -0,0 +1,285 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_object.cc                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include <stdio.h>
+#include <string>
+#include <map>
+
+#include "assert.h"
+#include "sc_object.h"
+//#include "sc_port.h"
+#include "internal.h"
+#include "sc_signal.h"
+#include "module_hierarchy.h"
+
+using namespace std;
+
+namespace sc_core {
+
+static void
+gen_name (const char *prefix, string &s)
+{
+  s = prefix;
+  static int i = 0;
+  char ic[10];
+  sprintf (ic,"%d",i++);
+  s += ic;
+}
+// ----------------------------------------------------------------------------
+static void
+build_complete_name (const char *name, string &out)
+{
+	out = "";
+  module_name_stack_t::const_iterator i;
+  for (i = module_name_stack.begin (); i != module_name_stack.end (); ++i) {
+    const string &module_name = *i;
+    out += (module_name + ".");
+//    out += ".";
+  }
+//  ASSERT(name != NULL);
+  if (name)
+    out += name;
+  else
+    out[out.length ()-1] = '\0';
+#if 0
+  cerr << "complete_name = " << out << endl;
+#endif
+}
+
+#if 0
+static
+void
+build_full_name_r (string &out, const sc_object *obj)
+{
+  if (obj == NULL)
+  {
+    out = "";
+  } else {
+    const sc_object *parent = obj->get_parent_object ();
+    build_full_name_r (out, parent);
+    out += obj->basename ();
+    out += ".";
+  }
+}
+
+static
+void
+build_full_name (string &out, const sc_object &obj)
+{
+  const sc_object *parent = obj.get_parent_object ();
+  build_full_name_r (out, parent);
+  out += obj.basename ();
+  cerr << "build_full_name = " << out << endl;
+}
+#endif
+
+typedef std::map<const sc_object* const,string> object2name_t;
+static object2name_t object2basename;
+static object2name_t object2fullname;
+
+struct object_infos_t {
+	const char *kind_string;
+};
+typedef std::map<const sc_object* const,object_infos_t> object2infos_t;
+static object2infos_t object2infos;
+
+// We initialize SC_BIND_PROXY_NIL there to make sure object2infos,
+// object2fullname, and object2basename are already initialized.
+// SC_BIND_PROXY_NIL should be declared into sc_module.cc but it prevents us
+// to force the initialization order.
+const char *SC_BIND_PROXY_NIL_string = "SC_BIND_PROXY_NIL";
+sc_bind_proxy SC_BIND_PROXY_NIL (SC_BIND_PROXY_NIL_string,NULL);
+
+// ----------------------------------------------------------------------------
+//  FUNCTION : sc_gen_unique_name
+//                                               
+// ----------------------------------------------------------------------------
+
+const char *
+sc_gen_unique_name (const char *basename_)
+{
+	string s;
+	gen_name (basename_,s);
+	return strdup (s.c_str ());
+}
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_object
+//                                               
+// ----------------------------------------------------------------------------
+
+const char* const sc_object::kind_string = "sc_object";
+
+void
+sc_object::set_kind (const char *k)
+{
+	object2infos[this].kind_string = k;
+}
+
+void
+sc_object::init ()
+{
+	set_kind ("sc_object");
+  add_child (*this);
+}
+
+sc_object::sc_object()
+{
+	string noname;
+ 	gen_name ("noname_",noname);
+#if 0
+  cerr << "object2basename[this] = " << noname << "\n"; 
+#endif
+  object2basename[this] = noname;
+  build_complete_name (noname.c_str(),object2fullname[this]);
+	init ();
+}
+
+sc_object::sc_object(const char *name_)
+{
+  const char *temp;
+  if (name_ == NULL) {
+    if (module_name_stack.empty())
+    {
+      cerr << "Internal error : module_name_stack is empty.";
+      exit (21092005);
+    }
+    string &module_name = module_name_stack.back ();
+    temp = module_name.c_str ();
+  } else {
+    temp = name_;
+  }
+#if 0
+  cerr << "object2basename[this] = " << temp << "\n"; 
+  cerr << "name temp = " << temp << endl;
+#endif
+  object2basename[this] = temp;
+  build_complete_name (name_,object2fullname[this]);
+	init ();
+}
+
+const char *
+sc_object::basename () const
+{
+  return object2basename[this].c_str ();
+}
+
+const char *
+sc_object::name () const
+{
+	object2name_t::iterator i = object2fullname.find (this);
+#ifdef DEBUG
+	if (i == object2fullname.end ()) {
+		cerr << "Internal error : can't find name of " << this << "\n";
+		exit (90);
+	}
+#endif
+  return i->second.c_str ();
+}
+  
+void
+sc_object::rename (const char* newname) const
+{
+/*
+	object2name_t::iterator i = object2fullname.find (this);
+#ifdef DEBUG
+	if (i == object2fullname.end ()) {
+		cerr << "Internal error : can't find name of " << this << "\n";
+		exit (90);
+	}
+#endif
+  i->second = newname;
+  object2basename[this] = newname;
+*/
+  object2basename[this] = newname;
+  build_complete_name (newname,object2fullname[this]);
+/*
+  const std::vector<sc_object*>& childs = get_child_objects();
+  std::vector<sc_object*>::const_iterator it;
+  for (it = childs.begin (); it != childs.end (); ++it)
+  {
+    string     out;
+    sc_object* obj = *it;
+    ASSERT(obj != NULL);
+    build_full_name (out, *obj);
+  }
+*/
+}
+const char *sc_object::kind () const
+{
+	object2infos_t::iterator i = object2infos.find (this);
+#ifdef DEBUG
+	if (i == object2infos.end ()) {
+		cerr << "Internal error : can't find kind of " << this << "\n";
+		exit (90);
+	}
+#endif
+  return i->second.kind_string;
+}
+
+sc_object::~sc_object ()
+{
+  if (save_on_exit)
+  {
+    sc_save_simulation (save_on_exit);
+    save_on_exit = NULL;
+  }
+  object2fullname.erase (this);
+  object2basename.erase (this);
+  object2infos.erase    (this);
+}
+
+std::ostream& 
+operator << (std::ostream& os, const sc_object& obj)
+{
+	return os << obj.name ();
+}
+
+/* virtual */ 
+const std::vector<sc_object*>& 
+sc_object::get_child_objects() const
+{
+  return sc_core::get_child_objects (*this);
+}
+
+sc_object*
+sc_object::get_parent_object () const
+{
+  return sc_core::get_parent_object (*this);
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/sc_object.h
===================================================================
--- /latest/src/sc_object.h	(revision 1)
+++ /latest/src/sc_object.h	(revision 1)
@@ -0,0 +1,77 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_object.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_OBJECT_H__
+#define __SC_OBJECT_H__
+
+#include <iostream>
+#include <vector>
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_object
+//
+// ----------------------------------------------------------------------------
+
+namespace sc_core {
+
+class sc_object
+{
+	///////////
+	// Internal
+	protected: void             init ();
+	protected: void             set_kind (const char *);
+	///////////		 
+public:
+  static const char* const kind_string;
+  // LRM
+  const char *name     () const;
+  const char *basename () const;
+  void        rename   (const char*) const;
+
+	friend std::ostream& operator << (std::ostream& , const sc_object&);
+  /*
+  void print () const;
+  virtual void print (std::ostream & os) const;
+  void dump () const;
+  virtual void dump (std::ostream & os) const;
+  virtual void trace (sc_trace_file *) const;
+  */
+  /*virtual*/ const char *kind () const;
+  /*
+  sc_simcontext *simcontext () const;
+  bool add_attribute (sc_attr_base &);
+  sc_attr_base *get_attribute (const sc_string &);
+  const sc_attr_base *get_attribute (const sc_string &) const;
+  sc_attr_base *remove_attribute (const sc_string &);
+  void remove_all_attributes ();
+  int num_attributes () const;
+    sc_attr_cltn & attr_cltn ();
+  const sc_attr_cltn & attr_cltn () const;
+  */
+  /* virtual */ const std::vector<sc_object*>& get_child_objects() const;
+  sc_object*               get_parent_object       () const;
+protected:
+    sc_object ();
+    sc_object (const char *);
+    /*virtual */~ sc_object ();
+		
+};
+
+const std::vector<sc_object*>& sc_get_top_level_objects();
+const sc_object*               sc_find_object          (const char*);
+
+} // end of sc_core namespace
+
+using sc_core::sc_get_top_level_objects;
+using sc_core::sc_find_object;
+
+#endif
+
Index: /latest/src/sc_pat_trace.cc
===================================================================
--- /latest/src/sc_pat_trace.cc	(revision 1)
+++ /latest/src/sc_pat_trace.cc	(revision 1)
@@ -0,0 +1,109 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_pat_trace.cc                 |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include"sc_trace.h"
+#include"sc_pat_trace.h"
+#include"sc_ver.h"
+#include"internal.h" // notrace
+
+#include<time.h>
+#include<string>
+
+#ifdef PAT_TRACE_FORMAT
+
+//-----------------------------------------
+
+extern "C" {
+#include "genpat.h"
+}
+
+//#include "malloc.h" // NO LONGER SUPPORTED
+#include <stdlib.h>
+#include "stdio.h"
+
+//-----------------------------------------
+
+using namespace std;
+
+namespace sc_core {
+
+//*************************************************************************
+
+sc_trace_file*
+sc_create_pat_trace_file(const char * name)
+{
+  if (notrace)
+    return NULL;
+	//création d'1 instance de la structure Sc_trace_file:
+	sc_trace_file *traceFic=new sc_trace_file();
+	traceFic->flag = PAT_FORMAT;	
+	
+	trace_file_list.push_back(traceFic);
+	
+	DEF_GENPAT((char *)name);
+	
+	return traceFic; 
+	//pointeur sur le sc_trace_file dontl'un des elts pointe sur le fichier.pat crée 
+	
+}
+
+//*************************************************************************
+
+void
+sc_close_pat_trace_file( sc_trace_file* traceFic )
+{	
+  if (notrace)
+    return;
+
+  trace  (*traceFic,false);
+
+	SAV_GENPAT ();
+	
+	//libération de l'instance de la structure en mémoire:
+	delete traceFic;
+
+	vector<sc_trace_file*>::iterator i;
+	for (i = trace_file_list.begin (); i != trace_file_list.end(); ++i)
+		if (*i == traceFic) {
+			trace_file_list.erase(i);
+			break;
+		}
+}
+
+} // end of sc_core namespace
+
+#endif
Index: /latest/src/sc_pat_trace.h
===================================================================
--- /latest/src/sc_pat_trace.h	(revision 1)
+++ /latest/src/sc_pat_trace.h	(revision 1)
@@ -0,0 +1,33 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                sc_pat_trace.h                     |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef SC_PAT_TRACE_H
+#define SC_PAT_TRACE_H
+
+#include "sc_fwd.h"
+
+
+namespace sc_core {
+
+// Create PAT file
+extern sc_trace_file *sc_create_pat_trace_file(const char* name);
+
+// Close PAT file
+extern void sc_close_pat_trace_file( sc_trace_file* tf );
+
+} // end of sc_core namespace
+
+using sc_core::sc_create_pat_trace_file;
+using sc_core::sc_close_pat_trace_file;
+
+#endif
+
Index: /latest/src/sc_port.cc
===================================================================
--- /latest/src/sc_port.cc	(revision 1)
+++ /latest/src/sc_port.cc	(revision 1)
@@ -0,0 +1,380 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_port.cc                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include<iomanip>
+#include<list>
+#include<map>
+#include<vector>
+
+#include"sc_port.h"
+#include"sc_signal.h"
+#include"sc_module.h"
+#include"entity.h"
+#include"global_functions.h"
+#include"assert.h"
+
+extern "C" {
+	extern char unstable;
+  char unstable = 0; // not in sc_core namespace because dynamic link support C linkage only
+  unsigned int pending_write_vector_nb = 0;
+}
+
+using namespace std;
+
+#ifdef CHECK_FSM_RULES
+#include"fsm_rules.h"
+namespace sc_core {
+casc_fsm_step_t casc_fsm_step = ELABORATION;
+}
+#endif
+
+namespace sc_core {
+
+const char *const sc_port_base::kind_string = "sc_port";
+const char *const sc_signal_base::kind_string = "sc_signal";
+
+unsigned int pending_write_vector_capacity = 512;
+pending_write_vector_t pending_write_vector = NULL;
+extern equi_list_t equi_list;
+
+const char* get_module_name (const tab_t *pointer)
+{
+	const equi_t &eq = get_equi (pointer);
+  return get_module_name (eq);
+}
+
+//typedef std::map<const sc_port_base*, const sc_module*> port2module_t;
+port2module_t port2module;
+
+// KIND STRING
+const char * const sc_inout_string = "sc_inout";
+const char * const sc_in_string    = "sc_in";
+const char * const sc_out_string   = "sc_out";
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_port_base
+//
+//                                               
+// ----------------------------------------------------------------------------
+
+sc_port_base::sc_port_base()
+{
+	init ();
+}
+
+sc_port_base::sc_port_base(const char* name_) : sc_object(name_)
+{
+	init ();
+}
+
+sc_port_base::sc_port_base(const sc_port_base& parent_) : sc_object (parent_.name ())
+{
+	init ();
+}
+
+void
+sc_port_base::init ()
+{
+#ifdef DEBUG
+	if (modules_stack.empty ()) {
+		cerr << "Internal error : modules stack empty\n";
+		exit (9);
+	}
+#endif
+	const sc_module *last_module = sc_core::modules_stack.top ();
+	port2module[this] = last_module;
+	set_kind (kind_string);
+}
+
+const sc_module &
+sc_port_base::get_module () const
+{
+	port2module_t::iterator i = port2module.find ((sc_port_base*)this);
+	if (i == port2module.end ()) {
+		cerr << "Internal error : Modules contain ports. "
+            "SystemCASS needs to identify the module that contains the following port : '" 
+        << name()
+			  << "'\n";
+		exit (17);
+	}
+  const sc_module *m = i->second;
+	return *m;
+}
+
+static bool check_multiwriting2port_error_message = 1;
+void
+sc_port_base::check_multiwriting2port () const
+{
+  static std::map<sc_port_base*, double> s;
+  double t = sc_simulation_time ();
+  if (t == 0)
+    return;
+  sc_port_base *port = (sc_port_base*)this;
+  if ((s[port] == t) && (check_multiwriting2port_error_message))
+  {
+    check_multiwriting2port_error_message = 0;
+    if (use_port_dependency)
+    {
+      std::cerr << "Error at cycle #" << t << " : "
+                   "SystemCASS allows only 1 writing for each ports/signals.\n"
+                << "Functions write several times into '" << name () << "'.\n";
+    } else {
+      std::cerr << "Error : "
+                   "Multiwriting to port assertion works only "
+                   "when SystemCASS uses port dependency information "
+                   "(--p parameter).\n";
+    }
+    sc_core::sc_stop ();
+    exit (31072006); // 6
+  } else
+    s[port] = t;
+}
+
+std::ostream& 
+operator << (std::ostream &o, const sc_port_base &p)
+{
+  return o << p.name ();
+}
+// ----------------------------------------------------------------------------
+//  CLASS : sc_signal_base
+//
+//  The sc_signal<T> primitive channel class.
+// ----------------------------------------------------------------------------
+
+void
+sc_signal_base::init ()
+{
+	set_kind (kind_string);
+	bind (*this);
+}
+
+sc_signal_base::sc_signal_base() { 
+  init ();
+}
+
+sc_signal_base::sc_signal_base(const char* name_) : sc_object(name_) { 
+  init ();
+}
+
+sc_signal_base::sc_signal_base(const char* name_, void*) : sc_object(name_) {
+	// this overload is only used for SC_BIND_PROXY_NIL constant.
+	// this signal should not be added to the signal list.
+}
+
+sc_signal_base::~sc_signal_base() { 
+}
+
+/*
+ * Signals copy
+ */
+
+#ifdef DUMP_SIGNAL_STATS
+typedef map<tab_t*,long long int> counter_t;
+static counter_t  counter;
+long long int unnecessary = 0;
+long long int total_assig = 0;
+#endif
+
+} // end of sc_core namespace
+
+extern "C" {
+void
+update ()
+{
+#if defined(DUMP_STAGE)
+  cerr << "Updating... ";
+#endif
+// stl vectors are too slow
+// memcopy is not better
+// signal table sorting doesn't give any better performance	
+#if 0
+	cerr << pending_write_vector_nb << " " << pending_write_vector_capacity << endl;
+#endif
+#if defined(DUMP_STAGE)
+  cerr << "(" << pending_write_vector_nb 
+       << " internal pending writings) ";
+#endif
+	unsigned int i;
+	for (i = 0; i < pending_write_vector_nb; ++i) {
+#if 0
+		cerr << "pending_write[" << i << "] : " << pending_write_vector[i];
+#endif
+#define iter (sc_core::pending_write_vector[i])
+#ifdef DEBUG
+		if (iter.pointer == NULL) {
+			cerr << "Internal error : trying to apply a posted write from an unassigned signal/port\n";
+			exit (8);
+		}
+#endif	
+#ifdef DUMP_SIGNAL_STATS
+		if (*(iter.pointer) == iter.value)
+			unnecessary++;
+		counter[iter.pointer]++;
+#endif
+		*(iter.pointer) = iter.value;	
+#undef iter
+  }
+#ifdef DUMP_SIGNAL_STATS
+	total_assig += pending_write_vector_nb;
+#endif
+	pending_write_vector_nb = 0;
+
+#if defined(DUMP_STAGE)
+  cerr << "done.\n";
+#endif
+#if defined(CHECK_MULTIWRITING2REGISTER)
+  sc_core::pending_writing2register_clear ();
+#endif
+}
+
+} // end of extern "C"
+
+namespace sc_core {
+
+void
+print_registers_writing_stats (ostream &o)
+{
+#ifdef DUMP_SIGNAL_STATS
+	o << "signal index / name / usage (>1%)\n";
+	o << setprecision (2);
+	double t = sc_simulation_time ();
+	if (t == 0) {
+		o << "Warning : simulation too short.\n";
+		t = 0.01;
+	}
+	if (total_assig == 0)
+		return;
+	counter_t::iterator k;
+	for (k = counter.begin (); k != counter.end (); ++k) {
+		double usage = k->second / t * 100;
+		if (usage <= 1)
+			continue;
+		o << k->first 
+			<< "   " << get_name (k->first) 
+			<< "   " << usage << "%\n";
+	}
+	typedef map<string,int> counter_module_t;
+	counter_module_t counter_by_module;
+	for (k = counter.begin (); k != counter.end (); ++k) {
+		string module_name = get_module_name (k->first);
+		counter_by_module[module_name] += k->second;	
+	}
+	o << "module name / usage\n";
+	counter_module_t::iterator i;
+	for (i = counter_by_module.begin (); i != counter_by_module.end (); ++i) {
+		o << i->first 
+			<< "   " << (i->second * 100 / total_assig) << "%\n";
+	}
+	cerr << "average of assignment number per cycle " << (total_assig / t) << "\n";
+	cerr << (unnecessary * 100 / total_assig) << "% of assignment are unecessary\n";
+#else
+	cerr << "Register usage not available.\n";
+#endif
+}
+
+static
+bool
+is_bound (/*const*/ sc_port_base &port)
+{
+  const tab_t *pointer = port.get_pointer ();
+  //ASSERT(pointer != NULL);
+  if (pointer == NULL)
+    return false; // case : sc_in not bound
+/*
+  equi_t &e = get_equi (pointer);
+  if (e.size () == 1)
+    return true; // case : sc_out not bound
+*/
+  return has_equi (port);
+}
+
+static
+void
+check_port (/*const*/ sc_port_base &port)
+{
+  if (!is_bound (port))
+  {
+    cerr << "Error : '" << port.name () << "' port"
+            " (" << port.kind() << ")"
+            " is not bound.\n";
+    exit (29);
+  }
+}
+
+void
+check_all_ports ()
+{
+  if (dump_stage)
+    cerr << "checking ports...";
+	port2module_t::/*const_*/iterator i;
+  for (i = port2module.begin (); i != port2module.end (); ++i)
+  {
+    /*const*/ sc_port_base *port = i->first;
+    ASSERT(port != NULL);
+    check_port (*port);
+  }
+  if (dump_stage)
+    cerr << " done.";
+}
+
+#if defined(CHECK_MULTIWRITING2REGISTER)
+typedef set<const tab_t*> pending_writing2register_set_t;
+pending_writing2register_set_t pending_writing2register_set;
+
+void 
+pending_writing2register_clear  ()
+{
+  pending_writing2register_set.clear(); 
+}
+
+void
+pending_writing2register_record_and_check (const tab_t *p)
+{
+  if (pending_writing2register_set.find (p) != pending_writing2register_set.end())
+  {
+		std::cerr << "Error : please check '" << get_name (p) << "'.\n";
+    std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";
+    sc_stop ();
+    exit (31072006); // 6
+  } else
+    pending_writing2register_set.insert(p);
+}
+#endif
+
+} // end of sc_core namespace
+
+
Index: /latest/src/sc_port.h
===================================================================
--- /latest/src/sc_port.h	(revision 1)
+++ /latest/src/sc_port.h	(revision 1)
@@ -0,0 +1,30 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_port.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_PORT_H__
+#define __SC_PORT_H__
+
+#include"sc_port_ext.h"
+#include"sc_fwd.h"
+//#include"internal_ext.h"
+
+#include <list>
+
+//
+namespace sc_core {
+//
+const char *get_module_name (const tab_t *pointer);
+void        check_all_ports ();
+
+} // end of sc_core namespace
+
+#endif /* __SC_PORT_H__ */
Index: /latest/src/sc_port_ext.h
===================================================================
--- /latest/src/sc_port_ext.h	(revision 1)
+++ /latest/src/sc_port_ext.h	(revision 1)
@@ -0,0 +1,472 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_port_ext.h                   |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_PORT_EXT_H__
+#define __SC_PORT_EXT_H__
+
+// Define registers writing method
+#include<iostream>
+#include"sc_fwd.h"
+#include"sc_nbdefs.h"
+//#include"sc_event_finder.h"
+#include"sc_event.h"
+#include"sc_object.h"
+#include"sc_interface.h"
+#include"internal_ext.h"
+#include"port_dependency_ext.h"
+#include"fsm_rules.h"
+
+
+//__GNUC__
+//__GNUC_MINOR__
+//__GNUC_PATCHLEVEL__
+//
+#if ((__GNUC__ < 3) || (__GNUC_MINOR__ < 4))
+#define INLINE __attribute__((always_inline))
+#else
+/* gcc3.4 doesn't support */ 
+#define INLINE
+#endif
+
+#include <list>
+
+//
+namespace sc_core {
+//
+const char *get_name        (const tab_t *pointer);
+
+#define READ_SIGNAL(value_type_,pointer_) \
+	((value_type_&) (*((value_type_*) (pointer_))))
+
+	///////////////////// DEPRECATED
+// C ANSI-only since it is needed to link with extern "C"
+// this declaration is not in casc.h since the CHECK_FSM_RULES macro
+// is not defined.
+
+extern void bind (sc_port_base&,sc_port_base&);
+extern void bind (sc_port_base&,sc_signal_base&);
+extern void bind (sc_signal_base &x);
+extern void bind (sc_port_base   &x);
+
+// KIND STRING
+extern const char * const sc_inout_string;
+extern const char * const sc_in_string;
+extern const char * const sc_out_string;  
+
+extern "C" void update (void);
+
+class sc_port_base : public sc_object, public sc_interface
+{
+protected:
+  typedef sc_port_base                        base_type;
+public:
+	///////////
+	// Internal
+	const sc_module &get_module () const;
+	void             init ();
+  void             check_multiwriting2port () const;
+	///////////		 
+  
+  friend std::ostream& operator << (std::ostream &, const sc_port_base &);
+ 
+  // LRM
+  //virtual const sc_event /*&*/ default_event () const;
+  static const char* const kind_string;
+//  virtual const char *kind () const;
+  //
+  sc_port_base();
+  sc_port_base(const char* name_);
+  explicit sc_port_base(const sc_port_base& parent_);
+  /*virtual */~sc_port_base () {};
+  // bind to a handle
+  void operator () (method_process_t &func) const;
+};
+
+template < typename T > class sc_port_b:public sc_port_base
+{
+};
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_in<T>
+//
+// ----------------------------------------------------------------------------
+
+template <typename T>
+class sc_in : public sc_port_base
+{
+private:
+  typedef T  data_type;
+  typedef sc_port_base                  base_type;
+  typedef sc_in<data_type>              this_type;
+  typedef sc_signal<data_type>          signal_type;
+
+	///////////
+	// Internal
+  void init ();
+	/*
+	public: virtual size_t data_size () const
+	{ return sizeof (data_type); }
+	*/
+	///////////
+public:
+  // constructors
+  sc_in(): base_type() { init (); }
+
+  explicit sc_in(const char* name_): base_type(name_) { init (); }
+
+  explicit sc_in(const base_type& parent_ ): base_type( parent_ ) { init (); }
+
+	/*
+  // LRM error !
+  //static const char *const kind_string; this is a template !
+	*/
+//  virtual const char *kind () const 
+//  { return "sc_in"; };
+ 
+#if 0
+  // LRM
+  sc_event_finder& neg () const { return *new sc_event_finder (*(sc_port_base*)this);};
+  sc_event_finder& pos () const { return *new sc_event_finder (*(sc_port_base*)this);};
+#endif
+
+  sc_event         neg () const { return sc_event (*this, sc_event::NEG);};
+  sc_event         pos () const { return sc_event (*this, sc_event::POS);};
+  // read the current value
+  inline const T& read() const INLINE;  
+  inline operator const T& () const INLINE;
+
+  // operateur ==
+  inline bool operator == (const T& v) INLINE;
+
+  // bind to in interface
+  void operator () (sc_signal<data_type> &s)
+  { sc_core::bind (*this,s); }
+  
+  // binding for hierarchical description
+  void operator () (this_type &parent_)  
+  { sc_core::bind (*this,parent_); }
+
+  void operator () (sc_out<data_type> &o) 
+  { sc_core::bind (*this,o); }
+
+  /*virtual */~sc_in() {};
+
+};
+
+template <typename T>
+void
+sc_in<T>::init()
+{ 
+	set_kind (sc_in_string);
+	sc_interface::init (sizeof (data_type)); 
+}
+
+// read
+template <typename T> inline 
+const T& 
+sc_in<T>::read() const
+{ 
+#ifdef DUMP_READ
+  std::cerr << "read " << READ_SIGNAL(const T&, get_pointer())
+	 	<< " on signal " << name () << "\n";
+#endif
+#ifdef CHECK_FSM_RULES
+	if (casc_fsm_step == GEN_MOORE) {
+		std::cerr << "FSM rules error : trying to read on input port '" 
+		          << name ()
+			  << "' from " <<  get_step_name () << " function.\n";
+		exit (-1);
+	}		
+#endif
+  return READ_SIGNAL(const T, get_pointer());
+}
+  
+template <typename T> inline 
+sc_in<T>::operator const T& () const
+{ return sc_in<T>::read (); }
+
+template <typename T> inline 
+bool sc_in<T>::operator == (const T& v) {
+  return sc_in<T>::read() == v;
+}
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_inout<T>
+//
+// ----------------------------------------------------------------------------
+
+template <typename T>
+class sc_inout : public sc_port_base
+{
+	///////////
+	// Internal
+protected:
+  void init ();
+	T val;
+private:
+  typedef T                                   data_type;
+
+  typedef sc_inout<data_type>                 this_type;
+  typedef sc_signal<data_type>                signal_type;
+
+	/*
+	public: virtual size_t data_size () const
+	{ return sizeof (data_type); }
+	*/
+	///////////
+public:
+  // contructeurs
+  sc_inout(): base_type() { init (); };
+
+  explicit sc_inout(const char* name_): base_type(name_) { init (); };
+
+	/*
+  // LRM error !
+  //static const char *const kind_string; this is a template !
+	*/
+  //virtual const char *kind () const 
+  //{ return "sc_inout"; };
+ 
+  // read the current value
+  inline const T& read() const INLINE;
+  // write the new value
+  inline void write( const T& ) INLINE;
+  template <int W> inline void write( const sc_uint<W>& v) 
+  { sc_inout<T>::write (v.read()); }
+
+  inline operator const T& () const INLINE;
+
+  inline sc_inout<T>& operator = ( const T& a ) INLINE;
+  
+  inline sc_inout<T>& operator = ( const sc_signal<T>& a ) INLINE;
+
+//  inline sc_inout<T>& operator = ( const sc_port_base& a ) INLINE;
+
+  // operateur ==
+  inline bool operator == (const bool& v) INLINE;
+
+  // bind to in interface
+  void operator () (sc_signal<data_type> &s)
+  { bind (*this); bind (*this,s); }
+  
+  void operator () (this_type &parent_) 
+  { bind (*this,parent_); }
+
+  /*virtual */~sc_inout() {};
+};
+
+template <typename T>
+void
+sc_inout<T>::init ()
+{
+	set_pointer ((tab_t*)&val);
+	sc_object::set_kind    (sc_inout_string);
+	sc_interface::init (sizeof (data_type)); 
+  /*ref*/ val = (0);
+  //sc_inout::write (0);
+    /* Fix : 
+     * FSM checker generates an error at runtime 
+     */
+
+}
+
+// read
+template <typename T>
+inline 
+const T& 
+sc_inout<T>::read() const
+{ 
+#ifdef DUMP_READ
+  std::cerr << "read " << READ_SIGNAL(const T, get_pointer()) // val
+	 	<< " on signal " << name () << "\n";
+#endif
+#ifdef CHECK_FSM_RULES
+	if (casc_fsm_step == GEN_MOORE) {
+		std::cerr << "FSM rules error : trying to read on input/output port " 
+			<< name () //get_name (get_pointer()) 
+			<< " from " << get_step_name () << " function.\n";
+		exit (-1);
+	}		
+#endif
+//  return val; 
+  return READ_SIGNAL(const T, get_pointer());
+}
+
+// write the new value
+template <typename T>
+inline
+void
+sc_inout<T>::write( const T& value_ )
+{
+#ifdef DUMP_WRITE
+  std::cerr << "write " << value_ 
+            << " on in/out port (writing into a signal) '" << name () << "'\n";
+#endif
+#ifdef CHECK_FSM_RULES
+	if ((casc_fsm_step != GEN_MOORE) && ( casc_fsm_step != GEN_MEALY)) {
+		std::cerr << "FSM rules error : trying to write on output port " 
+			<< name () 
+			<< " from an " << get_step_name () << " function.\n";
+		exit (-1);
+	}		
+#endif
+//	T& ref = *(T*)(get_pointer());
+#if defined(CHECK_MULTIWRITING2PORT)
+  check_multiwriting2port ();
+#endif
+#ifndef USE_PORT_DEPENDENCY
+  unstable |= (value_) != val; //ref;
+#endif
+  /*ref*/ val = (value_);
+}
+
+template <typename T>
+inline 
+sc_inout<T>::operator const T& () const
+{ return sc_inout<T>::read(); }
+
+template <typename T>
+inline sc_inout<T>& sc_inout<T>::operator = ( const T& a )
+{ sc_inout<T>::write( a ); return *this; }
+
+template <typename T>
+inline 
+sc_inout<T>& sc_inout<T>::operator = ( const sc_signal<T>& a )
+{ sc_inout<T>::write( a.read() ); return *this; }
+/*
+template <typename T>
+inline 
+sc_inout<T>& sc_inout<T>::operator = ( const sc_port_base& a )
+{ write( a.read() ); return *this; }
+*/
+template <typename T>
+inline 
+bool sc_inout<T>::operator == (const bool& v) 
+{ return sc_inout<T>::read() == v; }
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_out<T>
+//
+// ----------------------------------------------------------------------------
+// Official SystemC implementation notes :
+// "sc_out can also read from its port, hence no difference with sc_inout.
+// For debugging reasons, a class is provided instead of a define."
+
+template <typename T>
+class sc_out : public sc_inout<T>
+{
+	///////////
+	// Internal
+  void init ();
+	///////////
+public:
+  // typedefs 
+  typedef T data_type;
+  typedef sc_inout<T> base_type;
+  typedef sc_out<data_type>      this_type;
+  typedef sc_signal<data_type>   signal_type;
+public:
+  // constructors & destructor 
+  sc_out(): base_type() { init (); };
+  explicit sc_out(const char* name_): base_type(name_) { init (); };
+  sc_out (this_type & parent_);
+  sc_out (const char *name_, this_type & parent_);
+
+	/*
+  // LRM error !
+  //static const char *const kind_string; this is a template !
+	*/
+  //virtual const char *kind () const 
+  //{ return "sc_out"; };
+ 
+
+  inline this_type& operator = ( const data_type& a ) INLINE;
+  inline bool operator == (const bool& v) INLINE;
+
+  // bind to in interface
+  void operator () (sc_signal<data_type> &s)
+  { bind (*this,s); }
+  
+  void operator () (this_type &parent_) 
+  { bind (*this,parent_); }
+
+	//////////////////////
+	// Systemcass specific
+  void operator () (sc_port_base &o)
+  { set_port_dependency (&o, (sc_port_base&)(*this)); }
+/*
+  void operator () () // n'a pas de sens...
+  { set_port_dependency (NULL, (sc_port_base&)(*this)); }
+*/
+	//////////////////////
+
+
+  /*virtual */~ sc_out () {};
+
+private:
+  // disabled 
+  sc_out (const this_type &);
+};
+
+//
+template<typename T>
+void
+sc_out<T>::init ()
+{
+  sc_inout<T>::init ();
+//	tab_t *t = &(sc_inout<T>::val);
+//	sc_interface::set_pointer (t);
+	sc_object::set_kind (sc_out_string);
+//	sc_interface::init (sizeof (data_type)); 
+//  /*ref*/ sc_inout<T>::val = 0;
+  //sc_inout<T>::write (0); 
+    /* Fix : 
+     * FSM checker generates an error at runtime 
+     */
+}
+
+template<typename T> inline 
+sc_out<T>& 
+sc_out<T>::operator = ( const data_type& a )
+{ sc_out<T>::write( a ); return *this; }
+
+template<typename T> inline 
+bool 
+sc_out<T>::operator == (const bool& v) 
+{ return sc_out<T>::read() == v; }
+
+// Dumps
+template<typename T> inline 
+std::ostream& operator<<( std::ostream& os, const sc_in<T> &r) 
+{ return os << r.read (); }
+
+// Add '&'
+template<class T> inline 
+std::ostream& operator<<( std::ostream& os, const sc_inout<T> &r) 
+{ return os << r.read (); }
+
+template<class T> inline 
+std::ostream& operator<<( std::ostream& os, const sc_signal<T> &r)
+{ return os << r.read (); }
+
+// Declarations
+typedef sc_in<bool> sc_in_clk;
+
+#undef INLINE
+
+#undef READ_SIGNAL
+
+} // end of sc_core namespace
+
+using sc_core::sc_in_clk;
+
+#endif /* __SC_PORT_EXT_H__ */
Index: /latest/src/sc_sensitive.cc
===================================================================
--- /latest/src/sc_sensitive.cc	(revision 1)
+++ /latest/src/sc_sensitive.cc	(revision 1)
@@ -0,0 +1,168 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_sensitive.cc                   |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include"sc_sensitive.h"
+#include"sc_port.h"
+#include"sc_event.h"
+#include"sc_event_finder.h"
+#include"sc_module.h"
+#include"internal.h"
+
+using namespace std;
+
+namespace sc_core {
+  void assert_before_init ()
+  {
+    if (sc_core::already_initialized == true)
+      exit (14);
+  }
+  static
+	void add_sensitivity (const sc_event &s)
+  {
+		if (method == NULL) {
+			cerr << "declare a process before declaring " << s << " event\n";
+			exit (1);
+		}
+    method->sensitivity_list.push_back(s);
+  }
+}
+
+//
+using namespace sc_core;
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_sensitive
+//
+//  Static sensitivity class for events.
+// ----------------------------------------------------------------------------
+
+sc_sensitive& sc_sensitive::operator << (const sc_port_base& port)
+{
+  sc_event s (port,sc_event::VAL);
+  sc_core::add_sensitivity (s);
+  return *this;
+}
+
+sc_sensitive& sc_sensitive::operator () (const sc_port_base& port)
+{
+  return *this << port;
+}
+
+sc_sensitive& sc_sensitive::operator << (const sc_event &e)
+{
+  sc_core::add_sensitivity (e);
+  return *this;
+}
+
+sc_sensitive& sc_sensitive::operator () (const sc_event& e)
+{
+  return *this << e;
+}
+
+sc_sensitive& sc_sensitive::operator << (sc_event_finder& e)
+{
+  return *this << e.port ();
+}
+
+sc_sensitive& sc_sensitive::operator () (sc_event_finder& e)
+{
+  return *this << e;
+}
+
+sc_sensitive& sc_sensitive::operator << (const sc_interface &e)
+{
+  return *this << e.default_event ();
+}
+
+sc_sensitive& sc_sensitive::operator () (const sc_interface &e)
+{
+  return *this << e;
+}
+
+
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_sensitive_pos
+//
+//  Static sensitivity class for positive edge events.
+// ----------------------------------------------------------------------------
+
+sc_sensitive_pos& sc_sensitive_pos::operator << (const sc_port_base& port)
+{
+  sc_event s (port,sc_event::POS);
+  sc_core::add_sensitivity (s);
+  return *this;
+}
+
+sc_sensitive_pos& sc_sensitive_pos::operator () (const sc_port_base& port)
+{
+  return *this << port;
+}
+
+/*
+sc_sensitive_pos& sc_sensitive_pos::operator << (const sc_interface &e)
+{
+	sc_event s (e, sc_event::POS);
+  sc_core::add_sensitivity (s);
+  return *this;
+};
+
+sc_sensitive_pos& sc_sensitive_pos::operator () (const sc_interface &e)
+{
+  return *this << e;
+};
+*/
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_sensitive_neg
+//
+//  Static sensitivity class for negative edge events.
+// ----------------------------------------------------------------------------
+
+sc_sensitive_neg& sc_sensitive_neg::operator << (const sc_port_base& port)
+{
+  sc_event s (port,sc_event::NEG);
+  sc_core::add_sensitivity (s);
+  return *this;
+}
+
+sc_sensitive_neg& sc_sensitive_neg::operator () (const sc_port_base& port)
+{
+  return *this << port;
+}
+
+
+
Index: /latest/src/sc_sensitive.h
===================================================================
--- /latest/src/sc_sensitive.h	(revision 1)
+++ /latest/src/sc_sensitive.h	(revision 1)
@@ -0,0 +1,107 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_sensitive.h                    |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_SENSITIVE_H__
+#define __SC_SENSITIVE_H__
+
+#include<list>
+#include"sc_fwd.h"
+//#include"sc_event.h"
+//#include"sc_interface.h"
+//#include"internal_ext.h"
+
+namespace sc_core {
+
+// ----------------------------------------------------------------------------
+//  CLASS : sensitivity_t
+//
+//  Static events.
+// ----------------------------------------------------------------------------
+
+  /*
+struct sensitivity_t {
+  sc_port_base *port;
+  typedef enum { POS, NEG, VAL } flag_t;
+public:
+  flag_t flag;
+  bool pos () const ;
+  sensitivity_t (sc_port_base &port_, flag_t flag_);
+  friend std::ostream& operator << (std::ostream &, const sensitivity_t &);
+private:
+  // disabled
+  sensitivity_t ();
+};
+*/
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_sensitive
+//
+//  Static sensitivity class for events.
+// ----------------------------------------------------------------------------
+
+class sc_sensitive // from SystemC v201 LRM
+{
+public:
+  // constructor, destructor 
+  explicit sc_sensitive (sc_module *) {};
+  ~sc_sensitive () {};
+public:
+  //  specify static sensitivity for processes 
+  sc_sensitive & operator () (const sc_event &);
+  sc_sensitive & operator () (const sc_interface &);
+  sc_sensitive & operator () (const sc_port_base &);
+  sc_sensitive & operator () (sc_event_finder &);
+  sc_sensitive & operator << (const sc_event &);
+  sc_sensitive & operator << (const sc_interface &);
+  sc_sensitive & operator << (const sc_port_base &);
+  sc_sensitive & operator << (sc_event_finder &);
+private:
+  // disabled 
+  sc_sensitive ();
+  sc_sensitive (const sc_sensitive &);
+    sc_sensitive & operator = (const sc_sensitive &);
+};
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_sensitive_pos
+//
+//  Static sensitivity class for positive edge events.
+// ----------------------------------------------------------------------------
+
+class sc_sensitive_pos /* deprecated */
+{
+public:
+  
+  sc_sensitive_pos& operator << (const sc_port_base&);
+  sc_sensitive_pos& operator () (const sc_port_base&);
+  sc_sensitive_pos& operator << (const sc_interface &);
+  sc_sensitive_pos& operator () (const sc_interface &);
+};
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_sensitive_neg
+//
+//  Static sensitivity class for negative edge events.
+// ----------------------------------------------------------------------------
+
+class sc_sensitive_neg /* deprecated */
+{
+public:
+  
+  sc_sensitive_neg& operator << (const sc_port_base&);
+  sc_sensitive_neg& operator () (const sc_port_base&);
+  sc_sensitive_neg& operator << (const sc_interface &);
+  sc_sensitive_neg& operator () (const sc_interface &);
+};
+
+} // end of namespace sc_core
+
+#endif /* __SC_SENSITIVE_H__ */
Index: /latest/src/sc_signal.h
===================================================================
--- /latest/src/sc_signal.h	(revision 1)
+++ /latest/src/sc_signal.h	(revision 1)
@@ -0,0 +1,293 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_signal.h                     |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_SIGNAL_H__
+#define __SC_SIGNAL_H__
+
+// Define registers writing method
+#include<iostream>
+#include"sc_fwd.h"
+#include"sc_nbdefs.h"
+//#include"sc_event_finder.h"
+//#include"sc_event.h"
+#include"sc_time.h" // SC_ZERO_TIME
+#include"sc_object.h"
+#include"sc_interface.h"
+#include"internal_ext.h"
+#include "fsm_rules.h"
+
+namespace sc_core {
+
+//
+#if ((__GNUC__ < 3) || (__GNUC_MINOR__ < 4))
+#define INLINE __attribute__((always_inline))
+#else
+/* gcc3.4 doesn't support */ 
+#define INLINE
+#endif
+
+#define READ_SIGNAL(value_type_,pointer_) \
+	((value_type_&) (*((value_type_*) (pointer_))))
+
+	///////////////////// DEPRECATED
+// C ANSI-only since it is needed to link with extern "C"
+// this declaration is not in casc.h since the CHECK_FSM_RULES macro
+// is not defined.
+
+extern void bind (sc_port_base&,sc_port_base&);
+extern void bind (sc_port_base&,sc_signal_base&);
+extern void bind (sc_signal_base &x);
+extern void bind (sc_port_base   &x);
+typedef tab_t base_type;
+struct pending_write {
+	base_type   *pointer;
+	base_type    value;
+	//pending_write (base_type *const pointer_, const base_type value_)
+	//{	pointer = pointer_; value = value_; }
+	friend std::ostream& operator << (std::ostream &o, const pending_write &p)
+	{ return o << "(pointer = " << p.pointer << "; value = " << p.value << ")\n"; }
+};
+
+// Check pending_writing to register
+extern void pending_writing2register_clear  ();
+extern void pending_writing2register_record_and_check (const tab_t *);
+
+// Pending write to register (simple stack)
+typedef pending_write *pending_write_vector_t;
+extern pending_write_vector_t pending_write_vector;
+extern "C" unsigned int pending_write_vector_nb;
+extern unsigned int pending_write_vector_capacity;
+
+
+template <typename T>
+inline void post_write (base_type *const pointer_,
+                        const T          value_) /*INLINE*/;
+template <typename T>
+inline void post_multiwrite (base_type *const pointer_,
+                             const T          value_)
+{
+	size_t size = (sizeof (T)-1) / sizeof (base_type);
+	size_t i = 0;
+	const base_type *pvalue = (const base_type*)(&value_);
+	do {
+#if 0
+    cout << "post_multiwrite 0x" << hex << pvalue[i] << " @" << (pointer_ + i) << "\n";
+#endif
+		post_write (pointer_ + i, pvalue[i]);
+	} while (i++ < size);
+}
+template <typename T>
+inline void post_write (base_type *const pointer_, 
+                        const T          value_)
+{
+	if (sizeof (T) > sizeof (base_type)) {
+#if 0
+    cout << "sizeof (T) = " << sizeof (T) << " (base_type = " << sizeof
+(base_type) << "\n";
+#endif
+		post_multiwrite (pointer_,value_);
+	} else {
+#if defined(DEBUG)
+	if (pending_write_vector_nb >= pending_write_vector_capacity) {
+	//if (pending_write_vector_nb >= pending_write_vector_capacity * sizeof(pending_write)) {
+		std::cerr << "Error : The array for posted writing on register is too small.\n";
+		std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";
+		std::cerr << "Please check the hardware description.\n";
+		exit (-1);
+	}
+#endif // DEBUG
+  pending_write_vector[pending_write_vector_nb].pointer = pointer_;
+//	pending_write_vector[pending_write_vector_nb++].value = *(reinterpret_cast<const base_type*const>(&value_)); => bug !
+  pending_write_vector[pending_write_vector_nb++].value = value_; // => bug avec blues !
+
+	// -> fix to use user-defined struct in sc_signal/sc_in/sc_out/sc_inout
+	// pending_write_vector[pending_write_vector_nb++].value = *((base_type*)&value_); => bug !
+#if 0
+	std::cerr << "posted write : ptr = " << pointer_ << ", val = " << value_ << "\n";
+#endif
+#if 0 
+	// introduce bug on using trace functions
+	if (value_ == READ_SIGNAL(T,pointer_))
+		return;
+#endif
+	};
+}
+
+inline bool is_posted_write ()
+{
+		return pending_write_vector_nb > 0;
+}
+
+extern "C" void update (void);
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_signal_base
+//
+//  The sc_signal_base<T> primitive channel class.
+// ----------------------------------------------------------------------------
+
+class sc_signal_base : public sc_object, public sc_interface
+{
+	//////
+	// Internal
+  friend class sc_clock;
+  friend class sc_port_base;
+  void init ();
+	//////				 
+  
+
+public: 
+  // LRM (?)
+  //virtual const sc_event /*&*/ default_event () const;
+  static const char* const kind_string;
+  //virtual const char *kind () const;
+
+  //
+public:
+  sc_signal_base();
+  sc_signal_base(const char* name_);
+  sc_signal_base(const char* name_, void*);
+	~sc_signal_base();
+};
+
+template <typename T>
+class sc_signal : public sc_signal_base
+{
+private:
+	T val;
+  typedef T  data_type;
+  typedef sc_signal < T >  this_type;
+	///////////
+	// Internal
+	public: void init ();
+	///////////
+//  virtual void update ();
+  void check_writer ();
+public:
+  // constructors, destructor 
+  sc_signal () 
+	{ init (); }
+  explicit sc_signal (const char *name_): sc_signal_base(name_)
+	{ init (); }
+  /*virtual */~ sc_signal () 
+  {}
+  // methods 
+  /*
+  virtual void register_port (sc_port_base &, const char *)
+  {}
+  virtual const sc_event & default_event () const 
+  {}
+  virtual const sc_event & value_changed_event () const 
+  {}
+  */
+  /*virtual*/ inline const data_type & read () const INLINE;
+/*
+  virtual const T & get_data_ref () const
+  {}
+  virtual bool event () const
+  {}
+  */
+  /*virtual*/ inline void write (const data_type &) /*INLINE*/;
+  inline operator const data_type & () const
+  { return this->read(); }
+  inline this_type& operator = (const data_type & a)
+  { sc_signal<T>::write (a); return *this; }
+  inline this_type& operator = (const sc_signal < T > &a)
+  { sc_signal<T>::write (a.read()); return *this; }
+  inline this_type& operator += (const data_type & a)
+  { sc_signal<T>::write (read() + a); return *this; }
+  inline this_type& operator += (const sc_signal < T > &a)
+  { sc_signal<T>::write (read()+a.read()); return *this; }
+  const data_type & get_new_value () const;
+//  void trace (sc_trace_file * tf) const;
+  /*
+	virtual void print (std::ostream &o) const
+  { o << *this; }
+  virtual void dump (std::ostream &o) const
+  { o << *this; }
+	*/
+private:
+  // disabled 
+  sc_signal (const sc_signal < T > &);
+
+};
+
+template <typename T>
+void
+sc_signal<T>::init()
+{
+  set_pointer ((tab_t*)&val);
+  set_kind    (kind_string);
+	sc_interface::init (sizeof (data_type)); 
+  val = 0; /* The simulator initializes the signal/register to 0.    */
+           /* However, hardware initialization still has to be done. */
+           /* This kind of initialization is for trace diffing.      */
+}
+// read the value
+template <typename T>
+/*virtual*/ 
+inline 
+const T & 
+sc_signal<T>::read() const
+{
+#ifdef DUMP_READ
+  std::cerr << "read " << READ_SIGNAL(const T, get_pointer())
+	 	<< " on signal " << name () << "\n";
+#endif
+#ifdef CHECK_FSM_RULES
+	// we can read value from sc_signal type (used like a register) at any time
+#endif	
+    return READ_SIGNAL(const T, get_pointer());
+}
+
+// write the new value
+template <typename T>
+inline
+void
+sc_signal<T>::write( const data_type& value_ )
+{
+#ifdef CHECK_FSM_RULES
+	if ((casc_fsm_step != TRANSITION) 
+			&& ( casc_fsm_step != STIMULI)) {
+		std::cerr << "FSM rules error : trying to write on signal " 
+			  << name () 
+			  << " from " << get_step_name () << " function.\n";
+		exit (-1);
+	}		
+#endif
+#ifdef DEBUG
+  if (get_pointer() == NULL)
+  {
+    std::cerr << "Error : Unable to write into '" << name () << "'.";
+    exit (24032005);
+  }
+#endif
+#ifdef CHECK_MULTIWRITING2REGISTER
+  pending_writing2register_record_and_check (get_pointer ());
+#endif
+#ifdef DUMP_WRITE
+  if (sc_signal<T>::read() == value_)
+    return;
+  std::cerr << "write (posted) " << value_ 
+		<< " on sc_signal (writing into register) '" << name () << "'\n";
+#endif
+  post_write (/*(tab_t*)&val*/ get_pointer(), value_);
+}
+
+#undef INLINE
+
+#undef READ_SIGNAL
+
+} // end of namespace sc_core
+
+#endif /* __SC_SIGNAL_H__ */
+
Index: /latest/src/sc_signed.h
===================================================================
--- /latest/src/sc_signed.h	(revision 1)
+++ /latest/src/sc_signed.h	(revision 1)
@@ -0,0 +1,24 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_signed.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   14_04_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_SIGNED_H__
+#define __SC_SIGNED_H__
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_signed
+//
+// ----------------------------------------------------------------------------
+
+namespace sc_dt {
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_SIGNED_H__ */
Index: /latest/src/sc_string.h
===================================================================
--- /latest/src/sc_string.h	(revision 1)
+++ /latest/src/sc_string.h	(revision 1)
@@ -0,0 +1,20 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_string.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   04_05_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_STRING_H__
+#define __SC_STRING_H__
+
+#include <string>
+
+typedef std::string sc_string;
+
+#endif
+
Index: /latest/src/sc_time.cc
===================================================================
--- /latest/src/sc_time.cc	(revision 1)
+++ /latest/src/sc_time.cc	(revision 1)
@@ -0,0 +1,84 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_time.cc                        |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include"sc_time.h"
+#include <time.h>
+#include <sys/time.h>
+#include <string>
+
+using namespace std;
+
+namespace sc_core {
+
+uint64 nb_cycles = 0;
+
+const sc_time SC_ZERO_TIME(0,SC_NS);
+sc_time SC_CURRENT_TIME(0,SC_NS);
+
+sc_time::sc_time (const sc_time &t)
+{
+  time = t.time;
+}
+
+sc_time::sc_time (double val, sc_time_unit tu)
+{
+  time = (long long int) val;
+}
+
+
+sc_time&
+sc_time::operator = (const sc_time &t)
+{
+  time = t.time;
+}
+
+
+const string 
+sc_time::to_string () const
+{
+	char  res[32];
+  const char* unit;
+	if (time == 0)
+  {
+    unit = "s";
+  } else
+    unit = "ns";
+  sprintf (res, "%lld %s", time, unit);
+  return (string)res;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/sc_time.h
===================================================================
--- /latest/src/sc_time.h	(revision 1)
+++ /latest/src/sc_time.h	(revision 1)
@@ -0,0 +1,83 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_time.h                       |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_TIME_H__
+#define __SC_TIME_H__
+
+#include <iostream>
+#include <string>
+#include "sc_nbdefs.h"
+#include "internal_ext.h"
+
+namespace sc_core {
+
+// ----------------------------------------------------------------------------
+//  ENUM : sc_time_unit
+//
+//  Enumeration of time units.
+// ----------------------------------------------------------------------------
+
+enum sc_time_unit
+{
+    SC_FS = 0,
+    SC_PS,
+    SC_NS,
+    SC_US,
+    SC_MS,
+    SC_SEC
+};
+
+//
+class sc_time;
+extern const sc_time SC_ZERO_TIME;
+extern sc_time SC_CURRENT_TIME;
+
+extern uint64 nb_cycles;
+
+inline double sc_simulation_time()   // in default time units
+{
+  return (double)nb_cycles;
+}
+
+const sc_time& sc_time_stamp ();
+
+//
+class sc_time 
+{
+  friend const sc_time &sc_time_stamp ();
+  long long int time;
+public:
+//  sc_time (); LRM 2.1
+  sc_time (double val, sc_time_unit tu);
+  sc_time (const sc_time& = SC_ZERO_TIME);
+ 
+  sc_time& operator= (const sc_time &);
+ 
+  /*sc_dt::*/uint64 value     () const { return (/*sc_dt::*/uint64) time;}
+  double        to_double () const { return time * 1000;}
+  double        to_seconds() const { return time / (double)1000000000;};
+  operator      double    () const { return to_double ();};
+  const std::string to_string () const;
+};
+
+inline const sc_time& sc_time_stamp ()   // in default time units
+{
+  SC_CURRENT_TIME.time = nb_cycles;
+  return SC_CURRENT_TIME;// = sc_time (nb_cycles, SC_NS);
+}
+
+} // end of namespace sc_core
+
+using sc_core::sc_simulation_time;
+using sc_core::sc_time;
+using sc_core::sc_time_stamp;
+
+#endif /* __SC_TIME_H__ */
Index: /latest/src/sc_trace.cc
===================================================================
--- /latest/src/sc_trace.cc	(revision 1)
+++ /latest/src/sc_trace.cc	(revision 1)
@@ -0,0 +1,714 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_trace.cc                     |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "sc_port.h"
+#include "sc_clock.h"
+#include "sc_trace.h"
+#include "sc_interface.h"
+#include "bit2string.h"
+#include "hex2string.h"
+#include "assert.h"
+
+#include <list>
+#include <stdio.h>
+#include <iostream>
+
+//-----------------------------------------
+
+using namespace std;
+
+//-----------------------------------------
+#ifdef PAT_TRACE_FORMAT
+
+extern "C" {
+#include "genpat.h"
+}
+
+//#include "malloc.h" // NO LONGER SUPPORTED
+#include <stdlib.h>
+#include <stdio.h>
+
+#endif // PAT_TRACE_FORMAT
+//-----------------------------------------
+
+namespace sc_core {
+
+vector<sc_trace_file *>  trace_file_list;
+uint64                   cpt         = 0;
+uint64                   trace_start = 0;
+	
+//-----------------------------------------
+#if 0
+static ostream& operator << (ostream &, const signal2trace &);
+#endif
+
+//-----------------------------------------
+
+/*
+typedef list<signal2trace> signal2trace_list;
+
+template <typename T>
+static
+void make_list_from_vector (const vector<T>& v, list<T>& l)
+{
+	l.clear ();
+	typename vector<T>::const_iterator i;
+	for (i = v.begin (); i != v.end (); ++i)
+		l.push_back (*i);
+}
+
+template <typename T>
+static
+void make_vector_from_list (const list<T>& l, vector<T>& v)
+{
+	v.clear ();	
+	typename list<T>::const_iterator i;
+	for (i = l.begin (); i != l.end (); ++i)
+		v.push_back (*i);
+}
+
+static
+int operator<(const signal2trace &e1, const signal2trace &e2) 
+{ 
+	return (e1.bit_size < e2.bit_size);
+}
+
+static void 
+init (sc_trace_file *tf)
+{
+	signal2trace_list lsig;
+	make_list_from_vector (tf->sig_list, lsig);
+	lsig.reverse(); //sort ();
+	make_vector_from_list (lsig, tf->sig_list);
+}
+*/
+
+static 
+void 
+init (sc_trace_file &tf)
+{
+  if (dump_stage)
+    cerr << "Initializing trace functions : Looking for clocks...";
+
+	vector<signal2trace>::iterator i;
+	i = (tf.sig_list).begin();
+	while (i!=(tf.sig_list).end()) {
+		if (is_clock( *(i->inter) ) ) {
+			tf.clk_list.push_back(*i);
+			i = tf.sig_list.erase(i);
+		} 
+		else ++i;
+	}
+  if (dump_stage)
+    cerr << "Done\n";
+}
+
+static 
+void
+vcd_print_cycle_number (FILE *f,long long unsigned int num)
+{
+	string cycle;
+
+	//------------------------------------------------------------------------------------
+	// affichage des cycles (#500 ou #2500 etc...)
+	fprintf(f,"\n#%llu00\n", num * 5);//cycle de simulation
+}
+
+//--------------------------------------------------------------------------------------
+// trace function
+// Called each end of cycle to dump in trace files
+
+void
+trace_all (bool part)
+{
+	if (trace_file_list.empty ())
+		return;
+	
+  if (cpt >= trace_start)
+  {
+	  vector<sc_trace_file*>::const_iterator ptf;
+  	for (ptf = trace_file_list.begin (); ptf != trace_file_list.end(); ++ptf)
+    {
+      sc_trace_file *tf = *ptf;
+      ASSERT(tf != NULL);
+	  	trace (*tf, part);
+    }
+  }
+	
+	cpt++;
+}
+
+#if PAT_TRACE_FORMAT
+static void
+pat_set_value (char *buf, const signal2trace &s)
+{
+	if ( ( s.bit_size % 4 ) == 0 )
+	{
+		buf[1] = 'x';
+		hex2string( buf+2, s.inter->get_pointer() , s.bit_size );
+	}
+	else
+	{
+		buf[1] = 'b';
+		bit2string( buf+2, s.inter->get_pointer() , s.bit_size );
+	}
+}
+
+inline
+static 
+void
+affect    (const char          *cur,
+           const char          *nomSig,
+           const char          *buf)
+{
+#if 0
+  printf ("AFFECT (\"%s\", \"%s\", \"%s\");\n", 
+    cur,
+    nomSig,
+    buf);
+#endif
+	AFFECT ((char*)cur, (char*)nomSig, (char*)buf );
+}
+
+inline
+static 
+void
+pat_trace (sc_trace_file       &tf, 
+           const signal2trace  &s2t, 
+           const ostringstream &cur1,
+           const ostringstream &cur2)
+{
+	static char buf[50] = "0\0";
+	//cout << "Nom du signal: " << s->nomSig;
+	pat_set_value (buf, s2t);
+	affect (cur1.str().c_str(), s2t.nomSig.c_str(), buf);
+	affect (cur2.str().c_str(), s2t.nomSig.c_str(), buf);
+}
+
+inline
+static 
+void
+pat_trace_clocks (sc_trace_file &tf,
+                  const ostringstream &cur1,
+                  const ostringstream &cur2)
+{
+	vector<signal2trace>::const_iterator s;
+	for(s=(tf.clk_list).begin();s!=(tf.clk_list).end();s++)
+	{
+    const signal2trace &s2t = *s;
+    char *name = (char*)((s2t.nomSig).c_str());
+    const sc_interface *inter = s2t.inter;
+    const sc_clock     *clk   = (const sc_clock *) inter;
+    bool  posedge_first       = clk->posedge_first;
+    char *a, *b;
+    if (posedge_first)
+    {
+      a = "0B1"; b = "0B0";
+    } else {
+      a = "0B0"; b = "0B1"; 
+    }
+    affect (cur1.str().c_str(), name, a);
+    affect (cur2.str().c_str(), name, b);
+	}
+}
+
+static
+void
+pat_trace_init (sc_trace_file &tf)
+{
+  init (tf);
+}
+
+static 
+void
+pat_trace (sc_trace_file &tf,
+           bool           part)
+{ 
+  if (part)
+    return;
+	if (cpt==trace_start) {
+		pat_trace_init (tf);
+	}
+	// time counters
+	ostringstream cur1,cur2; 
+  long long unsigned int buf = cpt * 5;
+	cur1 << buf << "00";
+	cur2 << buf + 5 << "00";
+	// affect each signal
+	vector<signal2trace>::iterator s;
+	for(s=(tf.sig_list).begin();s!=(tf.sig_list).end();s++)
+	{
+    pat_trace (tf, *s, cur1, cur2);
+	}
+  pat_trace_clocks (tf, cur1, cur2);
+}
+#else
+void
+pat_trace (sc_trace_file &tf,
+           bool           part)
+{
+}
+#endif // PAT_TRACE_FORMAT
+
+static
+bool
+is_modified (const signal2trace &s2t)
+{
+  unsigned int bit_size = s2t.bit_size;
+  if (bit_size > 32)
+  {
+    const uint64 *const pointer_saved   = (const uint64 *)s2t.pointer;
+    const uint64 *const pointer_current = (const uint64 *)s2t.inter->get_pointer ();
+    return (*pointer_saved != *pointer_current);
+  } else if (bit_size > 16) {
+    const uint32 *const pointer_saved   = s2t.pointer;
+    const uint32 *const pointer_current = s2t.inter->get_pointer ();
+    return (*pointer_saved != *pointer_current);
+  } else {
+    const uint16 *const pointer_saved   = (const uint16 *)s2t.pointer;
+    const uint16 *const pointer_current = (const uint16 *)s2t.inter->get_pointer ();
+    return (*pointer_saved != *pointer_current);
+  }
+}
+
+static
+bool
+save_modification (signal2trace &s2t)
+{
+  *(s2t.pointer) = *(s2t.inter->get_pointer ());
+}
+
+static
+inline
+void
+print (sc_trace_file &tf, signal2trace &s2t)
+{
+	char buf[100];
+	bit2string( buf+1, s2t.inter->get_pointer() , s2t.bit_size );
+	
+	char *buf2 = strip(buf+1);
+  int   len  = strlen (buf2);
+  if (s2t.bit_size != 1)
+  {
+    --buf2;
+    buf2[0] = 'b';
+    sprintf (buf2 + len + 1, " %s\n", s2t.alias);
+  } else {
+    sprintf (buf2 + len, "%s\n", s2t.alias);
+  }
+/*	
+	char *buf2 = strip(buf);
+  char buf3[128];
+
+  if (s2t.bit_size != 1)
+    sprintf (buf3, "b%s %s\n", buf2, s2t.alias);
+  else
+    sprintf (buf3, "%s%s\n", buf2, s2t.alias);
+  */  
+	// ecriture liste[i] dans le fichier VCD:
+	if ((fprintf(tf.pfic,buf2))==0)
+	{
+	  cerr << "erreur ecriture du couple Valeur/Nom du signal dans le VCD\n";
+		exit(16);
+	}
+}
+
+static
+inline 
+void
+vcd_trace (sc_trace_file &tf, 
+           signal2trace  &s2t, 
+           bool           skip = true)
+{
+  if ((skip) && (!is_modified (s2t)))
+    return;
+  save_modification (s2t);
+  print (tf, s2t);
+}
+
+static
+void
+vcd_trace_clocks (const sc_trace_file &tf, 
+                  bool v)
+{
+	vector<signal2trace>::const_iterator i;
+	for(i=(tf.clk_list).begin();i!=(tf.clk_list).end();i++) 
+	{
+    const signal2trace &s2t   = *i;
+    const sc_interface *inter = s2t.inter;
+    const sc_clock     *clk   = (const sc_clock *) inter;
+    bool  posedge_first       = clk->posedge_first;
+		fprintf(tf.pfic, "%c%s\n",(v^posedge_first)?'0':'1', i->alias);
+	}
+}
+
+static tab_t *vcd_signal_table = NULL;
+
+
+static
+int
+vcd_get_size (const signal2trace &s2t)
+{
+#if 0
+  cerr << "alias     : " << s2t.alias    << "\n";
+  cerr << "bit_size  : " << s2t.bit_size << "\n";
+  cerr << "=> #tab_t : " << ((s2t.bit_size - 1) / (sizeof (tab_t)*8)) + 1 << "\n";
+#endif
+  return ((s2t.bit_size - 1) / (sizeof (tab_t)*8)) + 1;
+}
+
+static
+int
+vcd_get_signal_table_size (const sc_trace_file &tf)
+{
+  int total_size = 0;
+	vector<signal2trace>::const_iterator i;
+	for(i=(tf.sig_list).begin();i!=(tf.sig_list).end();i++)
+	{
+    const signal2trace &s2t = *i;
+    total_size += vcd_get_size (s2t);
+  }
+  return total_size;
+}
+
+static
+void
+vcd_alloc_signal_table (int size)
+{
+  if (size == 0)
+    vcd_signal_table = NULL;
+  else
+    vcd_signal_table = (tab_t*) malloc (sizeof (tab_t) * size);
+#if DEBUG
+  if (vcd_signal_table == NULL)
+  {
+    cerr << "Internal error : Unable to allocate memory for signal table to trace.\n";
+    exit (24032005);
+  }
+#endif
+}
+
+static
+void
+vcd_bind_to_signal_table (sc_trace_file &tf)
+{
+  tab_t *cur = vcd_signal_table;
+	vector<signal2trace>::iterator i;
+	for(i=(tf.sig_list).begin();i!=(tf.sig_list).end();i++)
+	{
+    signal2trace &s2t = *i;
+    s2t.pointer = cur;
+    cur += vcd_get_size (s2t);
+#if 0
+    std::cout << s2t 
+      << "\nget_pointer () => " << hex << s2t.inter->get_pointer () 
+      << "\nvcd pointer () => " << hex << s2t.pointer 
+      << "\nvcd_get_size () => " << vcd_get_size (s2t)
+      << "\n";
+#endif
+  }
+}
+
+static
+void
+vcd_build_signal_table (sc_trace_file &tf)
+{
+  int s = vcd_get_signal_table_size (tf);
+
+  vcd_alloc_signal_table (s);
+
+  vcd_bind_to_signal_table (tf);
+}
+
+static
+void
+vcd_trace_init (sc_trace_file &tf)
+{
+	init (tf);
+	fprintf (tf.pfic,"$upscope $end\n$enddefinitions  $end\n\n$comment\nAll initial values are dumped below at time 0 sec = 0 timescale units.\n$end\n\n$dumpvars\n");
+  vcd_build_signal_table (tf);
+
+  // dump all var
+	vector<signal2trace>::iterator i;
+	for(i=(tf.sig_list).begin();i!=(tf.sig_list).end();i++)
+	{
+    vcd_trace (tf, *i, false);
+	}//fin de la liste des signal2trace
+
+  // clocks to trace
+  vcd_trace_clocks (tf, true);
+
+	if (cpt==trace_start)
+		fprintf(tf.pfic,"$end\n"); //fin du $dumpvars
+}
+
+static
+void
+vcd_trace (sc_trace_file &tf,
+           bool           part)
+{
+	if (sc_core::cpt==sc_core::trace_start) {
+    if (part == false)
+      vcd_trace_init (tf);
+  } else {
+#if defined(DEBUG)
+      if (vcd_signal_table == NULL)
+      {
+        cerr << "Internal Error : VCD signal table is not yet allocated.\n";
+        exit (1042005);
+      }
+#endif
+      vcd_print_cycle_number (tf.pfic,sc_core::cpt);
+      // signals to trace 
+      if (part == false)
+      {
+//        vector<signal2trace> &sig_list = (part == false)?to_update_on_pos:to_update_on_neg;
+        vector<signal2trace>::iterator i;
+        for(i=tf.sig_list.begin();i!=tf.sig_list.end();i++)
+        {
+          vcd_trace (tf, *i);
+        }//fin de la liste des signal2trace
+      }
+      // clocks to trace
+      vcd_trace_clocks (tf, !part);
+  }
+}
+
+void
+trace (sc_trace_file &tf, bool part)
+{
+/*------------------------------------------------------------------------------------*/
+	
+	switch (tf.flag){
+
+	// fonction trace() pour VCD:
+	case VCD_FORMAT:
+		vcd_trace (tf, part);
+    break;//fin de la fonction trace() pour VCD
+
+/*------------------------------------------------------------------------------------*/
+	
+	// fonction trace() pour PAT:
+	case PAT_FORMAT : 
+    pat_trace (tf, part);
+		break;//fin de la fonction trace() pour PAT
+	}// fin du switch format pour trace()
+		
+}
+
+/*------------------------------------------------------------------------------------*/
+
+static
+void
+vcd_sc_trace (sc_trace_file *tf, const signal2trace &t, const std::string
+&name)
+{
+	//déclaration du signal dans l'en-tête du fichier VCD:
+	// exemple de déclarations :
+	// $var wire    1  aaa  clk       $end
+	// $var wire    1  aab  resetn       $end
+	// $var wire    1  aac  _mips0_IT_5       $end
+
+	std::string declaration;
+	std::ostringstream buf;
+  // begin
+	declaration = "$var wire ";
+	buf.width (4);
+  buf << t.bit_size;
+  declaration += buf.str();
+  declaration += "  ";
+  declaration += t.alias;
+  declaration += "  ";
+  declaration += name;
+  // bit range
+  if (t.bit_size != 1)
+  {
+    declaration += " [";
+	  std::ostringstream bit_size;
+    bit_size << t.bit_size - 1;
+    declaration += bit_size.str();
+    declaration += ":0]";
+  }
+  // end
+	declaration += "       $end\n";
+	//declaration += "  $end\n";
+
+	if ((fprintf(tf->pfic,declaration.c_str()))==0)
+		{
+			cerr << "erreur ecriture de declaration du signal sc_signal\n";
+			exit(3);
+		}
+}
+
+static
+void
+pat_sc_trace (sc_trace_file *tf, const signal2trace &t, const std::string
+&name)
+{
+#ifdef PAT_TRACE_FORMAT
+	//exemple:
+	//DECLAR ("a", ":2", "X", IN, "3  downto 0", "" );
+	//DECLAR ("b", ":2", "X", IN, "3  downto 0", "" );
+	//DECLAR ("vdd", ":2", "B", IN, "", "" );
+
+	std::string downto;	
+	const sc_object *obj = (const sc_object *) t.inter;
+	const char *obj_kind = obj->kind ();
+	char *format;
+	char *dir;
+
+	if (strstr (obj_kind,"inout"))
+		dir = OUT; // Direction is OUT instead of INOUT
+               // because port behavior is only seen as an output port.
+	else if (strstr (obj_kind,"in"))
+		dir = IN;
+	else if (strstr (obj_kind,"out"))
+		dir = OUT;
+	else if (obj_kind == sc_clock::kind_string)
+		dir = SIGNAL;
+	else if (obj_kind == sc_signal_base::kind_string)
+    dir = REGISTER;
+  // to do : dir = REGISTER;
+	//         dir = SIGNAL;
+
+	if ( t.bit_size % 4 == 0)
+		format = "x";
+	else
+		format = "b";
+
+  if ( t.bit_size == 1) {
+		downto = "";
+	}
+	else  
+	{
+		std::ostringstream nbits;
+		nbits << t.bit_size-1;
+		downto = nbits.str();
+		downto += " downto 0";
+	}
+	
+#if 0
+  printf ("DECLAR (\"%s\", \":1\", \"%s\", %s, \"%s\", \"\" );\n", 
+    name.c_str (),
+    format,
+    dir,
+    downto.c_str());
+#endif
+	DECLAR ((char*)(name.c_str ()), ":1", format, dir,(char *) downto.c_str(), "" );
+#endif // PAT_TRACE_FORMAT
+}
+
+void
+sc_trace( sc_trace_file* tf, const signal2trace &t, const std::string &name )
+{
+  if (tf == NULL)
+    return;
+	if (t.bit_size > 64)
+		cerr << "Warning : tracing functions do not support data types larger than 64 bits.\n";
+	if (already_initialized)
+		cerr << "Warning : please call tracing functions BEFORE sc_initialize.\n";
+	//ajout du signal dans la liste des signaux à tracer:
+	(tf->sig_list).push_back (t); 
+
+	switch (tf->flag) {
+	case VCD_FORMAT : 
+    vcd_sc_trace (tf, t, name);
+		break;
+	
+	case PAT_FORMAT :
+    pat_sc_trace (tf, t, name);
+		break;
+	default :
+		{
+		cerr << "Unknown trace format.\n";
+		exit (1);
+		}
+	}// fin switch format pour sc_trace
+	
+}
+
+//---------------------------------------------------------------------------
+
+#if 0
+static
+ostream&
+operator << (ostream &o,
+             const signal2trace &s2t)
+{
+  o << "signal2trace {"
+    << "inter = " << hex << s2t.inter
+    << ",alias = '" << s2t.alias << "'"
+    << ",bitsize = " << dec << s2t.bit_size
+    << ",pointer = " << hex << s2t.pointer
+    << ",nomSig  = " << s2t.nomSig << "}";
+  return o;
+}
+#endif
+
+//----------------------------------------------------------------------------
+
+#define DEF_SC_TRACE(T) /*inline \*/ \
+  void   \
+  sc_trace (sc_trace_file* tf, const T& object, const std::string &name) \
+  { \
+		signal2trace t;                                      \
+		sc_interface *inter = new sc_localvar<T> (object);   \
+		t.inter = inter;                                     \
+		t.alias = alias();                                   \
+		t.bit_size = get_bits_number(object);                \
+		t.nomSig = name;                                     \
+		sc_trace (tf, t, name);                              \
+  } \
+
+	DEF_SC_TRACE(bool)
+	DEF_SC_TRACE(float)
+	DEF_SC_TRACE(double)
+	DEF_SC_TRACE(unsigned char)
+	DEF_SC_TRACE(unsigned short)
+	DEF_SC_TRACE(unsigned int)
+	DEF_SC_TRACE(unsigned long)
+	DEF_SC_TRACE(char)
+	DEF_SC_TRACE(short)
+	DEF_SC_TRACE(int)
+	DEF_SC_TRACE(long)
+	DEF_SC_TRACE(uint64)
+	DEF_SC_TRACE(int64)
+
+#undef DEF_SC_TRACE
+
+//---------------------------------------------------------------------------
+} // end of sc_core namespace
+
Index: /latest/src/sc_trace.h
===================================================================
--- /latest/src/sc_trace.h	(revision 1)
+++ /latest/src/sc_trace.h	(revision 1)
@@ -0,0 +1,73 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_trace.h                      |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef __SC_TRACE_H__
+#define __SC_TRACE_H__
+
+#include "sc_trace_ext.h"
+#include <vector>
+
+//---------------------------------------------------------------------------
+
+namespace sc_core {
+
+//---------------------------------------------------------------------------
+
+typedef enum {VCD_FORMAT, PAT_FORMAT} TRACE_FORMAT;
+
+//---------------------------------------------------------------------------
+
+extern std::vector<sc_trace_file *> trace_file_list;
+extern uint64                       cpt;
+
+extern void trace_all (bool part);
+extern void trace     (sc_trace_file&, bool part);
+
+//---------------------------------------------------------------------------
+
+struct sc_trace_file
+{
+	TRACE_FORMAT  flag;
+	FILE*         pfic;
+	std::vector<signal2trace> sig_list;
+	std::vector<signal2trace> clk_list;
+};
+
+//---------------------------------------------------------------------------
+
+} // end of sc_core namespace
+
+//----------------------------------------------------------------------------
+#endif
+
Index: /latest/src/sc_trace_ext.h
===================================================================
--- /latest/src/sc_trace_ext.h	(revision 1)
+++ /latest/src/sc_trace_ext.h	(revision 1)
@@ -0,0 +1,200 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_trace.h                      |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __SC_TRACE_EXT_H__
+#define __SC_TRACE_EXT_H__
+
+#include "sc_fwd.h"
+#include "alias.h"
+#include <vector>
+#include <iostream>
+#include <string>
+#include <sstream>
+
+#include "sc_module_ext.h"
+#include "sc_localvar.h"
+
+//---------------------------------------------------------------------------
+
+namespace sc_core {
+
+//---------------------------------------------------------------------------
+
+struct signal2trace
+{
+	const sc_interface   *inter;
+	const char           *alias;
+	unsigned int          bit_size;
+  tab_t                *pointer;
+  std::string           nomSig;
+};
+
+//---------------------------------------------------------------------------
+
+template<typename T> struct bits_number_getter {};
+ 
+#define BITS_NUMBER_GETTER_DEF(newt,typ, expr)      \
+template<newt> struct bits_number_getter<typ> {     \
+    typedef typ val_t;                              \
+    static inline unsigned int get() {return expr;} \
+}
+
+ BITS_NUMBER_GETTER_DEF(, bool          ,1);
+ BITS_NUMBER_GETTER_DEF(, char          ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, signed   char ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, unsigned char ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, unsigned short,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, signed   short,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, signed   int  ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, unsigned int  ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, signed   long ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, unsigned long ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, float         ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, sc_unsigned   ,8*sizeof(unsigned int));
+ BITS_NUMBER_GETTER_DEF(, sc_signed     ,8*sizeof(int));
+ BITS_NUMBER_GETTER_DEF(, double        ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, uint64        ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(, int64         ,8*sizeof(val_t));
+ BITS_NUMBER_GETTER_DEF(typename inval_t, sc_in<inval_t>    ,bits_number_getter<inval_t>::get());
+ BITS_NUMBER_GETTER_DEF(typename inval_t, sc_out<inval_t>   ,bits_number_getter<inval_t>::get());
+ BITS_NUMBER_GETTER_DEF(typename inval_t, sc_inout<inval_t> ,bits_number_getter<inval_t>::get());
+ BITS_NUMBER_GETTER_DEF(typename inval_t, sc_signal<inval_t>,bits_number_getter<inval_t>::get());
+ BITS_NUMBER_GETTER_DEF(int W, sc_int<W>,W);
+ BITS_NUMBER_GETTER_DEF(int W, sc_uint<W>,W);
+ BITS_NUMBER_GETTER_DEF(int W, sc_bigint<W>,W);
+ BITS_NUMBER_GETTER_DEF(int W, sc_biguint<W>,W);
+ BITS_NUMBER_GETTER_DEF(int W, sc_bv<W>,W);
+ BITS_NUMBER_GETTER_DEF(int W, sc_lv<W>,W);
+#undef BITS_NUMBER_GETTER_DEF
+ 
+template < typename T > inline
+unsigned int get_bits_number (const T & object)
+{
+    return bits_number_getter<T>::get();
+}
+
+//---------------------------------------------------------------------------
+
+struct sc_trace_file;
+
+//---------------------------------------------------------------------------
+
+extern void
+sc_trace( sc_trace_file* tf, const signal2trace &t, const std::string &name );
+
+template <class T> /*inline*/
+void
+sc_trace( sc_trace_file* tf, const sc_in<T>& port, const std::string &name )
+{
+	signal2trace t;
+	t.inter = (const sc_interface*) &port;
+	t.alias = alias();
+	t.bit_size = get_bits_number(port);
+	t.nomSig = name;
+	sc_trace (tf, t, name);
+}
+
+//----------------------------------------------------------------------------
+
+template <class T> /*inline*/
+void
+sc_trace( sc_trace_file* tf, const sc_out<T>& out, const std::string &name )
+{
+	signal2trace t;
+	t.inter = (const sc_interface*) &out;
+	t.alias = alias();
+	t.bit_size = get_bits_number(out);
+	t.nomSig = name;
+	sc_trace (tf, t, name);
+}
+
+//----------------------------------------------------------------------------
+
+template <typename T> /*inline*/
+void
+sc_trace( sc_trace_file* tf, const sc_inout<T>& inout, const std::string &name )
+{
+	signal2trace t;
+	t.inter = (const sc_interface*) &inout;
+	t.alias = alias();
+	t.bit_size = get_bits_number(inout);
+	t.nomSig = name;
+	sc_trace (tf, t, name);
+}
+
+//----------------------------------------------------------------------------
+
+template <typename T> /*inline*/
+void
+sc_trace( sc_trace_file* tf, const sc_signal<T>& signal, const std::string &name )
+{
+	signal2trace t;
+	t.inter = (const sc_interface*) &signal;
+	t.alias = alias();
+	t.bit_size = get_bits_number(signal);
+	t.nomSig = name;
+	sc_trace (tf, t, name);
+}
+
+//----------------------------------------------------------------------------
+
+#define DEF_SC_TRACE(T) /*inline \*/ \
+  extern void   \
+  sc_trace (sc_trace_file*,      \
+            const T& object,     \
+            const std::string&);
+
+	DEF_SC_TRACE(bool)
+	DEF_SC_TRACE(float)
+	DEF_SC_TRACE(double)
+	DEF_SC_TRACE(unsigned char)
+	DEF_SC_TRACE(unsigned short)
+	DEF_SC_TRACE(unsigned int)
+	DEF_SC_TRACE(unsigned long)
+	DEF_SC_TRACE(char)
+	DEF_SC_TRACE(short)
+	DEF_SC_TRACE(int)
+	DEF_SC_TRACE(long)
+	DEF_SC_TRACE(uint64)
+	DEF_SC_TRACE(int64)
+
+#undef DEF_SC_TRACE
+
+} // end of sc_core namespace
+
+//----------------------------------------------------------------------------
+#endif
+
Index: /latest/src/sc_uint.h
===================================================================
--- /latest/src/sc_uint.h	(revision 1)
+++ /latest/src/sc_uint.h	(revision 1)
@@ -0,0 +1,261 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_uint.h                         |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_UINT_H__
+#define __SC_UINT_H__
+
+#include <data_field.h>
+#include <sc_numrep.h>
+#include <sc_bit.h>
+#include <sc_logic.h>
+#include <sc_bv.h>
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_uint<W>
+//
+// ----------------------------------------------------------------------------
+
+#include"sc_nbdefs.h"
+
+namespace sc_dt {
+
+typedef sc_uint<1> sc_uint_bit_ref;
+typedef sc_uint<1> sc_uint_bit_ref_r;
+
+// --------------------------------
+// CLASS : sc_uint_subref_r
+//
+// Used for range, concat functions
+class sc_uint_subref_r
+{
+  template <int W> friend class sc_dt::sc_uint;
+  int       left, right;
+  public : uint64    val;
+  sc_uint_subref_r (uint64 val_, int left_, int right_)
+  {
+    val = val_; left = left_; right = right_;
+  }
+  public:
+  inline uint64 read () const { return val; }
+  inline const sc_uint_subref_r& operator | (const sc_uint_subref_r &v) const
+  { print_warning (); return *this; }
+
+  private :void print_warning () const;
+};
+
+//
+#define MASK32(W) ((~ (const uint32)0) >> (sizeof (uint32) * 8 - W))
+#define MASK64(W) ((~ (const uint64)0) >> (sizeof (uint64) * 8 - W))
+//
+
+template<int W> struct s_uint_type { typedef uint64 uint_type;};
+#define DECLAR_UINT_TYPE(W) template<> struct s_uint_type<W> { typedef smallest_uint uint_type; }// not declared as uint16 because << operator threats like a character
+DECLAR_UINT_TYPE( 1);
+DECLAR_UINT_TYPE( 2);
+DECLAR_UINT_TYPE( 3);
+DECLAR_UINT_TYPE( 4);
+DECLAR_UINT_TYPE( 5);
+DECLAR_UINT_TYPE( 6);
+DECLAR_UINT_TYPE( 7);
+DECLAR_UINT_TYPE( 8);
+#undef DECLAR_UINT_TYPE
+#define DECLAR_UINT_TYPE(W) template<> struct s_uint_type<W> { typedef uint16 uint_type; }
+DECLAR_UINT_TYPE( 9);
+DECLAR_UINT_TYPE(10);
+DECLAR_UINT_TYPE(11);
+DECLAR_UINT_TYPE(12);
+DECLAR_UINT_TYPE(13);
+DECLAR_UINT_TYPE(14);
+DECLAR_UINT_TYPE(15);
+DECLAR_UINT_TYPE(16);
+#undef DECLAR_UINT_TYPE
+#define DECLAR_UINT_TYPE(W) template<> struct s_uint_type<W> { typedef uint32 uint_type; }
+DECLAR_UINT_TYPE(17);
+DECLAR_UINT_TYPE(18);
+DECLAR_UINT_TYPE(19);
+DECLAR_UINT_TYPE(20);
+DECLAR_UINT_TYPE(21);
+DECLAR_UINT_TYPE(22);
+DECLAR_UINT_TYPE(23);
+DECLAR_UINT_TYPE(24);
+DECLAR_UINT_TYPE(25);
+DECLAR_UINT_TYPE(26);
+DECLAR_UINT_TYPE(27);
+DECLAR_UINT_TYPE(28);
+DECLAR_UINT_TYPE(29);
+DECLAR_UINT_TYPE(30);
+DECLAR_UINT_TYPE(31);
+DECLAR_UINT_TYPE(32);
+#undef DECLAR_UINT_TYPE
+
+class sc_uint_subref_r;
+
+template<int W>     /* width of data type = SC_INTWIDTH */
+class sc_uint
+{
+  /***********************/
+  /* SYSTEMCASS SPECIFIC */
+  /***********************/
+  typedef sc_uint<W>                         this_type;
+  typedef typename s_uint_type<W>::uint_type data_type;
+
+  typedef data_type sc_uint_subref;
+//typedef data_type sc_uint_subref_r; 
+    /* removed since "operator ," was going wrong */
+
+// internal
+	union {
+    val_field<W,(sizeof (data_type) * 8) - W,data_type> vf; /* To compute */
+		data_type val;          /* To return an int reference (read function) */
+//	  data_type valW:W; /* works with little endianess only */
+//  bool      valB[W]; /* removed since 1 bool takes 1 byte */
+	};
+
+  /***********************/
+  /*        L R M        */
+  /***********************/
+public:
+  sc_uint ()                { val = 0; }
+//  sc_uint (data_type val_)  { val = 0; write (val_); }
+  sc_uint (const char *a)   { val = 0; write (atoi (a)); }
+  sc_uint (unsigned short a){ val = 0; write (a); }
+  sc_uint (short a)         { val = 0; write (a); }
+  sc_uint (unsigned long a) { val = 0; write (a); }
+  sc_uint (long a)          { val = 0; write (a); }
+  sc_uint (unsigned int a)  { val = 0; write (a); }
+  sc_uint (int a)           { val = 0; write (a); }
+  sc_uint (int64 a)         { val = 0; write (a); }
+  sc_uint (uint64 a)        { val = 0; write (a); }
+  sc_uint (double a)        { val = 0; write (a); }
+
+  template <int W2> sc_uint (const sc_uint<W2> &val_) { val = 0; write (val_.read());}
+  /* this template doesn't redefine default copy constructor of sc_uint.
+   * So, we define by this way 
+   */
+  sc_uint (const sc_uint &val_)          { val = 0; write (val_.read()); }
+  sc_uint (const sc_uint_subref_r &val_) { val = 0; write (val_.read()); } 
+    /* the user needs to cast explicitly result of range () method. */
+
+  /***********************/
+  /* SYSTEMCASS SPECIFIC */
+  /***********************/
+  // read/write
+  inline const data_type& read() const { return val; }
+  inline void write(data_type val_)    { vf.valW = val_; }
+  template <int W2> inline void write (const sc_uint<W2> val_) { write (val_.read()); }
+//inline void write (const sc_uint<W> val_) { write (val_.read()); }
+  inline void write (const sc_uint_subref_r& s) { write (s.read()); }
+
+  /***********************/
+  /*        L R M        */
+  /***********************/
+  // operators
+  inline operator const data_type& () const { return read (); }
+//  inline void write(uint64 val_) { val = val_ & MASK64(W); }
+//  inline void write(unsigned int val_)   { val = val_ & MASK32(W); }
+	template <typename T> inline sc_uint& operator = (const T& val_) 
+  { write (val_); return *this; }
+	inline sc_uint& operator = (const sc_uint_subref_r& a) 
+  { write (a);    return *this; }
+
+  // explicit conversions
+  inline uint32         to_uint   () const {return val & MASK32(W);}
+  inline int32          to_int    () const {return val & MASK32(W);}
+  inline uint64         to_uint64 () const {return val & MASK64(W);}
+  inline int64          to_int64  () const {return val & MASK64(W);}
+  
+  // explicit conversion to character string 
+  const sc_string to_string       ( sc_numrep numrep = SC_DEC ) const 
+  { return sc_dt::to_string (val, W, numrep); }
+  const sc_string to_dec() const  { return to_string (SC_DEC); }
+  const sc_string to_bin() const  { return to_string (SC_BIN); }
+  const sc_string to_oct() const  { return to_string (SC_OCT); }
+  const sc_string to_hex() const  { return to_string (SC_HEX); }
+
+  // arithmetic
+  template <typename T>
+  inline sc_uint& operator <<= (T v)
+  { vf.valW <<= v; return *this; }
+  template <typename T>
+  inline sc_uint& operator >>= (T v)
+  { vf.valW >>= v; return *this; }
+  template <typename T>
+  inline sc_uint& operator += (T v)
+  { vf.valW += v; return *this; }
+  template <typename T>
+  inline sc_uint& operator -= (T v)
+  { vf.valW -= v; return *this; }
+  template <typename T>
+  inline sc_uint& operator *= (T v)
+  { vf.valW *= v; return *this; }
+  template <typename T>
+  inline sc_uint& operator /= (T v)
+  { vf.valW /= v; return *this; }
+  template <typename T>
+  inline sc_uint& operator %= (T v)
+  { vf.valW %= v; return *this; }
+  template <typename T>
+  inline sc_uint& operator &= (T v)
+  { vf.valW &= v; return *this; }
+  template <typename T>
+  inline sc_uint& operator |= (T v)
+  { vf.valW |= v; return *this; }
+  template <typename T>
+  inline sc_uint& operator ^= (T v)
+  { vf.valW ^= v; return *this; }
+  inline sc_uint_bit_ref operator [] (int v)
+  { return (vf.valW >> v) & 1; }
+  inline sc_uint_bit_ref_r operator [] (int v) const
+  { return (vf.valW >> v) & 1; }
+
+  template <int W2> 
+  inline sc_uint<W+W2> operator , (const sc_uint<W2> &b) const
+  { sc_uint<W+W2> res = read() << W2; res += b.read(); return res; }
+#if 0 
+std::cerr << "[" << to_bin() << "," << b.to_bin() << " = " << res.to_bin() << "]\n"; 
+#endif
+
+  inline sc_uint<W+1> operator , (bool b) const
+  { sc_uint<W+1> res = read(); res <<= 1; res += b; return res; }
+#if 0 
+std::cerr << "[" << to_bin() << "," << b.to_bin() << " = " << res.to_bin() << "]\n"; 
+#endif
+
+  template <int W2>
+  inline sc_uint<W2> operator , (const sc_uint_subref_r &v) const
+  { std::cerr << "Warning : \n"; return sc_uint<W2> (v.read()); }
+
+  inline sc_uint_subref range (int left, int right)
+  { return (data_type)((data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right; }
+
+  inline sc_uint_subref_r range (int left, int right) const
+  { return sc_uint_subref_r (((data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right, left, right); }
+#if 0
+std::cerr << "range(" << left << "," << right << ")\n";
+std::cerr << "val = " << val << "\n";
+std::cerr << "~0 >> " << (sizeof (data_type) * 8 - left - 1) << " = " << (data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) << "\n";
+std::cerr <<  ((data_type) ((((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right) << "\n";
+std::cerr << "data_type = " << sizeof (data_type) << "\n";
+#endif
+
+}; 
+
+//
+// no sign flag to threat
+//
+
+inline std::ostream& operator << (std::ostream &o, const sc_uint_subref_r& s)
+{ return o << s.val; }
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_UINT_H__ */
+
Index: /latest/src/sc_uint_subref_r.cc
===================================================================
--- /latest/src/sc_uint_subref_r.cc	(revision 1)
+++ /latest/src/sc_uint_subref_r.cc	(revision 1)
@@ -0,0 +1,53 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_uint_subref_r                  |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   08_06_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <iostream>
+#include "sc_uint.h"
+
+using namespace std;
+
+void
+sc_dt::sc_uint_subref_r::print_warning () const
+{
+  cerr << "Warning :\n"
+  "  SystemCASS need you to cast explicitly result of range() method.\n";
+  cerr << "  Result Type of range(" << left << "," << right << ")"
+          " shoud be sc_uint<" << left - right + 1 << "> in this case.\n";
+  exit (23);
+}
+
+
+
+
Index: /latest/src/sc_unit.h
===================================================================
--- /latest/src/sc_unit.h	(revision 1)
+++ /latest/src/sc_unit.h	(revision 1)
@@ -0,0 +1,26 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_unit.h                         |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_UNIT_H__
+#define __SC_UNIT_H__
+
+#include <sc_bit.h>
+#include <sc_bv.h>
+#include <sc_logic.h>
+#include <sc_lv.h>
+#include <sc_uint.h>
+#include <sc_int.h>
+#include <sc_biguint.h>
+#include <sc_bigint.h>
+#include <sc_unsigned.h>
+#include <sc_signed.h>
+
+#endif /* __SC_UNIT_H__ */
Index: /latest/src/sc_unsigned.h
===================================================================
--- /latest/src/sc_unsigned.h	(revision 1)
+++ /latest/src/sc_unsigned.h	(revision 1)
@@ -0,0 +1,29 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_unsigned.h                     |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   14_04_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SC_UNSIGNED_H__
+#define __SC_UNSIGNED_H__
+
+// ----------------------------------------------------------------------------
+//  CLASS : sc_bv
+//
+// ----------------------------------------------------------------------------
+
+#include"sc_nbdefs.h"
+#include"sc_logic.h"
+
+
+namespace sc_dt {
+
+
+} /* end of sc_dt namespace */
+
+#endif /* __SC_UNSIGNED_H__ */
Index: /latest/src/sc_vcd_trace.cc
===================================================================
--- /latest/src/sc_vcd_trace.cc	(revision 1)
+++ /latest/src/sc_vcd_trace.cc	(revision 1)
@@ -0,0 +1,144 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_vcd_trace.cc                   |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include"sc_trace.h"
+#include"sc_vcd_trace.h"
+#include"sc_ver.h"
+#include"internal.h"
+#include"assert.h"
+
+#include<time.h>
+#include<string>
+
+//-----------------------------------------*/
+
+using namespace std;
+
+namespace sc_core {
+
+//-----------------------------------------*/
+
+sc_trace_file*
+sc_create_vcd_trace_file(const char * name)
+{
+  if (notrace)
+    return NULL;
+  ASSERT(name != NULL);
+	string filename;
+	filename = name;
+	filename += ".vcd";
+	//char varToday[1024];system(varToday=echo `date`);
+	
+	//création d'1 instance de la structure Sc_trace_file:
+	sc_trace_file *traceFic=new sc_trace_file();
+	traceFic->flag = VCD_FORMAT;	
+	
+	trace_file_list.push_back(traceFic);
+	
+	//en-tête du fichier VCD:
+	char entete[]="$date\n\t%s\n$end\n\n$version\n\t%s\n$end\n\n$timescale\n\t1 ps\n$end\n\n$scope module SystemC $end\n";
+	
+	//ouverture du fichier nommé "*name":
+	traceFic->pfic=fopen(filename.c_str(),"w+");//on a un pointeur sur le fichier
+	if((traceFic->pfic)==NULL)
+	{
+		/* fopen renvoie NULL si erreur */
+		fprintf(stderr,"\n\terreur ouverture outVcd\n");
+		exit(15);
+	}
+
+  char date[128];	
+  time_t timep = time (NULL);
+  const struct tm *tm = localtime (&timep);
+  strftime (date, 128, "%A %d %B %y %Z - %R:%S -", tm); 
+
+	//écriture de l'en-tête du format VCD:
+	if ((fprintf(traceFic->pfic,entete, date, sc_version ()))==0)
+		{
+			/* fprintf renvoie 0 si erreur */
+			cerr << "\n\terreur ecriture de l'entete \n";
+			exit(2);
+		}
+	
+	//on retourne un pointeur sur la structure traceFile
+	//dont un des éléments pointe sur notre fichier VCD:
+	return traceFic;
+}
+
+
+//*************************************************************************
+
+void
+sc_close_vcd_trace_file( sc_trace_file* traceFic )
+{	
+  if (notrace)
+    return;
+  if (!traceFic)
+  {
+    cerr << "Warning : Unable to close vcd trace file.\n";
+    return;
+  }
+
+  if (cpt >= trace_start)
+  {
+    trace (*traceFic,false);
+    cpt++;
+    trace (*traceFic,true);
+  }
+
+	//fermeture fichier VCD
+	if (fclose(traceFic->pfic))
+	{
+		/* fclose renvoie 0 si OK */
+		perror("\n\tclosing VCD file.");
+		exit(4);
+	}
+
+	//libération de l'instance de la structure en mémoire:
+	delete traceFic;
+
+	vector<sc_trace_file*>::iterator i;
+	for (i = trace_file_list.begin (); i != trace_file_list.end(); ++i)
+		if (*i == traceFic) {
+			trace_file_list.erase(i);
+			break;
+		}
+
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/sc_vcd_trace.h
===================================================================
--- /latest/src/sc_vcd_trace.h	(revision 1)
+++ /latest/src/sc_vcd_trace.h	(revision 1)
@@ -0,0 +1,30 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_vcd_trace.h                    |
+|                                                             |
+| Author  :                 Kingbo Paul-Jerome                |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef SC_VCD_TRACE_H
+#define SC_VCD_TRACE_H
+
+#include "sc_fwd.h"
+
+// ----------------------------------------------------------------------------
+namespace sc_core {
+
+// Create VCD file
+extern sc_trace_file *sc_create_vcd_trace_file(const char* name);
+extern void sc_close_vcd_trace_file( sc_trace_file* tf );
+
+} // end of sc_core namespace
+
+using sc_core::sc_create_vcd_trace_file;
+using sc_core::sc_close_vcd_trace_file;
+
+#endif
Index: /latest/src/sc_ver.cc
===================================================================
--- /latest/src/sc_ver.cc	(revision 1)
+++ /latest/src/sc_ver.cc	(revision 1)
@@ -0,0 +1,112 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 sc_ver.cc                         |
+|                                                             |
+| Author  :                 Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "sc_ver.h"
+#include <string>
+#include <iostream>
+
+namespace sc_core {
+
+static
+const char copyright[] =
+    "        Copyright (c) 2003-2005 by all Contributors\n"
+    "                    ALL RIGHTS RESERVED";
+
+static
+const char systemc_version[] =
+    "SystemCASS alpha --- Compilation date : " __DATE__ " " __TIME__;
+
+static 
+const char splash_screen[] =
+	" ____            _                  ____    _    ____ ____  \n"
+	"/ ___| _   _ ___| |_ ___ _ __ ___  / ___|  / \\  / ___/ ___| \n"
+	"\\___ \\| | | / __| __/ _ \\ '_ ` _ \\| |     / _ \\ \\___ \\___ \\ \n"
+	" ___) | |_| \\__ \\ ||  __/ | | | | | |___ / ___ \\ ___) |__) |\n"
+	"|____/ \\__, |___/\\__\\___|_| |_| |_|\\____/_/   \\_\\____/____/ \n"
+	"       |___/                                                \n"
+	"\n"
+	"         Cycle Accurate System Simulator\n"
+#ifdef DEBUG
+  "            DEBUG version\n"
+#endif
+#ifdef USE_PORT_DEPENDENCY
+  "            using explicit port dependancy\n"
+#endif
+	"            ASIM/LIP6/UPMC\n"
+	"            E-mail support:  Richard.Buchmann@asim.lip6.fr\n"
+	"            Contributors : Richard Buchmann, Sami Taktak,\n"
+  "                           Paul-Jerome Kingbo, Frédéric Pétrot,\n"
+  "                           Nicolas Pouillon\n"
+	"\n"
+	"                           Last change : " __DATE__ "\n"
+	"\n";
+
+const char*
+sc_copyright()
+{
+    return copyright;
+}
+
+const char*
+sc_version()
+{
+    return systemc_version;
+}
+
+const char*
+get_splash_screen()
+{
+    return splash_screen;
+}
+
+} // end of sc_core namespace
+
+bool
+casc_check_version (const char *runtime_ver)
+{
+  const char *lib_version = SYSTEMC_VERSION;
+  bool right_version =  strcmp (runtime_ver, lib_version) == 0;
+  if (right_version == false)
+  {
+    std::cerr << "Current SystemCASS library version doesn't match.\n";
+    std::cerr << "SystemCASS linked library is : " << lib_version << "\n";
+    std::cerr << "SystemCASS environnement variable points to : " << runtime_ver << "\n";
+    exit(125);
+  }
+ 
+  return true;
+}
+
Index: /latest/src/sc_ver.h
===================================================================
--- /latest/src/sc_ver.h	(revision 1)
+++ /latest/src/sc_ver.h	(revision 1)
@@ -0,0 +1,24 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  sc_ver.h                         |
+|                                                             |
+| Author  :                 Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef SC_VER_H
+#define SC_VER_H
+
+#include "sc_ver_ext.h"
+
+namespace sc_core {
+
+extern const char* get_splash_screen();
+
+} // end of sc_core
+
+#endif
Index: /latest/src/sc_ver_ext.h
===================================================================
--- /latest/src/sc_ver_ext.h	(revision 1)
+++ /latest/src/sc_ver_ext.h	(revision 1)
@@ -0,0 +1,55 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  sc_ver_ext.h                     |
+|                                                             |
+| Author  :                 Taktak Sami                       |
+|                           Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef SC_VER_EXT_H
+#define SC_VER_EXT_H
+
+extern "C" bool casc_check_version (const char *);
+
+#include "systemcass_version_ext.h"
+
+namespace sc_core {
+
+extern const char* sc_copyright();
+extern const char* sc_version();
+
+} // end of sc_core
+
+using sc_core::sc_copyright;
+using sc_core::sc_version;
+
+#endif
+
Index: /latest/src/schedulers.cc
===================================================================
--- /latest/src/schedulers.cc	(revision 1)
+++ /latest/src/schedulers.cc	(revision 1)
@@ -0,0 +1,336 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 schedulers.cc                     |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Nicolas Pouillon                  |
+|                                                             |
+| Date    :                   23_03_2007                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include<iostream>
+#include"sc_module.h" // method_process_t
+#include"gen_code.h"  // gen_scheduling_code_for_dynamic_link & gen_scheduling_code_for_static_func
+#include"internal.h"  // dump_all_graph
+#include"graph_cass.h" // makegraph
+#include"process_dependency.h" // MakeProcessDependencyList
+#include"signal_dependency.h" // MakeSignalDependencyGraph
+#include"mouchard_scheduling.h" // MakeMouchardScheduling
+#include"graph_signals.h" // makegraph
+//#include"module_hierarchy2dot.h"
+#include"assert.h"
+
+using namespace std;
+
+namespace sc_core {
+
+/* ***************************** */
+/* Dumping functions (for debug) */
+/* ***************************** */
+
+template <typename T>
+ostream& operator << (ostream &o, const vector<T*> &v)
+{
+  typename vector<T*>::const_iterator i;
+  for (i = v.begin(); i != v.end(); ++i) {
+    o << **i << " ";
+  }
+  return o;
+}
+
+/* ************ */
+/*  functions   */
+/****************/
+
+//
+// sort_functions splits and sorts instances_list into three functions lists : 
+method_process_list_t transition_func_list;
+method_process_list_t moore_func_list;
+method_process_list_t combinational_func_list;
+
+#if 0
+static
+bool
+isCostly (const char *n)
+{
+  const char *costly[] = {/*"vgmn", */"mips", "cache", NULL};
+  int i = 0;
+  do {
+    if (strstr (n, costly[i]) != NULL)
+      return true;
+  } while (costly[++i] != NULL);
+  return false;
+}
+
+static
+bool 
+only_sort_by_module_ptr (const method_process_t *a1, 
+                         const method_process_t *a2)
+{
+  ASSERT(a1 != NULL);
+  ASSERT(a2 != NULL);
+  sc_module *m1 = a1->module;
+  sc_module *m2 = a2->module;
+  const char* n1 = m1->basename ();
+  const char* n2 = m2->basename ();
+  bool        h1 = isCostly (n1);
+  bool        h2 = isCostly (n2);
+  if ((h1 ^ h2) == true)
+    return h1 > h2;
+  if (a1->module == a2->module)
+  {
+    union {
+        SC_ENTRY_FUNC func;
+        unsigned long addr_l;
+        unsigned long long addr_ll;
+    } addr1, addr2;
+    addr1.func = a1->func;
+    addr2.func = a2->func;
+    ASSERT(addr1.addr_ll != addr2.addr_ll);
+    if ( sizeof(SC_ENTRY_FUNC) == 4 ) {
+        return (addr1.addr_l < addr2.addr_l);
+    } else {
+        return (addr1.addr_ll < addr2.addr_ll);
+    }
+  }
+  return (a1->module < a2->module);
+}
+#endif
+#if 1
+static
+bool 
+sort_by_module_ptr (const method_process_t *a1, 
+                    const method_process_t *a2)
+{
+  ASSERT(a1 != NULL);
+  ASSERT(a2 != NULL);
+  return (a1->module < a2->module);
+}
+
+static
+bool 
+sort_by_fct_ptr (const method_process_t *a1, 
+                 const method_process_t *a2)
+{
+    ASSERT(a1 != NULL);
+    ASSERT(a2 != NULL);
+    union {
+        SC_ENTRY_FUNC func;
+        unsigned long addr_l;
+        unsigned long long addr_ll;
+    } addr1, addr2;
+    addr1.func = a1->func;
+    addr2.func = a2->func;
+    if (a1->func == a2->func)
+      return sort_by_module_ptr (a1,a2);
+    if ( sizeof(SC_ENTRY_FUNC) == 4 ) {
+        return (addr1.addr_l < addr2.addr_l);
+    } else {
+        return (addr1.addr_ll < addr2.addr_ll);
+    }
+}
+#endif
+void
+sort_functions ()
+{
+#if 0
+  cerr << method_process_list << endl;
+#endif
+  method_process_list_t::const_iterator m;
+  for (m = method_process_list.begin(); m != method_process_list.end(); ++m) {
+      if ((*m)->is_combinational()) combinational_func_list.push_back(*m);
+      else if ((*m)->is_transition ()) transition_func_list.push_back(*m);
+      else if ((*m)->is_genmoore ())   moore_func_list.push_back(*m);
+  }
+#if 1
+  // Sort transition functions by method pointer (1) and by module pointer (2)
+  std::sort (transition_func_list.begin(), transition_func_list.end(), sort_by_fct_ptr);
+  // Sort generation functions by method pointer (1) and by module pointer (2)
+  std::sort (moore_func_list.begin(), moore_func_list.end(), sort_by_fct_ptr);
+#endif
+#if 0
+  std::sort (transition_func_list.begin(), transition_func_list.end(), only_sort_by_module_ptr);
+  std::sort (moore_func_list.begin(), moore_func_list.end(), only_sort_by_module_ptr);
+#endif
+}
+
+/* ****************** */
+/* process dependency */
+/* ****************** */
+
+static
+SignalDependencyGraph*
+MakeAcyclicSignalDependencyGraph ()
+{
+  if (dump_all_graph) {
+    const PortDependencyGraph &port_graph = get_port_dependency_graph ();
+    PortDependencyGraph2dot ("port_graph", port_graph);
+  }
+
+	SignalDependencyGraph* sig_graph = MakeSignalDependencyGraph ();
+
+  if (dump_all_graph)
+    SignalDependencyGraph2dot ("signal_graph",*sig_graph);
+
+	if (!Check (*sig_graph))
+	{
+		cerr << "The signal dependency graph is not valid.\n";
+    exit (29092004);
+	}
+
+#if 1
+  if (!Check (method_process_list,*sig_graph))
+  {
+    cerr << "Sensitivity list is not valid.\n";
+    exit (30092004);
+  }
+#endif
+	
+	// There is a cycle in the signal dependency graph ?
+  Graph *sig_knuth = makegraph (*sig_graph);
+	strong_component_list_t *s = strong_component(sig_knuth);
+
+  if (dump_all_graph)
+    SignalDependencyOrder2txt ("signal_order",*s);
+
+	if (has_cycle (*s))
+	{
+		cerr << "Error : There is a cycle in the signal dependency graph.\n";
+#if 0
+    print_cycle (cerr, get_cycle (*s));
+#endif
+    exit (24092004);
+	}
+  return sig_graph;
+}
+
+static
+ProcessDependencyList*
+MouchardScheduling ()
+{
+  SignalDependencyGraph *sig_graph = MakeAcyclicSignalDependencyGraph ();
+  ASSERT(sig_graph != NULL);
+  // Create the process evaluation list
+  ProcessDependencyList* process_list = MakeMouchardScheduling (*sig_graph);
+  ASSERT(process_list != NULL);
+
+  if (dump_all_graph)
+  	ProcessDependencyList2dot  ("process_order",*process_list);
+
+	return process_list;
+}
+
+static
+ProcessDependencyList*
+BuchmannScheduling ()
+{
+  SignalDependencyGraph *sig_graph = MakeAcyclicSignalDependencyGraph ();
+  // Create the process evaluation list
+	ProcessDependencyList* process_list = MakeProcessDependencyList (*sig_graph);
+
+  if (dump_all_graph)
+  	ProcessDependencyList2dot  ("process_order",*process_list);
+
+	return process_list;
+}
+
+string
+get_scheduling (int scheduling_method) 
+{
+  /* marque les fonctions comme fonction de mealy ou non */
+  if (dump_funclist_info)
+    cerr << "method process list : " << method_process_list << "\n";
+  sort_functions ();
+  if (dump_funclist_info)
+  {
+    cerr << "Transition functions : " << transition_func_list << "\n";
+    cerr << "Moore generation functions : " << moore_func_list << "\n";
+    cerr << "Mealy generation functions : " << combinational_func_list << "\n";
+  }
+
+  /* Schedule */ 
+  string base_name;
+  switch (scheduling_method) {
+  case BUCHMANN_SCHEDULING : {
+    // Generate the scheduled code, compile and link.
+    // Buchmann's thesis explains this scheduling method.
+    // Uses port dependancies like Dr. Mouchard.
+    ProcessDependencyList* process_list = BuchmannScheduling ();
+    base_name = gen_scheduling_code_for_dynamic_link (transition_func_list, moore_func_list,*process_list);
+    gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list);
+    break;
+  }
+  case MOUCHARD_SCHEDULING : {
+    // Generate the scheduled code, compile and link.
+    // Mouchard's thesis explains this scheduling method.
+    // Uses port dependancies like Dr. Mouchard.
+    // CAUTION : unlike FastSysC, this scheduling is totally static 
+    // and does not use an event-driven scheduler.
+    ProcessDependencyList* process_list = MouchardScheduling ();
+    base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list,*process_list);
+    gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list);
+    break;
+  }
+  case CASS_SCHEDULING : {
+    // Generate the scheduled code, compile and link
+    // Hommais's thesis explains this scheduling method (like CASS strategy)
+    // Doesn't use port dependancies
+    Graph *g = makegraph (&combinational_func_list);
+    if (dump_all_graph && g)
+      graph2dot("module_graph", *g);
+    strong_component_list_t *strong_list = strong_component (g);
+    base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list,*strong_list);
+    gen_scheduling_code_for_quasistatic_func (transition_func_list, moore_func_list, *strong_list);
+    break;
+  }
+  default :
+    cerr << "Error : Unable to schedule SystemC process."
+            "Please select a scheduling method.\n";
+    exit (35);
+  }
+  return base_name;
+}
+
+bool
+run_schedule_editor (const char *schedule)
+{
+  char buf[128];
+  const char *editor = getenv ("EDITOR");
+  if (editor == NULL)
+    editor = "vim";
+  sprintf (buf, "(cd '%s' ; %s '%s')", temporary_dir, editor, schedule);
+  if (dump_stage)
+    cerr << "Executing : " << buf << endl;
+  return (system(buf) == 0);
+}
+
+/////////////////////////
+
+} // end of sc_core namespace
+
Index: /latest/src/schedulers.h
===================================================================
--- /latest/src/schedulers.h	(revision 1)
+++ /latest/src/schedulers.h	(revision 1)
@@ -0,0 +1,32 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 schedulers.h                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   23_03_2007                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SCHEDULERS_H__
+#define __SCHEDULERS_H__
+
+#include"sc_fwd.h"
+#include"sc_time.h"
+
+namespace sc_core {
+
+/////////////////////////
+///// SYSTEMCASS_SPECIFIC
+extern const char *temporary_dir;
+extern const char *generated_files_dir;
+extern std::string get_scheduling      (int scheduling_method);
+extern bool        run_schedule_editor (const char* scheduling);
+
+/////////////////////////
+
+} // end of namespace sc_core
+
+#endif
+
Index: /latest/src/serialization.cc
===================================================================
--- /latest/src/serialization.cc	(revision 1)
+++ /latest/src/serialization.cc	(revision 1)
@@ -0,0 +1,196 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 serializations.cc                 |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   10_01_2006                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include<vector>
+#include<map>
+#include<fstream> // save_module_hierarchy
+#include"internal_ext.h" // tab_t
+#include"serialization.h"
+#include"entity.h"
+#include"sc_module.h"
+#include"sc_object.h"
+#include"hex2string.h"
+#include"assert.h"
+
+using namespace std;
+using namespace sc_core;
+
+namespace sc_core {
+
+#if 0
+static
+void
+save_module_hierarchy (ostream   &o, 
+                       sc_object *obj)
+{
+  const std::vector<sc_object*> &children = obj->get_child_objects();
+  for (unsigned i = 0; i < children.size(); i++)
+  {
+    if (children[i])
+      save_module_hierarchy (o,children[i]);
+  };
+//  if (obj->kind () != sc_module::kind_string)
+//    o << obj->name () << " " << obj->kind() << endl;
+}
+
+static
+void
+save_module_hierarchy (ostream &o,
+                       const std::vector<sc_object*> &obj_list)
+{
+  for (signed int i = obj_list.size(); i >= 0; i--)
+    save_module_hierarchy(o, obj_list[i]);
+}
+#endif
+
+static
+void
+dec2string (char        *buf,
+            const tab_t *val,
+            int          bit_number)
+{
+  ASSERT(bit_number <= 64);
+  if (bit_number == 1) {
+    bool v = *((const bool*) val);
+    sprintf (buf, "%d", (v)?1:0);
+  } else if (bit_number <= 8) {
+    uint8 v = *((const uint8*)val);
+    int   v2 = v;
+    sprintf (buf, "%d", v2);
+  } else if (bit_number <= 16) {
+    uint16 v = *((const uint16*)val);
+    sprintf (buf, "%d", v);
+  } else if (bit_number <= 32) {
+    uint32 v = *((const uint32*)val);
+    sprintf (buf, "%d", v);
+  } else if (bit_number <= 64) {
+    uint64 v = *((const uint64*)val);
+    sprintf (buf, "%lld", v);
+  }
+}
+
+static
+void
+save_signal_table (std::ostream &o, 
+                   int           hex = true)
+{
+  const equi_list_t &eq_l = get_equi_list ();
+  equi_list_t::const_iterator it;
+  for (it = eq_l.begin (); it != eq_l.end (); ++it)
+  {
+    const equi_t           &eq = *it;
+    equi_t::const_iterator it2 = eq.begin();
+    const entity           &en = *it2;
+    const sc_interface     *f = en.interface;
+    o << dec << get_name (eq) << endl;
+//    print_value (o, *f);
+    char buf[128];
+    if (hex)
+    {
+      buf[0] = '0';
+      buf[1] = 'x';
+      hex2string (buf+2, f->get_pointer (), f->data_size_in_bytes() << 3);
+    } else {
+      dec2string (buf, f->get_pointer (), f->data_size_in_bytes() << 3);
+    }
+    o << buf;
+    o << endl;
+  }
+}
+
+typedef std::map<const sc_module *, save_fct_t1> sc_module2save_fct_t1;
+sc_module2save_fct_t1 save_handler_table;
+
+void 
+set_save_handler   (const sc_module &mod, 
+                    save_fct_t1      fct)
+{
+  //ASSERT(fct != NULL);
+  //sc_module2save_fct_t1::value_type pair(&mod,fct);
+  //save_handler_table.insert (pair);
+  save_handler_table[&mod] = fct;
+}
+
+static
+void
+//save_modules (ostream &o)
+save_modules (FILE    *o)
+{
+  sc_module2save_fct_t1::const_iterator it;
+  for (it = save_handler_table.begin(); 
+       it != save_handler_table.end(); 
+       ++it)
+  {
+    const sc_module *mod = it->first;
+    save_fct_t1      fct = it->second;
+    ASSERT(mod != NULL);
+//    ASSERT(fct != NULL);
+    //o << mod->name () << endl;
+    fprintf (o,"module\n%s\n",mod->name ());
+    if (fct != NULL)
+      (((sc_module*)mod)->*fct) (o);
+  }
+}
+
+void 
+sc_save_simulation (const char *filename)
+{
+  update ();
+  if (dump_stage)
+    cerr << "Saving simulation into \"" << filename << "\"... ";
+    
+  ofstream file;
+  file.open (filename);
+  file << "CABA Save!" << endl;
+  file << (sc_time_stamp () / 1000) << endl;
+  file << sc_time_stamp ().to_string () << endl;
+  //save_module_hierarchy (file,sc_get_top_level_objects ());
+  save_signal_table (file, true);
+  //save_modules (file);
+  //file.close ();
+  file.close ();
+  FILE *f = fopen (filename, "a+");
+  ASSERT(f != NULL);
+  save_modules (f);
+  fclose (f);
+
+  if (dump_stage)
+    cerr << "done.\n";
+}
+
+} // end of sc_core namespace
+
+
Index: /latest/src/serialization.h
===================================================================
--- /latest/src/serialization.h	(revision 1)
+++ /latest/src/serialization.h	(revision 1)
@@ -0,0 +1,27 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 serialization.h                   |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   10_01_2006                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __SERIALIZATION_H__
+#define __SERIALIZATION_H__
+
+#include"serialization_ext.h"
+#include"sc_fwd.h"
+
+namespace sc_core {
+/////////////////////////
+// SYSTEMCASS SPECIFIC //
+
+extern void set_save_handler   (const sc_module &, save_fct_t1);
+
+} // end of sc_core namespace
+
+#endif // __SERIALIZATION_H__
+
Index: /latest/src/serialization_ext.h
===================================================================
--- /latest/src/serialization_ext.h	(revision 1)
+++ /latest/src/serialization_ext.h	(revision 1)
@@ -0,0 +1,60 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 serialization_ext.h               |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   10_01_2006                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __SERIALIZATION_EXT_H__
+#define __SERIALIZATION_EXT_H__
+
+#include<iostream>
+#include"sc_fwd.h"
+
+namespace sc_core {
+/////////////////////////
+// SYSTEMCASS SPECIFIC //
+
+// Types
+//typedef void (sc_core::sc_module::*save_fct_t2) (std::ostream&) const;
+typedef void (sc_core::sc_module::*save_fct_t1) (FILE*) const;
+
+// Functions
+extern void sc_save_simulation (const char *filename = "savedefault");
+
+} // end of sc_core namespace
+
+/////////////////////////
+// SYSTEMCASS SPECIFIC //
+using sc_core::sc_save_simulation;
+
+#endif // __SERIALIZATION_EXT_H__
+
Index: /latest/src/signal_dependency.cc
===================================================================
--- /latest/src/signal_dependency.cc	(revision 1)
+++ /latest/src/signal_dependency.cc	(revision 1)
@@ -0,0 +1,284 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  port_dependency.cc               |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   21_09_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <set>
+#include <iostream>
+#include <fstream>
+#include "signal_dependency.h"
+#include "simplify_string.h"
+#include "sc_fwd.h"
+#include "sc_port.h"
+#include "sc_module.h"
+#include "sc_ver_ext.h"
+
+using namespace std;
+
+namespace sc_core {
+
+bool 
+SignalDependency::operator < (const SignalDependency &b) const
+{
+	if (source < b.source)
+		return true;
+	if (destination < b.destination)
+		return true;
+	return false;
+}
+
+static
+void
+txt_write (ofstream &o, const component_list_t &l)
+{
+	component_list_t::const_iterator it;
+	for (it = l.begin (); it != l.end (); ++it)
+	{
+		o << get_name(*((equi_t*)(*it))) << " ";
+	}
+}
+
+static
+void
+txt_write (ofstream &o, const strong_component_list_t &l)
+{
+	strong_component_list_t::const_iterator it;
+	for (it = l.begin (); it != l.end (); ++it)
+	{
+		txt_write (o,**it);
+		o <<  "\n";
+	}
+}
+
+bool
+SignalDependencyOrder2txt (const char *name,
+                           const strong_component_list_t&l)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".txt";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	txt_write (o,l);
+	o.close ();
+	return true;
+	
+}
+
+static
+void
+dot_write (ofstream &o, const SignalDependencyGraph &g)
+{
+	string s;
+	SignalDependencyGraph::const_iterator it;
+	for (it = g.begin (); it != g.end (); ++it)
+	{
+		string name;
+		name = it->method->module->name();
+		name += "_";
+		name += it->method->name;
+		o << "edge [label="
+      << simplify_name(name.c_str(),s)
+      << "];\n";
+    const equi_t *equi = it->source;
+		name = get_name (*equi);
+		o << simplify_name(name.c_str(),s);
+		o	<< " -> ";
+    equi = it->destination;
+		name = get_name (*equi);
+		o << simplify_name(name.c_str(),s);
+	  o << ";\n";
+	}
+}
+
+bool
+SignalDependencyGraph2dot (const char *name,
+                           const SignalDependencyGraph& g)
+{
+	if (!name)
+		return false;
+	string filename;
+	filename =  name;
+	filename += ".dot";
+	ofstream o;
+  o.open (filename.c_str(),ios::out | ios::trunc);
+	if (o.is_open () == false)
+		return false;
+	o << "// Signal dependency graph\n"
+       "// Generated by "
+    << sc_version () << "\n";
+	o << "strict digraph " << name << " {\n";
+	dot_write (o,g);
+	o << "}\n";
+	o.close ();
+  if (dump_stage)
+    cerr << "Signal Dependency Graph written into '" 
+         << filename << "'.\n";
+	return true;
+}
+
+SignalDependencyGraph* 
+MakeSignalDependencyGraph (const PortDependencyGraph& g)
+{
+  if (dump_stage)
+	  cerr << "Making signal dependency graph...\n";
+
+	SignalDependencyGraph *sig_g = new SignalDependencyGraph ();
+	PortDependencyGraph::const_iterator it;
+	for (it = g.begin(); it != g.end(); ++it)
+	{
+		SignalDependency s;
+		s.method = it->method;
+		const sc_interface *inter;
+		inter = it->source;
+		if (inter)
+			s.source = &(get_equi (*inter));
+		else
+			continue;
+		inter = it->destination;
+		s.destination = &(get_equi (*inter));
+		sig_g->insert(s);
+	}
+	return sig_g;
+}
+
+
+static
+bool
+is_in (const equi_t &e, const method_process_t &m)
+{
+  const tab_t *pt = e.begin ()->interface->get_pointer ();
+  const sensitivity_list_t &sens = m.sensitivity_list;
+  sensitivity_list_t::const_iterator it;
+  for (it = sens.begin (); it != sens.end (); ++it)
+  {
+    const sc_event &event = *it;
+    if (pt == event.get_interface().get_pointer ())
+      return true;
+  }
+	return false;
+}
+
+static
+bool
+is_valid (const SignalDependency &s)
+{
+#if 0
+  cerr << "'" << get_name (*(s.destination)) << "'"
+       << " depends on '" << get_name (*(s.source)) << "'"
+       << " in the module '" << s.method->module->name() << "'\n";
+  return true;
+#endif
+	if (is_in (*(s.source), *(s.method)))
+    return true;
+  const char *src = get_name (*(s.source));
+  cerr << "'" << get_name (*(s.destination)) << "'"
+       << " depends on '" << src << "'"
+       << " in the module '" << s.method->module->name() << "'"
+       << " but '" << src << "' is not in the sensitivity_list.\n";
+  return false;
+}
+
+bool
+Check (const SignalDependencyGraph &g)
+{
+	SignalDependencyGraph::const_iterator it;
+	for (it = g.begin(); it != g.end(); ++it)
+	{
+		const SignalDependency &s = (*it);
+    if (!is_valid (s))
+      return false;
+  }  
+  return true;
+}
+
+static
+bool
+is_in (const equi_t &e, const SignalDependencyGraph &g)
+{
+  SignalDependencyGraph::const_iterator it;
+  for (it = g.begin (); it != g.end (); ++it)
+  {
+    const SignalDependency &s = *it;
+    if (&e == s.source)
+      return true;
+  }
+	return false;
+}
+
+static
+bool
+is_in (const sensitivity_list_t &sens, const SignalDependencyGraph &g)
+{
+  sensitivity_list_t::const_iterator it;
+  for (it = sens.begin (); it != sens.end (); ++it)
+  {
+    const sc_event     &event = *it;
+    const sc_interface &i     = event.get_interface();
+    const equi_t       &equi  = get_equi (i);
+		if (is_clock (i))
+      continue;
+    if (!is_in (equi, g)) {
+      cerr << "'" << get_name(equi) << "'"
+           << " is in the sensitivity list of ";
+      return false;
+    }
+  }
+  return true;
+}
+
+bool
+Check       (const method_process_list_t &ml,
+             const SignalDependencyGraph &g)
+{
+	method_process_list_t::const_iterator it;
+	for (it = ml.begin(); it != ml.end(); ++it)
+	{
+		const method_process_t   &m = *(*it);
+    const sensitivity_list_t &sens = m.sensitivity_list;
+		if (!is_in (sens, g))
+    {
+      cerr << "'" << m.module->name() << "' module instance "
+           << "but any output port doesn't depend on this input.\n";
+      return false;
+    }
+  }  
+  return true;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/signal_dependency.h
===================================================================
--- /latest/src/signal_dependency.h	(revision 1)
+++ /latest/src/signal_dependency.h	(revision 1)
@@ -0,0 +1,49 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  signal_dependancy.h              |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef SIGNAL_DEPENDENCY_H
+#define SIGNAL_DEPENDENCY_H
+
+#include <set>
+#include "sc_fwd.h"
+#include "entity.h" // equi_t
+#include "graph.h"
+//#include "sc_port.h"
+#include "port_dependency.h"
+
+namespace sc_core {
+
+// Signal Dependency Graph
+struct SignalDependency {
+	const method_process_t *method;
+	const equi_t           *source;
+	const equi_t           *destination;
+	bool operator < (const SignalDependency &a) const;
+//	friend int operator < (const SignalDependency &a, const SignalDependency &b);
+};
+
+typedef std::set<SignalDependency> SignalDependencyGraph;
+
+// Convert Port Dependency Graph to Signal Dependency Graph
+extern SignalDependencyGraph* MakeSignalDependencyGraph (const PortDependencyGraph& = get_port_dependency_graph ());
+
+// Checking
+extern bool Check (const SignalDependencyGraph&);
+extern bool Check (const method_process_list_t&, const SignalDependencyGraph&);
+
+// Dump
+extern bool SignalDependencyGraph2dot (const char *name, const SignalDependencyGraph&);
+extern bool SignalDependencyOrder2txt (const char *name, const strong_component_list_t&);
+
+} // end of sc_core namespace
+
+#endif
+
Index: /latest/src/simplify_string.cc
===================================================================
--- /latest/src/simplify_string.cc	(revision 1)
+++ /latest/src/simplify_string.cc	(revision 1)
@@ -0,0 +1,62 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  simplify_string.cc               |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   21_09_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "simplify_string.h"
+
+using namespace std;
+
+namespace sc_core {
+
+// Truncate the name : delete "."
+string&
+simplify_name (const char *name, string &newname)
+{
+	if (!name) {
+    newname = "";
+		return newname;
+  }
+	newname = name;
+	string::size_type i = 0;
+	do { 
+		i = newname.find ('.');
+		if (i == -1)
+			break;
+	  newname[i] = '_';
+	} while (1);
+	return newname;
+}
+
+} // end of sc_core namespace
+
Index: /latest/src/simplify_string.h
===================================================================
--- /latest/src/simplify_string.h	(revision 1)
+++ /latest/src/simplify_string.h	(revision 1)
@@ -0,0 +1,23 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  simplify_string.h                |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   21_09_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef SIMPLIFY_STRING_H
+#define SIMPLIFY_STRING_H
+
+#include <string>
+
+// Truncate the name : delete "."
+namespace sc_core {
+extern std::string& simplify_name (const char *name, std::string &newname);
+}
+
+#endif
+
Index: /latest/src/systemc.h
===================================================================
--- /latest/src/systemc.h	(revision 1)
+++ /latest/src/systemc.h	(revision 1)
@@ -0,0 +1,73 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                   sc_main.cc                      |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                           Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+/------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __SYSTEMC_H__
+#define __SYSTEMC_H__
+
+#define SYSTEMCASS_SPECIFIC
+//#define SOCVIEW // we can't define SOCVIEW macro because we don't support
+//some features like "debug" function
+#define STATESAVER_SYSTEM
+#define NONAME_RENAME
+#define PORT_DEPENDANCIES_ENABLED
+
+#include"sc_fwd.h"
+
+#include"global_functions.h"
+#include"sc_nbdefs.h"
+#include"sc_ver_ext.h"
+#include"sc_module_name.h"
+#include"sc_module_ext.h"
+#include"sc_module_name.h"
+#include"module_hierarchy_ext.h"
+#include"serialization_ext.h"
+#include"sc_port_ext.h"
+#include"sc_signal.h"
+#include"sc_clock_ext.h"
+#include"sc_sensitive.h"
+
+#include"sc_time.h"
+#include"sc_unit.h"
+#include"sc_trace_ext.h"
+#include"sc_vcd_trace.h"
+#include"sc_pat_trace.h"
+#include"endianness.h"
+
+using std::ios;
+using std::cerr;
+
+#endif
+
Index: /latest/src/systemcass_version_ext.h
===================================================================
--- /latest/src/systemcass_version_ext.h	(revision 1)
+++ /latest/src/systemcass_version_ext.h	(revision 1)
@@ -0,0 +1,1 @@
+#define SYSTEMC_VERSION "SystemCASS : mardi 19 juin 2007, 17:44:28"
Index: /latest/src/usage.h
===================================================================
--- /latest/src/usage.h	(revision 1)
+++ /latest/src/usage.h	(revision 1)
@@ -0,0 +1,80 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                  usage.h                          |
+|                                                             |
+| Author  :                 Buchmann Richard                  |
+|                                                             |
+| Date    :                   ??_??_2005                      |
+|                                                             |
+\------------------------------------------------------------*/
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef __USAGE_H__
+#define __USAGE_H__
+
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <unistd.h>
+#include <iostream>
+
+struct usage_t {
+	unsigned int elapsed_time;
+  long         memory_size;
+	usage_t () 
+	{
+		elapsed_time = 0;
+    memory_size  = 0;
+	}
+	void start () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		elapsed_time = usage.ru_utime.tv_sec;
+		memory_size  = usage.ru_maxrss;
+	}
+	void cont () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		elapsed_time = usage.ru_utime.tv_sec - elapsed_time;
+		memory_size  = usage.ru_maxrss;
+	}
+	void stop ()
+	{
+		cont ();
+	}
+	operator unsigned int () const
+	{ return elapsed_time; }	
+  long     get_memory_size () const
+  { return memory_size;  }
+	friend std::ostream& operator << (std::ostream& o, const usage_t &c)
+	{
+		return o << c.elapsed_time << "seconds";
+	}
+};
+
+#endif
+
Index: /latest/src/utils.h
===================================================================
--- /latest/src/utils.h	(revision 1)
+++ /latest/src/utils.h	(revision 1)
@@ -0,0 +1,38 @@
+/*------------------------------------------------------------\
+|                                                             |
+| Tool    :                  systemcass                       |
+|                                                             |
+| File    :                 utils.h                           |
+|                                                             |
+| Author  :                 Taktak Sami                       |
+|                                                             |
+| Date    :                   09_07_2004                      |
+|                                                             |
+\------------------------------------------------------------*/
+#ifndef __UTILS_H__
+#define __UTILS_H__
+
+/* 
+ * This file is part of the Disydent Project
+ * Copyright (C) Laboratoire LIP6 - Département ASIM
+ * Universite Pierre et Marie Curie
+ * 
+ * Home page          : http://www-asim.lip6.fr/disydent
+ * E-mail             : mailto:richard.buchmann@lip6.fr
+ * 
+ * This library is free software; you  can redistribute it and/or modify it
+ * under the terms  of the GNU Library General Public  License as published
+ * by the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ * 
+ * Disydent is distributed  in the hope  that it  will be
+ * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy  of the GNU General Public License along
+ * with the GNU C Library; see the  file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#endif /* __UTILS_H__ */
Index: /latest/test_regression/02052006/Makefile
===================================================================
--- /latest/test_regression/02052006/Makefile	(revision 1)
+++ /latest/test_regression/02052006/Makefile	(revision 1)
@@ -0,0 +1,59 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE)
+
+test : main
+	@./system_systemcass.x --p || eval ${failcom}
+	
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+%_socview.x : %_socview.o  $(SOCVIEW_LIB)
+	$(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_socview.cpp : %.cpp 
+	ln -s $*.cpp $*_socview.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITE -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITE -c $*_systemcass.cpp -o $*_systemcass.o
+
+%_socview.o : %_socview.cpp
+	$(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f gmon.out *~
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	
Index: /latest/test_regression/02052006/Makefile.deps
===================================================================
--- /latest/test_regression/02052006/Makefile.deps	(revision 1)
+++ /latest/test_regression/02052006/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/02052006/system.cpp
===================================================================
--- /latest/test_regression/02052006/system.cpp	(revision 1)
+++ /latest/test_regression/02052006/system.cpp	(revision 1)
@@ -0,0 +1,111 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+  int                             reg;
+  sc_signal<bool>                 reg_bool;
+  sc_signal<int>                  reg_int;
+  sc_signal<unsigned int>         reg_unsigned_int;
+  sc_signal<char>                 reg_char;
+  sc_signal<double>               reg_double;
+  sc_signal<long>                 reg_long;
+  sc_signal<sc_uint<32> >         reg_ui32;
+  sc_signal<sc_uint<16> >         reg_ui16;
+  sc_signal<sc_uint<6> >          reg_ui6;
+  sc_signal<sc_int<32> >          reg_i32;
+  sc_signal<sc_int<16> >          reg_i16;
+  sc_signal<sc_int<6> >           reg_i6;
+ 
+  sc_in_clk                       clk;
+  sc_in<bool>                     resetn;
+
+  void trans ()
+  {
+    if (resetn.read() == true)
+    {
+      ASSERT(((reg & 1))            == reg_bool  .read());
+      ASSERT(((int)   reg)          == reg_int   .read());
+      ASSERT(((unsigned int)reg)    == reg_unsigned_int   .read());
+      ASSERT(((char)  reg)        == reg_char  .read());
+      ASSERT(((double)reg)          == reg_double.read());
+      ASSERT(((long)  reg)          == reg_long  .read());
+      ASSERT(((unsigned int) reg & 0xFFFFFFFF) == (unsigned int) (reg_ui32 .read()));
+      ASSERT(((unsigned int) reg & 0x0000FFFF) == (unsigned int) (reg_ui16 .read()));
+#if 0
+      cerr << reg_ui6.read() << " " << (reg & 0x0000003F) << endl;
+#endif
+      ASSERT(((unsigned int) reg & 0x0000003F)  == (unsigned int) (reg_ui6  .read()));
+      ASSERT(((signed int) reg & 0xFFFFFFFF) == (signed int) (reg_i32 .read()));
+      ASSERT(((signed int) reg & 0x0000FFFF) == (signed int) (reg_i16 .read()));
+      ASSERT(((signed int) reg & 0x0000003F)  == (signed int) (reg_i6  .read()));
+      reg        = reg + 1;
+      reg_bool   = reg & 1;
+      reg_int    = reg;
+      reg_unsigned_int = reg;
+      reg_char   = reg;
+      reg_double = reg;
+      reg_long   = reg;
+      reg_ui32   = reg;
+      reg_ui16   = reg;
+      reg_ui6    = reg;
+      reg_i32    = reg;
+      reg_i16    = reg;
+      reg_i6     = reg;
+    } else {
+      reg        = 0;
+      reg_bool   = 0;
+      reg_int    = 0;
+      reg_unsigned_int = 0;
+      reg_char   = 0;
+      reg_double = 0;
+      reg_long   = 0;
+      reg_ui32   = 0;
+      reg_ui16   = 0;
+      reg_ui6    = 0;
+      reg_i32    = 0;
+      reg_i16    = 0;
+      reg_i6     = 0;
+    }
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<bool> resetn("resetn");
+
+  test test1("test1");
+  test1.clk    (signal_clk);
+  test1.resetn (resetn);
+
+	// Init & run
+	sc_start (0);
+
+  resetn = false;
+	sc_start (4);
+  resetn = true;
+  sc_start (100);
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/04052005/Makefile
===================================================================
--- /latest/test_regression/04052005/Makefile	(revision 1)
+++ /latest/test_regression/04052005/Makefile	(revision 1)
@@ -0,0 +1,54 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : ${EXE}
+	./system_systemcass.x || eval ${failcom}
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	-rm -rf generated_by_systemcass
+	
Index: /latest/test_regression/04052005/Makefile.deps
===================================================================
--- /latest/test_regression/04052005/Makefile.deps	(revision 1)
+++ /latest/test_regression/04052005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/04052005/system.cpp
===================================================================
--- /latest/test_regression/04052005/system.cpp	(revision 1)
+++ /latest/test_regression/04052005/system.cpp	(revision 1)
@@ -0,0 +1,102 @@
+#include "systemc.h"
+#include <iostream>
+
+
+using namespace std;
+
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 0;
+ 
+  sc_uint<32> a;
+  sc_uint<3>  b;
+  sc_uint<2>  c;
+  sc_uint<5>  d;
+  sc_uint<8>  e;
+  sc_uint<10> f;
+
+  a = 0xCFFFFFFF;
+  b = 0x7;
+  c = 0x3;
+  d = 0xA0;
+  e = 0x11;
+  f = 0x1A0;
+ 
+  cerr << "a = 0x" << hex << (unsigned int)a << " = " << a.to_string (SC_BIN) << "\n";
+  if (a.to_string (SC_BIN) != "0b011001111111111111111111111111111")
+    exit (errnum);
+  errnum++;
+
+  cerr << "b = 0x" << hex << (unsigned int)b << " = " << b.to_string (SC_BIN) << "\n";
+  if (b.to_string (SC_BIN) != "0b0111")
+    exit (errnum);
+  errnum++;
+
+  cerr << "c = 0x" << hex << (unsigned int)c << " = " << c.to_string (SC_BIN) << "\n";
+  if (c.to_string (SC_BIN) != "0b011")
+    exit (errnum);
+  errnum++;
+
+  cerr << "d = 0x" << hex << (unsigned int)d << " = " << d.to_string (SC_BIN) << "\n";
+  if (d.to_string (SC_BIN) != "0b000000")
+    exit (errnum);
+  errnum++;
+
+  cerr << "e = 0x" << hex << (unsigned int)e << " = " << e.to_string (SC_BIN) << "\n";
+  if (e.to_string (SC_BIN) != "0b000010001")
+    exit (errnum);
+  errnum++;
+
+  cerr << "f = 0x" << hex << (unsigned int)f << " = " << f.to_string (SC_BIN) << "\n";
+  if (f.to_string (SC_BIN) != "0b00110100000")
+    exit (errnum);
+  errnum++;
+
+
+  cerr << "b,e = 0x" << hex << (unsigned int)(b,e) << " = " << (b,e).to_string (SC_BIN) << "\n";
+  if ((b,e).to_string (SC_BIN) != "0b011100010001")
+    exit (errnum);
+  errnum++;
+
+
+  cerr << "b,c,d,e,f = 0x" << hex << (unsigned int)(b,c,d,e,f) << " = " << (b,c,d,e,f).to_string (SC_BIN) << "\n";
+  if ((b,c,d,e,f).to_string (SC_BIN) != "0b01111100000000100010110100000")
+    exit (errnum);
+  errnum++;
+
+  a = b,c,d,e,f;
+  cerr << "a = b,c,d,e,f; a = 0x" << hex << (unsigned int) a << " = " << a.to_string (SC_BIN) << "\n";
+  if (a.to_string (SC_BIN) != "0b000000000000000000000000000000111")
+    exit (errnum);
+  errnum++;
+
+  sc_uint<3> tb = b.range (2,0);
+  cerr << "b.range (2,0) = 0x" << hex << (unsigned int) tb << " = " << tb.to_string (SC_BIN) << "\n";
+  if (tb.to_string (SC_BIN) != "0b0111")
+    exit (errnum);
+  errnum++;
+
+  sc_uint<5> te = e.range (5,1);
+  cerr << "e.range (5,1) = 0x" << hex << (unsigned int) te << " = " << te.to_string (SC_BIN) << "\n";
+  if (te.to_string (SC_BIN) != "0b001000")
+    exit (errnum);
+  errnum++;
+  
+  sc_uint<5> tf = f.range (9,5);
+  cerr << "f.range (9,5) = 0x" << hex << (unsigned int) tf << " = " << tf.to_string (SC_BIN) << "\n";
+  if (tf.to_string (SC_BIN) != "0b001101")
+    exit (errnum);
+  errnum++;
+
+  sc_uint<5> tf2 = f.range (8,4);
+  a = (tf2,b,c,d,e,f);
+  cerr << "a = f.range (7,3),b,c,d,e,f; a = 0x" << hex << (unsigned int) a << " = " << a.to_string (SC_BIN) << "\n";
+  if (a.to_string (SC_BIN) != "0b010101111100000000100010110100000")
+    exit (errnum);
+  errnum++;
+
+  return 0;
+}
+
Index: /latest/test_regression/05042006/Makefile
===================================================================
--- /latest/test_regression/05042006/Makefile	(revision 1)
+++ /latest/test_regression/05042006/Makefile	(revision 1)
@@ -0,0 +1,70 @@
+include ../env.mk
+
+SYSTEM    = system.cpp system2.cpp system3.cpp system4.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE_SVIEW = $(SYSTEM:.cpp=_socview.x)
+EXE       = ${EXE_SCASS}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE)
+
+test : main
+	@./system_systemcass.x --p ; \
+  if [ $$? -ne 6 ] ; then eval ${failcom} ; fi ; \
+  echo Bug detection OK
+	@./system2_systemcass.x --p || eval ${failcom}
+	@./system3_systemcass.x --p || eval ${failcom}
+	@./system4_systemcass.x --p || eval ${failcom}
+  
+	
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+%_socview.x : %_socview.o  $(SOCVIEW_LIB)
+	$(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_socview.cpp : %.cpp 
+	ln -s $*.cpp $*_socview.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITING2PORT -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITING2PORT -c $*_systemcass.cpp -o $*_systemcass.o
+
+%_socview.o : %_socview.cpp
+	$(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f results
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	-rm -rf generated_by_systemcass
+	
Index: /latest/test_regression/05042006/Makefile.deps
===================================================================
--- /latest/test_regression/05042006/Makefile.deps	(revision 1)
+++ /latest/test_regression/05042006/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/05042006/system.cpp
===================================================================
--- /latest/test_regression/05042006/system.cpp	(revision 1)
+++ /latest/test_regression/05042006/system.cpp	(revision 1)
@@ -0,0 +1,77 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+	sc_in_clk                       clk;
+  sc_in<int>                      i1;
+  sc_out<int>                     o1;
+  sc_out<bool>                    o2;
+
+  sc_signal<bool>                 reg1;
+  sc_signal<int>                  reg2;
+
+  void trans ()
+  {
+    reg1 = i1 & 1;
+    reg2 = i1;
+  }
+
+  void gen ()
+  {
+    o1 = reg2.read();
+    o2 = reg1.read();
+    o2 = reg1.read();
+    o1 = reg2.read() + 1;
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), 
+    o1("o1"),
+    o2("o2"),
+    reg1("reg1"),
+    reg2("reg2")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+  int errnum = 0;
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<int>     s01("s01");
+  sc_signal<int>     s02("s02");
+  sc_signal<bool>    s03("s03");
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.o1 (s02);
+  test1.o2 (s03);
+
+	// Init & run
+	sc_start (0);
+
+  sc_start (10);
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/05042006/system2.cpp
===================================================================
--- /latest/test_regression/05042006/system2.cpp	(revision 1)
+++ /latest/test_regression/05042006/system2.cpp	(revision 1)
@@ -0,0 +1,73 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+	sc_in_clk                       clk;
+  sc_in<int>                      i1;
+  sc_out<int>                     o1;
+  sc_out<bool>                    o2;
+
+  sc_signal<bool>                 reg1;
+  sc_signal<int>                  reg2;
+
+  void trans ()
+  {
+    reg1 = i1 & 1;
+    reg2 = i1;
+  }
+
+  void gen ()
+  {
+    o2 = reg1.read();
+    o1 = reg2.read() + 1;
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), 
+    o1("o1"),
+    o2("o2"),
+    reg1("reg1"),
+    reg2("reg2")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock           signal_clk("my_clock",1, 0.5);
+  sc_signal<int>     s01("s01");
+  sc_signal<int>     s02("s02");
+  sc_signal<bool>    s03("s03");
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.o1 (s02);
+  test1.o2 (s03);
+
+	// Init & run
+	sc_start (0);
+
+  sc_start (10);
+
+	return EXIT_SUCCESS;
+}
+
Index: /latest/test_regression/05042006/system3.cpp
===================================================================
--- /latest/test_regression/05042006/system3.cpp	(revision 1)
+++ /latest/test_regression/05042006/system3.cpp	(revision 1)
@@ -0,0 +1,78 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+	sc_in_clk                       clk;
+  sc_in<int>                      i1;
+  sc_out<int>                     o1;
+  sc_out<bool>                    o2;
+
+  sc_signal<bool>                 reg1;
+  sc_signal<int>                  reg2;
+
+  void trans ()
+  {
+    reg1 = i1 & 1;
+    reg2 = i1;
+  }
+
+  void gen ()
+  {
+    o2 = reg1.read();
+    o1 = reg2.read() + 1;
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), 
+    o1("o1"),
+    o2("o2"),
+    reg1("reg1"),
+    reg2("reg2")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock           signal_clk("my_clock",1, 0.5);
+  sc_signal<int>     s01("s01");
+  sc_signal<int>     s02("s02");
+  sc_signal<bool>    s03("s03");
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.o1 (s02);
+  test1.o2 (s03);
+
+	// Init & run
+	sc_start (0);
+
+  int i;
+  for (i = 0; i < 10; ++i)
+  {
+    sc_start (1);
+    ASSERT(test1.o1.read() == test1.reg2.read () + 1);
+  }
+
+	return EXIT_SUCCESS;
+}
+
Index: /latest/test_regression/05042006/system4.cpp
===================================================================
--- /latest/test_regression/05042006/system4.cpp	(revision 1)
+++ /latest/test_regression/05042006/system4.cpp	(revision 1)
@@ -0,0 +1,118 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct inner : sc_module {
+	sc_in_clk                       clk;
+  sc_in<int>                      i1;
+  sc_out<int>                     o1;
+  sc_signal<int>                  reg2;
+
+  void trans ()
+  {
+    reg2 = i1;
+  }
+
+  void gen ()
+  {
+    o1 = reg2.read() + 1;
+  }
+
+  SC_HAS_PROCESS(inner);
+	inner (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), 
+    o1("o1"),
+    reg2("reg2")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+	};
+};
+
+struct test : sc_module {
+  inner                           in;
+	sc_in_clk                       clk;
+  sc_in<int>                      i1;
+  sc_out<int>                     o1;
+  sc_out<bool>                    o2;
+
+  sc_signal<bool>                 reg1;
+
+  void trans ()
+  {
+    reg1 = i1 & 1;
+  }
+
+  void gen ()
+  {
+    o2 = reg1.read();
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n), 
+    in ("inner"),
+    clk("clk"),
+    i1("i1"), 
+    o1("o1"),
+    o2("o2"),
+    reg1("reg1")
+  {
+    in.clk (clk);
+    in.o1 (o1);
+    in.i1 (i1);
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock           signal_clk("my_clock",1, 0.5);
+  sc_signal<int>     s01("s01");
+  sc_signal<int>     s02("s02");
+  sc_signal<bool>    s03("s03");
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.o1 (s02);
+  test1.o2 (s03);
+
+	// Init & run
+	sc_start (0);
+
+  int i;
+  for (i = 0; i < 10; ++i)
+  {
+    sc_start (1);
+    s01 = i % 2;
+#if 0
+    cerr << "cycle #" << i << " : " 
+         << test1.o1.read() << " ; " 
+         <<test1.in.reg2.read () + 1 << endl;
+#endif
+    ASSERT(test1.o1.read() == test1.in.reg2.read () + 1);
+    ASSERT(test1.o1.read() == test1.in.o1.read ());
+  }
+
+	return EXIT_SUCCESS;
+}
+
Index: /latest/test_regression/05092005/Makefile
===================================================================
--- /latest/test_regression/05092005/Makefile	(revision 1)
+++ /latest/test_regression/05092005/Makefile	(revision 1)
@@ -0,0 +1,59 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : $(EXE_SCASS)
+	@for i in ${EXE_SCASS} ; do \
+    echo Testing $$i... ; \
+    $$i ; \
+    if [ $$? -ne 77 ] ; then eval $${failcom} ; fi ; \
+    echo Bug detection OK ; \
+  done;
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	-rm -rf generated_by_systemcass
+	
Index: /latest/test_regression/05092005/Makefile.deps
===================================================================
--- /latest/test_regression/05092005/Makefile.deps	(revision 1)
+++ /latest/test_regression/05092005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/05092005/system.cpp
===================================================================
--- /latest/test_regression/05092005/system.cpp	(revision 1)
+++ /latest/test_regression/05092005/system.cpp	(revision 1)
@@ -0,0 +1,41 @@
+#include "systemc.h"
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct hard : sc_module
+{
+  sc_in <bool> i;
+  sc_out<bool> o;
+  SC_HAS_PROCESS(hard);
+  hard(sc_module_name)
+  {
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  sc_signal<bool> s[5];
+  hard a("a");
+  hard b("b");
+  a.i (s[0]);
+  a.o (s[1]);
+  b.i (s[5]); // Wrong array index. This BUG should be detected.
+  b.o (s[2]);
+
+  sc_initialize ();
+  sc_start (1);
+
+  cerr << "Test KO.\n";
+  return 0;
+}
+
Index: /latest/test_regression/07052005/Makefile
===================================================================
--- /latest/test_regression/07052005/Makefile	(revision 1)
+++ /latest/test_regression/07052005/Makefile	(revision 1)
@@ -0,0 +1,58 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : ${LOG}
+	@echo Test OK.
+
+%.log : %_systemcass.x %_systemc.x
+	./$*_systemcass.x
+	touch $*.log
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	-rm -rf generated_by_systemcass
+	
Index: /latest/test_regression/07052005/Makefile.deps
===================================================================
--- /latest/test_regression/07052005/Makefile.deps	(revision 1)
+++ /latest/test_regression/07052005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/07052005/system.cpp
===================================================================
--- /latest/test_regression/07052005/system.cpp	(revision 1)
+++ /latest/test_regression/07052005/system.cpp	(revision 1)
@@ -0,0 +1,64 @@
+#include <systemc.h>
+#include <iostream>
+
+
+using namespace std;
+
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 0;
+ 
+  sc_uint<17> a;
+  sc_uint<3>  b;
+  sc_uint<2>  c1;
+  sc_uint<2>  c2;
+  sc_uint<5>  d;
+  sc_uint<7>  e;
+  sc_uint<1>  f;
+  sc_uint<16> g;
+  sc_uint<8>  h;
+
+  b  = 0x7;
+  c1 = 0x3;
+  c2 = 0x1;
+  d  = 0xA0;
+  e  = 0x11;
+  g  = 0xabcd;
+
+  // bit vector concatenation and boolean concatenation
+  a = (b,
+       (c1 | c2),
+       d & (b,c1),
+       e);
+  
+  f = b.range (0,0);
+
+  h = g.range (11,4);
+
+  errnum++;
+  cerr << "a = 0x" << hex << (unsigned int)a << " = " << a.to_string (SC_BIN) << "\n";
+  if (a.to_string (SC_BIN) != "0b000000111100010001")
+  {
+    exit (errnum);
+  }
+
+  errnum++;
+  cerr << "f = 0x" << hex << (unsigned int)f << " = " << f.to_string (SC_BIN) << "\n";
+  if (f.to_string (SC_BIN) != "0b01")
+  {
+    exit (errnum);
+  }
+
+  errnum++;
+  cerr << "h = 0x" << hex << (unsigned int)h << " = " << h.to_string (SC_BIN) << "\n";
+  if (h.to_string (SC_BIN) != "0b010111100")
+  {
+    exit (errnum);
+  }
+
+  cerr << "Test OK.\n";
+  return 0;
+}
+
Index: /latest/test_regression/07122006/Makefile
===================================================================
--- /latest/test_regression/07122006/Makefile	(revision 1)
+++ /latest/test_regression/07122006/Makefile	(revision 1)
@@ -0,0 +1,39 @@
+include ../env.mk
+
+EXE     = system.x system2.x
+OBJECTS = system.o system_gen_moore.o system_gen_mealy.o system_transition.o 
+OBJECTS2= system2.o
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : system.x system2.x
+	system.x > /dev/null ; \
+  if [ $$? -ne 0 ] ; then eval ${failcom} ; fi
+	@echo Test OK.
+	system2.x > /dev/null ; \
+	if [ $$? -ne 139 ] ; then eval ${failcom} ; fi
+
+system.x : ${OBJECTS} $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ ${OBJECTS} $(LFLAGS_SYSTEMCASS)
+
+system2.x : ${OBJECTS2} $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ ${OBJECTS2} $(LFLAGS_SYSTEMCASS)
+
+include Makefile.deps
+
+%.o : %.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*.cpp -o $*.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f *.txt 
+	-rm -f $(EXE) $(OBJECTS) $(OBJECTS2)
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -f *~
+	-rm -rf generated_by_systemcass .libs/
+	
Index: /latest/test_regression/07122006/Makefile.deps
===================================================================
--- /latest/test_regression/07122006/Makefile.deps	(revision 1)
+++ /latest/test_regression/07122006/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/07122006/system.cpp
===================================================================
--- /latest/test_regression/07122006/system.cpp	(revision 1)
+++ /latest/test_regression/07122006/system.cpp	(revision 1)
@@ -0,0 +1,43 @@
+#include <systemc.h>
+#include <signal.h>
+#include <iostream>
+#include <fstream>
+
+#include "test.h"
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : '" #x "' at cycle number " << sc_simulation_time () << "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+	
+
+int sc_main (int argc, char *argv[])
+{
+  sc_clock        clk("clk");
+  sc_signal<bool> resetn("resetn");
+  sc_signal<int>  in ("in");
+  sc_signal<int>  out("out");
+ 
+  test test("test");
+  test.clk    (clk);
+  test.resetn (resetn);
+
+  test.i (in);
+  test.o (out);
+
+  sc_initialize ();
+
+  resetn = false;
+  sc_start (3);
+  resetn = true;
+  sc_start (20);
+
+  cout << "Test OK.\n";
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/07122006/system2.cpp
===================================================================
--- /latest/test_regression/07122006/system2.cpp	(revision 1)
+++ /latest/test_regression/07122006/system2.cpp	(revision 1)
@@ -0,0 +1,92 @@
+#include <systemc.h>
+#include <signal.h>
+#include <iostream>
+#include <fstream>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : '" #x "' at cycle number " << sc_simulation_time () << "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct inner_test : public sc_module
+{
+  virtual void transition ()
+  {
+  };
+  inner_test(sc_module_name n)
+  {
+  };
+};
+
+struct test : public inner_test
+{
+  sc_in<bool>     clk;
+  sc_in<bool>     resetn;
+  sc_out<int>     o;
+  sc_in <int>     i;
+  sc_signal<int>  reg;
+
+  void transition ();
+  void gen_moore  ();
+  void gen_mealy  ();
+
+  SC_HAS_PROCESS(test);
+  test(sc_module_name n) : inner_test (n)
+  {
+    SC_METHOD(transition);
+    sensitive << clk.pos();
+    SC_METHOD(gen_moore);
+    sensitive << clk.neg();
+    SC_METHOD(gen_mealy);
+    sensitive << clk.neg() << i;
+  }
+};
+
+
+void test::transition ()
+{
+  std::cout << "transition\n";
+}
+
+void test::gen_moore ()
+{
+  std::cout << "gen_moore\n";
+}
+
+void test::gen_mealy ()
+{
+  std::cout << "gen_mealy\n";
+}
+
+
+
+int sc_main (int argc, char *argv[])
+{
+  sc_clock        clk("clk");
+  sc_signal<bool> resetn("resetn");
+  sc_signal<int>  in ("in");
+  sc_signal<int>  out("out");
+ 
+  test test("test");
+  test.clk    (clk);
+  test.resetn (resetn);
+
+  test.i (in);
+  test.o (out);
+
+  sc_initialize ();
+
+  resetn = false;
+  sc_start (3);
+  resetn = true;
+  sc_start (10);
+
+  cout << "Test OK.\n";
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/07122006/system_gen_mealy.cpp
===================================================================
--- /latest/test_regression/07122006/system_gen_mealy.cpp	(revision 1)
+++ /latest/test_regression/07122006/system_gen_mealy.cpp	(revision 1)
@@ -0,0 +1,9 @@
+#include "test.h"
+#include <iostream>
+
+
+void test::gen_mealy ()
+{
+  std::cout << "gen_mealy\n";
+}
+
Index: /latest/test_regression/07122006/system_gen_moore.cpp
===================================================================
--- /latest/test_regression/07122006/system_gen_moore.cpp	(revision 1)
+++ /latest/test_regression/07122006/system_gen_moore.cpp	(revision 1)
@@ -0,0 +1,8 @@
+#include "test.h"
+#include <iostream>
+
+void test::gen_moore ()
+{
+  std::cout << "gen_moore\n";
+}
+
Index: /latest/test_regression/07122006/system_transition.cpp
===================================================================
--- /latest/test_regression/07122006/system_transition.cpp	(revision 1)
+++ /latest/test_regression/07122006/system_transition.cpp	(revision 1)
@@ -0,0 +1,10 @@
+#include "test.h"
+#include <iostream>
+
+void test::transition ()
+{
+  std::cout << "transition\n";
+}
+
+
+
Index: /latest/test_regression/07122006/test.h
===================================================================
--- /latest/test_regression/07122006/test.h	(revision 1)
+++ /latest/test_regression/07122006/test.h	(revision 1)
@@ -0,0 +1,25 @@
+#include <systemc.h>
+
+struct test : public sc_module
+{
+  sc_in<bool>     clk;
+  sc_in<bool>     resetn;
+  sc_out<int>     o;
+  sc_in <int>     i;
+  sc_signal<int>  reg;
+
+  void transition ();
+  void gen_moore  ();
+  void gen_mealy  ();
+
+  SC_CTOR(test)
+  {
+    SC_METHOD(transition);
+    sensitive << clk.pos();
+    SC_METHOD(gen_moore);
+    sensitive << clk.neg();
+    SC_METHOD(gen_mealy);
+    sensitive << clk.neg() << i;
+  }
+};
+
Index: /latest/test_regression/08092005/Makefile
===================================================================
--- /latest/test_regression/08092005/Makefile	(revision 1)
+++ /latest/test_regression/08092005/Makefile	(revision 1)
@@ -0,0 +1,61 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : $(EXE_SCASS)
+	@for i in ${EXE_SCASS} ; do \
+    echo Testing $$i... ; \
+    $$i --p --t ; \
+    if [ $$? -ne 197 ] ; then eval $${failcom} ; fi ; \
+    (tail -n +3 reduced_signal_graph.dot | diff reduced_signal_graph_reference.dot -) || eval ${failcom} ; \
+    diff methodprocess_graph.dot methodprocess_graph_reference.dot || eval ${failcom} ; \
+    echo Bug detection OK ; \
+  done;
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/08092005/Makefile.deps
===================================================================
--- /latest/test_regression/08092005/Makefile.deps	(revision 1)
+++ /latest/test_regression/08092005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/08092005/system.cpp
===================================================================
--- /latest/test_regression/08092005/system.cpp	(revision 1)
+++ /latest/test_regression/08092005/system.cpp	(revision 1)
@@ -0,0 +1,89 @@
+#include "systemc.h"
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct hard : sc_module
+{
+  sc_in_clk    clk;
+  sc_in <int>  i1, i2;
+  sc_out<int>  o1, o2;
+
+  void f ()
+  {
+    o1 = i1;
+    o2 = i2;
+  }
+
+  SC_HAS_PROCESS(hard);
+  hard(sc_module_name) /*:
+    clk("clk"),
+    i1 ("i1"),
+    i2 ("i2"),
+    o1 ("o1"),
+    o2 ("o2")*/
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << i1 << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+    o1 (i1);
+    o2 (i2);
+#endif
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  sc_clock        clk("clk");
+  sc_signal<int>  s[10];
+  hard a("a");
+  hard b("b");
+  hard c("c");
+
+  a.clk (clk);
+  b.clk (clk);
+
+  a.i1 (s[0]);
+
+  a.o1 (s[1]);
+  b.i1 (s[1]);
+
+  b.o1 (s[2]);
+
+  b.i2 (s[3]);
+
+  b.o2 (s[4]);
+  a.i2 (s[4]);
+
+  a.o2 (s[5]);
+
+  c.i1 (s[6]);
+  c.o1 (s[7]);
+  c.i2 (s[8]);
+  c.o2 (s[9]);
+
+  sc_initialize ();
+ 
+  s[0] = 1;
+  s[3] = 1;
+
+  sc_start (1);
+
+  s[0] = 123;
+  s[3] = 321;
+
+  sc_start (1);
+
+  return 0;
+}
+
Index: /latest/test_regression/09092005/Makefile
===================================================================
--- /latest/test_regression/09092005/Makefile	(revision 1)
+++ /latest/test_regression/09092005/Makefile	(revision 1)
@@ -0,0 +1,64 @@
+include ../env.mk
+
+CFLAGS_SYSTEMC    = $(CFLAGS) -I$(SYSTEMC_INC)
+CFLAGS_SYSTEMCASS = $(CFLAGS) -I$(SYSTEMCASS_INC) -rdynamic #-Wno-deprecated
+LFLAGS_SYSTEMC    = $(LFLAGS) $(SYSTEMC_LIB)
+LFLAGS_SYSTEMCASS = $(LFLAGS) -rdynamic $(SYSTEMCASS_LIB) ${EFENCE}
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : $(EXE_SCASS)
+	@for i in ${EXE_SCASS} ; do \
+    echo Testing $$i... ; \
+    ./$$i --p ; \
+    if [ $$? -ne 197 ] ; then eval $${failcom} ; fi ; \
+    echo Bug detection OK ; \
+  done;
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/09092005/Makefile.deps
===================================================================
--- /latest/test_regression/09092005/Makefile.deps	(revision 1)
+++ /latest/test_regression/09092005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/09092005/system.cpp
===================================================================
--- /latest/test_regression/09092005/system.cpp	(revision 1)
+++ /latest/test_regression/09092005/system.cpp	(revision 1)
@@ -0,0 +1,31 @@
+#include "systemc.h"
+#include <iostream>
+
+
+using namespace std;
+
+#define ADDRSIZE   32
+#define OFFSETSIZE 6
+#define BPFSIZE    3
+
+#define ASSERT(x) { if (!(x)) { \
+                      cerr << "ASSERT : " #x \
+                              "\n"; \
+                      exit (errnum); \
+                    } else errnum++; \
+                  }
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 1;
+
+  sc_uint<ADDRSIZE> LINEADDR_MASK = ~(((sc_uint<ADDRSIZE>) ~0x0) >> (ADDRSIZE-OFFSETSIZE-BPFSIZE));
+//  cerr << "0x" << hex << (int)LINEADDR_MASK << "\n";
+  ASSERT(LINEADDR_MASK == 0xFFFFFE00);
+
+  cerr << "Test OK\n";
+
+  return 0;
+}
+
Index: /latest/test_regression/09092005b/Makefile
===================================================================
--- /latest/test_regression/09092005b/Makefile	(revision 1)
+++ /latest/test_regression/09092005b/Makefile	(revision 1)
@@ -0,0 +1,55 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : $(EXE_SCASS)
+	./system_systemcass.x || eval ${failcom} ; \
+	tail -n +8 trace_file.vcd | diff trace_file_reference.vcd - || eval ${failcom}
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf trace_file.vcd
+	
Index: /latest/test_regression/09092005b/Makefile.deps
===================================================================
--- /latest/test_regression/09092005b/Makefile.deps	(revision 1)
+++ /latest/test_regression/09092005b/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/09092005b/system.cpp
===================================================================
--- /latest/test_regression/09092005b/system.cpp	(revision 1)
+++ /latest/test_regression/09092005b/system.cpp	(revision 1)
@@ -0,0 +1,99 @@
+#include "systemc.h"
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct hard : sc_module
+{
+  sc_in_clk    clk;
+  sc_in <int>  i1, i2;
+  sc_out<int>  o1, o2;
+
+  void f ()
+  {
+    o1 = i1;
+    o2 = i2;
+  }
+
+  SC_HAS_PROCESS(hard);
+  hard(sc_module_name)
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << i1 << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+    o1 (i1);
+    o2 (i2);
+#endif
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  sc_clock        clk1("clk1");
+  sc_clock        clk2("clk2", 1, 0.5, 0, false);
+  sc_signal<int>  s[10];
+  hard a("a");
+  hard b("b");
+  hard c("c");
+
+  a.clk (clk1);
+  b.clk (clk2);
+  c.clk (clk2);
+
+  a.i1 (s[0]);
+
+  a.o1 (s[1]);
+  b.i1 (s[1]);
+
+  b.o1 (s[2]);
+
+  b.i2 (s[3]);
+
+  b.o2 (s[4]);
+  a.i2 (s[4]);
+
+  a.o2 (s[5]);
+
+  c.i1 (s[6]);
+  c.o1 (s[7]);
+  c.i2 (s[8]);
+  c.o2 (s[9]);
+
+ 	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file ("trace_file");
+	
+	/* clks waveforms are always useful */
+	sc_trace(system_trace_file, clk1, "clk1");
+	sc_trace(system_trace_file, clk2, "clk2");
+
+  /* others signals */ 
+  for (int i = 0; i < 10; ++i)
+    sc_trace(system_trace_file, s[i], sc_gen_unique_name ("s"));
+ 
+  /* initilization */
+  sc_initialize ();
+
+  s[0] = 1;
+  s[3] = 1;
+
+  sc_start (1);
+
+  s[0] = 123;
+  s[3] = 321;
+
+  sc_start (1);
+
+  return 0;
+}
+
Index: /latest/test_regression/09092005b/trace_file_reference.vcd
===================================================================
--- /latest/test_regression/09092005b/trace_file_reference.vcd	(revision 1)
+++ /latest/test_regression/09092005b/trace_file_reference.vcd	(revision 1)
@@ -0,0 +1,57 @@
+
+$timescale
+	1 ps
+$end
+
+$scope module SystemC $end
+$var wire    1  aaa  clk1       $end
+$var wire    1  aab  clk2       $end
+$var wire   32  aac  s25 [31:0]       $end
+$var wire   32  aad  s26 [31:0]       $end
+$var wire   32  aae  s27 [31:0]       $end
+$var wire   32  aaf  s28 [31:0]       $end
+$var wire   32  aag  s29 [31:0]       $end
+$var wire   32  aah  s30 [31:0]       $end
+$var wire   32  aai  s31 [31:0]       $end
+$var wire   32  aaj  s32 [31:0]       $end
+$var wire   32  aak  s33 [31:0]       $end
+$var wire   32  aal  s34 [31:0]       $end
+$upscope $end
+$enddefinitions  $end
+
+$comment
+All initial values are dumped below at time 0 sec = 0 timescale units.
+$end
+
+$dumpvars
+b1 aac
+b1 aad
+b1 aae
+b1 aaf
+b1 aag
+b1 aah
+b0 aai
+b0 aaj
+b0 aak
+b0 aal
+1aaa
+0aab
+$end
+
+#500
+0aaa
+1aab
+
+#1000
+b1111011 aac
+b1111011 aad
+b1111011 aae
+b101000001 aaf
+b101000001 aag
+b101000001 aah
+1aaa
+0aab
+
+#1500
+0aaa
+1aab
Index: /latest/test_regression/09092005c/Makefile
===================================================================
--- /latest/test_regression/09092005c/Makefile	(revision 1)
+++ /latest/test_regression/09092005c/Makefile	(revision 1)
@@ -0,0 +1,57 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : $(EXE_SCASS) ${EXE_SC}
+	@for i in ${EXE_SCASS} ${EXE_SC} ; do \
+    echo Testing $$i... ; \
+    ./$$i || eval ${failcom} ; \
+  done;
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/09092005c/Makefile.deps
===================================================================
--- /latest/test_regression/09092005c/Makefile.deps	(revision 1)
+++ /latest/test_regression/09092005c/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/09092005c/system.cpp
===================================================================
--- /latest/test_regression/09092005c/system.cpp	(revision 1)
+++ /latest/test_regression/09092005c/system.cpp	(revision 1)
@@ -0,0 +1,150 @@
+#include "systemc.h"
+#include <iostream>
+
+using namespace std;
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct observer : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_in<int>   i;
+
+  void f ()
+  {
+#if 0
+    cerr << i.read();
+#endif
+  }
+
+  SC_HAS_PROCESS(observer);
+  observer(sc_module_name) : clk ("clk"),
+                             i   ("i")
+
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+  }
+};
+
+struct generator : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_out<int>   o;
+
+  void f ()
+  {
+    int t = (int) (sc_time_stamp ().to_double());
+#if 0
+    cerr << "f = " << t << endl;
+#endif
+    o.write(t);
+  }
+
+  SC_HAS_PROCESS(generator);
+  generator(sc_module_name) : clk ("clk"),
+                              o   ("o")
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+  }
+};
+
+struct top_level : sc_module
+{
+  sc_in_clk    clk;
+  
+  sc_out<int>    o;
+//  sc_out<int>  io;
+//  sc_signal<int> s;
+//  sc_signal<int> s2;
+
+  generator g;
+  observer  obs1, obs2;
+  
+  SC_HAS_PROCESS(top_level);
+  top_level(sc_module_name) : g   ("generator"), 
+                              obs1("observer1"),
+                              obs2("observer2"),
+                              clk ("clk"),
+                              o   ("o")/*,
+                              s   ("s")*/
+  {
+    g.clk    (clk);
+    obs1.clk (clk);
+    obs2.clk (clk);
+
+    g.o   (o);
+    obs1.i(o);
+    obs2.i(o);
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 0;
+  sc_clock       clk("top_clk");
+  sc_signal<int> out("top_out");
+
+  top_level t("top_level");
+
+  t.clk (clk);
+  t.o   (out);
+
+#if 0
+ 	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file ("trace_file");
+	
+	/* clks waveforms are always useful */
+	sc_trace(system_trace_file, clk1, "clk1");
+	sc_trace(system_trace_file, clk2, "clk2");
+
+  /* others signals */ 
+  for (int i = 0; i < 10; ++i)
+    sc_trace(system_trace_file, s[i], sc_gen_unique_name ("s"));
+#endif
+
+  /* initilization */
+#if 0 
+  cout << "initilization...\n";
+#endif
+  sc_initialize ();
+
+  /* simulation */
+#if 0 
+  cout << "simulation...\n";
+#endif
+  int i = 0;
+  while (i++ < 5)
+  {
+   sc_start (1);
+   ASSERT(out.read() == t.obs1.i.read())
+   ASSERT(out.read() == t.obs2.i.read())
+  }
+
+#if 0 
+  cout << "\ndone.\n";  
+#endif
+
+  return 0;
+}
+
Index: /latest/test_regression/11062007/Makefile
===================================================================
--- /latest/test_regression/11062007/Makefile	(revision 1)
+++ /latest/test_regression/11062007/Makefile	(revision 1)
@@ -0,0 +1,69 @@
+include ../env.mk
+
+EXE_SCASS = system_systemcass.x
+EXE_SC    = system_systemc.x
+EXE       = ${EXE_SCASS}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+RESULTS   = systemcass_dynamiclink_10.txt systemcass_m_nodynamiclink_10.txt systemcass_a_nodynamiclink_10.txt systemcass_p_nodynamiclink_10.txt
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : ${RESULTS}
+	diff systemcass_dynamiclink_10.txt systemcass_m_nodynamiclink_10.txt || eval ${failcom}
+	diff systemcass_a_nodynamiclink_10.txt systemcass_p_nodynamiclink_10.txt || eval ${failcom}
+	diff systemcass_dynamiclink_10.txt systemcass_a_nodynamiclink_10.txt || eval ${failcom}
+	@echo Test OK.
+
+systemcass_a_nodynamiclink_10.txt : system_systemcass.x
+	((./system_systemcass.x --nobanner --a --nodynamiclink 10 ) | tail -n 5  > systemcass_a_nodynamiclink_10.txt) || eval ${failcom}
+
+systemcass_p_nodynamiclink_10.txt : system_systemcass.x
+	((./system_systemcass.x --nobanner --p --nodynamiclink 10 ) | tail -n 5 > systemcass_p_nodynamiclink_10.txt) || eval ${failcom}
+
+systemcass_m_nodynamiclink_10.txt : system_systemcass.x
+	((./system_systemcass.x --nobanner --m --nodynamiclink 10 ) | tail -n 5  > systemcass_m_nodynamiclink_10.txt) || eval ${failcom}
+
+systemcass_dynamiclink_10.txt : system_systemcass.x
+	((./system_systemcass.x --nobanner 10 ) | tail -n 5 > systemcass_dynamiclink_10.txt) || eval ${failcom}
+
+%.png : %.dot
+	dot -Tpng -o $*.png $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f signal_order.txt module_order.dot signal_graph.dot port_graph.dot
+	-rm -f module_graph.dot process_order.dot
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf tracesystem_systemcass.x.vcd tracesystem_systemc.x.vcd
+	-rm -rf ${RESULTS}
+	
Index: /latest/test_regression/11062007/Makefile.deps
===================================================================
--- /latest/test_regression/11062007/Makefile.deps	(revision 1)
+++ /latest/test_regression/11062007/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/11062007/system.cpp
===================================================================
--- /latest/test_regression/11062007/system.cpp	(revision 1)
+++ /latest/test_regression/11062007/system.cpp	(revision 1)
@@ -0,0 +1,138 @@
+#include <systemc.h>
+#include <signal.h>
+
+using namespace std;
+	
+struct A : sc_module {
+	sc_in_clk                       clk;
+	sc_out<bool>                    o1;
+
+	void eval () {
+    o1 = (rand()%2) == 0;
+	}
+
+	SC_CTOR (A) : clk ("clk"), o1("o1") {
+		SC_METHOD(eval);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+//		s1();
+#endif
+	};
+};
+
+struct B : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+	void eval2 () {
+    o2 = ~i2;
+	}
+
+	SC_CTOR (B) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+	};
+};
+
+struct C : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_out<bool>                    o1;
+
+	void eval1 () {
+    o1 = i1 ^ i2;
+	}
+
+	SC_CTOR (C) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1 << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+		o1(i2);
+#endif
+	};
+};
+
+struct D : sc_module {
+	sc_in_clk                       clk;
+	sc_out<bool>                    o1;
+
+	void eval () {
+    o1 = (rand()%2) == 0;
+	}
+
+	SC_CTOR (D) : clk ("clk"), o1("o1") {
+		SC_METHOD(eval);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+//		s1();
+#endif
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1("s1"),s2("s2"),s3("s3"),s4("s4"),s5("s5");
+
+	A      a("a");
+	B      b("b");
+	C      c("c");
+	D      d("d");
+	
+	a.clk         (signal_clk);
+	b.clk         (signal_clk);
+	c.clk         (signal_clk);
+	d.clk         (signal_clk);
+	
+	a.o1          (s1);
+	b.i1          (s1);
+		
+	d.o1          (s2);
+	c.i2          (s2);
+
+	b.o1          (s3);
+	c.i1          (s3);
+	
+	c.o1          (s4);
+	b.i2          (s4);
+	
+	b.o2          (s5);
+	
+	// Init & run
+	sc_initialize ();
+
+  if (argc == 1)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return EXIT_SUCCESS;
+  }
+
+  sc_start (atoi(argv[1]));
+
+  cout << s1.read() << endl;
+  cout << s2.read() << endl;
+  cout << s3.read() << endl;
+  cout << s4.read() << endl;
+  cout << s5.read() << endl;
+
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/14092005/Makefile
===================================================================
--- /latest/test_regression/14092005/Makefile	(revision 1)
+++ /latest/test_regression/14092005/Makefile	(revision 1)
@@ -0,0 +1,65 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : trace_file_scass.vcd trace_file_systemc.vcd trace_file_reference.vcd
+	-diff trace_file_systemc.vcd trace_file_scass.vcd
+	diff trace_file_reference.vcd trace_file_scass.vcd
+
+trace_file_scass.vcd : system_systemcass.x
+	./system_systemcass.x
+	tail -n +11 trace_file.vcd > trace_file_temp.vcd
+	mv trace_file_temp.vcd trace_file_scass.vcd
+
+trace_file_systemc.vcd : system_systemc.x
+	./system_systemc.x
+	tail -n +11 trace_file.vcd > trace_file_temp.vcd
+	mv trace_file_temp.vcd trace_file_systemc.vcd
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf trace_file.vcd
+	
Index: /latest/test_regression/14092005/Makefile.deps
===================================================================
--- /latest/test_regression/14092005/Makefile.deps	(revision 1)
+++ /latest/test_regression/14092005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/14092005/system.cpp
===================================================================
--- /latest/test_regression/14092005/system.cpp	(revision 1)
+++ /latest/test_regression/14092005/system.cpp	(revision 1)
@@ -0,0 +1,99 @@
+#include "systemc.h"
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct hard : sc_module
+{
+  sc_in_clk        clk;
+  sc_in<bool>      resetn;
+  sc_in <int>      i1;
+  sc_out<int>      o1;
+  sc_signal <int>  r1;
+
+  void fg ()
+  {
+    o1 = r1;
+  }
+
+  void ft ()
+  {
+    if (resetn.read())
+      r1 = i1;
+    else
+      r1 = 0x0;
+  }
+
+  SC_HAS_PROCESS(hard);
+  hard(sc_module_name)
+  {
+    SC_METHOD(ft);
+    dont_initialize();
+    sensitive << clk.pos();
+    SC_METHOD(fg);
+    dont_initialize();
+    sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 0;
+  sc_clock        clk1("clk1", 1, 0.5,0,true);
+  sc_signal<bool> resetn;
+  sc_signal<int>  s[10];
+  hard a("a");
+
+  a.clk    (clk1);
+  a.resetn (resetn);
+
+  a.i1 (s[0]);
+  a.o1 (s[1]);
+
+ 	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file ("trace_file");
+	
+	/* clks waveforms are always useful */
+	sc_trace(system_trace_file, resetn, "resetn");
+	sc_trace(system_trace_file, s[0],   "i1");
+	sc_trace(system_trace_file, s[1],   "o1");
+	sc_trace(system_trace_file, clk1,   "clk1");
+
+  /* initilization */
+  sc_initialize ();
+
+  s[0] = 0;
+  resetn = 0;
+
+  sc_start (5);
+
+  s[0] = 0x7B;
+  resetn = 1;
+
+  sc_start (1);
+
+  for (int i = 0; i < 10; i++)
+  {
+    s[0] = i;
+    sc_start (1);
+//    cout << i << " " << s[1].read() << " " << a.o1.read() << endl;
+    //ASSERT(((i > 0) && (s[1].read() == i - 1)) || ((i == 0) && (s[1].read() == 0x7B)));
+    ASSERT(s[1].read() == i);
+  }
+
+  cout << "Test OK\n";
+  return 0;
+}
+
Index: /latest/test_regression/14092005/trace_file_reference.vcd
===================================================================
--- /latest/test_regression/14092005/trace_file_reference.vcd	(revision 1)
+++ /latest/test_regression/14092005/trace_file_reference.vcd	(revision 1)
@@ -0,0 +1,135 @@
+$end
+
+$scope module SystemC $end
+$var wire    1  aaa  resetn       $end
+$var wire   32  aab  i1 [31:0]       $end
+$var wire   32  aac  o1 [31:0]       $end
+$var wire    1  aad  clk1       $end
+$upscope $end
+$enddefinitions  $end
+
+$comment
+All initial values are dumped below at time 0 sec = 0 timescale units.
+$end
+
+$dumpvars
+0aaa
+b0 aab
+b0 aac
+1aad
+$end
+
+#500
+0aad
+
+#1000
+1aad
+
+#1500
+0aad
+
+#2000
+1aad
+
+#2500
+0aad
+
+#3000
+1aad
+
+#3500
+0aad
+
+#4000
+1aad
+
+#4500
+0aad
+
+#5000
+1aaa
+b1111011 aab
+1aad
+
+#5500
+0aad
+
+#6000
+b0 aab
+b1111011 aac
+1aad
+
+#6500
+0aad
+
+#7000
+b1 aab
+b0 aac
+1aad
+
+#7500
+0aad
+
+#8000
+b10 aab
+b1 aac
+1aad
+
+#8500
+0aad
+
+#9000
+b11 aab
+b10 aac
+1aad
+
+#9500
+0aad
+
+#10000
+b100 aab
+b11 aac
+1aad
+
+#10500
+0aad
+
+#11000
+b101 aab
+b100 aac
+1aad
+
+#11500
+0aad
+
+#12000
+b110 aab
+b101 aac
+1aad
+
+#12500
+0aad
+
+#13000
+b111 aab
+b110 aac
+1aad
+
+#13500
+0aad
+
+#14000
+b1000 aab
+b111 aac
+1aad
+
+#14500
+0aad
+
+#15000
+b1001 aab
+b1000 aac
+1aad
+
+#15500
+0aad
Index: /latest/test_regression/15062006/Makefile
===================================================================
--- /latest/test_regression/15062006/Makefile	(revision 1)
+++ /latest/test_regression/15062006/Makefile	(revision 1)
@@ -0,0 +1,87 @@
+include ../env.mk
+
+SOCVIEW_INC    = ${SOCVIEW}/include
+SOCVIEW_LIB    = ${SOCVIEW}/lib-linux/libsystemc.a
+CFLAGS_SOCVIEW = ${CFLAGS} -DSOCVIEW -I${SOCVIEW_INC}
+LFLAGS_SOCVIEW = ${LFLAGS} -ltermcap -lreadline ${SOCVIEW_LIB}
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE_SVIEW = $(SYSTEM:.cpp=_socview.x)
+EXE       = ${EXE_SCASS} ${EXE_SVIEW} ${EXE_SC}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+TEST1_DAT = \
+           test_socview_1.dat test_socview_1_reloaded.dat   \
+           test_socview_2.dat test_socview_2_reloaded.dat   \
+           test_socview_3.dat test_socview_3_reloaded.dat   \
+           test_socview_3b.dat test_socview_3_reloaded_bis.dat   \
+           test_socview_4.dat test_socview_4_reloaded.dat   \
+           test_socview_5.dat test_socview_5_reloaded.dat   \
+           test_socview_6.dat test_socview_6_reloaded.dat   \
+           test_socview_7.dat test_socview_7_reloaded.dat   \
+           test_socview_8.dat test_socview_8_reloaded.dat   \
+           test_socview_9.dat test_socview_9_reloaded.dat   \
+           test_socview_10.dat test_socview_10_reloaded.dat \
+           test_socview_10b.dat \
+
+TEST2_DAT = test2_socview_10.dat \
+            test2_socview_24a.dat test2_socview_24b.dat test2_socview_24c.dat \
+            test2_socview_20a.dat test2_socview_20b.dat test2_systemcass_20.dat
+
+.SECONDARY:
+
+main : $(EXE)
+
+test : system_systemcass.x
+	./system_systemcass.x
+	
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+%_socview.x : %_socview.o  $(SOCVIEW_LIB)
+	$(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_socview.cpp : %.cpp 
+	ln -s $*.cpp $*_socview.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+%_socview.o : %_socview.cpp
+	$(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f results
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/15062006/Makefile.deps
===================================================================
--- /latest/test_regression/15062006/Makefile.deps	(revision 1)
+++ /latest/test_regression/15062006/Makefile.deps	(revision 1)
@@ -0,0 +1,99 @@
+
+system_systemcass.o: system_systemcass.cpp \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/systemc.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/global_functions.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_time.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/internal_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/casc.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_ver_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/systemcass_version_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_module_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/internal_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_object.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_sensitive.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/serialization_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_module_name.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/module_hierarchy_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_module_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_object.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/serialization_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_port_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_event.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_object.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_interface.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/internal_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/internal_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/port_dependency_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/fsm_rules.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_signal.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_time.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_object.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_interface.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/internal_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/fsm_rules.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_clock_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_signal.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_sensitive.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_time.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_unit.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_bit.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_logic.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_string.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_numrep.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_string.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_bv.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_logic.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_unsigned.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_logic.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_signed.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_uint.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/data_field.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/endianness.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_int.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_lv.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_logic.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_unsigned.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_signed.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_uint.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_int.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_biguint.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_bigint.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_nbdefs.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_trace_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/alias.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_module_ext.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_localvar.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_signal.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_vcd_trace.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_pat_trace.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/sc_fwd.h \
+  /users/cao/buchmann/systemcass/systemcass/i686-Linux.SLA4x/include/endianness.h
Index: /latest/test_regression/15062006/system.cpp
===================================================================
--- /latest/test_regression/15062006/system.cpp	(revision 1)
+++ /latest/test_regression/15062006/system.cpp	(revision 1)
@@ -0,0 +1,104 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+template<typename datatype>
+class module_base : public sc_module {
+public:
+	sc_in_clk                       clk;
+  sc_in<datatype>                 i1;
+  sc_out<datatype>                o1;
+  sc_signal<datatype>             reg1;
+
+private:
+  void trans_module_base ()
+  {
+  }
+  void gen_module_base ()
+  {
+    this->kikoo ();
+  }
+  virtual void kikoo () = 0;
+
+public:
+  SC_HAS_PROCESS(module_base);
+	module_base (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), 
+    o1("o1"),
+    reg1("reg1")
+  {
+		SC_METHOD(trans_module_base);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen_module_base);
+		sensitive << clk.neg();
+    dont_initialize();
+  }
+};
+
+template<typename datatype>
+class test : public module_base<datatype> {
+public:
+  sc_in<datatype>                      i2;
+  sc_out<datatype>                     o2;
+  sc_signal<datatype>                  reg2;
+
+private:
+  void trans ()
+  {
+  }
+
+  void gen ()
+  {
+  }
+  virtual void kikoo ()
+  { }
+
+public:
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : module_base<datatype> (n),
+    i2("i2"), 
+    o2("o2"),
+    reg2("reg2")
+  {
+		SC_METHOD(trans);
+		this->sensitive << this->clk.pos();
+    this->dont_initialize();
+		SC_METHOD(gen);
+		this->sensitive << this->clk.neg();
+    this->dont_initialize();
+	}
+};
+
+int sc_main (int argc, char *argv[])
+{
+  int errnum = 0;
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<int>     s01("s01"),
+                     s02("s02"),
+                     s03("s03"),
+                     s04("s04");
+
+  test<int> test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.i2 (s02);
+  test1.o1 (s03);
+  test1.o2 (s04);
+
+	// Init & run
+	sc_start (0);
+
+	return EXIT_SUCCESS;
+}
+
Index: /latest/test_regression/15092005/Makefile
===================================================================
--- /latest/test_regression/15092005/Makefile	(revision 1)
+++ /latest/test_regression/15092005/Makefile	(revision 1)
@@ -0,0 +1,68 @@
+include ../env.mk
+
+SYSTEM    = system.cpp system2.cpp system3.cpp system4.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : ${EXE_SCASS} ${EXE_SC}
+	@for i in ${EXE_SC} ; do \
+    echo Testing $$i... ; \
+    $$i || eval ${failcom} ; \
+  done
+	echo Testing system_systemcass.x ; system_systemcass.x || eval ${failcom} ; \
+	echo Testing system2_systemcass.x ;system2_systemcass.x || eval ${failcom} ; \
+	echo Testing system2_systemcass.x --p --d ;system2_systemcass.x --p --d ; \
+  if [ $$? -ne 37 ] ; then echo "Bug not detected" ; eval $${failcom} ; fi ; \
+  echo Bug detection OK ; \
+	echo Testing system3_systemcass.x ;system3_systemcass.x ; \
+	if [ $$? -ne 165 ] ; then echo "Bug not detected" ; eval $${failcom} ; fi ; \
+  echo Bug detection OK ; \
+	echo Testing system4_systemcass.x ;system4_systemcass.x ; \
+	if [ $$? -ne 101 ] ; then echo "Bug not detected" ; eval $${failcom} ; fi ; \
+  echo Bug detection OK ; \
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/15092005/Makefile.deps
===================================================================
--- /latest/test_regression/15092005/Makefile.deps	(revision 1)
+++ /latest/test_regression/15092005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/15092005/system.cpp
===================================================================
--- /latest/test_regression/15092005/system.cpp	(revision 1)
+++ /latest/test_regression/15092005/system.cpp	(revision 1)
@@ -0,0 +1,161 @@
+#include "systemc.h"
+#include <iostream>
+
+using namespace std;
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct observer : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_in<int>   i;
+
+  void f ()
+  {
+#if 0
+    cerr << i.read();
+#endif
+  }
+
+  SC_HAS_PROCESS(observer);
+  observer(sc_module_name) : clk ("clk"),
+                             i   ("i")
+
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+  }
+};
+
+struct generator : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_out<int>   o;
+  sc_in<int>    i;
+
+  void f ()
+  {
+    int t = (int) (sc_time_stamp ().to_double());
+#if 0
+    cerr << "f = " << t << endl;
+#endif
+    o.write(t);
+  }
+
+  SC_HAS_PROCESS(generator);
+  generator(sc_module_name) : clk ("clk"),
+                              o   ("o")
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.neg() << i;
+#ifdef SYSTEMCASS_SPECIFIC
+    o(i);
+#endif
+  }
+};
+
+struct top_level : sc_module
+{
+  sc_in_clk    clk;
+  
+  sc_out<int>    o;
+  sc_in <int>    i;
+//  sc_out<int>  io;
+//  sc_signal<int> s;
+//  sc_signal<int> s2;
+
+  generator g;
+  observer  obs1, obs2;
+  
+  SC_HAS_PROCESS(top_level);
+  top_level(sc_module_name) : g   ("generator"), 
+                              obs1("observer1"),
+                              obs2("observer2"),
+                              clk ("clk"),
+                              o   ("o"),
+                              i   ("i")/*,
+                              s   ("s")*/
+  {
+    g.clk    (clk);
+    obs1.clk (clk);
+    obs2.clk (clk);
+
+    g.i   (i);
+    g.o   (o);
+    obs1.i(o);
+    obs2.i(o);
+ 
+#ifdef SYSTEMCASS_SPECIFIC
+    o     (i); // wrong declaration that needs detection (no sc_method)
+#endif
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 0;
+  sc_clock       clk("top_clk");
+  sc_signal<int> out("top_out");
+  sc_signal<int> in ("top_in");
+
+  top_level t("top_level");
+
+  t.clk (clk);
+  t.o   (out);
+  t.i   (in);
+
+#if 0
+ 	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file ("trace_file");
+	
+	/* clks waveforms are always useful */
+	sc_trace(system_trace_file, clk1, "clk1");
+	sc_trace(system_trace_file, clk2, "clk2");
+
+  /* others signals */ 
+  for (int i = 0; i < 10; ++i)
+    sc_trace(system_trace_file, s[i], sc_gen_unique_name ("s"));
+#endif
+
+  /* initilization */
+#if 0 
+  cout << "initilization...\n";
+#endif
+  sc_initialize ();
+
+  /* simulation */
+#if 0 
+  cout << "simulation...\n";
+#endif
+  int i = 0;
+  while (i++ < 5)
+  {
+   sc_start (1);
+   ASSERT(out.read() == t.obs1.i.read())
+   ASSERT(out.read() == t.obs2.i.read())
+  }
+
+#if 0 
+  cout << "\ndone.\n";  
+#endif
+
+  return 0;
+}
+
Index: /latest/test_regression/15092005/system2.cpp
===================================================================
--- /latest/test_regression/15092005/system2.cpp	(revision 1)
+++ /latest/test_regression/15092005/system2.cpp	(revision 1)
@@ -0,0 +1,162 @@
+#include "systemc.h"
+#include <iostream>
+
+using namespace std;
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct observer : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_in<int>   i;
+
+  void f ()
+  {
+#if 0
+    cerr << i.read();
+#endif
+  }
+
+  SC_HAS_PROCESS(observer);
+  observer(sc_module_name) : clk ("clk"),
+                             i   ("i")
+
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+  }
+};
+
+struct generator : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_out<int>   o;
+  sc_in<int>    i;
+
+  void f ()
+  {
+    int t = (int) (sc_time_stamp ().to_double());
+#if 0
+    cerr << "f = " << t << endl;
+#endif
+    o.write(t);
+  }
+
+  SC_HAS_PROCESS(generator);
+  generator(sc_module_name) : clk ("clk"),
+                              o   ("o")
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+    o(i);
+#endif
+  }
+};
+
+struct top_level : sc_module
+{
+  sc_in_clk    clk;
+  
+  sc_out<int>    o;
+  sc_in <int>    i;
+//  sc_out<int>  io;
+//  sc_signal<int> s;
+//  sc_signal<int> s2;
+
+  generator g;
+  observer  obs1, obs2;
+  
+  SC_HAS_PROCESS(top_level);
+  top_level(sc_module_name) : g   ("generator"), 
+                              obs1("observer1"),
+                              obs2("observer2"),
+                              clk ("clk"),
+                              o   ("o"),
+                              i   ("i")/*,
+                              s   ("s")*/
+  {
+    g.clk    (clk);
+    obs1.clk (clk);
+    obs2.clk (clk);
+
+    g.i   (i);
+    g.o   (o);
+    obs1.i(o);
+    obs2.i(o);
+ 
+#ifdef SYSTEMCASS_SPECIFIC
+    o     (i);
+    g.o   (obs1.i); // <----- wrong declaration that needs detection
+#endif
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 0;
+  sc_clock       clk("top_clk");
+  sc_signal<int> out("top_out");
+  sc_signal<int> in ("top_in");
+
+  top_level t("top_level");
+
+  t.clk (clk);
+  t.o   (out);
+  t.i   (in);
+
+#if 0
+ 	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file ("trace_file");
+	
+	/* clks waveforms are always useful */
+	sc_trace(system_trace_file, clk1, "clk1");
+	sc_trace(system_trace_file, clk2, "clk2");
+
+  /* others signals */ 
+  for (int i = 0; i < 10; ++i)
+    sc_trace(system_trace_file, s[i], sc_gen_unique_name ("s"));
+#endif
+
+  /* initilization */
+#if 0 
+  cout << "initilization...\n";
+#endif
+  sc_initialize ();
+
+  /* simulation */
+#if 0 
+  cout << "simulation...\n";
+#endif
+  int i = 0;
+  while (i++ < 5)
+  {
+   sc_start (1);
+   ASSERT(out.read() == t.obs1.i.read())
+   ASSERT(out.read() == t.obs2.i.read())
+  }
+
+#if 0 
+  cout << "\ndone.\n";  
+#endif
+
+  return 0;
+}
+
Index: /latest/test_regression/15092005/system3.cpp
===================================================================
--- /latest/test_regression/15092005/system3.cpp	(revision 1)
+++ /latest/test_regression/15092005/system3.cpp	(revision 1)
@@ -0,0 +1,157 @@
+#include "systemc.h"
+#include <iostream>
+
+using namespace std;
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct observer : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_in<int>   i;
+
+  void f ()
+  {
+#if 0
+    cerr << i.read();
+#endif
+  }
+
+  SC_HAS_PROCESS(observer);
+  observer(sc_module_name) : clk ("clk"),
+                             i   ("i")
+
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+  }
+};
+
+struct generator : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_out<int>   o;
+  sc_in<int>    i;
+
+  void f ()
+  {
+    int t = (int) (sc_time_stamp ().to_double());
+#if 0
+    cerr << "f = " << t << endl;
+#endif
+    o.write(t);
+  }
+
+  SC_HAS_PROCESS(generator);
+  generator(sc_module_name) : clk ("clk"),
+                              o   ("o")
+  {
+#ifdef SYSTEMCASS_SPECIFIC
+    o(i);
+#endif
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.neg() << i;
+  }
+};
+
+struct top_level : sc_module
+{
+  sc_in_clk    clk;
+  
+  sc_out<int>    o;
+  sc_in <int>    i;
+//  sc_out<int>  io;
+//  sc_signal<int> s;
+//  sc_signal<int> s2;
+
+  generator g;
+  observer  obs1, obs2;
+  
+  SC_HAS_PROCESS(top_level);
+  top_level(sc_module_name) : g   ("generator"), 
+                              obs1("observer1"),
+                              obs2("observer2"),
+                              clk ("clk"),
+                              o   ("o"),
+                              i   ("i")/*,
+                              s   ("s")*/
+  {
+    g.clk    (clk);
+    obs1.clk (clk);
+    obs2.clk (clk);
+
+    g.i   (i);
+    g.o   (o);
+    obs1.i(o);
+    obs2.i(o);
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 0;
+  sc_clock       clk("top_clk");
+  sc_signal<int> out("top_out");
+  sc_signal<int> in ("top_in");
+
+  top_level t("top_level");
+
+  t.clk (clk);
+  t.o   (out);
+  t.i   (in);
+
+#if 0
+ 	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file ("trace_file");
+	
+	/* clks waveforms are always useful */
+	sc_trace(system_trace_file, clk1, "clk1");
+	sc_trace(system_trace_file, clk2, "clk2");
+
+  /* others signals */ 
+  for (int i = 0; i < 10; ++i)
+    sc_trace(system_trace_file, s[i], sc_gen_unique_name ("s"));
+#endif
+
+  /* initilization */
+#if 0 
+  cout << "initilization...\n";
+#endif
+  sc_initialize ();
+
+  /* simulation */
+#if 0 
+  cout << "simulation...\n";
+#endif
+  int i = 0;
+  while (i++ < 5)
+  {
+   sc_start (1);
+   ASSERT(out.read() == t.obs1.i.read())
+   ASSERT(out.read() == t.obs2.i.read())
+  }
+
+#if 0 
+  cout << "\ndone.\n";  
+#endif
+
+  return 0;
+}
+
Index: /latest/test_regression/15092005/system4.cpp
===================================================================
--- /latest/test_regression/15092005/system4.cpp	(revision 1)
+++ /latest/test_regression/15092005/system4.cpp	(revision 1)
@@ -0,0 +1,165 @@
+#include "systemc.h"
+#include <iostream>
+
+using namespace std;
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct observer : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_in<int>   i;
+
+  void f ()
+  {
+#if 0
+    cerr << i.read();
+#endif
+  }
+
+  SC_HAS_PROCESS(observer);
+  observer(sc_module_name) : clk ("clk"),
+                             i   ("i")
+
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+  }
+};
+
+struct generator : sc_module
+{
+  sc_in_clk    clk;
+
+  sc_out<int>   o;
+  sc_in<int>    i;
+
+  void f ()
+  {
+    int t = (int) (sc_time_stamp ().to_double());
+#if 0
+    cerr << "f = " << t << endl;
+#endif
+    o.write(t);
+  }
+
+  SC_HAS_PROCESS(generator);
+  generator(sc_module_name) : clk ("clk"),
+                              o   ("o")
+  {
+    SC_METHOD(f);
+    dont_initialize();
+    sensitive << clk.neg() << i;
+#ifdef SYSTEMCASS_SPECIFIC
+    o(i);
+#endif
+  }
+};
+
+struct top_level : sc_module
+{
+  sc_in_clk    clk;
+  
+  sc_out<int>    o;
+  sc_in <int>    i;
+//  sc_out<int>  io;
+//  sc_signal<int> s;
+//  sc_signal<int> s2;
+
+  generator g;
+  observer  obs1, obs2;
+  
+  SC_HAS_PROCESS(top_level);
+  top_level(sc_module_name) : g   ("generator"), 
+                              obs1("observer1"),
+                              obs2("observer2"),
+                              clk ("clk"),
+                              o   ("o"),
+                              i   ("i")/*,
+                              s   ("s")*/
+  {
+    g.clk    (clk);
+    obs1.clk (clk);
+    obs2.clk (clk);
+
+    g.i   (i);
+    g.o   (o);
+    obs1.i(o);
+    obs2.i(o);
+ 
+#ifdef SYSTEMCASS_SPECIFIC
+    o     (i); // wrong declaration that needs detection (no sc_method)
+#endif
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  int errnum = 0;
+  sc_clock       clk("top_clk");
+  sc_signal<int> out("top_out");
+  sc_signal<int> in ("top_in");
+
+  top_level t("top_level");
+
+  t.clk (clk);
+  t.o   (out);
+  t.i   (in);
+
+#ifdef SYSTEMCASS_SPECIFIC
+  t.o(t.i);
+#endif
+
+#if 0
+ 	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file ("trace_file");
+	
+	/* clks waveforms are always useful */
+	sc_trace(system_trace_file, clk1, "clk1");
+	sc_trace(system_trace_file, clk2, "clk2");
+
+  /* others signals */ 
+  for (int i = 0; i < 10; ++i)
+    sc_trace(system_trace_file, s[i], sc_gen_unique_name ("s"));
+#endif
+
+  /* initilization */
+#if 0 
+  cout << "initilization...\n";
+#endif
+  sc_initialize ();
+
+  /* simulation */
+#if 0 
+  cout << "simulation...\n";
+#endif
+  int i = 0;
+  while (i++ < 5)
+  {
+   sc_start (1);
+   ASSERT(out.read() == t.obs1.i.read())
+   ASSERT(out.read() == t.obs2.i.read())
+  }
+
+#if 0 
+  cout << "\ndone.\n";  
+#endif
+
+  return 0;
+}
+
Index: /latest/test_regression/16022007/Makefile
===================================================================
--- /latest/test_regression/16022007/Makefile	(revision 1)
+++ /latest/test_regression/16022007/Makefile	(revision 1)
@@ -0,0 +1,54 @@
+include ../env.mk
+
+EXE_SCASS = system_systemcass.x
+EXE_SC    = system_systemc.x
+EXE       = ${EXE_SCASS} ${EXE_SC}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : ${EXE}
+	((./system_systemcass.x 3 ) 2>&1 | grep "Cycle Accurate System Simulator") || eval ${failcom}
+	(./system_systemcass.x --nobanner 3 ) 2>&1 | grep "Cycle Accurate System Simulator" ; \
+  if [ $$? -ne 1 ] ; then eval ${failcom} ; fi
+	@echo Test OK.
+
+%.png : %.dot
+	dot -Tpng -o $*.png $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f signal_order.txt module_order.dot signal_graph.dot port_graph.dot
+	-rm -f module_graph.dot process_order.dot
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf tracesystem_systemcass.x.vcd tracesystem_systemc.x.vcd
+	
Index: /latest/test_regression/16022007/Makefile.deps
===================================================================
--- /latest/test_regression/16022007/Makefile.deps	(revision 1)
+++ /latest/test_regression/16022007/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/16022007/system.cpp
===================================================================
--- /latest/test_regression/16022007/system.cpp	(revision 1)
+++ /latest/test_regression/16022007/system.cpp	(revision 1)
@@ -0,0 +1,264 @@
+#include <systemc.h>
+#include <signal.h>
+
+using namespace std;
+	
+struct M_0i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_out<bool>                    o1;
+
+	void eval () {
+    o1 = (rand()%2) == 0;
+    printf ("M_0i1o::eval ()\n");
+	}
+
+	SC_CTOR (M_0i1o) : clk ("clk"), o1("o1") {
+		SC_METHOD(eval);
+		sensitive << clk.neg();
+	};
+};
+
+struct M_1i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_out<bool>                    o1;
+
+	void eval1 () {
+    o1 = ~i1;
+    printf ("M_1i1o::eval1 ()\n");
+	}
+
+	SC_CTOR (M_1i1o) : clk ("clk"), i1 ("i1"), o1("o1") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+	};
+};
+
+
+struct M_2i2o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval1 () {
+    o1 = ~i1;
+    printf ("M_2i2o::eval1 ()\n");
+	}
+	void eval2 () {
+    o2 = ~i2;
+    printf ("M_2i2o::eval2 ()\n");
+	}
+
+	SC_CTOR (M_2i2o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+	};
+};
+
+struct M_4i2o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_in<bool>                     i4;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval1 () {
+    o1 = ~i1;
+    printf ("M_4i2o::eval1 ()\n");
+	}
+	void eval2 () {
+    o2 = ~i2;
+    printf ("M_4i2o::eval2 ()\n");
+	}
+  void eval3 () {
+    cout << i3 << i4 << "\n";
+    printf ("M_4i2o::eval3 ()\n");
+  }
+
+	SC_CTOR (M_4i2o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2"),
+i3 ("i3"), i4 ("i4") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+		SC_METHOD(eval3);
+		sensitive << clk.pos();
+	};
+};
+
+struct M_4i3o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_in<bool>                     i4;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+	sc_out<bool>                    o3;
+
+	void eval1 () {
+    o1 = ~i1;
+    printf ("M_4i3o::eval1 ()\n");
+	}
+	void eval2 () {
+    o2 = ~i2;
+    printf ("M_4i3o::eval2 ()\n");
+	}
+  void eval3 () {
+    o3 = ~i3;
+    printf ("M_4i3o::eval3 ()\n");
+  }
+  void eval4 () {
+    cout << i4 << "\n";
+  }
+
+	SC_CTOR (M_4i3o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2"), i3 ("i3"), i4 ("i4"), o3 ("o3") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+		SC_METHOD(eval4);
+		sensitive << clk.pos();
+		// sensitive << i4;
+		SC_METHOD(eval3);
+		sensitive << clk.neg();
+		sensitive << i3;
+#ifdef SYSTEMCASS_SPECIFIC
+		o3(i3);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+	};
+};
+
+struct M_1i0o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+
+	void eval1 () {
+    cout << i1.read() << "\n";
+    printf ("M_1i0o::eval1 ()\n");
+	}
+
+	SC_CTOR (M_1i0o) : clk ("clk"), i1 ("i1") {
+		SC_METHOD(eval1);
+		sensitive << clk.pos();
+		// sensitive << i1;
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1 ("s01"),
+                               s2 ("s02"),
+                               s3 ("s03"),
+                               s4 ("s04"),
+                               s5 ("s05"),
+                               s6 ("s06"),
+                               s7 ("s07"),
+                               s8 ("s08"),
+                               s9 ("s09"),
+                               s10("s10"),
+                               s11("s11"),
+                               s12("s12"),
+                               s13("s13"),
+                               s14("s14"),
+                               s15("s15");
+                               
+
+	M_0i1o      a("a");
+	M_4i2o      b("b");
+	M_1i1o      c("c");
+	M_4i3o      d("d");
+	M_1i1o      e("e");
+	M_1i1o      f("f");
+	M_2i2o      g("g");
+	M_1i1o      h("h");
+	M_1i0o      i("i");
+	M_0i1o      j("j");
+	M_0i1o      k("k");
+	M_0i1o      l("l");
+	
+	a.clk         (signal_clk);
+	b.clk         (signal_clk);
+	c.clk         (signal_clk);
+	d.clk         (signal_clk);
+	e.clk         (signal_clk);
+	f.clk         (signal_clk);
+	g.clk         (signal_clk);
+	h.clk         (signal_clk);
+	i.clk         (signal_clk);
+	j.clk         (signal_clk);
+	k.clk         (signal_clk);
+	l.clk         (signal_clk);
+	
+	a.o1          (s1);
+	b.i1          (s1);
+		
+	b.o2          (s2);
+	c.i1          (s2);
+
+	c.o1          (s3);
+	d.i1          (s3);
+	
+	d.o1          (s4);
+	b.i3          (s4);
+	
+	d.o2          (s5);
+	b.i4          (s5);
+	
+	b.o1          (s6);
+	e.i1          (s6);
+	
+	e.o1          (s7);
+	f.i1          (s7);
+	
+	f.o1          (s8);
+	b.i2          (s8);
+	
+	d.o3          (s9);
+	g.i1          (s9);
+	
+	g.o1          (s10);
+	h.i1          (s10);
+	
+	h.o1          (s11);
+	d.i4          (s11);
+	
+	j.o1          (s12);
+	g.i2          (s12);
+	
+	g.o2          (s13);
+	i.i1          (s13);	
+	
+	l.o1          (s14);
+	d.i3          (s14);
+	
+	k.o1          (s15);
+	d.i2          (s15);
+
+	// Init & run
+	sc_initialize ();
+
+  if (argc == 1)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return 1;
+  }
+
+  sc_start (atoi(argv[1]));
+
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/16062005/Makefile
===================================================================
--- /latest/test_regression/16062005/Makefile	(revision 1)
+++ /latest/test_regression/16062005/Makefile	(revision 1)
@@ -0,0 +1,58 @@
+include ../env.mk
+
+SYSTEM    = system.cpp system2.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE_SCASS) 
+
+test : main
+	./system_systemcass.x object_hierarchy1.txt
+	diff object_hierarchy1_reference.txt object_hierarchy1.txt
+	./system2_systemcass.x object_hierarchy2.txt
+	diff object_hierarchy2_reference.txt object_hierarchy2.txt
+	@echo Test OK.
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/16062005/Makefile.deps
===================================================================
--- /latest/test_regression/16062005/Makefile.deps	(revision 1)
+++ /latest/test_regression/16062005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/16062005/object_hierarchy1_reference.txt
===================================================================
--- /latest/test_regression/16062005/object_hierarchy1_reference.txt	(revision 1)
+++ /latest/test_regression/16062005/object_hierarchy1_reference.txt	(revision 1)
@@ -0,0 +1,19 @@
+clock sc_clock
+top1.a.b.d1 sc_object
+top1.a.b.d2 sc_object
+top1.a.b.c sc_object
+top1.a.b sc_object
+top1.a.c sc_object
+top1.a sc_object
+top1.d sc_object
+top1 sc_object
+top2.b1.d1 sc_object
+top2.b1.d2 sc_object
+top2.b1.c sc_object
+top2.b1 sc_object
+top2.b2.d1 sc_object
+top2.b2.d2 sc_object
+top2.b2.c sc_object
+top2.b2 sc_object
+top2.c sc_object
+top2 sc_object
Index: /latest/test_regression/16062005/object_hierarchy2_reference.txt
===================================================================
--- /latest/test_regression/16062005/object_hierarchy2_reference.txt	(revision 1)
+++ /latest/test_regression/16062005/object_hierarchy2_reference.txt	(revision 1)
@@ -0,0 +1,11 @@
+Top level :
+s_clk, noname_0, noname_1, noname_2, noname_3, m, top_level_module
+
+Child of "m" :
+m.i_bool, m.i_int, m.i_sc_int17, m.o_int, m.o_sc_uint38, m.reg_lv8, m.reg_int, m.reg_uint, m.reg_sc_uint3, m.reg_sc_int31, m.noname_4, m.intern_module_of_moldu
+
+Child of "m.intern_module_of_moldu" :
+m.intern_module_of_moldu.noname_5
+
+Child of "top_level_module" :
+top_level_module.noname_6
Index: /latest/test_regression/16062005/system.cpp
===================================================================
--- /latest/test_regression/16062005/system.cpp	(revision 1)
+++ /latest/test_regression/16062005/system.cpp	(revision 1)
@@ -0,0 +1,161 @@
+#include "systemc.h"
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+#define ASSERT(x) { if (!(x)) { \
+                      cerr << "ASSERT : " #x \
+                           << " in function '" << __FUNCTION__  \
+                           << "'\n"; exit (-1); \
+                    } \
+                  }
+
+
+using namespace std;
+
+struct D : sc_module
+{
+  D (sc_module_name)
+  {
+  }
+};
+
+struct C : sc_module
+{
+  C (sc_module_name)
+  {
+  }
+};
+
+struct B : sc_module
+{
+  D d1;
+  D d2;
+  C c;
+  B (sc_module_name) : d1("d1"), d2("d2"), c("c")
+  {
+  }
+};
+
+struct A : sc_module
+{
+  B b;
+  C c;
+  A (sc_module_name) : b("b"), c("c")
+  {
+  }
+};
+
+struct top_level1 : sc_module
+{
+  A a;
+  D d;
+  top_level1(sc_module_name) : a("a"), d("d")
+  {
+  }
+};
+
+struct top_level2 : sc_module
+{
+  B b1;
+  B b2;
+  C c;
+  top_level2(sc_module_name) : b1("b1"), b2("b2"), c("c")
+  {
+  }
+};
+
+void
+dump_hierarchy (ostream &o, sc_object *obj)
+{
+  const std::vector<sc_object*> &children = obj->get_child_objects();
+  for (unsigned i = 0; i < children.size(); i++)
+    if (children[i])
+      dump_hierarchy (o,children[i]);
+  o << obj->name () << " " << obj->kind() << endl;
+}
+
+void
+dump_hierarchy (ostream &o, const std::vector<sc_object*> &obj_list)
+{
+  for (unsigned i = 0; i < obj_list.size(); i++)
+    dump_hierarchy(o, obj_list[i]);
+}
+
+int
+sc_main (int argc, char ** argv)
+{
+  if (argc < 2)
+  {
+    cerr << "Usage : " << argv[0] << " <filename>\n";
+    exit (-1);
+  }
+
+  sc_clock   clk("clock");
+  top_level1 top1("top1");
+  top_level2 top2("top2");
+ 
+  ofstream o;
+  o.open (argv[1],ios::out | ios::trunc);
+  if (o.is_open () == false)
+  {
+    cerr << "Unable to open '" << argv[1] << "'.\n";
+    return 1;
+  }
+
+  sc_start(0);
+  dump_hierarchy (o,sc_get_top_level_objects());
+  
+  ASSERT(sc_find_object("top2.b1"    ) == &top2.b1    );
+  ASSERT(sc_find_object("top2.b1.d1" ) == &top2.b1.d1 );
+  ASSERT(sc_find_object("top2.b1.d2" ) == &top2.b1.d2 );
+  ASSERT(sc_find_object("top2.b1.c"  ) == &top2.b1.c  );
+  ASSERT(sc_find_object("top2.b2"    ) == &top2.b2    );
+  ASSERT(sc_find_object("top2.c"     ) == &top2.c     );
+  ASSERT(sc_find_object("top1.a"     ) == &top1.a     );
+  ASSERT(sc_find_object("top1.d"     ) == &top1.d     ); 
+  ASSERT(sc_find_object("top1.a.b"   ) == &top1.a.b   );
+  ASSERT(sc_find_object("top1.a.b.d1") == &top1.a.b.d1);
+  ASSERT(sc_find_object("top1.a.b.d2") == &top1.a.b.d2);
+  ASSERT(sc_find_object("top1.a.b.c" ) == &top1.a.b.c );
+  ASSERT(sc_find_object("top1.a.c"   ) == &top1.a.c   );  
+  ASSERT(sc_find_object("top1.c"     ) == NULL        );
+  ASSERT(sc_find_object("top1"       )->get_parent_object() == NULL);
+  ASSERT(sc_find_object("top1.a"     )->get_parent_object() == &top1);
+  ASSERT(sc_find_object("top1.a.b"   )->get_parent_object() == &top1.a);
+  ASSERT(sc_find_object("top1.a.b.d2")->get_parent_object() == &top1.a.b);
+  ASSERT(sc_find_object("top1.d"     )->get_parent_object() == &top1);
+  ASSERT(sc_find_object("top2.b1"    )->get_parent_object() == &top2);
+  ASSERT(sc_find_object("top2.b2"    )->get_parent_object() == &top2);
+  ASSERT(sc_find_object("top2.c"     )->get_parent_object() == &top2);
+  ASSERT(sc_find_object("top2.b1.c"  )->get_parent_object() == &top2.b1);
+#if 0
+  o << sc_find_object("top2.b1.d1")->name() << endl;
+  o << sc_find_object("top2.b1.d2")->name() << endl;
+  o << sc_find_object("top2.b1.c")->name() << endl;
+  o << sc_find_object("top2.b2")->name() << endl;
+  o << sc_find_object("top2.c")->name() << endl;
+  o << sc_find_object("top1.a")->name() << endl;
+  o << sc_find_object("top1.d")->name() << endl;
+  o << sc_find_object("top1.a.b")->name() << endl;
+  o << sc_find_object("top1.a.b.d1")->name() << endl;
+  o << sc_find_object("top1.a.b.d2")->name() << endl;
+  o << sc_find_object("top1.a.b.c")->name() << endl;
+  o << sc_find_object("top1.a.c")->name() << endl;
+  if (sc_find_object("top1.c") == NULL)
+    o << "top1.c not found.\n";
+  else
+    o << "top1.c found.\n";
+  o << sc_find_object("top2.b1.c")->get_parent_object()->name () << endl;
+  o << sc_find_object("top1.a")->get_parent_object()->name () << endl;
+  if (top1.get_parent_object() == NULL)
+    o << "top1 has no parent.\n";
+  else
+    o << "top1 has a parent.\n";
+#endif
+
+  o.close ();
+
+  return 0;
+}
+
Index: /latest/test_regression/16062005/system2.cpp
===================================================================
--- /latest/test_regression/16062005/system2.cpp	(revision 1)
+++ /latest/test_regression/16062005/system2.cpp	(revision 1)
@@ -0,0 +1,105 @@
+#include "systemc.h"
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+using namespace std;
+
+struct intramoldu : sc_module
+{
+  sc_signal<long> reg_long;
+  intramoldu (sc_module_name n)
+  { }
+};
+
+
+struct moldu : sc_module
+{
+  sc_in<bool>             i_bool;
+  sc_in<int >             i_int;
+  sc_in<sc_int<17> >      i_sc_int17;
+  sc_out<int >            o_int;
+  sc_out<sc_uint<38> >    o_sc_uint38;
+  sc_signal<sc_lv<8> >    reg_lv8;
+  sc_signal<int>          reg_int;
+  sc_signal<unsigned int> reg_uint;
+  sc_signal<sc_uint<3> >  reg_sc_uint3;
+  sc_signal<sc_int<31> >  reg_sc_int31;
+  sc_in_clk               i_clk;
+  intramoldu              microarchitecture;
+  moldu (sc_module_name n) :
+                       microarchitecture ("intern_module_of_moldu"),
+                       i_bool     ("i_bool"),
+                       i_int      ("i_int"),
+                       i_sc_int17 ("i_sc_int17"),
+                       o_int      ("o_int"),
+                       o_sc_uint38("o_sc_uint38"),
+                       reg_lv8    ("reg_lv8"),
+                       reg_int    ("reg_int"),
+                       reg_uint   ("reg_uint"),
+                       reg_sc_uint3 ("reg_sc_uint3"),
+                       reg_sc_int31 ("reg_sc_int31")
+  {
+  }
+};
+
+void
+dump_objects (ofstream &o, const vector<sc_object*> &obj_list)
+{
+  for (unsigned i = 0; i < obj_list.size(); i++)
+  {
+    const sc_object *obj = obj_list[i];
+    if (obj == NULL)
+      o << "\nError : NULL pointer in objects list !\n"; 
+    else
+      o << ((i != 0)?", ":"") << obj->name ();
+  }
+  o << "\n";
+}
+
+int
+sc_main (int argc, char ** argv)
+{
+  if (argc < 2)
+  {
+    cerr << "Usage : " << argv[0] << " <filename>\n";
+    exit (-1);
+  }
+ 
+  ofstream o;
+  o.open (argv[1],ios::out | ios::trunc);
+  if (o.is_open () == false)
+  {
+    cerr << "Unable to open '" << argv[1] << "'.\n";
+    return 1;
+  }
+
+  sc_clock s_clk("s_clk");
+  sc_signal<bool>            s_bool;
+  sc_signal<int >            s_int;
+  sc_signal<sc_int<17> >     s_sc_int17;
+  sc_signal<sc_uint<38> >    s_sc_uint38;
+  moldu m("m");
+  intramoldu              microarchitecture("top_level_module");
+  m.i_clk      (s_clk);
+  m.i_bool     (s_bool);
+  m.i_int      (s_int);
+  m.i_sc_int17 (s_sc_int17);
+  m.o_int      (s_int);
+  m.o_sc_uint38(s_sc_uint38);
+
+  sc_start(0);
+  o << "Top level :\n";
+  dump_objects(o,sc_get_top_level_objects());
+  o << "\nChild of \"m\" :\n";
+  dump_objects(o,m.get_child_objects());
+  o << "\nChild of \"m.intern_module_of_moldu\" :\n";
+  dump_objects(o,m.microarchitecture.get_child_objects());
+  o << "\nChild of \"top_level_module\" :\n";
+  dump_objects(o,microarchitecture.get_child_objects());
+
+  o.close ();
+
+  return 0;
+}
+
Index: /latest/test_regression/16112005/Makefile
===================================================================
--- /latest/test_regression/16112005/Makefile	(revision 1)
+++ /latest/test_regression/16112005/Makefile	(revision 1)
@@ -0,0 +1,59 @@
+include ../env.mk
+
+SYSTEM    = system.cpp system2.cpp system3.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : main
+	./system_systemcass.x  || eval ${failcom} ; \
+	./system2_systemcass.x ; \
+   if [ $$? -ne 29 ] ; then eval ${failcom} ; fi ; \
+	./system3_systemcass.x ; \
+   if [ $$? -ne 29 ] ; then eval ${failcom} ; fi ; \
+	echo Test OK.
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -Wno-deprecated -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -Wno-deprecated -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/16112005/Makefile.deps
===================================================================
--- /latest/test_regression/16112005/Makefile.deps	(revision 1)
+++ /latest/test_regression/16112005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/16112005/system.cpp
===================================================================
--- /latest/test_regression/16112005/system.cpp	(revision 1)
+++ /latest/test_regression/16112005/system.cpp	(revision 1)
@@ -0,0 +1,69 @@
+#include "systemc.h"
+#include <iostream>
+#include <string>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+static int errnum = 0;
+
+struct internal_model : sc_module
+{
+  sc_in<int>     i;
+  sc_out<int>    o;
+	internal_model (sc_module_name n) : sc_module (n),
+    i("i"),
+		o("o")
+  {
+  }
+};
+
+struct model : sc_module
+{
+  sc_in<int>     i1, i2, i3;
+  sc_out<int>    o1, o2, o3;
+	sc_signal<int> r1, r2;
+  internal_model internal;
+	model (sc_module_name n) : sc_module (n),
+    i1("i1"), i2("i2"), i3("i3"),
+		o1("o1"), o2("o2"), o3("o3"),
+		r1("r1"), r2("r2"),
+    internal ("internal")
+  {
+    internal.o (o3);
+    internal.i (i3);
+//    o3 (internal.o);
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  model    m("m");
+  sc_clock clk ("clock");
+	sc_signal<int> s1("s1"), s2("s2"), s3("s3"), s4("s4");
+
+  m.i1 (s1);
+  m.i2 (s1); //
+  m.i3 (s1);
+  m.o1 (s4); //
+  m.o2 (s2);
+  m.o3 (s3);
+
+	sc_start (0);
+
+	sc_start (1);
+	sc_start (10);
+
+  cerr << "Test OK.\n";
+  return 0;
+}
+
Index: /latest/test_regression/16112005/system2.cpp
===================================================================
--- /latest/test_regression/16112005/system2.cpp	(revision 1)
+++ /latest/test_regression/16112005/system2.cpp	(revision 1)
@@ -0,0 +1,69 @@
+#include "systemc.h"
+#include <iostream>
+#include <string>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+static int errnum = 0;
+
+struct internal_model : sc_module
+{
+  sc_in<int>     i;
+  sc_out<int>    o;
+	internal_model (sc_module_name n) : sc_module (n),
+    i("i"),
+		o("o")
+  {
+  }
+};
+
+struct model : sc_module
+{
+  sc_in<int>     i1, i2, i3;
+  sc_out<int>    o1, o2, o3;
+	sc_signal<int> r1, r2;
+  internal_model internal;
+	model (sc_module_name n) : sc_module (n),
+    i1("i1"), i2("i2"), i3("i3"),
+		o1("o1"), o2("o2"), o3("o3"),
+		r1("r1"), r2("r2"),
+    internal ("internal")
+  {
+    internal.o (o3);
+    internal.i (i3);
+//    o3 (internal.o);
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  model    m("m");
+  sc_clock clk ("clock");
+	sc_signal<int> s1("s1"), s2("s2"), s3("s3"), s4("s4");
+
+  m.i1 (s1);
+//  m.i2 (s1); //
+  m.i3 (s1);
+  m.o1 (s4); //
+  m.o2 (s2);
+  m.o3 (s3);
+
+	sc_start (0);
+
+	sc_start (1);
+	sc_start (10);
+
+  cerr << "Test OK.\n";
+  return 0;
+}
+
Index: /latest/test_regression/16112005/system3.cpp
===================================================================
--- /latest/test_regression/16112005/system3.cpp	(revision 1)
+++ /latest/test_regression/16112005/system3.cpp	(revision 1)
@@ -0,0 +1,69 @@
+#include "systemc.h"
+#include <iostream>
+#include <string>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+static int errnum = 0;
+
+struct internal_model : sc_module
+{
+  sc_in<int>     i;
+  sc_out<int>    o;
+	internal_model (sc_module_name n) : sc_module (n),
+    i("i"),
+		o("o")
+  {
+  }
+};
+
+struct model : sc_module
+{
+  sc_in<int>     i1, i2, i3;
+  sc_out<int>    o1, o2, o3;
+	sc_signal<int> r1, r2;
+  internal_model internal;
+	model (sc_module_name n) : sc_module (n),
+    i1("i1"), i2("i2"), i3("i3"),
+		o1("o1"), o2("o2"), o3("o3"),
+		r1("r1"), r2("r2"),
+    internal ("internal")
+  {
+    internal.o (o3);
+    internal.i (i3);
+//    o3 (internal.o);
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  model    m("m");
+  sc_clock clk ("clock");
+	sc_signal<int> s1("s1"), s2("s2"), s3("s3"), s4("s4");
+
+  m.i1 (s1);
+  m.i2 (s1); //
+  m.i3 (s1);
+//  m.o1 (s4); //
+  m.o2 (s2);
+  m.o3 (s3);
+
+	sc_start (0);
+
+	sc_start (1);
+	sc_start (10);
+
+  cerr << "Test OK.\n";
+  return 0;
+}
+
Index: /latest/test_regression/16122005/Makefile
===================================================================
--- /latest/test_regression/16122005/Makefile	(revision 1)
+++ /latest/test_regression/16122005/Makefile	(revision 1)
@@ -0,0 +1,55 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE)
+
+test : main
+	./system_systemcass.x
+	diff results.txt results_reference.txt
+	@echo Test OK.
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f results.txt
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/16122005/Makefile.deps
===================================================================
--- /latest/test_regression/16122005/Makefile.deps	(revision 1)
+++ /latest/test_regression/16122005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/16122005/results_reference.txt
===================================================================
--- /latest/test_regression/16122005/results_reference.txt	(revision 1)
+++ /latest/test_regression/16122005/results_reference.txt	(revision 1)
@@ -0,0 +1,2 @@
+top2
+top2
Index: /latest/test_regression/16122005/system.cpp
===================================================================
--- /latest/test_regression/16122005/system.cpp	(revision 1)
+++ /latest/test_regression/16122005/system.cpp	(revision 1)
@@ -0,0 +1,92 @@
+#include "systemc.h"
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+#define ASSERT(x) { if (!(x)) { \
+                      cerr << "ASSERT : " #x \
+                           << " in function '" << __FUNCTION__  \
+                           << "'\n"; exit (-1); \
+                    } \
+                  }
+
+
+using namespace std;
+
+struct D : sc_module
+{
+  D (sc_module_name n)
+  {
+  }
+};
+
+struct C : sc_module
+{
+  C (sc_module_name n)
+  {
+  }
+};
+
+struct B : sc_module
+{
+  D d1;
+  D d2;
+  C c;
+  B (sc_module_name n) : d1("d1"), d2("d2"), c("c")
+  {
+  }
+};
+
+struct A : sc_module
+{
+  B b;
+  C c;
+  A (sc_module_name n) : b("b"), c("c")
+  {
+  }
+};
+
+struct top_level1 : sc_module
+{
+  A a;
+  D d;
+  top_level1(sc_module_name insname) : sc_module (insname), a("a"), d("d")
+  {
+    ASSERT(strcmp ((const char*)insname,"top1") == 0);
+  }
+};
+
+struct top_level2 : sc_module
+{
+  B b1;
+  B b2;
+  C c;
+  top_level2(sc_module_name insname) : b1("b1"), b2("b2"), c("c")
+  {
+    ASSERT(strcmp ((const char*)insname,"top2") == 0);
+    ofstream o;
+    o.open ("results.txt");
+    o << (const char*)insname << endl;
+    o << insname << endl;
+    o.close ();
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  if (argc < 1)
+  {
+    cerr << "Usage : " << argv[0] << "\n";
+    exit (-1);
+  }
+
+  sc_clock   clk("clock");
+  top_level1 top1("top1");
+  top_level2 top2("top2");
+
+  sc_start(0);
+
+  return 0;
+}
+
Index: /latest/test_regression/17022006/Makefile
===================================================================
--- /latest/test_regression/17022006/Makefile	(revision 1)
+++ /latest/test_regression/17022006/Makefile	(revision 1)
@@ -0,0 +1,87 @@
+include ../env.mk
+
+SOCVIEW_INC    = ${SOCVIEW}/include
+SOCVIEW_LIB    = ${SOCVIEW}/lib-linux/libsystemc.a
+CFLAGS_SOCVIEW = ${CFLAGS} -DSOCVIEW -I${SOCVIEW_INC}
+LFLAGS_SOCVIEW = ${LFLAGS} -ltermcap -lreadline ${SOCVIEW_LIB}
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE_SVIEW = $(SYSTEM:.cpp=_socview.x)
+EXE       = ${EXE_SCASS} ${EXE_SVIEW} ${EXE_SC}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+TEST1_DAT = \
+           test_socview_1.dat test_socview_1_reloaded.dat   \
+           test_socview_2.dat test_socview_2_reloaded.dat   \
+           test_socview_3.dat test_socview_3_reloaded.dat   \
+           test_socview_3b.dat test_socview_3_reloaded_bis.dat   \
+           test_socview_4.dat test_socview_4_reloaded.dat   \
+           test_socview_5.dat test_socview_5_reloaded.dat   \
+           test_socview_6.dat test_socview_6_reloaded.dat   \
+           test_socview_7.dat test_socview_7_reloaded.dat   \
+           test_socview_8.dat test_socview_8_reloaded.dat   \
+           test_socview_9.dat test_socview_9_reloaded.dat   \
+           test_socview_10.dat test_socview_10_reloaded.dat \
+           test_socview_10b.dat \
+
+TEST2_DAT = test2_socview_10.dat \
+            test2_socview_24a.dat test2_socview_24b.dat test2_socview_24c.dat \
+            test2_socview_20a.dat test2_socview_20b.dat test2_systemcass_20.dat
+
+.SECONDARY:
+
+main : $(EXE)
+
+test : system_systemc.x system_systemcass.x system_socview.x
+	./system_systemc.x ; ./system_systemcass.x ;	./system_socview.x
+	
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+%_socview.x : %_socview.o  $(SOCVIEW_LIB)
+	$(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_socview.cpp : %.cpp 
+	ln -s $*.cpp $*_socview.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+%_socview.o : %_socview.cpp
+	$(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f results
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/17022006/Makefile.deps
===================================================================
--- /latest/test_regression/17022006/Makefile.deps	(revision 1)
+++ /latest/test_regression/17022006/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/17022006/system.cpp
===================================================================
--- /latest/test_regression/17022006/system.cpp	(revision 1)
+++ /latest/test_regression/17022006/system.cpp	(revision 1)
@@ -0,0 +1,105 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+	sc_in_clk                       clk;
+  sc_in<int>                      i1;
+  sc_in<bool>                     i2[4];
+  sc_out<int>                     o1;
+  sc_out<char>                    o2[3];
+
+  sc_signal<bool>                 reg1;
+  sc_signal<int>                  reg2;
+  sc_signal<int>                  reg3;
+  sc_signal<int>                  reg4[10];
+
+  void trans ()
+  {
+  }
+
+  void gen ()
+  {
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), 
+    o1("o1"),
+    reg1("reg1"),
+    reg2("reg2"),
+    reg3("reg3")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+#ifdef NONAME_RENAME
+    char str[100];
+    for (int i=0; i<3; i++ ) {
+      sprintf(str,"o2_%d", i);
+      o2[i].rename(str);
+    }
+    for (int i=0; i<4; i++ ) {
+      sprintf(str,"i2_%d", i);
+      i2[i].rename(str);
+    }
+    for (int i=0; i<10; i++ ) {
+      sprintf(str,"reg4_%d", i);
+      reg4[i].rename(str);
+    }
+#endif
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+  int errnum = 0;
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<int>     s01("s01");
+  sc_signal<bool>    s02_0("s02_0"), s02_1("s02_1"), s02_2("s02_2"), s02_3("s02_3");
+  sc_signal<int>     s03("s03");
+  sc_signal<char>    s04_0("s04_0"),s04_1("s04_1"),s04_2("s04_2");
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.i2[0] (s02_0);
+  test1.i2[1] (s02_1);
+  test1.i2[2] (s02_2);
+  test1.i2[3] (s02_3);
+  test1.o1 (s03);
+  test1.o2[0] (s04_0);
+  test1.o2[1] (s04_1);
+  test1.o2[2] (s04_2);
+
+	// Init & run
+	sc_start (0);
+
+  ASSERT(strcmp (test1.o1.name (), "test1.o1") == 0);
+  ASSERT(strcmp (test1.i1.name (), "test1.i1") == 0);
+  ASSERT(strcmp (test1.reg1.name (), "test1.reg1") == 0);
+  ASSERT(strcmp (test1.reg2.basename (), "reg2") == 0);
+  ASSERT(strcmp (test1.reg3.name (), "test1.reg3") == 0);
+#if defined(NONAME_RENAME)
+  ASSERT(strcmp (test1.o2[1].name (), "test1.o2_1") == 0);
+  ASSERT(strcmp (test1.i2[2].basename (), "i2_2") == 0);
+  ASSERT(strcmp (test1.reg4[1].name (), "test1.reg4_1") == 0);
+  ASSERT(strcmp (test1.reg4[9].basename (), "reg4_9") == 0);
+#endif
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/17032005/Makefile
===================================================================
--- /latest/test_regression/17032005/Makefile	(revision 1)
+++ /latest/test_regression/17032005/Makefile	(revision 1)
@@ -0,0 +1,59 @@
+include ../env.mk
+
+EXE     = system_systemc.x system_systemcass.x
+OBJECTS = $(EXE:.x=.o)
+LINKS   = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : system-23.vcd system-23_reference.vcd
+	-diff system-23.vcd system-23_reference.vcd
+	@echo Test OK.
+
+system-23.vcd : system_systemcass.x
+	./system_systemcass.x system 23
+	tail -n +8 system.vcd > system-23.vcd
+	rm system.vcd
+
+system-23_reference.vcd : system_systemc.x
+	./system_systemc.x system 23
+	tail -n +8 system.vcd > system-23_reference.vcd
+	rm system.vcd
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f *.txt 
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -f *~
+	-rm -rf generated_by_systemcass
+	-rm -rf trace_system_systemcass.x.vcd trace_system_systemc.x.vcd
+	-rm -rf system-23.vcd
+	-rm -rf system_systemcass.log
+	
Index: /latest/test_regression/17032005/Makefile.deps
===================================================================
--- /latest/test_regression/17032005/Makefile.deps	(revision 1)
+++ /latest/test_regression/17032005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/17032005/system-23_reference.vcd
===================================================================
--- /latest/test_regression/17032005/system-23_reference.vcd	(revision 1)
+++ /latest/test_regression/17032005/system-23_reference.vcd	(revision 1)
@@ -0,0 +1,317 @@
+
+$timescale
+     1 ps
+$end
+
+$scope module SystemC $end
+$var wire    6  aaa  ui6 [5:0]  $end
+$var wire   16  aab  ui16 [15:0]  $end
+$var wire   31  aac  ui31 [30:0]  $end
+$var wire   32  aad  ui32 [31:0]  $end
+$var wire   64  aae  ui64 [63:0]  $end
+$var wire    6  aaf  i6 [5:0]  $end
+$var wire   16  aag  i16 [15:0]  $end
+$var wire   31  aah  i31 [30:0]  $end
+$var wire   32  aai  i32 [31:0]  $end
+$var wire   64  aaj  i64 [63:0]  $end
+$var wire    1  aak  clk       $end
+$upscope $end
+$enddefinitions  $end
+
+$comment
+All initial values are dumped below at time 0 sec = 0 timescale units.
+$end
+
+$dumpvars
+b1111 aaa
+b111111 aab
+b100000000 aac
+b1000010001 aad
+b10101011110011110001001000110100 aae
+b1111 aaf
+b111111 aag
+b10001000100010010001000100010 aah
+b1000011001000010100001100100001 aai
+b1000100010001001010101111001101 aaj
+1aak
+$end
+
+#500
+0aak
+
+#1000
+1aak
+
+#1500
+0aak
+
+#2000
+1aak
+
+#2500
+0aak
+
+#3000
+b11111 aaa
+b1111111 aab
+b1000000001 aac
+b10000100011 aad
+b101010111100111100010010001101001 aae
+b11111 aaf
+b1111111 aag
+b100010001000100100010001000101 aah
+b10000110010000101000011001000011 aai
+b10001000100010010101011110011011 aaj
+1aak
+
+#3500
+0aak
+
+#4000
+b111111 aaa
+b11111111 aab
+b10000000011 aac
+b100001000111 aad
+b1010101111001111000100100011010011 aae
+b111111 aaf
+b11111111 aag
+b1000100010001001000100010001011 aah
+b1100100001010000110010000111 aai
+b100010001000100101010111100110111 aaj
+1aak
+
+#4500
+0aak
+
+#5000
+b111111111 aab
+b100000000111 aac
+b1000010001111 aad
+b10101011110011110001001000110100111 aae
+b111111111 aag
+b1000100010010001000100010111 aah
+b11001000010100001100100001111 aai
+b1000100010001001010101111001101111 aaj
+1aak
+
+#5500
+0aak
+
+#6000
+b1111111111 aab
+b1000000001111 aac
+b10000100011111 aad
+b101010111100111100010010001101001111 aae
+b1111111111 aag
+b10001000100100010001000101111 aah
+b110010000101000011001000011111 aai
+b10001000100010010101011110011011111 aaj
+1aak
+
+#6500
+0aak
+
+#7000
+b11111111111 aab
+b10000000011111 aac
+b100001000111111 aad
+b1010101111001111000100100011010011111 aae
+b11111111111 aag
+b100010001001000100010001011111 aah
+b1100100001010000110010000111111 aai
+b100010001000100101010111100110111111 aaj
+1aak
+
+#7500
+0aak
+
+#8000
+b111111111111 aab
+b100000000111111 aac
+b1000010001111111 aad
+b10101011110011110001001000110100111111 aae
+b111111111111 aag
+b1000100010010001000100010111111 aah
+b11001000010100001100100001111111 aai
+b1000100010001001010101111001101111111 aaj
+1aak
+
+#8500
+0aak
+
+#9000
+b1111111111111 aab
+b1000000001111111 aac
+b10000100011111111 aad
+b101010111100111100010010001101001111111 aae
+b1111111111111 aag
+b1000100100010001000101111111 aah
+b10010000101000011001000011111111 aai
+b10001000100010010101011110011011111111 aaj
+1aak
+
+#9500
+0aak
+
+#10000
+b11111111111111 aab
+b10000000011111111 aac
+b100001000111111111 aad
+b1010101111001111000100100011010011111111 aae
+b11111111111111 aag
+b10001001000100010001011111111 aah
+b100001010000110010000111111111 aai
+b100010001000100101010111100110111111111 aaj
+1aak
+
+#10500
+0aak
+
+#11000
+b111111111111111 aab
+b100000000111111111 aac
+b1000010001111111111 aad
+b10101011110011110001001000110100111111111 aae
+b111111111111111 aag
+b100010010001000100010111111111 aah
+b1000010100001100100001111111111 aai
+b1000100010001001010101111001101111111111 aaj
+1aak
+
+#11500
+0aak
+
+#12000
+b1111111111111111 aab
+b1000000001111111111 aac
+b10000100011111111111 aad
+b101010111100111100010010001101001111111111 aae
+b1111111111111111 aag
+b1000100100010001000101111111111 aah
+b10000101000011001000011111111111 aai
+b10001000100010010101011110011011111111111 aaj
+1aak
+
+#12500
+0aak
+
+#13000
+b10000000011111111111 aac
+b100001000111111111111 aad
+b1010101111001111000100100011010011111111111 aae
+b1001000100010001011111111111 aah
+b1010000110010000111111111111 aai
+b100010001000100101010111100110111111111111 aaj
+1aak
+
+#13500
+0aak
+
+#14000
+b100000000111111111111 aac
+b1000010001111111111111 aad
+b10101011110011110001001000110100111111111111 aae
+b10010001000100010111111111111 aah
+b10100001100100001111111111111 aai
+b1000100010001001010101111001101111111111111 aaj
+1aak
+
+#14500
+0aak
+
+#15000
+b1000000001111111111111 aac
+b10000100011111111111111 aad
+b101010111100111100010010001101001111111111111 aae
+b100100010001000101111111111111 aah
+b101000011001000011111111111111 aai
+b10001000100010010101011110011011111111111111 aaj
+1aak
+
+#15500
+0aak
+
+#16000
+b10000000011111111111111 aac
+b100001000111111111111111 aad
+b1010101111001111000100100011010011111111111111 aae
+b1001000100010001011111111111111 aah
+b1010000110010000111111111111111 aai
+b100010001000100101010111100110111111111111111 aaj
+1aak
+
+#16500
+0aak
+
+#17000
+b100000000111111111111111 aac
+b1000010001111111111111111 aad
+b10101011110011110001001000110100111111111111111 aae
+b10001000100010111111111111111 aah
+b10100001100100001111111111111111 aai
+b1000100010001001010101111001101111111111111111 aaj
+1aak
+
+#17500
+0aak
+
+#18000
+b1000000001111111111111111 aac
+b10000100011111111111111111 aad
+b101010111100111100010010001101001111111111111111 aae
+b100010001000101111111111111111 aah
+b1000011001000011111111111111111 aai
+b10001000100010010101011110011011111111111111111 aaj
+1aak
+
+#18500
+0aak
+
+#19000
+b10000000011111111111111111 aac
+b100001000111111111111111111 aad
+b1010101111001111000100100011010011111111111111111 aae
+b1000100010001011111111111111111 aah
+b10000110010000111111111111111111 aai
+b100010001000100101010111100110111111111111111111 aaj
+1aak
+
+#19500
+0aak
+
+#20000
+b100000000111111111111111111 aac
+b1000010001111111111111111111 aad
+b10101011110011110001001000110100111111111111111111 aae
+b1000100010111111111111111111 aah
+b1100100001111111111111111111 aai
+b1000100010001001010101111001101111111111111111111 aaj
+1aak
+
+#20500
+0aak
+
+#21000
+b1000000001111111111111111111 aac
+b10000100011111111111111111111 aad
+b101010111100111100010010001101001111111111111111111 aae
+b10001000101111111111111111111 aah
+b11001000011111111111111111111 aai
+b10001000100010010101011110011011111111111111111111 aaj
+1aak
+
+#21500
+0aak
+
+#22000
+b10000000011111111111111111111 aac
+b100001000111111111111111111111 aad
+b1010101111001111000100100011010011111111111111111111 aae
+b100010001011111111111111111111 aah
+b110010000111111111111111111111 aai
+b100010001000100101010111100110111111111111111111111 aaj
+1aak
+
+#22500
+0aak
+
Index: /latest/test_regression/17032005/system.cpp
===================================================================
--- /latest/test_regression/17032005/system.cpp	(revision 1)
+++ /latest/test_regression/17032005/system.cpp	(revision 1)
@@ -0,0 +1,182 @@
+#include <systemc.h>
+#include <signal.h>
+#include <iostream>
+#include <fstream>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : '" #x "' at cycle number " << sc_simulation_time () << "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+	
+struct sc_test : public sc_module
+{
+  sc_in<bool>     clk;
+  sc_in<bool>     resetn;
+	sc_signal<sc_uint<6>     > ui6;
+	sc_signal<sc_uint<16>    > ui16;
+	sc_signal<sc_uint<31>    > ui31;
+	sc_signal<sc_uint<32>    > ui32;
+  sc_signal<sc_uint<64>    > ui64;
+  sc_signal<sc_int<6>      > i6;
+  sc_signal<sc_int<16>     > i16;
+  sc_signal<sc_int<31>     > i31;
+  sc_signal<sc_int<32>     > i32;
+  sc_signal<sc_int<64>     > i64;
+
+  unsigned int ui6_c_type :6;
+  sc_uint<6>   ui6_sc_uint;
+//  sc_signal<sc_biguint<64> > bui64;
+//  long long unsigned int     bui64b;
+//  sc_signal<sc_biguint<96> > bui96;
+
+  void eval ()
+  {
+    if (resetn == false)
+    {
+      ui6   = 0xF; ui6_c_type = 0xF; ui6_sc_uint = 0xF;
+      ui16  = 0x3F;
+      ui31  = 0x100;
+      ui32  = 0x211;
+      ui64  = 0xABCF1234;
+      i6    = 0xF;
+      i16   = 0x3F;
+      i31   = 0x11112222;
+      i32   = 0x43214321;
+      i64   = 0x4444abcd;
+//      bui64 = 0xFFFFFFFF;
+//      bui64b= 0xFFFFFFFF;
+//      bui96 = 0xABCDEF01;
+    } else {
+      cerr << hex << ui6.read () << " "
+                  << ui6_c_type  << " "
+                  << ui6_sc_uint << endl;
+      ASSERT(ui6.read() == ui6_c_type);
+      ui6         = (ui6   .read() * 2) + 1;
+      ui6_c_type  = (ui6_c_type    * 2) + 1;
+      ui6_sc_uint = (ui6_sc_uint   * 2) + 1;
+      ui16  = (ui16  .read() * 2) + 1;
+      ui31  = (ui31  .read() * 2) + 1;
+      ui32  = (ui32  .read() * 2) + 1;
+      ui64  = (ui64  .read() * 2) + 1;
+      i6    = (i6    .read() * 2) + 1;
+      i16   = (i16   .read() * 2) + 1;
+      i31   = (i31   .read() * 2) + 1;
+      i32   = (i32   .read() * 2) + 1;
+      i64   = (i64   .read() * 2) + 1;
+//      bui64 = (bui64 .read() * 2) + 1;
+//      bui64b= bui64b        * 2; bui64b= bui64b        + 1;
+//      bui96 = bui96 .read() * 2; bui96 = bui96 .read() + 1;
+#if 0
+      cout << bui64.read() << " "; 
+      cout << bui64b << "\n";
+#endif
+    }
+  }
+
+  SC_CTOR(sc_test)
+  {
+    SC_METHOD(eval);
+    dont_initialize ();
+    sensitive << clk.pos();
+  }
+};
+
+int sc_main (int argc, char *argv[])
+{
+	int errnum = 1;
+	cout << "Tests ok\n";
+  sc_clock        clk("clk");
+  sc_signal<bool> resetn("resetn");
+ 
+  sc_test test("test");
+  test.clk    (clk);
+  test.resetn (resetn);
+  
+	sc_trace_file *tf;
+
+  if (argc != 3)
+  {
+    cerr << "Usage : " << argv[0] << " <trace filename> <#cycles>\n";
+    exit (-1);
+  }
+
+  string trace_filename = argv[1];
+	tf = sc_create_vcd_trace_file (trace_filename.c_str());
+  sc_trace (tf, test.ui6  , "ui6"  );
+  sc_trace (tf, test.ui16 , "ui16" );
+  sc_trace (tf, test.ui31 , "ui31" );
+  sc_trace (tf, test.ui32 , "ui32" );
+  sc_trace (tf, test.ui64 , "ui64" );
+  sc_trace (tf, test.i6   , "i6"   );
+  sc_trace (tf, test.i16  , "i16"  );
+  sc_trace (tf, test.i31  , "i31"  );
+  sc_trace (tf, test.i32  , "i32"  );
+  sc_trace (tf, test.i64  , "i64"  );
+  sc_trace (tf, clk       , "clk"  );
+//  sc_trace (tf, test.bui64, "bui64");
+//  sc_trace (tf, test.bui96, "bui96");
+
+  ASSERT(test.ui6.read() == 0);
+  ASSERT(test.ui31.read() == 0);
+  ASSERT(test.ui32.read() == 0);
+  ASSERT(test.ui64.read() == 0);
+  ASSERT(test.i6.read() == 0);
+  ASSERT(test.i64.read() == 0);
+
+  sc_initialize ();
+
+  resetn = false;
+ 
+  sc_start (3);
+  resetn = true;
+  sc_start (20);
+
+  sc_close_vcd_trace_file (tf);
+
+#if 1
+  cout << "0x3f"            << " 0x" << hex << (unsigned int) (sc_uint<6> )test.ui6   << endl;
+  cout << "0x100fffff"      << " 0x" << hex << (unsigned int) (sc_uint<31>)test.ui31  << endl;  
+  cout << "0x211fffff"      << " 0x" << hex << (unsigned int) (sc_uint<32>)test.ui32  << endl;
+  cout << "0xabcf1234fffff" << " 0x" << hex << (long long unsigned int) (sc_uint<64>)test.ui64  << endl;  
+#endif
+  cerr << test.ui6.read() << endl;
+  union t {
+    int v1:3;
+    int v2;
+  };
+  t t1,t2;
+  t1.v1 = 7;
+  cerr << t1.v1 << " " << t1.v2 << endl;
+  t2.v2 = 7;
+  cerr << t2.v1 << " " << t2.v2 << endl;
+
+  ASSERT(test.ui6.read() == 0x3f);
+  ASSERT(test.ui31.read() == 0x100fffff);
+  ASSERT(test.ui32.read() == 0x211fffff);
+  long long unsigned int ui64_reference = 0xabcf1234;
+  ui64_reference <<= 20;
+  ui64_reference += 0xfffff;
+#if 0
+  cout << "0xffffffff"      << " 0x" << hex << (int) (sc_int<6>)test.i6    << endl;
+  cout << "0x222fffff"      << " 0x" << hex << (int) (sc_int<31>)test.i31   << endl;  
+  cout << "0x321fffff"      << " 0x" << hex << (int) (sc_int<32>)test.i32   << endl;
+  cout << "0x4444abcdfffff" << " 0x" << hex << (long long signed int) (sc_int<64>)test.i64   << endl;    
+#endif
+  ASSERT(test.ui64.read() == ui64_reference);
+  ASSERT(test.i6.read() == (sc_int<6>)~0);
+  ASSERT(test.i31.read() == 0x222fffff);
+  ASSERT(test.i32.read() == 0x321fffff)
+  long long signed int i64_reference = 0x4444abcd;
+  i64_reference <<= 20;
+  i64_reference += 0xfffff;
+  ASSERT(test.i64.read() == i64_reference);
+//  cout << "0x4294967315" << " 0x" << hex << test.bui64 << endl;    
+  cout << "Test OK.\n";
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/19042005/Makefile
===================================================================
--- /latest/test_regression/19042005/Makefile	(revision 1)
+++ /latest/test_regression/19042005/Makefile	(revision 1)
@@ -0,0 +1,59 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : system.vcd system_systemcass.x-60_reference.vcd
+	diff system.vcd system_systemcass.x-60_reference.vcd
+
+%.vcd : %_systemcass.x %_systemc.x
+	./$*_systemcass.x $*_systemcass.x 60
+	tail -n +8 $*_systemcass.x.vcd > $*.vcd
+	rm $*_systemcass.x.vcd
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/19042005/Makefile.deps
===================================================================
--- /latest/test_regression/19042005/Makefile.deps	(revision 1)
+++ /latest/test_regression/19042005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/19042005/system.cpp
===================================================================
--- /latest/test_regression/19042005/system.cpp	(revision 1)
+++ /latest/test_regression/19042005/system.cpp	(revision 1)
@@ -0,0 +1,241 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+//#define sc_inout sc_out
+	
+struct test : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<char>                     i2;
+	sc_in<int>                      i3;
+	sc_in<sc_int<4> >               i4;
+	sc_in<sc_uint<4> >              i5;
+	sc_in<sc_uint<64> >             i6;
+	sc_out<bool>                    o1;
+	sc_out<char>                    o2;
+	sc_out<int >                    o3;
+	sc_out<sc_int<4> >              o4;
+	sc_out<sc_uint<4> >             o5;
+	sc_out<sc_uint<64> >            o6;
+	sc_inout<sc_uint<64> >          io1;
+//	sc_inout<sc_signed >            io2;
+//	sc_inout<sc_unsigned >          io3;
+	sc_inout<sc_uint<32> >          io4;
+
+  sc_signal<bool>                 reg1;
+  sc_signal<char>                 reg2;
+  sc_signal<int>                  reg3;
+  sc_signal<sc_int<4> >           reg4;
+  sc_signal<sc_uint<4> >          reg5;
+  sc_signal<sc_uint<64> >         reg6;
+//  sc_signal<sc_signed   >         reg7;
+//  sc_signal<sc_unsigned >         reg8;
+  sc_signal<sc_uint<32> >         reg9;
+
+	void gen ()
+  {
+    o1  = reg1.read() ^ true;
+    o2  = reg2.read()+ 1;
+    o3  = reg3.read()+ 1;
+    o4  = reg4.read()+ 1;
+    o5  = reg5.read()+ 1;
+    o6  = reg6.read()+ 1;
+    io1 = reg6.read() * 2 + 1;
+    io4 = reg9.read()+ 1;
+  }
+
+  void trans ()
+  {
+//    io2 = io2.read() + 1;
+//    io3 = io3.read() + 1;
+        
+    reg1 = reg1.read() ^ 1;
+    reg2 = reg2.read() + 1;
+    reg3 = reg3.read() + 1;
+    reg4 = reg4.read() + 1;
+    reg5 = reg5.read() + 1;
+    reg6 = reg6.read() * 2 + 1;
+    reg9 = reg9.read() + 1;
+  }
+
+	SC_CTOR (test) : clk("clk"), i1("i1"), o1("o1"), i2("i2"), o2("o2"),
+i3("i3"), o3("o3"), io1("io1"), io4("io4"), reg9("reg9") {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+	};
+};
+
+
+
+int sc_main (int argc, char *argv[])
+{
+  int errnum = 0;
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1 ("s01"),
+                               s2 ("s02");
+  sc_signal<char>              s3 ("s03"),
+                               s4 ("s04");
+  sc_signal<int>               s5 ("s05"),
+                               s6 ("s06");
+  sc_signal<sc_int<4> >        s7 ("s07"),
+                               s8 ("s08");
+  sc_signal<sc_uint<4> >       s9 ("s09"),
+                               s10("s10");
+  sc_signal<sc_uint<64> >      s11("s11"),
+                               s12("s12"),
+                               s13("s13");
+//  sc_signal<sc_signed >        s14("s14");                     
+//  sc_signal<sc_unsigned >      s15("s15");
+  sc_signal<sc_uint<32> >      s16("s16");
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s1);
+  test1.o1 (s2);
+  test1.i2 (s3);
+  test1.o2 (s4);
+  test1.i3 (s5);
+  test1.o3 (s6);
+  test1.i4 (s7);
+  test1.o4 (s8);
+  test1.i5 (s9);
+  test1.o5 (s10);
+  test1.i6 (s11);
+  test1.o6 (s12);
+  test1.io1(s13);
+//  test1.io2(s14);
+//  test1.io3(s15);
+  test1.io4(s16);
+
+	/* Open trace file */
+	sc_trace_file *system_trace_file;
+	system_trace_file = sc_create_vcd_trace_file (argv[1]);
+	/* clk waveform is always useful */
+	sc_trace(system_trace_file, signal_clk, "clk");
+
+  bool   b1 = 0;
+  long   l1 = 0;
+
+#if 0
+#if defined(SYSTEMCASS_SPECIFIC)
+  uint64 ui1 = 0;
+  int64  i1  = 0;
+  sc_trace(system_trace_file, ui1, "ui1");
+  sc_trace(system_trace_file, i1,  "i1");
+#endif
+#endif
+
+  #define TRACE(x) sc_trace (system_trace_file, x, #x);
+  TRACE(b1);
+  TRACE(l1);
+  TRACE(test1.i1);
+  TRACE(test1.i2);
+  TRACE(test1.i3);
+  TRACE(test1.i4);
+  TRACE(test1.i5);
+  TRACE(test1.i6);
+  TRACE(test1.o1);
+  TRACE(test1.o2);
+  TRACE(test1.o3);
+  TRACE(test1.o4);
+  TRACE(test1.o5);
+  TRACE(test1.o6);
+  TRACE(test1.io1);
+//  TRACE(test1.io2);
+//  TRACE(test1.io3);
+  TRACE(test1.io4);
+  TRACE(s1);
+  TRACE(s2);
+  TRACE(s3);
+  TRACE(s4);
+  TRACE(s5);
+  TRACE(s6);
+  TRACE(s7);
+  TRACE(s8);
+  TRACE(s9);
+  TRACE(s10);
+  TRACE(s11);
+  TRACE(s12);
+  TRACE(s13);
+//  TRACE(s14);
+//  TRACE(s15);
+  TRACE(s16);
+  #undef TRACE
+
+	// Init & run
+	sc_initialize ();
+
+  ASSERT(test1.i1.read() == false);
+  ASSERT(s4.read() == 0);
+  ASSERT(s10.read() == 0);
+  ASSERT(s16.read() == 0);
+
+#if 0
+#if SYSTEMCASS_SPECIFIC
+  cerr << "s16 = " << hex << s16.get_pointer () << endl;
+  cerr << "io4 = " << hex << test1.io4.get_pointer () << endl;
+//  cerr << "io4(base) = " << hex << &(test1.io4.val) << endl;
+#endif
+  cerr << s16 << " " << test1.io4 << endl;
+  s16 = 5;
+  cerr << s16 << " " << test1.io4 << endl;
+  test1.io4 = 7;
+  cerr << s16 << " " << test1.io4 << endl;
+#endif
+
+  if (argc == 2)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return EXIT_SUCCESS;
+  }
+
+	int nb = atoi(argv[2]);
+  
+  sc_start (1);
+
+  b1 = 1;
+  l1 = 5;
+
+  int i;
+  for (i = 1; i < nb; ++i)
+  {
+    l1 += i;
+    b1 ^= true;
+    s1  = s1.read()  ^ true;
+    s3  = s3.read()  + 2;
+    s5  = s5.read()  + 3;
+    s7  = s7.read()  + 4;
+    s9  = s9.read()  + 5;
+    s11 = s11.read() + 6;
+#if 0
+#if defined(SYSTEMCASS_SPECIFIC)
+  ui1 <<= 1; ui1 += 1;
+  i1  <<= 1; i1 += 1;
+#endif
+#endif
+#if 0
+    cerr << test1.io4.read() << " " << s16.read() << "\n";
+#endif
+    sc_start (1);
+  }
+
+	sc_close_vcd_trace_file (system_trace_file);
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/19042005/system_systemcass.x-10_reference.vcd
===================================================================
--- /latest/test_regression/19042005/system_systemcass.x-10_reference.vcd	(revision 1)
+++ /latest/test_regression/19042005/system_systemcass.x-10_reference.vcd	(revision 1)
@@ -0,0 +1,316 @@
+
+$timescale
+	1 ps
+$end
+
+$scope module SystemC $end
+$var wire    1  aaa  clk       $end
+$var wire    1  aab  b1       $end
+$var wire   32  aac  l1       $end
+$var wire    1  aad  test1.i1       $end
+$var wire    8  aae  test1.i2       $end
+$var wire   32  aaf  test1.i3       $end
+$var wire    4  aag  test1.i4       $end
+$var wire    4  aah  test1.i5       $end
+$var wire   64  aai  test1.i6       $end
+$var wire    1  aaj  test1.o1       $end
+$var wire    8  aak  test1.o2       $end
+$var wire   32  aal  test1.o3       $end
+$var wire    4  aam  test1.o4       $end
+$var wire    4  aan  test1.o5       $end
+$var wire   64  aao  test1.o6       $end
+$var wire   64  aap  test1.io1       $end
+$var wire   32  aaq  test1.io4       $end
+$var wire    1  aar  s1       $end
+$var wire    1  aas  s2       $end
+$var wire    8  aat  s3       $end
+$var wire    8  aau  s4       $end
+$var wire   32  aav  s5       $end
+$var wire   32  aaw  s6       $end
+$var wire    4  aax  s7       $end
+$var wire    4  aay  s8       $end
+$var wire    4  aaz  s9       $end
+$var wire    4  aba  s10       $end
+$var wire   64  abb  s11       $end
+$var wire   64  abc  s12       $end
+$var wire   64  abd  s13       $end
+$var wire   32  abe  s16       $end
+$upscope $end
+$enddefinitions  $end
+
+$comment
+All initial values are dumped below at time 0 sec = 0 timescale units.
+$end
+
+$dumpvars
+0aab
+b101 aac
+0aad
+b0 aae
+b0 aaf
+b0 aag
+b0 aah
+b0 aai
+0aaj
+b0 aak
+b0 aal
+b0 aam
+b0 aan
+b0 aao
+b0 aap
+b0 aaq
+0aar
+0aas
+b0 aat
+b0 aau
+b0 aav
+b0 aaw
+b0 aax
+b0 aay
+b0 aaz
+b0 aba
+b0 abb
+b0 abc
+b0 abd
+b0 abe
+1aaa
+$end
+
+#500
+0aaa
+
+#1000
+1aab
+b110 aac
+b10 aak
+b10 aal
+b10 aam
+b10 aan
+b10 aao
+b10 aap
+b10 aaq
+b10 aau
+b10 aaw
+b10 aay
+b10 aba
+b10 abc
+b10 abd
+b10 abe
+1aaa
+
+#1500
+0aaa
+
+#2000
+0aab
+b1000 aac
+1aaj
+b11 aak
+b11 aal
+b11 aam
+b11 aan
+b11 aao
+b11 aap
+b11 aaq
+1aas
+b11 aau
+b11 aaw
+b11 aay
+b11 aba
+b11 abc
+b11 abd
+b11 abe
+1aaa
+
+#2500
+0aaa
+
+#3000
+1aab
+b1011 aac
+0aaj
+b100 aak
+b100 aal
+b100 aam
+b100 aan
+b100 aao
+b100 aap
+b100 aaq
+0aas
+b100 aau
+b100 aaw
+b100 aay
+b100 aba
+b100 abc
+b100 abd
+b100 abe
+1aaa
+
+#3500
+0aaa
+
+#4000
+0aab
+b1111 aac
+1aaj
+b101 aak
+b101 aal
+b101 aam
+b101 aan
+b101 aao
+b101 aap
+b101 aaq
+1aas
+b101 aau
+b101 aaw
+b101 aay
+b101 aba
+b101 abc
+b101 abd
+b101 abe
+1aaa
+
+#4500
+0aaa
+
+#5000
+1aab
+b10100 aac
+0aaj
+b110 aak
+b110 aal
+b110 aam
+b110 aan
+b110 aao
+b110 aap
+b110 aaq
+0aas
+b110 aau
+b110 aaw
+b110 aay
+b110 aba
+b110 abc
+b110 abd
+b110 abe
+1aaa
+
+#5500
+0aaa
+
+#6000
+0aab
+b11010 aac
+1aaj
+b111 aak
+b111 aal
+b111 aam
+b111 aan
+b111 aao
+b111 aap
+b111 aaq
+1aas
+b111 aau
+b111 aaw
+b111 aay
+b111 aba
+b111 abc
+b111 abd
+b111 abe
+1aaa
+
+#6500
+0aaa
+
+#7000
+1aab
+b100001 aac
+0aaj
+b1000 aak
+b1000 aal
+b1000 aam
+b1000 aan
+b1000 aao
+b1000 aap
+b1000 aaq
+0aas
+b1000 aau
+b1000 aaw
+b1000 aay
+b1000 aba
+b1000 abc
+b1000 abd
+b1000 abe
+1aaa
+
+#7500
+0aaa
+
+#8000
+0aab
+b101001 aac
+1aaj
+b1001 aak
+b1001 aal
+b1001 aam
+b1001 aan
+b1001 aao
+b1001 aap
+b1001 aaq
+1aas
+b1001 aau
+b1001 aaw
+b1001 aay
+b1001 aba
+b1001 abc
+b1001 abd
+b1001 abe
+1aaa
+
+#8500
+0aaa
+
+#9000
+1aab
+b110010 aac
+0aaj
+b1010 aak
+b1010 aal
+b1010 aam
+b1010 aan
+b1010 aao
+b1010 aap
+b1010 aaq
+0aas
+b1010 aau
+b1010 aaw
+b1010 aay
+b1010 aba
+b1010 abc
+b1010 abd
+b1010 abe
+1aaa
+
+#9500
+0aaa
+
+#10000
+1aaj
+b1011 aak
+b1011 aal
+b1011 aam
+b1011 aan
+b1011 aao
+b1011 aap
+b1011 aaq
+1aas
+b1011 aau
+b1011 aaw
+b1011 aay
+b1011 aba
+b1011 abc
+b1011 abd
+b1011 abe
+1aaa
+
+#10500
+0aaa
Index: /latest/test_regression/19042005/system_systemcass.x-60_reference.vcd
===================================================================
--- /latest/test_regression/19042005/system_systemcass.x-60_reference.vcd	(revision 1)
+++ /latest/test_regression/19042005/system_systemcass.x-60_reference.vcd	(revision 1)
@@ -0,0 +1,2223 @@
+
+$timescale
+	1 ps
+$end
+
+$scope module SystemC $end
+$var wire    1  aaa  clk       $end
+$var wire    1  aab  b1       $end
+$var wire   32  aac  l1 [31:0]       $end
+$var wire    1  aad  test1.i1       $end
+$var wire    8  aae  test1.i2 [7:0]       $end
+$var wire   32  aaf  test1.i3 [31:0]       $end
+$var wire    4  aag  test1.i4 [3:0]       $end
+$var wire    4  aah  test1.i5 [3:0]       $end
+$var wire   64  aai  test1.i6 [63:0]       $end
+$var wire    1  aaj  test1.o1       $end
+$var wire    8  aak  test1.o2 [7:0]       $end
+$var wire   32  aal  test1.o3 [31:0]       $end
+$var wire    4  aam  test1.o4 [3:0]       $end
+$var wire    4  aan  test1.o5 [3:0]       $end
+$var wire   64  aao  test1.o6 [63:0]       $end
+$var wire   64  aap  test1.io1 [63:0]       $end
+$var wire   32  aaq  test1.io4 [31:0]       $end
+$var wire    1  aar  s1       $end
+$var wire    1  aas  s2       $end
+$var wire    8  aat  s3 [7:0]       $end
+$var wire    8  aau  s4 [7:0]       $end
+$var wire   32  aav  s5 [31:0]       $end
+$var wire   32  aaw  s6 [31:0]       $end
+$var wire    4  aax  s7 [3:0]       $end
+$var wire    4  aay  s8 [3:0]       $end
+$var wire    4  aaz  s9 [3:0]       $end
+$var wire    4  aba  s10 [3:0]       $end
+$var wire   64  abb  s11 [63:0]       $end
+$var wire   64  abc  s12 [63:0]       $end
+$var wire   64  abd  s13 [63:0]       $end
+$var wire   32  abe  s16 [31:0]       $end
+$upscope $end
+$enddefinitions  $end
+
+$comment
+All initial values are dumped below at time 0 sec = 0 timescale units.
+$end
+
+$dumpvars
+0aab
+b0 aac
+0aad
+b0 aae
+b0 aaf
+b0 aag
+b0 aah
+b0 aai
+0aaj
+b0 aak
+b0 aal
+b0 aam
+b0 aan
+b0 aao
+b0 aap
+b0 aaq
+0aar
+0aas
+b0 aat
+b0 aau
+b0 aav
+b0 aaw
+b0 aax
+b0 aay
+b0 aaz
+b0 aba
+b0 abb
+b0 abc
+b0 abd
+b0 abe
+1aaa
+$end
+
+#500
+0aaa
+
+#1000
+b110 aac
+1aad
+b10 aae
+b11 aaf
+b100 aag
+b101 aah
+b110 aai
+b10 aak
+b10 aal
+b10 aam
+b10 aan
+b10 aao
+b11 aap
+b10 aaq
+1aar
+b10 aat
+b10 aau
+b11 aav
+b10 aaw
+b100 aax
+b10 aay
+b101 aaz
+b10 aba
+b110 abb
+b10 abc
+b11 abd
+b10 abe
+1aaa
+
+#1500
+0aaa
+
+#2000
+1aab
+b1000 aac
+0aad
+b100 aae
+b110 aaf
+b1000 aag
+b1010 aah
+b1100 aai
+1aaj
+b11 aak
+b11 aal
+b11 aam
+b11 aan
+b100 aao
+b111 aap
+b11 aaq
+0aar
+1aas
+b100 aat
+b11 aau
+b110 aav
+b11 aaw
+b1000 aax
+b11 aay
+b1010 aaz
+b11 aba
+b1100 abb
+b100 abc
+b111 abd
+b11 abe
+1aaa
+
+#2500
+0aaa
+
+#3000
+0aab
+b1011 aac
+1aad
+b110 aae
+b1001 aaf
+b1100 aag
+b1111 aah
+b10010 aai
+0aaj
+b100 aak
+b100 aal
+b100 aam
+b100 aan
+b1000 aao
+b1111 aap
+b100 aaq
+1aar
+0aas
+b110 aat
+b100 aau
+b1001 aav
+b100 aaw
+b1100 aax
+b100 aay
+b1111 aaz
+b100 aba
+b10010 abb
+b1000 abc
+b1111 abd
+b100 abe
+1aaa
+
+#3500
+0aaa
+
+#4000
+1aab
+b1111 aac
+0aad
+b1000 aae
+b1100 aaf
+b0 aag
+b100 aah
+b11000 aai
+1aaj
+b101 aak
+b101 aal
+b101 aam
+b101 aan
+b10000 aao
+b11111 aap
+b101 aaq
+0aar
+1aas
+b1000 aat
+b101 aau
+b1100 aav
+b101 aaw
+b0 aax
+b101 aay
+b100 aaz
+b101 aba
+b11000 abb
+b10000 abc
+b11111 abd
+b101 abe
+1aaa
+
+#4500
+0aaa
+
+#5000
+0aab
+b10100 aac
+1aad
+b1010 aae
+b1111 aaf
+b100 aag
+b1001 aah
+b11110 aai
+0aaj
+b110 aak
+b110 aal
+b110 aam
+b110 aan
+b100000 aao
+b111111 aap
+b110 aaq
+1aar
+0aas
+b1010 aat
+b110 aau
+b1111 aav
+b110 aaw
+b100 aax
+b110 aay
+b1001 aaz
+b110 aba
+b11110 abb
+b100000 abc
+b111111 abd
+b110 abe
+1aaa
+
+#5500
+0aaa
+
+#6000
+1aab
+b11010 aac
+0aad
+b1100 aae
+b10010 aaf
+b1000 aag
+b1110 aah
+b100100 aai
+1aaj
+b111 aak
+b111 aal
+b111 aam
+b111 aan
+b1000000 aao
+b1111111 aap
+b111 aaq
+0aar
+1aas
+b1100 aat
+b111 aau
+b10010 aav
+b111 aaw
+b1000 aax
+b111 aay
+b1110 aaz
+b111 aba
+b100100 abb
+b1000000 abc
+b1111111 abd
+b111 abe
+1aaa
+
+#6500
+0aaa
+
+#7000
+0aab
+b100001 aac
+1aad
+b1110 aae
+b10101 aaf
+b1100 aag
+b11 aah
+b101010 aai
+0aaj
+b1000 aak
+b1000 aal
+b1000 aam
+b1000 aan
+b10000000 aao
+b11111111 aap
+b1000 aaq
+1aar
+0aas
+b1110 aat
+b1000 aau
+b10101 aav
+b1000 aaw
+b1100 aax
+b1000 aay
+b11 aaz
+b1000 aba
+b101010 abb
+b10000000 abc
+b11111111 abd
+b1000 abe
+1aaa
+
+#7500
+0aaa
+
+#8000
+1aab
+b101001 aac
+0aad
+b10000 aae
+b11000 aaf
+b0 aag
+b1000 aah
+b110000 aai
+1aaj
+b1001 aak
+b1001 aal
+b1001 aam
+b1001 aan
+b100000000 aao
+b111111111 aap
+b1001 aaq
+0aar
+1aas
+b10000 aat
+b1001 aau
+b11000 aav
+b1001 aaw
+b0 aax
+b1001 aay
+b1000 aaz
+b1001 aba
+b110000 abb
+b100000000 abc
+b111111111 abd
+b1001 abe
+1aaa
+
+#8500
+0aaa
+
+#9000
+0aab
+b110010 aac
+1aad
+b10010 aae
+b11011 aaf
+b100 aag
+b1101 aah
+b110110 aai
+0aaj
+b1010 aak
+b1010 aal
+b1010 aam
+b1010 aan
+b1000000000 aao
+b1111111111 aap
+b1010 aaq
+1aar
+0aas
+b10010 aat
+b1010 aau
+b11011 aav
+b1010 aaw
+b100 aax
+b1010 aay
+b1101 aaz
+b1010 aba
+b110110 abb
+b1000000000 abc
+b1111111111 abd
+b1010 abe
+1aaa
+
+#9500
+0aaa
+
+#10000
+1aab
+b111100 aac
+0aad
+b10100 aae
+b11110 aaf
+b1000 aag
+b10 aah
+b111100 aai
+1aaj
+b1011 aak
+b1011 aal
+b1011 aam
+b1011 aan
+b10000000000 aao
+b11111111111 aap
+b1011 aaq
+0aar
+1aas
+b10100 aat
+b1011 aau
+b11110 aav
+b1011 aaw
+b1000 aax
+b1011 aay
+b10 aaz
+b1011 aba
+b111100 abb
+b10000000000 abc
+b11111111111 abd
+b1011 abe
+1aaa
+
+#10500
+0aaa
+
+#11000
+0aab
+b1000111 aac
+1aad
+b10110 aae
+b100001 aaf
+b1100 aag
+b111 aah
+b1000010 aai
+0aaj
+b1100 aak
+b1100 aal
+b1100 aam
+b1100 aan
+b100000000000 aao
+b111111111111 aap
+b1100 aaq
+1aar
+0aas
+b10110 aat
+b1100 aau
+b100001 aav
+b1100 aaw
+b1100 aax
+b1100 aay
+b111 aaz
+b1100 aba
+b1000010 abb
+b100000000000 abc
+b111111111111 abd
+b1100 abe
+1aaa
+
+#11500
+0aaa
+
+#12000
+1aab
+b1010011 aac
+0aad
+b11000 aae
+b100100 aaf
+b0 aag
+b1100 aah
+b1001000 aai
+1aaj
+b1101 aak
+b1101 aal
+b1101 aam
+b1101 aan
+b1000000000000 aao
+b1111111111111 aap
+b1101 aaq
+0aar
+1aas
+b11000 aat
+b1101 aau
+b100100 aav
+b1101 aaw
+b0 aax
+b1101 aay
+b1100 aaz
+b1101 aba
+b1001000 abb
+b1000000000000 abc
+b1111111111111 abd
+b1101 abe
+1aaa
+
+#12500
+0aaa
+
+#13000
+0aab
+b1100000 aac
+1aad
+b11010 aae
+b100111 aaf
+b100 aag
+b1 aah
+b1001110 aai
+0aaj
+b1110 aak
+b1110 aal
+b1110 aam
+b1110 aan
+b10000000000000 aao
+b11111111111111 aap
+b1110 aaq
+1aar
+0aas
+b11010 aat
+b1110 aau
+b100111 aav
+b1110 aaw
+b100 aax
+b1110 aay
+b1 aaz
+b1110 aba
+b1001110 abb
+b10000000000000 abc
+b11111111111111 abd
+b1110 abe
+1aaa
+
+#13500
+0aaa
+
+#14000
+1aab
+b1101110 aac
+0aad
+b11100 aae
+b101010 aaf
+b1000 aag
+b110 aah
+b1010100 aai
+1aaj
+b1111 aak
+b1111 aal
+b1111 aam
+b1111 aan
+b100000000000000 aao
+b111111111111111 aap
+b1111 aaq
+0aar
+1aas
+b11100 aat
+b1111 aau
+b101010 aav
+b1111 aaw
+b1000 aax
+b1111 aay
+b110 aaz
+b1111 aba
+b1010100 abb
+b100000000000000 abc
+b111111111111111 abd
+b1111 abe
+1aaa
+
+#14500
+0aaa
+
+#15000
+0aab
+b1111101 aac
+1aad
+b11110 aae
+b101101 aaf
+b1100 aag
+b1011 aah
+b1011010 aai
+0aaj
+b10000 aak
+b10000 aal
+b0 aam
+b0 aan
+b1000000000000000 aao
+b1111111111111111 aap
+b10000 aaq
+1aar
+0aas
+b11110 aat
+b10000 aau
+b101101 aav
+b10000 aaw
+b1100 aax
+b0 aay
+b1011 aaz
+b0 aba
+b1011010 abb
+b1000000000000000 abc
+b1111111111111111 abd
+b10000 abe
+1aaa
+
+#15500
+0aaa
+
+#16000
+1aab
+b10001101 aac
+0aad
+b100000 aae
+b110000 aaf
+b0 aag
+b0 aah
+b1100000 aai
+1aaj
+b10001 aak
+b10001 aal
+b1 aam
+b1 aan
+b10000000000000000 aao
+b11111111111111111 aap
+b10001 aaq
+0aar
+1aas
+b100000 aat
+b10001 aau
+b110000 aav
+b10001 aaw
+b0 aax
+b1 aay
+b0 aaz
+b1 aba
+b1100000 abb
+b10000000000000000 abc
+b11111111111111111 abd
+b10001 abe
+1aaa
+
+#16500
+0aaa
+
+#17000
+0aab
+b10011110 aac
+1aad
+b100010 aae
+b110011 aaf
+b100 aag
+b101 aah
+b1100110 aai
+0aaj
+b10010 aak
+b10010 aal
+b10 aam
+b10 aan
+b100000000000000000 aao
+b111111111111111111 aap
+b10010 aaq
+1aar
+0aas
+b100010 aat
+b10010 aau
+b110011 aav
+b10010 aaw
+b100 aax
+b10 aay
+b101 aaz
+b10 aba
+b1100110 abb
+b100000000000000000 abc
+b111111111111111111 abd
+b10010 abe
+1aaa
+
+#17500
+0aaa
+
+#18000
+1aab
+b10110000 aac
+0aad
+b100100 aae
+b110110 aaf
+b1000 aag
+b1010 aah
+b1101100 aai
+1aaj
+b10011 aak
+b10011 aal
+b11 aam
+b11 aan
+b1000000000000000000 aao
+b1111111111111111111 aap
+b10011 aaq
+0aar
+1aas
+b100100 aat
+b10011 aau
+b110110 aav
+b10011 aaw
+b1000 aax
+b11 aay
+b1010 aaz
+b11 aba
+b1101100 abb
+b1000000000000000000 abc
+b1111111111111111111 abd
+b10011 abe
+1aaa
+
+#18500
+0aaa
+
+#19000
+0aab
+b11000011 aac
+1aad
+b100110 aae
+b111001 aaf
+b1100 aag
+b1111 aah
+b1110010 aai
+0aaj
+b10100 aak
+b10100 aal
+b100 aam
+b100 aan
+b10000000000000000000 aao
+b11111111111111111111 aap
+b10100 aaq
+1aar
+0aas
+b100110 aat
+b10100 aau
+b111001 aav
+b10100 aaw
+b1100 aax
+b100 aay
+b1111 aaz
+b100 aba
+b1110010 abb
+b10000000000000000000 abc
+b11111111111111111111 abd
+b10100 abe
+1aaa
+
+#19500
+0aaa
+
+#20000
+1aab
+b11010111 aac
+0aad
+b101000 aae
+b111100 aaf
+b0 aag
+b100 aah
+b1111000 aai
+1aaj
+b10101 aak
+b10101 aal
+b101 aam
+b101 aan
+b100000000000000000000 aao
+b111111111111111111111 aap
+b10101 aaq
+0aar
+1aas
+b101000 aat
+b10101 aau
+b111100 aav
+b10101 aaw
+b0 aax
+b101 aay
+b100 aaz
+b101 aba
+b1111000 abb
+b100000000000000000000 abc
+b111111111111111111111 abd
+b10101 abe
+1aaa
+
+#20500
+0aaa
+
+#21000
+0aab
+b11101100 aac
+1aad
+b101010 aae
+b111111 aaf
+b100 aag
+b1001 aah
+b1111110 aai
+0aaj
+b10110 aak
+b10110 aal
+b110 aam
+b110 aan
+b1000000000000000000000 aao
+b1111111111111111111111 aap
+b10110 aaq
+1aar
+0aas
+b101010 aat
+b10110 aau
+b111111 aav
+b10110 aaw
+b100 aax
+b110 aay
+b1001 aaz
+b110 aba
+b1111110 abb
+b1000000000000000000000 abc
+b1111111111111111111111 abd
+b10110 abe
+1aaa
+
+#21500
+0aaa
+
+#22000
+1aab
+b100000010 aac
+0aad
+b101100 aae
+b1000010 aaf
+b1000 aag
+b1110 aah
+b10000100 aai
+1aaj
+b10111 aak
+b10111 aal
+b111 aam
+b111 aan
+b10000000000000000000000 aao
+b11111111111111111111111 aap
+b10111 aaq
+0aar
+1aas
+b101100 aat
+b10111 aau
+b1000010 aav
+b10111 aaw
+b1000 aax
+b111 aay
+b1110 aaz
+b111 aba
+b10000100 abb
+b10000000000000000000000 abc
+b11111111111111111111111 abd
+b10111 abe
+1aaa
+
+#22500
+0aaa
+
+#23000
+0aab
+b100011001 aac
+1aad
+b101110 aae
+b1000101 aaf
+b1100 aag
+b11 aah
+b10001010 aai
+0aaj
+b11000 aak
+b11000 aal
+b1000 aam
+b1000 aan
+b100000000000000000000000 aao
+b111111111111111111111111 aap
+b11000 aaq
+1aar
+0aas
+b101110 aat
+b11000 aau
+b1000101 aav
+b11000 aaw
+b1100 aax
+b1000 aay
+b11 aaz
+b1000 aba
+b10001010 abb
+b100000000000000000000000 abc
+b111111111111111111111111 abd
+b11000 abe
+1aaa
+
+#23500
+0aaa
+
+#24000
+1aab
+b100110001 aac
+0aad
+b110000 aae
+b1001000 aaf
+b0 aag
+b1000 aah
+b10010000 aai
+1aaj
+b11001 aak
+b11001 aal
+b1001 aam
+b1001 aan
+b1000000000000000000000000 aao
+b1111111111111111111111111 aap
+b11001 aaq
+0aar
+1aas
+b110000 aat
+b11001 aau
+b1001000 aav
+b11001 aaw
+b0 aax
+b1001 aay
+b1000 aaz
+b1001 aba
+b10010000 abb
+b1000000000000000000000000 abc
+b1111111111111111111111111 abd
+b11001 abe
+1aaa
+
+#24500
+0aaa
+
+#25000
+0aab
+b101001010 aac
+1aad
+b110010 aae
+b1001011 aaf
+b100 aag
+b1101 aah
+b10010110 aai
+0aaj
+b11010 aak
+b11010 aal
+b1010 aam
+b1010 aan
+b10000000000000000000000000 aao
+b11111111111111111111111111 aap
+b11010 aaq
+1aar
+0aas
+b110010 aat
+b11010 aau
+b1001011 aav
+b11010 aaw
+b100 aax
+b1010 aay
+b1101 aaz
+b1010 aba
+b10010110 abb
+b10000000000000000000000000 abc
+b11111111111111111111111111 abd
+b11010 abe
+1aaa
+
+#25500
+0aaa
+
+#26000
+1aab
+b101100100 aac
+0aad
+b110100 aae
+b1001110 aaf
+b1000 aag
+b10 aah
+b10011100 aai
+1aaj
+b11011 aak
+b11011 aal
+b1011 aam
+b1011 aan
+b100000000000000000000000000 aao
+b111111111111111111111111111 aap
+b11011 aaq
+0aar
+1aas
+b110100 aat
+b11011 aau
+b1001110 aav
+b11011 aaw
+b1000 aax
+b1011 aay
+b10 aaz
+b1011 aba
+b10011100 abb
+b100000000000000000000000000 abc
+b111111111111111111111111111 abd
+b11011 abe
+1aaa
+
+#26500
+0aaa
+
+#27000
+0aab
+b101111111 aac
+1aad
+b110110 aae
+b1010001 aaf
+b1100 aag
+b111 aah
+b10100010 aai
+0aaj
+b11100 aak
+b11100 aal
+b1100 aam
+b1100 aan
+b1000000000000000000000000000 aao
+b1111111111111111111111111111 aap
+b11100 aaq
+1aar
+0aas
+b110110 aat
+b11100 aau
+b1010001 aav
+b11100 aaw
+b1100 aax
+b1100 aay
+b111 aaz
+b1100 aba
+b10100010 abb
+b1000000000000000000000000000 abc
+b1111111111111111111111111111 abd
+b11100 abe
+1aaa
+
+#27500
+0aaa
+
+#28000
+1aab
+b110011011 aac
+0aad
+b111000 aae
+b1010100 aaf
+b0 aag
+b1100 aah
+b10101000 aai
+1aaj
+b11101 aak
+b11101 aal
+b1101 aam
+b1101 aan
+b10000000000000000000000000000 aao
+b11111111111111111111111111111 aap
+b11101 aaq
+0aar
+1aas
+b111000 aat
+b11101 aau
+b1010100 aav
+b11101 aaw
+b0 aax
+b1101 aay
+b1100 aaz
+b1101 aba
+b10101000 abb
+b10000000000000000000000000000 abc
+b11111111111111111111111111111 abd
+b11101 abe
+1aaa
+
+#28500
+0aaa
+
+#29000
+0aab
+b110111000 aac
+1aad
+b111010 aae
+b1010111 aaf
+b100 aag
+b1 aah
+b10101110 aai
+0aaj
+b11110 aak
+b11110 aal
+b1110 aam
+b1110 aan
+b100000000000000000000000000000 aao
+b111111111111111111111111111111 aap
+b11110 aaq
+1aar
+0aas
+b111010 aat
+b11110 aau
+b1010111 aav
+b11110 aaw
+b100 aax
+b1110 aay
+b1 aaz
+b1110 aba
+b10101110 abb
+b100000000000000000000000000000 abc
+b111111111111111111111111111111 abd
+b11110 abe
+1aaa
+
+#29500
+0aaa
+
+#30000
+1aab
+b111010110 aac
+0aad
+b111100 aae
+b1011010 aaf
+b1000 aag
+b110 aah
+b10110100 aai
+1aaj
+b11111 aak
+b11111 aal
+b1111 aam
+b1111 aan
+b1000000000000000000000000000000 aao
+b1111111111111111111111111111111 aap
+b11111 aaq
+0aar
+1aas
+b111100 aat
+b11111 aau
+b1011010 aav
+b11111 aaw
+b1000 aax
+b1111 aay
+b110 aaz
+b1111 aba
+b10110100 abb
+b1000000000000000000000000000000 abc
+b1111111111111111111111111111111 abd
+b11111 abe
+1aaa
+
+#30500
+0aaa
+
+#31000
+0aab
+b111110101 aac
+1aad
+b111110 aae
+b1011101 aaf
+b1100 aag
+b1011 aah
+b10111010 aai
+0aaj
+b100000 aak
+b100000 aal
+b0 aam
+b0 aan
+b10000000000000000000000000000000 aao
+b11111111111111111111111111111111 aap
+b100000 aaq
+1aar
+0aas
+b111110 aat
+b100000 aau
+b1011101 aav
+b100000 aaw
+b1100 aax
+b0 aay
+b1011 aaz
+b0 aba
+b10111010 abb
+b10000000000000000000000000000000 abc
+b11111111111111111111111111111111 abd
+b100000 abe
+1aaa
+
+#31500
+0aaa
+
+#32000
+1aab
+b1000010101 aac
+0aad
+b1000000 aae
+b1100000 aaf
+b0 aag
+b0 aah
+b11000000 aai
+1aaj
+b100001 aak
+b100001 aal
+b1 aam
+b1 aan
+b100000000000000000000000000000000 aao
+b111111111111111111111111111111111 aap
+b100001 aaq
+0aar
+1aas
+b1000000 aat
+b100001 aau
+b1100000 aav
+b100001 aaw
+b0 aax
+b1 aay
+b0 aaz
+b1 aba
+b11000000 abb
+b100000000000000000000000000000000 abc
+b111111111111111111111111111111111 abd
+b100001 abe
+1aaa
+
+#32500
+0aaa
+
+#33000
+0aab
+b1000110110 aac
+1aad
+b1000010 aae
+b1100011 aaf
+b100 aag
+b101 aah
+b11000110 aai
+0aaj
+b100010 aak
+b100010 aal
+b10 aam
+b10 aan
+b1000000000000000000000000000000000 aao
+b1111111111111111111111111111111111 aap
+b100010 aaq
+1aar
+0aas
+b1000010 aat
+b100010 aau
+b1100011 aav
+b100010 aaw
+b100 aax
+b10 aay
+b101 aaz
+b10 aba
+b11000110 abb
+b1000000000000000000000000000000000 abc
+b1111111111111111111111111111111111 abd
+b100010 abe
+1aaa
+
+#33500
+0aaa
+
+#34000
+1aab
+b1001011000 aac
+0aad
+b1000100 aae
+b1100110 aaf
+b1000 aag
+b1010 aah
+b11001100 aai
+1aaj
+b100011 aak
+b100011 aal
+b11 aam
+b11 aan
+b10000000000000000000000000000000000 aao
+b11111111111111111111111111111111111 aap
+b100011 aaq
+0aar
+1aas
+b1000100 aat
+b100011 aau
+b1100110 aav
+b100011 aaw
+b1000 aax
+b11 aay
+b1010 aaz
+b11 aba
+b11001100 abb
+b10000000000000000000000000000000000 abc
+b11111111111111111111111111111111111 abd
+b100011 abe
+1aaa
+
+#34500
+0aaa
+
+#35000
+0aab
+b1001111011 aac
+1aad
+b1000110 aae
+b1101001 aaf
+b1100 aag
+b1111 aah
+b11010010 aai
+0aaj
+b100100 aak
+b100100 aal
+b100 aam
+b100 aan
+b100000000000000000000000000000000000 aao
+b111111111111111111111111111111111111 aap
+b100100 aaq
+1aar
+0aas
+b1000110 aat
+b100100 aau
+b1101001 aav
+b100100 aaw
+b1100 aax
+b100 aay
+b1111 aaz
+b100 aba
+b11010010 abb
+b100000000000000000000000000000000000 abc
+b111111111111111111111111111111111111 abd
+b100100 abe
+1aaa
+
+#35500
+0aaa
+
+#36000
+1aab
+b1010011111 aac
+0aad
+b1001000 aae
+b1101100 aaf
+b0 aag
+b100 aah
+b11011000 aai
+1aaj
+b100101 aak
+b100101 aal
+b101 aam
+b101 aan
+b1000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111 aap
+b100101 aaq
+0aar
+1aas
+b1001000 aat
+b100101 aau
+b1101100 aav
+b100101 aaw
+b0 aax
+b101 aay
+b100 aaz
+b101 aba
+b11011000 abb
+b1000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111 abd
+b100101 abe
+1aaa
+
+#36500
+0aaa
+
+#37000
+0aab
+b1011000100 aac
+1aad
+b1001010 aae
+b1101111 aaf
+b100 aag
+b1001 aah
+b11011110 aai
+0aaj
+b100110 aak
+b100110 aal
+b110 aam
+b110 aan
+b10000000000000000000000000000000000000 aao
+b11111111111111111111111111111111111111 aap
+b100110 aaq
+1aar
+0aas
+b1001010 aat
+b100110 aau
+b1101111 aav
+b100110 aaw
+b100 aax
+b110 aay
+b1001 aaz
+b110 aba
+b11011110 abb
+b10000000000000000000000000000000000000 abc
+b11111111111111111111111111111111111111 abd
+b100110 abe
+1aaa
+
+#37500
+0aaa
+
+#38000
+1aab
+b1011101010 aac
+0aad
+b1001100 aae
+b1110010 aaf
+b1000 aag
+b1110 aah
+b11100100 aai
+1aaj
+b100111 aak
+b100111 aal
+b111 aam
+b111 aan
+b100000000000000000000000000000000000000 aao
+b111111111111111111111111111111111111111 aap
+b100111 aaq
+0aar
+1aas
+b1001100 aat
+b100111 aau
+b1110010 aav
+b100111 aaw
+b1000 aax
+b111 aay
+b1110 aaz
+b111 aba
+b11100100 abb
+b100000000000000000000000000000000000000 abc
+b111111111111111111111111111111111111111 abd
+b100111 abe
+1aaa
+
+#38500
+0aaa
+
+#39000
+0aab
+b1100010001 aac
+1aad
+b1001110 aae
+b1110101 aaf
+b1100 aag
+b11 aah
+b11101010 aai
+0aaj
+b101000 aak
+b101000 aal
+b1000 aam
+b1000 aan
+b1000000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111111 aap
+b101000 aaq
+1aar
+0aas
+b1001110 aat
+b101000 aau
+b1110101 aav
+b101000 aaw
+b1100 aax
+b1000 aay
+b11 aaz
+b1000 aba
+b11101010 abb
+b1000000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111111 abd
+b101000 abe
+1aaa
+
+#39500
+0aaa
+
+#40000
+1aab
+b1100111001 aac
+0aad
+b1010000 aae
+b1111000 aaf
+b0 aag
+b1000 aah
+b11110000 aai
+1aaj
+b101001 aak
+b101001 aal
+b1001 aam
+b1001 aan
+b10000000000000000000000000000000000000000 aao
+b11111111111111111111111111111111111111111 aap
+b101001 aaq
+0aar
+1aas
+b1010000 aat
+b101001 aau
+b1111000 aav
+b101001 aaw
+b0 aax
+b1001 aay
+b1000 aaz
+b1001 aba
+b11110000 abb
+b10000000000000000000000000000000000000000 abc
+b11111111111111111111111111111111111111111 abd
+b101001 abe
+1aaa
+
+#40500
+0aaa
+
+#41000
+0aab
+b1101100010 aac
+1aad
+b1010010 aae
+b1111011 aaf
+b100 aag
+b1101 aah
+b11110110 aai
+0aaj
+b101010 aak
+b101010 aal
+b1010 aam
+b1010 aan
+b100000000000000000000000000000000000000000 aao
+b111111111111111111111111111111111111111111 aap
+b101010 aaq
+1aar
+0aas
+b1010010 aat
+b101010 aau
+b1111011 aav
+b101010 aaw
+b100 aax
+b1010 aay
+b1101 aaz
+b1010 aba
+b11110110 abb
+b100000000000000000000000000000000000000000 abc
+b111111111111111111111111111111111111111111 abd
+b101010 abe
+1aaa
+
+#41500
+0aaa
+
+#42000
+1aab
+b1110001100 aac
+0aad
+b1010100 aae
+b1111110 aaf
+b1000 aag
+b10 aah
+b11111100 aai
+1aaj
+b101011 aak
+b101011 aal
+b1011 aam
+b1011 aan
+b1000000000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111111111 aap
+b101011 aaq
+0aar
+1aas
+b1010100 aat
+b101011 aau
+b1111110 aav
+b101011 aaw
+b1000 aax
+b1011 aay
+b10 aaz
+b1011 aba
+b11111100 abb
+b1000000000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111111111 abd
+b101011 abe
+1aaa
+
+#42500
+0aaa
+
+#43000
+0aab
+b1110110111 aac
+1aad
+b1010110 aae
+b10000001 aaf
+b1100 aag
+b111 aah
+b100000010 aai
+0aaj
+b101100 aak
+b101100 aal
+b1100 aam
+b1100 aan
+b10000000000000000000000000000000000000000000 aao
+b11111111111111111111111111111111111111111111 aap
+b101100 aaq
+1aar
+0aas
+b1010110 aat
+b101100 aau
+b10000001 aav
+b101100 aaw
+b1100 aax
+b1100 aay
+b111 aaz
+b1100 aba
+b100000010 abb
+b10000000000000000000000000000000000000000000 abc
+b11111111111111111111111111111111111111111111 abd
+b101100 abe
+1aaa
+
+#43500
+0aaa
+
+#44000
+1aab
+b1111100011 aac
+0aad
+b1011000 aae
+b10000100 aaf
+b0 aag
+b1100 aah
+b100001000 aai
+1aaj
+b101101 aak
+b101101 aal
+b1101 aam
+b1101 aan
+b100000000000000000000000000000000000000000000 aao
+b111111111111111111111111111111111111111111111 aap
+b101101 aaq
+0aar
+1aas
+b1011000 aat
+b101101 aau
+b10000100 aav
+b101101 aaw
+b0 aax
+b1101 aay
+b1100 aaz
+b1101 aba
+b100001000 abb
+b100000000000000000000000000000000000000000000 abc
+b111111111111111111111111111111111111111111111 abd
+b101101 abe
+1aaa
+
+#44500
+0aaa
+
+#45000
+0aab
+b10000010000 aac
+1aad
+b1011010 aae
+b10000111 aaf
+b100 aag
+b1 aah
+b100001110 aai
+0aaj
+b101110 aak
+b101110 aal
+b1110 aam
+b1110 aan
+b1000000000000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111111111111 aap
+b101110 aaq
+1aar
+0aas
+b1011010 aat
+b101110 aau
+b10000111 aav
+b101110 aaw
+b100 aax
+b1110 aay
+b1 aaz
+b1110 aba
+b100001110 abb
+b1000000000000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111111111111 abd
+b101110 abe
+1aaa
+
+#45500
+0aaa
+
+#46000
+1aab
+b10000111110 aac
+0aad
+b1011100 aae
+b10001010 aaf
+b1000 aag
+b110 aah
+b100010100 aai
+1aaj
+b101111 aak
+b101111 aal
+b1111 aam
+b1111 aan
+b10000000000000000000000000000000000000000000000 aao
+b11111111111111111111111111111111111111111111111 aap
+b101111 aaq
+0aar
+1aas
+b1011100 aat
+b101111 aau
+b10001010 aav
+b101111 aaw
+b1000 aax
+b1111 aay
+b110 aaz
+b1111 aba
+b100010100 abb
+b10000000000000000000000000000000000000000000000 abc
+b11111111111111111111111111111111111111111111111 abd
+b101111 abe
+1aaa
+
+#46500
+0aaa
+
+#47000
+0aab
+b10001101101 aac
+1aad
+b1011110 aae
+b10001101 aaf
+b1100 aag
+b1011 aah
+b100011010 aai
+0aaj
+b110000 aak
+b110000 aal
+b0 aam
+b0 aan
+b100000000000000000000000000000000000000000000000 aao
+b111111111111111111111111111111111111111111111111 aap
+b110000 aaq
+1aar
+0aas
+b1011110 aat
+b110000 aau
+b10001101 aav
+b110000 aaw
+b1100 aax
+b0 aay
+b1011 aaz
+b0 aba
+b100011010 abb
+b100000000000000000000000000000000000000000000000 abc
+b111111111111111111111111111111111111111111111111 abd
+b110000 abe
+1aaa
+
+#47500
+0aaa
+
+#48000
+1aab
+b10010011101 aac
+0aad
+b1100000 aae
+b10010000 aaf
+b0 aag
+b0 aah
+b100100000 aai
+1aaj
+b110001 aak
+b110001 aal
+b1 aam
+b1 aan
+b1000000000000000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111111111111111 aap
+b110001 aaq
+0aar
+1aas
+b1100000 aat
+b110001 aau
+b10010000 aav
+b110001 aaw
+b0 aax
+b1 aay
+b0 aaz
+b1 aba
+b100100000 abb
+b1000000000000000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111111111111111 abd
+b110001 abe
+1aaa
+
+#48500
+0aaa
+
+#49000
+0aab
+b10011001110 aac
+1aad
+b1100010 aae
+b10010011 aaf
+b100 aag
+b101 aah
+b100100110 aai
+0aaj
+b110010 aak
+b110010 aal
+b10 aam
+b10 aan
+b10000000000000000000000000000000000000000000000000 aao
+b11111111111111111111111111111111111111111111111111 aap
+b110010 aaq
+1aar
+0aas
+b1100010 aat
+b110010 aau
+b10010011 aav
+b110010 aaw
+b100 aax
+b10 aay
+b101 aaz
+b10 aba
+b100100110 abb
+b10000000000000000000000000000000000000000000000000 abc
+b11111111111111111111111111111111111111111111111111 abd
+b110010 abe
+1aaa
+
+#49500
+0aaa
+
+#50000
+1aab
+b10100000000 aac
+0aad
+b1100100 aae
+b10010110 aaf
+b1000 aag
+b1010 aah
+b100101100 aai
+1aaj
+b110011 aak
+b110011 aal
+b11 aam
+b11 aan
+b100000000000000000000000000000000000000000000000000 aao
+b111111111111111111111111111111111111111111111111111 aap
+b110011 aaq
+0aar
+1aas
+b1100100 aat
+b110011 aau
+b10010110 aav
+b110011 aaw
+b1000 aax
+b11 aay
+b1010 aaz
+b11 aba
+b100101100 abb
+b100000000000000000000000000000000000000000000000000 abc
+b111111111111111111111111111111111111111111111111111 abd
+b110011 abe
+1aaa
+
+#50500
+0aaa
+
+#51000
+0aab
+b10100110011 aac
+1aad
+b1100110 aae
+b10011001 aaf
+b1100 aag
+b1111 aah
+b100110010 aai
+0aaj
+b110100 aak
+b110100 aal
+b100 aam
+b100 aan
+b1000000000000000000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111111111111111111 aap
+b110100 aaq
+1aar
+0aas
+b1100110 aat
+b110100 aau
+b10011001 aav
+b110100 aaw
+b1100 aax
+b100 aay
+b1111 aaz
+b100 aba
+b100110010 abb
+b1000000000000000000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111111111111111111 abd
+b110100 abe
+1aaa
+
+#51500
+0aaa
+
+#52000
+1aab
+b10101100111 aac
+0aad
+b1101000 aae
+b10011100 aaf
+b0 aag
+b100 aah
+b100111000 aai
+1aaj
+b110101 aak
+b110101 aal
+b101 aam
+b101 aan
+b10000000000000000000000000000000000000000000000000000 aao
+b11111111111111111111111111111111111111111111111111111 aap
+b110101 aaq
+0aar
+1aas
+b1101000 aat
+b110101 aau
+b10011100 aav
+b110101 aaw
+b0 aax
+b101 aay
+b100 aaz
+b101 aba
+b100111000 abb
+b10000000000000000000000000000000000000000000000000000 abc
+b11111111111111111111111111111111111111111111111111111 abd
+b110101 abe
+1aaa
+
+#52500
+0aaa
+
+#53000
+0aab
+b10110011100 aac
+1aad
+b1101010 aae
+b10011111 aaf
+b100 aag
+b1001 aah
+b100111110 aai
+0aaj
+b110110 aak
+b110110 aal
+b110 aam
+b110 aan
+b100000000000000000000000000000000000000000000000000000 aao
+b111111111111111111111111111111111111111111111111111111 aap
+b110110 aaq
+1aar
+0aas
+b1101010 aat
+b110110 aau
+b10011111 aav
+b110110 aaw
+b100 aax
+b110 aay
+b1001 aaz
+b110 aba
+b100111110 abb
+b100000000000000000000000000000000000000000000000000000 abc
+b111111111111111111111111111111111111111111111111111111 abd
+b110110 abe
+1aaa
+
+#53500
+0aaa
+
+#54000
+1aab
+b10111010010 aac
+0aad
+b1101100 aae
+b10100010 aaf
+b1000 aag
+b1110 aah
+b101000100 aai
+1aaj
+b110111 aak
+b110111 aal
+b111 aam
+b111 aan
+b1000000000000000000000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111111111111111111111 aap
+b110111 aaq
+0aar
+1aas
+b1101100 aat
+b110111 aau
+b10100010 aav
+b110111 aaw
+b1000 aax
+b111 aay
+b1110 aaz
+b111 aba
+b101000100 abb
+b1000000000000000000000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111111111111111111111 abd
+b110111 abe
+1aaa
+
+#54500
+0aaa
+
+#55000
+0aab
+b11000001001 aac
+1aad
+b1101110 aae
+b10100101 aaf
+b1100 aag
+b11 aah
+b101001010 aai
+0aaj
+b111000 aak
+b111000 aal
+b1000 aam
+b1000 aan
+b10000000000000000000000000000000000000000000000000000000 aao
+b11111111111111111111111111111111111111111111111111111111 aap
+b111000 aaq
+1aar
+0aas
+b1101110 aat
+b111000 aau
+b10100101 aav
+b111000 aaw
+b1100 aax
+b1000 aay
+b11 aaz
+b1000 aba
+b101001010 abb
+b10000000000000000000000000000000000000000000000000000000 abc
+b11111111111111111111111111111111111111111111111111111111 abd
+b111000 abe
+1aaa
+
+#55500
+0aaa
+
+#56000
+1aab
+b11001000001 aac
+0aad
+b1110000 aae
+b10101000 aaf
+b0 aag
+b1000 aah
+b101010000 aai
+1aaj
+b111001 aak
+b111001 aal
+b1001 aam
+b1001 aan
+b100000000000000000000000000000000000000000000000000000000 aao
+b111111111111111111111111111111111111111111111111111111111 aap
+b111001 aaq
+0aar
+1aas
+b1110000 aat
+b111001 aau
+b10101000 aav
+b111001 aaw
+b0 aax
+b1001 aay
+b1000 aaz
+b1001 aba
+b101010000 abb
+b100000000000000000000000000000000000000000000000000000000 abc
+b111111111111111111111111111111111111111111111111111111111 abd
+b111001 abe
+1aaa
+
+#56500
+0aaa
+
+#57000
+0aab
+b11001111010 aac
+1aad
+b1110010 aae
+b10101011 aaf
+b100 aag
+b1101 aah
+b101010110 aai
+0aaj
+b111010 aak
+b111010 aal
+b1010 aam
+b1010 aan
+b1000000000000000000000000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111111111111111111111111 aap
+b111010 aaq
+1aar
+0aas
+b1110010 aat
+b111010 aau
+b10101011 aav
+b111010 aaw
+b100 aax
+b1010 aay
+b1101 aaz
+b1010 aba
+b101010110 abb
+b1000000000000000000000000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111111111111111111111111 abd
+b111010 abe
+1aaa
+
+#57500
+0aaa
+
+#58000
+1aab
+b11010110100 aac
+0aad
+b1110100 aae
+b10101110 aaf
+b1000 aag
+b10 aah
+b101011100 aai
+1aaj
+b111011 aak
+b111011 aal
+b1011 aam
+b1011 aan
+b10000000000000000000000000000000000000000000000000000000000 aao
+b11111111111111111111111111111111111111111111111111111111111 aap
+b111011 aaq
+0aar
+1aas
+b1110100 aat
+b111011 aau
+b10101110 aav
+b111011 aaw
+b1000 aax
+b1011 aay
+b10 aaz
+b1011 aba
+b101011100 abb
+b10000000000000000000000000000000000000000000000000000000000 abc
+b11111111111111111111111111111111111111111111111111111111111 abd
+b111011 abe
+1aaa
+
+#58500
+0aaa
+
+#59000
+0aab
+b11011101111 aac
+1aad
+b1110110 aae
+b10110001 aaf
+b1100 aag
+b111 aah
+b101100010 aai
+0aaj
+b111100 aak
+b111100 aal
+b1100 aam
+b1100 aan
+b100000000000000000000000000000000000000000000000000000000000 aao
+b111111111111111111111111111111111111111111111111111111111111 aap
+b111100 aaq
+1aar
+0aas
+b1110110 aat
+b111100 aau
+b10110001 aav
+b111100 aaw
+b1100 aax
+b1100 aay
+b111 aaz
+b1100 aba
+b101100010 abb
+b100000000000000000000000000000000000000000000000000000000000 abc
+b111111111111111111111111111111111111111111111111111111111111 abd
+b111100 abe
+1aaa
+
+#59500
+0aaa
+
+#60000
+1aaj
+b111101 aak
+b111101 aal
+b1101 aam
+b1101 aan
+b1000000000000000000000000000000000000000000000000000000000000 aao
+b1111111111111111111111111111111111111111111111111111111111111 aap
+b111101 aaq
+1aas
+b111101 aau
+b111101 aaw
+b1101 aay
+b1101 aba
+b1000000000000000000000000000000000000000000000000000000000000 abc
+b1111111111111111111111111111111111111111111111111111111111111 abd
+b111101 abe
+1aaa
+
+#60500
+0aaa
Index: /latest/test_regression/19072006/Makefile
===================================================================
--- /latest/test_regression/19072006/Makefile	(revision 1)
+++ /latest/test_regression/19072006/Makefile	(revision 1)
@@ -0,0 +1,62 @@
+include ../env.mk
+
+SYSTEM    = system_bug.cpp system_ok.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE)
+
+test : main
+	@./system_bug_systemcass.x --p ; \
+  if [ $$? -ne 6 ] ; then eval ${failcom} ; fi ; \
+  echo Bug detection OK
+	@./system_ok_systemcass.x --p || eval ${failcom}
+	
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+%_socview.x : %_socview.o  $(SOCVIEW_LIB)
+	$(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_socview.cpp : %.cpp 
+	ln -s $*.cpp $*_socview.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITING2REGISTER -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITING2REGISTER -c $*_systemcass.cpp -o $*_systemcass.o
+
+%_socview.o : %_socview.cpp
+	$(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f gmon.out *~
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	
Index: /latest/test_regression/19072006/Makefile.deps
===================================================================
--- /latest/test_regression/19072006/Makefile.deps	(revision 1)
+++ /latest/test_regression/19072006/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/19072006/system_bug.cpp
===================================================================
--- /latest/test_regression/19072006/system_bug.cpp	(revision 1)
+++ /latest/test_regression/19072006/system_bug.cpp	(revision 1)
@@ -0,0 +1,90 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+  int                             reg;
+  sc_signal<bool>                 reg_bool;
+  sc_signal<char>                 reg_char;
+  sc_signal<double>               reg_double;
+  sc_signal<sc_biguint<64> >      reg_ui64;
+  sc_signal<sc_uint<33> >         reg_ui33;
+  sc_signal<sc_uint<32> >         reg_ui32;
+  sc_signal<sc_uint<16> >         reg_ui16;
+  sc_signal<sc_uint<6> >          reg_ui6;
+  sc_signal<sc_int<2> >           reg_i2;
+ 
+  sc_in_clk                       clk;
+  sc_in<bool>                     resetn;
+
+  void trans ()
+  {
+    if (resetn.read() == true)
+    {
+      reg        = reg + 1;
+      reg_bool   = reg & 1;
+      reg_char   = reg;
+      reg_double = reg;
+      reg_ui64   = reg-1;
+      reg_ui64   = reg;
+      reg_ui33   = reg;
+      reg_ui32   = reg;
+      reg_ui16   = reg;
+      reg_ui6    = reg;
+      reg_i2     = 1;
+      reg_i2     = 0;
+      reg_i2     = reg;
+    } else {
+      reg        = 0;
+      reg_bool   = 0;
+      reg_char   = 0;
+      reg_double = 0;
+      reg_ui64   = 0;
+      reg_ui33   = 0;
+      reg_ui32   = 0;
+      reg_ui16   = 0;
+      reg_ui6    = 0;
+      reg_i2     = 0;
+    }
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<bool> resetn("resetn");
+
+  test test1("test1");
+  test1.clk    (signal_clk);
+  test1.resetn (resetn);
+
+	// Init & run
+	sc_start (0);
+
+  resetn = false;
+	sc_start (4);
+  resetn = true;
+  sc_start (100);
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/19072006/system_ok.cpp
===================================================================
--- /latest/test_regression/19072006/system_ok.cpp	(revision 1)
+++ /latest/test_regression/19072006/system_ok.cpp	(revision 1)
@@ -0,0 +1,87 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+  int                             reg;
+  sc_signal<bool>                 reg_bool;
+  sc_signal<char>                 reg_char;
+  sc_signal<double>               reg_double;
+  sc_signal<sc_biguint<64> >      reg_ui64;
+  sc_signal<sc_uint<33> >         reg_ui33;
+  sc_signal<sc_uint<32> >         reg_ui32;
+  sc_signal<sc_uint<16> >         reg_ui16;
+  sc_signal<sc_uint<6> >          reg_ui6;
+  sc_signal<sc_int<2> >           reg_i2;
+ 
+  sc_in_clk                       clk;
+  sc_in<bool>                     resetn;
+
+  void trans ()
+  {
+    if (resetn.read() == true)
+    {
+      reg        = reg + 1;
+      reg_bool   = reg & 1;
+      reg_char   = reg;
+      reg_double = reg;
+      reg_ui64   = reg;
+      reg_ui33   = reg;
+      reg_ui32   = reg;
+      reg_ui16   = reg;
+      reg_ui6    = reg;
+      reg_i2     = reg;
+    } else {
+      reg        = 0;
+      reg_bool   = 0;
+      reg_char   = 0;
+      reg_double = 0;
+      reg_ui64   = 0;
+      reg_ui33   = 0;
+      reg_ui32   = 0;
+      reg_ui16   = 0;
+      reg_ui6    = 0;
+      reg_i2     = 0;
+    }
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<bool> resetn("resetn");
+
+  test test1("test1");
+  test1.clk    (signal_clk);
+  test1.resetn (resetn);
+
+	// Init & run
+	sc_start (0);
+
+  resetn = false;
+	sc_start (4);
+  resetn = true;
+  sc_start (100);
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/19122005/Makefile
===================================================================
--- /latest/test_regression/19122005/Makefile	(revision 1)
+++ /latest/test_regression/19122005/Makefile	(revision 1)
@@ -0,0 +1,149 @@
+include ../env.mk
+
+SOCVIEW_INC    = ${SOCVIEW}/include
+SOCVIEW_LIB    = ${SOCVIEW}/lib-linux/libsystemc.a
+CFLAGS_SOCVIEW = ${CFLAGS} -I${SOCVIEW_INC}
+LFLAGS_SOCVIEW = ${LFLAGS} -ltermcap -lreadline ${SOCVIEW_LIB}
+
+SYSTEM    = system.cpp system2.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE_SVIEW = $(SYSTEM:.cpp=_socview.x)
+EXE       = ${EXE_SCASS} ${EXE_SVIEW} ${EXE_SC}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+TEST1_DAT = \
+           test_socview_1.dat test_socview_1_reloaded.dat   \
+           test_socview_2.dat test_socview_2_reloaded.dat   \
+           test_socview_3.dat test_socview_3_reloaded.dat   \
+           test_socview_3b.dat test_socview_3_reloaded_bis.dat   \
+           test_socview_4.dat test_socview_4_reloaded.dat   \
+           test_socview_5.dat test_socview_5_reloaded.dat   \
+           test_socview_6.dat test_socview_6_reloaded.dat   \
+           test_socview_7.dat test_socview_7_reloaded.dat   \
+           test_socview_8.dat test_socview_8_reloaded.dat   \
+           test_socview_9.dat test_socview_9_reloaded.dat   \
+           test_socview_10.dat test_socview_10_reloaded.dat \
+           test_socview_10b.dat \
+           test_systemcass_0.dat \
+           test_systemcass_1.dat \
+           test_systemcass_2.dat \
+           test_systemcass_3.dat \
+           test_systemcass_4.dat \
+           test_systemcass_5.dat \
+           test_systemcass_6.dat \
+           test_systemcass_7.dat \
+           test_systemcass_8.dat \
+           test_systemcass_9.dat \
+           test_systemcass_10.dat \
+           test_systemcass_11.dat \
+#
+TEST2_DAT = test2_socview_10.dat \
+            test2_socview_24a.dat test2_socview_24b.dat test2_socview_24c.dat \
+            test2_socview_20a.dat test2_socview_20b.dat test2_systemcass_20.dat
+#
+TEST3 = 20
+TEST3_DAT = \
+            $(foreach i,${TEST3},test3_systemcass_$(i).dat)
+#
+.SECONDARY:
+
+main : $(EXE)
+
+test : test1 test2 test3
+
+test1 : ${TEST1_DAT}
+	diff test_socview_10.dat test_socview_10b.dat
+	diff test_socview_1.dat test_socview_1_reloaded.dat
+	diff test_socview_2.dat test_socview_2_reloaded.dat
+	diff test_socview_3.dat test_socview_3b.dat
+	diff test_socview_3.dat test_socview_3_reloaded_bis.dat
+	diff test_socview_3.dat test_socview_3_reloaded.dat
+	diff test_socview_4.dat test_socview_4_reloaded.dat
+	diff test_socview_5.dat test_socview_5_reloaded.dat
+	diff test_socview_6.dat test_socview_6_reloaded.dat
+	diff test_socview_7.dat test_socview_7_reloaded.dat
+	diff test_socview_8.dat test_socview_8_reloaded.dat
+	diff test_socview_9.dat test_socview_9_reloaded.dat
+	diff test_socview_10.dat test_socview_10_reloaded.dat
+	@echo Test OK.
+
+test2 : ${TEST2_DAT}
+	diff test2_socview_20a.dat test2_socview_20b.dat
+	diff test2_socview_24a.dat test2_socview_24c.dat
+	diff test2_socview_24a.dat test2_socview_24b.dat
+	
+test3 : ${TEST3_DAT} ${TEST2_DAT}
+	for i in ${TEST3} ; do \
+    diff test2_systemcass_$${i}.dat test3_systemcass_$${i}.dat \
+      || eval ${failcom} ; \
+  done
+
+${TEST1_DAT} : system_socview.x system_systemcass.x socview_check_command socview_command
+	rm -f ${TEST1_DAT}
+	./system_socview.x 11 < socview_command
+	./system_systemcass.x 11
+	./system_socview.x 11 < socview_check_command
+
+${TEST2_DAT} : system2_systemcass.x system2_socview.x socview_command2
+	rm -f ${TEST2_DAT}
+	./system2_systemcass.x 20
+	./system2_socview.x 20 < socview_command2
+
+${TEST3_DAT} : system3_systemcass.x
+	for i in ${TEST3} ; do \
+    system3_systemcass.x --save_on_exit test3_systemcass_$${i}.dat $${i} \
+      || eval ${failcom} ; \
+  done
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+%_socview.x : %_socview.o  $(SOCVIEW_LIB)
+	$(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_socview.cpp : %.cpp 
+	ln -s $*.cpp $*_socview.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+%_socview.o : %_socview.cpp
+	$(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o
+
+cleandat :
+	-rm -f ${TEST1_DAT} ${TEST2_DAT} ${TEST3_DAT}
+
+clean : cleandat
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f results
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/19122005/Makefile.deps
===================================================================
--- /latest/test_regression/19122005/Makefile.deps	(revision 1)
+++ /latest/test_regression/19122005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/19122005/socview_check_command
===================================================================
--- /latest/test_regression/19122005/socview_check_command	(revision 1)
+++ /latest/test_regression/19122005/socview_check_command	(revision 1)
@@ -0,0 +1,43 @@
+func
+restore test_socview_5.dat
+
+save test_socview_6_bis.dat
+restore test_systemcass_0.dat
+
+save test_socview_1_reloaded.dat
+restore test_systemcass_1.dat
+
+save test_socview_2_reloaded.dat
+restore test_socview_2.dat
+run 1
+save test_socview_3b.dat
+restore test_systemcass_3.dat
+save test_socview_3_reloaded_bis.dat
+restore test_systemcass_2.dat
+
+save test_socview_3_reloaded.dat
+restore test_systemcass_3.dat
+
+save test_socview_4_reloaded.dat
+restore test_systemcass_4.dat
+
+save test_socview_5_reloaded.dat
+restore test_systemcass_5.dat
+
+save test_socview_6_reloaded.dat
+restore test_systemcass_6.dat
+
+save test_socview_7_reloaded.dat
+restore test_systemcass_7.dat
+
+save test_socview_8_reloaded.dat
+restore test_systemcass_8.dat
+
+save test_socview_9_reloaded.dat
+restore test_systemcass_9.dat
+
+save test_socview_10_reloaded.dat
+exit
+
+
+
Index: /latest/test_regression/19122005/socview_command
===================================================================
--- /latest/test_regression/19122005/socview_command	(revision 1)
+++ /latest/test_regression/19122005/socview_command	(revision 1)
@@ -0,0 +1,27 @@
+func
+save test_socview_0.dat
+
+save test_socview_1.dat
+
+save test_socview_2.dat
+
+save test_socview_3.dat
+
+save test_socview_4.dat
+
+save test_socview_5.dat
+
+save test_socview_6.dat
+
+save test_socview_7.dat
+
+save test_socview_8.dat
+
+save test_socview_9.dat
+
+save test_socview_10.dat
+restore test_socview_8.dat
+run 2
+save test_socview_10b.dat
+exit
+
Index: /latest/test_regression/19122005/socview_command2
===================================================================
--- /latest/test_regression/19122005/socview_command2	(revision 1)
+++ /latest/test_regression/19122005/socview_command2	(revision 1)
@@ -0,0 +1,18 @@
+func
+run 10
+save test2_socview_10.dat
+run 10
+save test2_socview_20a.dat
+run 4
+save test2_socview_24a.dat
+restore test2_systemcass_20.dat
+run 4
+save test2_socview_24b.dat
+restore test2_socview_20a.dat
+run 4
+save test2_socview_24c.dat
+restore test2_socview_10.dat
+run 10
+save test2_socview_20b.dat
+exit
+
Index: /latest/test_regression/19122005/system.cpp
===================================================================
--- /latest/test_regression/19122005/system.cpp	(revision 1)
+++ /latest/test_regression/19122005/system.cpp	(revision 1)
@@ -0,0 +1,249 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<int>                      i2;
+	sc_in<int>                      i3;
+#if 0
+	sc_in<sc_int<4> >               i4;
+	sc_in<sc_uint<4> >              i5;
+#endif
+#if 0
+	sc_in<sc_uint<64> >             i6;
+#endif
+	sc_out<bool>                    o1;
+	sc_out<int>                    o2;
+	sc_out<int >                    o3;
+#if 0
+	sc_out<sc_int<4> >              o4;
+	sc_out<sc_uint<4> >             o5;
+#endif
+#if 0
+	sc_out<sc_uint<64> >            o6;
+	sc_inout<sc_uint<64> >          io1;
+#endif
+//	sc_inout<sc_signed >            io2;
+//	sc_inout<sc_unsigned >          io3;
+	sc_inout<sc_uint<32> >          io4;
+  sc_out<int>                     mealy1;
+  sc_out<int>                     mealy2;
+
+  sc_signal<bool>                 reg1;
+  sc_signal<int>                  reg2;
+  sc_signal<int>                  reg3;
+#if 0
+  sc_signal<sc_int<4> >           reg4;
+  sc_signal<sc_uint<4> >          reg5;
+#endif
+#if 0
+  sc_signal<sc_uint<64> >         reg6;
+#endif
+//  sc_signal<sc_signed   >         reg7;
+//  sc_signal<sc_unsigned >         reg8;
+  sc_signal<sc_uint<32> >         reg9;
+  sc_signal<int>                  reg10;
+
+  void fmealy1 ()
+  {
+    mealy1 = i2.read();
+  }
+
+  void fmealy2 ()
+  {
+    mealy2 = i2.read() + reg2.read();
+  }
+
+	void gen ()
+  {
+    o1  = reg1.read() ^ true;
+    o2  = reg2.read()+ 1;
+    o3  = reg3.read()+ 1;
+//    o4  = reg4.read()+ 1;
+//    o5  = reg5.read()+ 1;
+//    o6  = reg6.read()+ 1;
+//    io1 = reg6.read() * 2 + 1;
+    io4 = reg9.read()+ 1;
+  }
+
+  void trans ()
+  {
+//    io2 = io2.read() + 1;
+//    io3 = io3.read() + 1;
+    reg1 = reg1.read() ^ 1;
+    reg2 = reg2.read() + 1;
+    reg3 = reg3.read() + 1;
+//    reg4 = reg4.read() + 1;
+//    reg5 = reg5.read() + 1;
+//    reg6 = reg6.read() * 2 + 1;
+    reg9 = reg9.read() + 2;
+    reg10 = reg10.read() + i2.read();
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), i2("i2"), i3("i3"), /*i4("i4"), i5("i5"), */ /*i6("i6"),*/
+    o1("o1"), o2("o2"), o3("o3"), /*o4("o4"), o5("o5"), */ /*o6("o6"),
+    io1("io1"), */io4("io4"), 
+    mealy1("mealy1_equivalent_to_i2"),
+    mealy2("mealy2_equivalent_to_i2_plus_reg2"),
+    reg1("reg1_cycle_number_not_parity"),
+    reg2("reg2_cycle_number"),
+    reg3("reg3_cycle_number"),
+//    reg4("reg4"),
+//    reg5("reg5"),
+//    reg6("reg6"),
+//    reg7("reg7"),
+//    reg8("reg8"),
+    reg9("reg9_cycle_number_x2"),
+    reg10("reg10_sum_cycle_number")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+		SC_METHOD(fmealy1);
+		sensitive << i2;
+    dont_initialize();
+		SC_METHOD(fmealy2);
+		sensitive << i2 << clk.neg();
+    dont_initialize();
+	};
+};
+
+int
+usage (const char *com)
+{
+  cout << "Usage :\n" << com << " [#cycles]\n";
+  return EXIT_FAILURE;
+}
+
+sc_signal<bool>              s01 ("i1_cycle_number_not_parity"),
+                             s02 ("o2_not_reg1");
+sc_signal<int>               s03 ("i2_cycle_number_x2"),
+                             s04 ("o2_reg2_plus_one");
+sc_signal<int>               s05 ("i3_cycle_number_x3"),
+                             s06 ("o3_reg3_plus_one");
+#if 0
+sc_signal<sc_int<4> >        s07 ("s07"),
+                             s08 ("s08");
+sc_signal<sc_uint<4> >       s09 ("s09"),
+                             s10 ("s10");
+#endif
+#if 0
+sc_signal<sc_uint<64> >      s11 ("s11"),
+                             s12 ("s12"),
+                             s13 ("s13");
+#endif
+//sc_signal<sc_signed >        s14("s14");                     
+//sc_signal<sc_unsigned >      s15("s15");
+sc_signal<sc_uint<32> >      s16 ("io4_reg9_plus_one");
+sc_signal<int>               s17 ("mealy1_equivalent_to_i2");
+sc_signal<int>               s18 ("mealy2_i2_plus_reg2");
+
+int
+s (int i)
+{
+  int val = 0;
+  while (i)
+    val += i--;
+  return val;
+}
+
+void*
+func ()
+{
+  cerr << "func () at #" << sc_time_stamp () << endl;
+  int i = (int)(sc_time_stamp ().to_double ()) / 1000;
+  s01  = (i & 1) > 0;
+  s03  = i * 2;
+  s05  = i * 3;
+//  s07  = i * 4;
+//  s09  = i * 5;
+//  s11  = i * 6;
+  ++i;
+  return 0;
+}
+
+void
+save ()
+{
+#ifdef SYSTEMCASS_SPECIFIC
+  char name[256];
+  sprintf (name,"test_systemcass_%d.dat",((int)sc_time_stamp().to_double() / 1000));
+  sc_save_simulation (name);
+#endif
+}
+
+int sc_main (int argc, char *argv[])
+{
+  int errnum = 0;
+	sc_clock  signal_clk("my_clock",1, 0.5);
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.o1 (s02);
+  test1.i2 (s03);
+  test1.o2 (s04);
+  test1.i3 (s05);
+  test1.o3 (s06);
+//  test1.i4 (s07);
+//  test1.o4 (s08);
+//  test1.i5 (s09);
+//  test1.o5 (s10);
+//  test1.i6 (s11);
+//  test1.o6 (s12);
+//  test1.io1(s13);
+//  test1.io2(s14);
+//  test1.io3(s15);
+  test1.io4(s16);
+  test1.mealy1(s17);
+  test1.mealy2(s18);
+
+	// Init & run
+	sc_start (0);
+
+#ifndef SOCVIEW
+  if (argc != 2)
+  {
+    return usage (argv[0]);
+  }
+
+	int nb = atoi(argv[1]);
+
+  if (nb == 0)
+  {
+    return usage (argv[0]);
+  } 
+
+  int i = 0;
+  save ();
+  while (i++ < nb)
+  {
+    func ();
+    sc_start (1);
+    save ();
+  }
+#else
+  debug(&func);
+#endif
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/19122005/system2.cpp
===================================================================
--- /latest/test_regression/19122005/system2.cpp	(revision 1)
+++ /latest/test_regression/19122005/system2.cpp	(revision 1)
@@ -0,0 +1,202 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct inner : sc_module {
+	sc_in_clk       clk;
+  sc_in<int>      i1;
+  int reg;
+
+  void save (ostream &o)
+  {
+    o << reg << endl;
+  }
+
+  void save_state (FILE *fic)
+  {
+    cerr << "saving " << name () << "\n";
+    fprintf (fic, "%d\n", reg);
+  }
+
+  void restore_state (FILE *fic)
+  {
+    cerr << "restoring " << name () << "\n";
+    int i;
+    fscanf (fic, "%d\n", &i);
+    reg = i;
+  }
+
+  void trans ()
+  {
+    reg = i1.read();
+  }
+
+  SC_HAS_PROCESS(inner);
+	inner (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+#ifdef SYSTEMCASS_SPECIFIC
+    //SAVE_HANDLER(save);
+    SAVE_HANDLER(save_state);
+#endif
+	};
+};
+
+struct test : sc_module {
+	sc_in_clk       clk;
+	sc_in<bool>     i1;
+	sc_in<int>      i2;
+	sc_in<int>      i3;
+  inner           inner1;
+
+  int  tab[16];
+  bool b;
+
+  void trans ()
+  {
+    b = i1.read() ^ b;
+    tab[i3.read() % 16] = i2;
+  }
+
+
+  void save (ostream &o)
+  {
+    o << ((b)?1:0) << endl;
+    int i;
+    for (i = 0; i < 16; ++i)
+      o << tab[i] << endl;
+  }
+
+  void save_state (FILE *fic)
+  {
+    cerr << "saving " << name () << "\n";
+    fprintf (fic, "%c\n", ((b)?'1':'0'));
+    int i;
+    for (i = 0; i < 16; ++i)
+    {
+      fprintf (fic, "%d\n", tab[i]);
+    }
+  }
+
+  void restore_state (FILE *fic)
+  {
+    cerr << "restoring " << name () << "\n";
+    int j;
+    fscanf (fic, "%d\n", &j);
+    b = (j > 0);
+    int i;
+    for (i = 0; i < 16; ++i)
+    {
+      fscanf (fic, "%d\n", &j);
+      tab[i] = j;
+    }
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), i2("i2"), i3("i3"),
+    inner1 ("inner1")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+#ifdef SYSTEMCASS_SPECIFIC
+    //SAVE_HANDLER(save);
+    SAVE_HANDLER(save_state);
+#endif
+	};
+};
+
+int
+usage (const char *com)
+{
+  cout << "Usage :\n" << com << " [#cycles]\n";
+  return EXIT_FAILURE;
+}
+
+sc_signal<bool>              s01 ("bool");
+sc_signal<int>               s02 ("tab_index"),
+                             s03 ("value_to_write_in_tab");
+
+void*
+func ()
+{
+  cerr << "func () at #" << sc_time_stamp () << endl;
+  int i = (int)(sc_time_stamp ().to_double ()) / 1000;
+  s01  = (i & 1) > 0;
+  s02  = (i + (i << 1)) << 6;
+  s03  = i;
+  ++i;
+  return 0;
+}
+
+void
+save ()
+{
+#ifdef SYSTEMCASS_SPECIFIC
+  int current_cycle = ((int)sc_time_stamp().to_double() / 1000);
+  if (current_cycle != 20)
+    return;
+  char name[256];
+  sprintf (name,"test2_systemcass_%d.dat",current_cycle);
+  sc_save_simulation (name);
+#endif
+}
+
+int sc_main (int argc, char *argv[])
+{
+  int errnum = 0;
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.i2 (s02);
+  test1.i3 (s03);
+  test1.inner1.clk (signal_clk);
+  test1.inner1.i1 (s02);
+
+	// Init & run
+	sc_start (0);
+
+#ifndef SOCVIEW
+  if (argc != 2)
+  {
+    return usage (argv[0]);
+  }
+
+	int nb = atoi(argv[1]);
+
+  if (nb == 0)
+  {
+    return usage (argv[0]);
+  } 
+
+  int i = 0;
+  while (i++ < nb)
+  {
+    func ();
+    sc_start (1);
+    save ();
+  }
+#else
+  debug(&func); 
+#endif
+
+	return EXIT_SUCCESS;
+}
+
Index: /latest/test_regression/19122005/system3.cpp
===================================================================
--- /latest/test_regression/19122005/system3.cpp	(revision 1)
+++ /latest/test_regression/19122005/system3.cpp	(revision 1)
@@ -0,0 +1,172 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+struct inner : sc_module {
+	sc_in_clk       clk;
+  sc_in<int>      i1;
+  int reg;
+
+  void save_state (FILE *fic)
+  {
+    cerr << "saving " << name () << "\n";
+    fprintf (fic, "%d\n", reg);
+  }
+
+  void restore_state (FILE *fic)
+  {
+    cerr << "restoring " << name () << "\n";
+    int i;
+    fscanf (fic, "%d\n", &i);
+    reg = i;
+  }
+
+  void trans ()
+  {
+    reg = i1.read();
+  }
+
+  SC_HAS_PROCESS(inner);
+	inner (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+#ifdef SYSTEMCASS_SPECIFIC
+    SAVE_HANDLER(save_state);
+#endif
+	};
+};
+
+struct test : sc_module {
+	sc_in_clk       clk;
+	sc_in<bool>     i1;
+	sc_in<int>      i2;
+	sc_in<int>      i3;
+  inner           inner1;
+
+  int  tab[16];
+  bool b;
+
+  void trans ()
+  {
+    b = i1.read() ^ b;
+    tab[i3.read() % 16] = i2;
+  }
+
+  void save_state (FILE *fic)
+  {
+    cerr << "saving " << name () << "\n";
+    fprintf (fic, "%c\n", ((b)?'1':'0'));
+    int i;
+    for (i = 0; i < 16; ++i)
+    {
+      fprintf (fic, "%d\n", tab[i]);
+    }
+  }
+
+  void restore_state (FILE *fic)
+  {
+    cerr << "restoring " << name () << "\n";
+    int j;
+    fscanf (fic, "%d\n", &j);
+    b = (j > 0);
+    int i;
+    for (i = 0; i < 16; ++i)
+    {
+      fscanf (fic, "%d\n", &j);
+      tab[i] = j;
+    }
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk"),
+    i1("i1"), i2("i2"), i3("i3"),
+    inner1 ("inner1")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+#ifdef SYSTEMCASS_SPECIFIC
+    SAVE_HANDLER(save_state);
+#endif
+	};
+};
+
+int
+usage (const char *com)
+{
+  cout << "Usage :\n" << com << " [#cycles]\n";
+  return EXIT_FAILURE;
+}
+
+sc_signal<bool>              s01 ("bool");
+sc_signal<int>               s02 ("tab_index"),
+                             s03 ("value_to_write_in_tab");
+
+void*
+func ()
+{
+  cerr << "func () at #" << sc_time_stamp () << endl;
+  int i = (int)(sc_time_stamp ().to_double ()) / 1000;
+  s01  = (i & 1) > 0;
+  s02  = (i + (i << 1)) << 6;
+  s03  = i;
+  ++i;
+  return 0;
+}
+
+int sc_main (int argc, char *argv[])
+{
+  int errnum = 0;
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+
+  test test1("test1");
+  test1.clk (signal_clk);
+  test1.i1 (s01);
+  test1.i2 (s02);
+  test1.i3 (s03);
+  test1.inner1.clk (signal_clk);
+  test1.inner1.i1 (s02);
+
+	// Init & run
+	sc_start (0);
+
+#ifndef SOCVIEW
+  if (argc != 2)
+  {
+    return usage (argv[0]);
+  }
+
+	int nb = atoi(argv[1]);
+
+  if (nb == 0)
+  {
+    return usage (argv[0]);
+  } 
+
+  int i = 0;
+  while (i++ < nb)
+  {
+    func ();
+    sc_start (1);
+  }
+#else
+  debug(&func); 
+#endif
+
+	return EXIT_SUCCESS;
+}
+
Index: /latest/test_regression/20122006/Makefile
===================================================================
--- /latest/test_regression/20122006/Makefile	(revision 1)
+++ /latest/test_regression/20122006/Makefile	(revision 1)
@@ -0,0 +1,61 @@
+include ../env.mk
+
+EXE_SCASS = system_systemcass.x
+EXE_SC    = system_systemc.x
+EXE       = ${EXE_SCASS} ${EXE_SC}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : ${EXE}
+	./system_systemcass.x --a --t --k; \
+  (tail -n +3 module_graph.dot | diff module_graph_cass_reference.dot -) || eval ${failcom}
+	./system_systemcass.x --m --t --k; \
+  (tail -n +3 port_graph.dot | diff port_graph_reference.dot -) || eval ${failcom} ; \
+  (tail -n +3 signal_graph.dot | diff signal_graph_reference.dot -) || eval ${failcom} ; \
+	(tail -n +3 process_order.dot | diff process_order_mouchard_reference.dot -) || eval ${failcom}
+	./system_systemcass.x --p --t --k; \
+  (tail -n +3 port_graph.dot | diff port_graph_reference.dot -) || eval ${failcom} ; \
+  (tail -n +3 signal_graph.dot | diff signal_graph_reference.dot -) || eval ${failcom} ; \
+	(tail -n +3 process_order.dot | diff process_order_buchmann_reference.dot -) || eval ${failcom}
+	@echo Test OK.
+
+%.png : %.dot
+	dot -Tpng -o $*.png $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f signal_order.txt module_order.dot signal_graph.dot port_graph.dot
+	-rm -f module_graph.dot process_order.dot
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf tracesystem_systemcass.x.vcd tracesystem_systemc.x.vcd
+	
Index: /latest/test_regression/20122006/Makefile.deps
===================================================================
--- /latest/test_regression/20122006/Makefile.deps	(revision 1)
+++ /latest/test_regression/20122006/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/20122006/chrono.h
===================================================================
--- /latest/test_regression/20122006/chrono.h	(revision 1)
+++ /latest/test_regression/20122006/chrono.h	(revision 1)
@@ -0,0 +1,39 @@
+#ifndef __CHRONO_H__
+#define __CHRONO_H__
+
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+struct chrono_t {
+	unsigned int sec;
+	chrono_t () 
+	{
+		sec = 0;
+	}
+	void start () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec;
+	}
+	void cont () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec - sec;
+	}
+	void stop ()
+	{
+		cont ();
+	}
+	operator unsigned int () const
+	{ return sec; }	
+	friend std::ostream& operator << (std::ostream& o, const chrono_t &c)
+	{
+		return o << c.sec << "sec";
+	}
+};
+
+#endif
+
Index: /latest/test_regression/20122006/system.cpp
===================================================================
--- /latest/test_regression/20122006/system.cpp	(revision 1)
+++ /latest/test_regression/20122006/system.cpp	(revision 1)
@@ -0,0 +1,299 @@
+#include <systemc.h>
+#include <signal.h>
+#include "chrono.h"
+
+using namespace std;
+	
+struct M_0i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_out<bool>                    o1;
+
+	void eval () {
+    o1 = (rand()%2) == 0;
+	}
+
+	SC_CTOR (M_0i1o) : clk ("clk"), o1("o1") {
+		SC_METHOD(eval);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+		//o1(); /* no need */
+#endif
+	};
+};
+
+struct M_1i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_out<bool>                    o1;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+
+	SC_CTOR (M_1i1o) : clk ("clk"), i1 ("i1"), o1("o1") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+	};
+};
+
+
+struct M_2i2o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+	void eval2 () {
+    o2 = ~i2;
+	}
+
+	SC_CTOR (M_2i2o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+	};
+};
+
+struct M_4i2o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_in<bool>                     i4;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+	void eval2 () {
+    o2 = ~i2;
+	}
+  void eval3 () {
+    cout << i3 << i4 << "\n";
+  }
+
+	SC_CTOR (M_4i2o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2"),
+i3 ("i3"), i4 ("i4") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+		SC_METHOD(eval3);
+		sensitive << clk.pos();
+		// sensitive << i3 << i4;
+#ifdef SYSTEMCASS_SPECIFIC
+		// No port dependency
+#endif
+	};
+};
+
+struct M_4i3o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_in<bool>                     i4;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+	sc_out<bool>                    o3;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+	void eval2 () {
+    o2 = ~i2;
+	}
+  void eval3 () {
+    o3 = ~i3;
+  }
+  void eval4 () {
+    cout << i4 << "\n";
+  }
+
+	SC_CTOR (M_4i3o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2"), i3 ("i3"), i4 ("i4"), o3 ("o3") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval4);
+		sensitive << clk.pos();
+		// sensitive << i4;
+#ifdef SYSTEMCASS_SPECIFIC
+		// No port dependency
+#endif
+		SC_METHOD(eval3);
+		sensitive << clk.neg();
+		sensitive << i3;
+#ifdef SYSTEMCASS_SPECIFIC
+		o3(i3);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+	};
+};
+
+struct M_1i0o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+
+	void eval1 () {
+    cout << i1.read() << "\n";
+	}
+
+	SC_CTOR (M_1i0o) : clk ("clk"), i1 ("i1") {
+		SC_METHOD(eval1);
+		sensitive << clk.pos();
+		// sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		// No port dependency
+#endif
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1 ("s01"),
+                               s2 ("s02"),
+                               s3 ("s03"),
+                               s4 ("s04"),
+                               s5 ("s05"),
+                               s6 ("s06"),
+                               s7 ("s07"),
+                               s8 ("s08"),
+                               s9 ("s09"),
+                               s10("s10"),
+                               s11("s11"),
+                               s12("s12"),
+                               s13("s13"),
+                               s14("s14"),
+                               s15("s15");
+                               
+
+	M_0i1o      a("a");
+	M_4i2o      b("b");
+	M_1i1o      c("c");
+	M_4i3o      d("d");
+	M_1i1o      e("e");
+	M_1i1o      f("f");
+	M_2i2o      g("g");
+	M_1i1o      h("h");
+	M_1i0o      i("i");
+	M_0i1o      j("j");
+	M_0i1o      k("k");
+	M_0i1o      l("l");
+	
+	a.clk         (signal_clk);
+	b.clk         (signal_clk);
+	c.clk         (signal_clk);
+	d.clk         (signal_clk);
+	e.clk         (signal_clk);
+	f.clk         (signal_clk);
+	g.clk         (signal_clk);
+	h.clk         (signal_clk);
+	i.clk         (signal_clk);
+	j.clk         (signal_clk);
+	k.clk         (signal_clk);
+	l.clk         (signal_clk);
+	
+	a.o1          (s1);
+	b.i1          (s1);
+		
+	b.o2          (s2);
+	c.i1          (s2);
+
+	c.o1          (s3);
+	d.i1          (s3);
+	
+	d.o1          (s4);
+	b.i3          (s4);
+	
+	d.o2          (s5);
+	b.i4          (s5);
+	
+	b.o1          (s6);
+	e.i1          (s6);
+	
+	e.o1          (s7);
+	f.i1          (s7);
+	
+	f.o1          (s8);
+	b.i2          (s8);
+	
+	d.o3          (s9);
+	g.i1          (s9);
+	
+	g.o1          (s10);
+	h.i1          (s10);
+	
+	h.o1          (s11);
+	d.i4          (s11);
+	
+	j.o1          (s12);
+	g.i2          (s12);
+	
+	g.o2          (s13);
+	i.i1          (s13);	
+	
+	l.o1          (s14);
+	d.i3          (s14);
+	
+	k.o1          (s15);
+	d.i2          (s15);
+
+	// Init & run
+	sc_initialize ();
+
+  if (argc == 1)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return EXIT_SUCCESS;
+  }
+
+	chrono_t chrono;
+	chrono.start ();
+
+  sc_start (atoi(argv[1]));
+
+	chrono.stop ();
+	unsigned int t = chrono;
+	cout << "Time elapsed (sec) : " << t << endl;
+	cout << "Cycles done        : " << sc_simulation_time () << endl;
+	cout << "Performance        : " << sc_simulation_time () / t << endl;
+	printf("\nPress <RETURN> to exit simulation.");
+	char buf_ret[2];
+	cin.getline(buf_ret,1);
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/21062005/Makefile
===================================================================
--- /latest/test_regression/21062005/Makefile	(revision 1)
+++ /latest/test_regression/21062005/Makefile	(revision 1)
@@ -0,0 +1,55 @@
+include ../env.mk
+
+SYSTEM    = system.cpp #system2.cpp system3.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : main
+	./system_systemcass.x || eval ${failcom} ; \
+	echo Test OK.
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -Wno-deprecated -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -Wno-deprecated -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/21062005/Makefile.deps
===================================================================
--- /latest/test_regression/21062005/Makefile.deps	(revision 1)
+++ /latest/test_regression/21062005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/21062005/system.cpp
===================================================================
--- /latest/test_regression/21062005/system.cpp	(revision 1)
+++ /latest/test_regression/21062005/system.cpp	(revision 1)
@@ -0,0 +1,76 @@
+#include "systemc.h"
+#include <iostream>
+#include <string>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+using namespace std;
+
+static int errnum = 0;
+
+struct internal_model : sc_module
+{
+  sc_in<int>     i;
+  sc_out<int>    o;
+	internal_model (sc_module_name n) : sc_module (n),
+    i("i"),
+		o("o")
+  {
+  }
+};
+
+struct model : sc_module
+{
+  sc_in<int>     i1, i2, i3;
+  sc_out<int>    o1, o2, o3;
+	sc_signal<int> r1, r2;
+  internal_model internal1,internal2;
+  sc_signal<int> internal_signal;
+	model (sc_module_name n) : sc_module (n),
+    i1("i1"), i2("i2"), i3("i3"),
+		o1("o1"), o2("o2"), o3("o3"),
+		r1("r1"), r2("r2"),
+    internal1 ("internal1"),
+    internal2 ("internal2"),
+    internal_signal ("internal_signal")
+  {
+    internal1.i (i3);
+    internal2.i (internal1.o);
+    internal1.o (internal_signal);
+#if defined(ERROR)
+    internal1.o (internal2.i); // SystemC 2.0.1 & 2.1.v1 error: no match for call to `(sc_out<int>) (sc_in<int>&)'
+#endif
+    internal2.o (o3);
+  }
+};
+
+int
+sc_main (int argc, char ** argv)
+{
+  model    m("m");
+  sc_clock clk ("clock");
+	sc_signal<int> s1("s1"), s2("s2"), s3("s3"), s4("s4");
+
+  m.i1 (s1);
+  m.i2 (s1); //
+  m.i3 (s1);
+  m.o1 (s4); //
+  m.o2 (s2);
+  m.o3 (s3);
+
+	sc_start (0);
+
+	sc_start (1);
+	sc_start (10);
+
+  cerr << "Test OK.\n";
+  return 0;
+}
+
Index: /latest/test_regression/25032005/Makefile
===================================================================
--- /latest/test_regression/25032005/Makefile	(revision 1)
+++ /latest/test_regression/25032005/Makefile	(revision 1)
@@ -0,0 +1,59 @@
+include ../env.mk
+
+EXE_SCASS = system_systemcass.x
+EXE_SC    = system_systemc.x
+EXE       = ${EXE_SCASS} ${EXE_SC}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : main
+	./system_systemc.x ; \
+	./system_systemcass.x --p --t || eval ${failcom} ; \
+	((tail --lines=+3 signal_graph.dot  | diff signal_graph_reference.dot -)\
+        || (tail -n +3 signal_graph.dot | diff signal_graph_reference2.dot -)) \
+        || eval ${failcom} ; \
+        
+	tail --lines=+3 process_order.dot | diff process_order_reference.dot -
+	diff signal_order_reference.txt signal_order.txt
+	@echo Test OK.
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f port_graph.dot signal_order.txt process_order.dot signal_graph.dot
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -f *~
+	-rm -rf generated_by_systemcass
+	-rm -rf tracesystem_systemcass.x.vcd tracesystem_systemc.x.vcd
+	
Index: /latest/test_regression/25032005/Makefile.deps
===================================================================
--- /latest/test_regression/25032005/Makefile.deps	(revision 1)
+++ /latest/test_regression/25032005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/25032005/chrono.h
===================================================================
--- /latest/test_regression/25032005/chrono.h	(revision 1)
+++ /latest/test_regression/25032005/chrono.h	(revision 1)
@@ -0,0 +1,39 @@
+#ifndef __CHRONO_H__
+#define __CHRONO_H__
+
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+struct chrono_t {
+	unsigned int sec;
+	chrono_t () 
+	{
+		sec = 0;
+	}
+	void start () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec;
+	}
+	void cont () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec - sec;
+	}
+	void stop ()
+	{
+		cont ();
+	}
+	operator unsigned int () const
+	{ return sec; }	
+	friend std::ostream& operator << (std::ostream& o, const chrono_t &c)
+	{
+		return o << c.sec << "sec";
+	}
+};
+
+#endif
+
Index: /latest/test_regression/25032005/signal_order_reference.txt
===================================================================
--- /latest/test_regression/25032005/signal_order_reference.txt	(revision 1)
+++ /latest/test_regression/25032005/signal_order_reference.txt	(revision 1)
@@ -0,0 +1,5 @@
+s5 
+s4 
+s3 
+s1 
+s2 
Index: /latest/test_regression/25032005/system.cpp
===================================================================
--- /latest/test_regression/25032005/system.cpp	(revision 1)
+++ /latest/test_regression/25032005/system.cpp	(revision 1)
@@ -0,0 +1,144 @@
+#include <systemc.h>
+#include <signal.h>
+#include "chrono.h"
+
+using namespace std;
+	
+struct A : sc_module {
+	sc_in_clk                       clk;
+	sc_out<bool>                    o1;
+
+	void eval () {
+    o1 = (rand()%2) == 0;
+	}
+
+	SC_CTOR (A) : clk ("clk"), o1("o1") {
+		SC_METHOD(eval);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+//		s1();
+#endif
+	};
+};
+
+struct B : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+	void eval2 () {
+    o2 = ~i2;
+	}
+
+	SC_CTOR (B) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+	};
+};
+
+struct C : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_out<bool>                    o1;
+
+	void eval1 () {
+    o1 = i1 ^ i2;
+	}
+
+	SC_CTOR (C) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1 << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+		o1(i2);
+#endif
+	};
+};
+
+struct D : sc_module {
+	sc_in_clk                       clk;
+	sc_out<bool>                    o1;
+
+	void eval () {
+    o1 = (rand()%2) == 0;
+	}
+
+	SC_CTOR (D) : clk ("clk"), o1("o1") {
+		SC_METHOD(eval);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+//		s1();
+#endif
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1("s1"),s2("s2"),s3("s3"),s4("s4"),s5("s5");
+
+	A      a("a");
+	B      b("b");
+	C      c("c");
+	D      d("d");
+	
+	a.clk         (signal_clk);
+	b.clk         (signal_clk);
+	c.clk         (signal_clk);
+	d.clk         (signal_clk);
+	
+	a.o1          (s1);
+	b.i1          (s1);
+		
+	d.o1          (s2);
+	c.i2          (s2);
+
+	b.o1          (s3);
+	c.i1          (s3);
+	
+	c.o1          (s4);
+	b.i2          (s4);
+	
+	b.o2          (s5);
+	
+	// Init & run
+	sc_initialize ();
+
+  if (argc == 1)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return EXIT_SUCCESS;
+  }
+
+	chrono_t chrono;
+	chrono.start ();
+
+  sc_start (atoi(argv[1]));
+
+	chrono.stop ();
+	unsigned int t = chrono;
+	cout << "Time elapsed (sec) : " << t << endl;
+	cout << "Cycles done        : " << sc_simulation_time () << endl;
+	cout << "Performance        : " << sc_simulation_time () / t << endl;
+	printf("\nPress <RETURN> to exit simulation.");
+	char buf_ret[2];
+	cin.getline(buf_ret,1);
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/28082006/Makefile
===================================================================
--- /latest/test_regression/28082006/Makefile	(revision 1)
+++ /latest/test_regression/28082006/Makefile	(revision 1)
@@ -0,0 +1,62 @@
+include ../env.mk
+
+SYSTEM    = system_ok.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE)
+
+test : main
+	@./system_bug_systemcass.x --p ; \
+  if [ $$? -ne 6 ] ; then eval ${failcom} ; fi ; \
+  echo Bug detection OK
+	@./system_ok_systemcass.x --p || eval ${failcom}
+	
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+%_socview.x : %_socview.o  $(SOCVIEW_LIB)
+	$(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_socview.cpp : %.cpp 
+	ln -s $*.cpp $*_socview.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITING2REGISTER -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITING2REGISTER -c $*_systemcass.cpp -o $*_systemcass.o
+
+%_socview.o : %_socview.cpp
+	$(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f gmon.out *~
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	
Index: /latest/test_regression/28082006/Makefile.deps
===================================================================
--- /latest/test_regression/28082006/Makefile.deps	(revision 1)
+++ /latest/test_regression/28082006/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/28082006/system_ok.cpp
===================================================================
--- /latest/test_regression/28082006/system_ok.cpp	(revision 1)
+++ /latest/test_regression/28082006/system_ok.cpp	(revision 1)
@@ -0,0 +1,123 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct inner1 : sc_module {
+  sc_in_clk                       clk;
+  sc_in <int>                     i1;
+  sc_out<int>                     o1;
+
+  void mealy ()
+  {
+    cerr << "executing 'mealy' function at cycle #" << sc_simulation_time ()
+         << endl;
+    o1 = i1.read() + 3;
+  }
+
+  SC_HAS_PROCESS(inner1);
+  inner1 (sc_module_name)
+  {
+    SC_METHOD(mealy);
+    sensitive << clk.neg() << i1;
+  }
+};
+
+struct inner2 : sc_module {
+  sc_in_clk                       clk;
+  sc_in <bool>                    resetn;
+  sc_in <int>                     i1;
+  sc_out<int>                     o1;
+  sc_signal<int>                  reg1;
+
+  void transition ()
+  {
+    //reg1 = 0;
+    if (resetn.read())
+      reg1 = i1.read();
+    else
+      reg1 = 0;
+  }
+  void generation ()
+  {
+    o1  = reg1.read();
+  }
+
+  SC_HAS_PROCESS(inner2);
+  inner2 (sc_module_name)
+  {
+    SC_METHOD(transition);
+    sensitive << clk.pos();
+    SC_METHOD(generation);
+    sensitive << clk.neg();
+  }
+};
+
+struct test : sc_module {
+  sc_in_clk       clk;
+  sc_in<bool>     resetn;
+ 
+  sc_signal<int>  sig;
+
+  inner1          comp1;
+  inner2          comp2;
+ 
+  sc_in <int>                     i1;
+  sc_out<int>                     o1;
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    comp1("comp1"),
+    comp2("comp2"),
+    clk("clk")
+  {
+    comp1.clk (clk);
+    comp1.i1  (i1);
+    comp1.o1  (sig);
+    comp2.clk (clk);
+    comp2.resetn(resetn);
+    comp2.i1  (sig);
+    comp2.o1  (o1);
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<bool> resetn("resetn");
+  sc_signal<int > s01("s01");
+  sc_signal<int > s02("s02");
+
+  test test1("test1");
+  test1.clk    (signal_clk);
+  test1.resetn (resetn);
+  test1.i1     (s01);
+  test1.o1     (s02);
+
+	// Init & run
+	sc_start (0);
+
+  s01 = 1;
+  resetn = false;
+	sc_start (4);
+  resetn = true;
+  sc_start (1);
+  ASSERT(s02.read() == 4); 
+  sc_start (2);
+  ASSERT(s02.read() == 4); 
+  s01 = 10;
+  sc_start (20);
+  ASSERT(s02.read() == 13); 
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/28102005/Makefile
===================================================================
--- /latest/test_regression/28102005/Makefile	(revision 1)
+++ /latest/test_regression/28102005/Makefile	(revision 1)
@@ -0,0 +1,54 @@
+include ../env.mk
+
+SYSTEM    = system.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : main
+	@./system_systemcass.x || eval ${failcom}
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -Wno-deprecated -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -Wno-deprecated -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf system_systemcass.x.vcd system_systemc.x.vcd
+	
Index: /latest/test_regression/28102005/Makefile.deps
===================================================================
--- /latest/test_regression/28102005/Makefile.deps	(revision 1)
+++ /latest/test_regression/28102005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/28102005/system.cpp
===================================================================
--- /latest/test_regression/28102005/system.cpp	(revision 1)
+++ /latest/test_regression/28102005/system.cpp	(revision 1)
@@ -0,0 +1,77 @@
+#include "systemc.h"
+#include <iostream>
+#include <string>
+
+#define ASSERT(x) \
+  { errnum++; \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (errnum); \
+    } \
+  }
+
+#ifdef DEBUG
+#define CERR(x) \
+  { cerr << "" #x " = " << x << "\n"; }
+#else
+#define CERR(x)
+#endif
+
+
+using namespace std;
+
+static int errnum = 0;
+
+void
+check_time (int i)
+{
+	const sc_time &t = sc_time_stamp ();
+  CERR(i);
+  CERR(t.to_double());
+  ASSERT((int) (t.to_double ()) == i * 1000);
+  CERR(t.to_seconds ());
+	double seconds = t.to_seconds()*1000000000;
+  CERR(seconds);
+  ASSERT(((int)seconds) == i);
+  char s[256];
+  const char *unit;
+  if (i == 0)
+    unit = "s";
+  else if (i < 1000)
+    unit = "ns";
+  else
+    unit = "ns";
+  sprintf (s, "%d %s", i,unit);
+  CERR(s);
+  CERR(t.to_string());
+  ASSERT(strcmp (t.to_string ().c_str(), s)== 0); 
+}
+
+int
+sc_main (int argc, char ** argv)
+{
+  sc_clock clk ("clock");
+
+  check_time (0);
+	sc_start (0);
+
+  check_time (0);
+	sc_start (1);
+  check_time (1);
+
+	sc_start (15);
+  check_time (16);
+
+	sc_start (7);
+  check_time (23);
+
+	sc_start (100);
+  check_time (123);
+
+	sc_start (1000);
+  check_time (1123);
+  cerr << "Test OK.\n";
+  return 0;
+}
+
Index: /latest/test_regression/29032005/Makefile
===================================================================
--- /latest/test_regression/29032005/Makefile	(revision 1)
+++ /latest/test_regression/29032005/Makefile	(revision 1)
@@ -0,0 +1,63 @@
+include ../env.mk
+
+EXE_SCASS = system_systemcass.x
+EXE_SC    = system_systemc.x
+EXE       = ${EXE_SCASS} ${EXE_SC}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE) 
+
+test : ${EXE}
+	@for i in ${EXE_SCASS} ; do \
+  ./$$i --p --t --k; \
+  (tail -n +3 port_graph.dot | diff port_graph_reference.dot -) || eval ${failcom} ; \
+  ((tail -n +3 signal_graph.dot | diff signal_graph_reference.dot -) \
+  || (tail -n +3 signal_graph.dot | diff signal_graph_reference2.dot -)) \
+  || eval ${failcom} ; \
+  ((tail -n +3 process_order.dot | diff process_order_reference.dot -) \
+  || (tail -n +3 process_order.dot | diff process_order_reference2.dot -)) \
+  || eval ${failcom} ; \
+  (diff signal_order_reference.txt signal_order.txt) \
+  || (diff signal_order_reference2.txt signal_order.txt) \
+  || eval ${failcom} ; \
+  done
+	@echo Test OK.
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf tracesystem_systemcass.x.vcd tracesystem_systemc.x.vcd
+	
Index: /latest/test_regression/29032005/Makefile.deps
===================================================================
--- /latest/test_regression/29032005/Makefile.deps	(revision 1)
+++ /latest/test_regression/29032005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/29032005/chrono.h
===================================================================
--- /latest/test_regression/29032005/chrono.h	(revision 1)
+++ /latest/test_regression/29032005/chrono.h	(revision 1)
@@ -0,0 +1,39 @@
+#ifndef __CHRONO_H__
+#define __CHRONO_H__
+
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+struct chrono_t {
+	unsigned int sec;
+	chrono_t () 
+	{
+		sec = 0;
+	}
+	void start () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec;
+	}
+	void cont () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec - sec;
+	}
+	void stop ()
+	{
+		cont ();
+	}
+	operator unsigned int () const
+	{ return sec; }	
+	friend std::ostream& operator << (std::ostream& o, const chrono_t &c)
+	{
+		return o << c.sec << "sec";
+	}
+};
+
+#endif
+
Index: /latest/test_regression/29032005/signal_order_reference.txt
===================================================================
--- /latest/test_regression/29032005/signal_order_reference.txt	(revision 1)
+++ /latest/test_regression/29032005/signal_order_reference.txt	(revision 1)
@@ -0,0 +1,15 @@
+s04 
+s03 
+s02 
+s08 
+s07 
+s06 
+s01 
+s05 
+s11 
+s10 
+s09 
+s13 
+s12 
+s14 
+s15 
Index: /latest/test_regression/29032005/signal_order_reference2.txt
===================================================================
--- /latest/test_regression/29032005/signal_order_reference2.txt	(revision 1)
+++ /latest/test_regression/29032005/signal_order_reference2.txt	(revision 1)
@@ -0,0 +1,15 @@
+s13 
+s11 
+s10 
+s09 
+s14 
+s05 
+s15 
+s04 
+s03 
+s02 
+s08 
+s07 
+s06 
+s01 
+s12 
Index: /latest/test_regression/29032005/system.cpp
===================================================================
--- /latest/test_regression/29032005/system.cpp	(revision 1)
+++ /latest/test_regression/29032005/system.cpp	(revision 1)
@@ -0,0 +1,299 @@
+#include <systemc.h>
+#include <signal.h>
+#include "chrono.h"
+
+using namespace std;
+	
+struct M_0i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_out<bool>                    o1;
+
+	void eval () {
+    o1 = (rand()%2) == 0;
+	}
+
+	SC_CTOR (M_0i1o) : clk ("clk"), o1("o1") {
+		SC_METHOD(eval);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+		//o1(); /* no need */
+#endif
+	};
+};
+
+struct M_1i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_out<bool>                    o1;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+
+	SC_CTOR (M_1i1o) : clk ("clk"), i1 ("i1"), o1("o1") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+	};
+};
+
+
+struct M_2i2o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+	void eval2 () {
+    o2 = ~i2;
+	}
+
+	SC_CTOR (M_2i2o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+	};
+};
+
+struct M_4i2o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_in<bool>                     i4;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+	void eval2 () {
+    o2 = ~i2;
+	}
+  void eval3 () {
+    cout << i3 << i4 << "\n";
+  }
+
+	SC_CTOR (M_4i2o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2"),
+i3 ("i3"), i4 ("i4") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+		SC_METHOD(eval3);
+		sensitive << clk.pos();
+		// sensitive << i3 << i4;
+#ifdef SYSTEMCASS_SPECIFIC
+		// No port dependency
+#endif
+	};
+};
+
+struct M_4i3o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_in<bool>                     i4;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+	sc_out<bool>                    o3;
+
+	void eval1 () {
+    o1 = ~i1;
+	}
+	void eval2 () {
+    o2 = ~i2;
+	}
+  void eval3 () {
+    o3 = ~i3;
+  }
+  void eval4 () {
+    cout << i4 << "\n";
+  }
+
+	SC_CTOR (M_4i3o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2"), i3 ("i3"), i4 ("i4"), o3 ("o3") {
+		SC_METHOD(eval1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval4);
+		sensitive << clk.pos();
+		// sensitive << i4;
+#ifdef SYSTEMCASS_SPECIFIC
+		// No port dependency
+#endif
+		SC_METHOD(eval3);
+		sensitive << clk.neg();
+		sensitive << i3;
+#ifdef SYSTEMCASS_SPECIFIC
+		o3(i3);
+#endif
+		SC_METHOD(eval2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+	};
+};
+
+struct M_1i0o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+
+	void eval1 () {
+    cout << i1.read() << "\n";
+	}
+
+	SC_CTOR (M_1i0o) : clk ("clk"), i1 ("i1") {
+		SC_METHOD(eval1);
+		sensitive << clk.pos();
+		// sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		// No port dependency
+#endif
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1 ("s01"),
+                               s2 ("s02"),
+                               s3 ("s03"),
+                               s4 ("s04"),
+                               s5 ("s05"),
+                               s6 ("s06"),
+                               s7 ("s07"),
+                               s8 ("s08"),
+                               s9 ("s09"),
+                               s10("s10"),
+                               s11("s11"),
+                               s12("s12"),
+                               s13("s13"),
+                               s14("s14"),
+                               s15("s15");
+                               
+
+	M_0i1o      a("a");
+	M_4i2o      b("b");
+	M_1i1o      c("c");
+	M_4i3o      d("d");
+	M_1i1o      e("e");
+	M_1i1o      f("f");
+	M_2i2o      g("g");
+	M_1i1o      h("h");
+	M_1i0o      i("i");
+	M_0i1o      j("j");
+	M_0i1o      k("k");
+	M_0i1o      l("l");
+	
+	a.clk         (signal_clk);
+	b.clk         (signal_clk);
+	c.clk         (signal_clk);
+	d.clk         (signal_clk);
+	e.clk         (signal_clk);
+	f.clk         (signal_clk);
+	g.clk         (signal_clk);
+	h.clk         (signal_clk);
+	i.clk         (signal_clk);
+	j.clk         (signal_clk);
+	k.clk         (signal_clk);
+	l.clk         (signal_clk);
+	
+	a.o1          (s1);
+	b.i1          (s1);
+		
+	b.o2          (s2);
+	c.i1          (s2);
+
+	c.o1          (s3);
+	d.i1          (s3);
+	
+	d.o1          (s4);
+	b.i3          (s4);
+	
+	d.o2          (s5);
+	b.i4          (s5);
+	
+	b.o1          (s6);
+	e.i1          (s6);
+	
+	e.o1          (s7);
+	f.i1          (s7);
+	
+	f.o1          (s8);
+	b.i2          (s8);
+	
+	d.o3          (s9);
+	g.i1          (s9);
+	
+	g.o1          (s10);
+	h.i1          (s10);
+	
+	h.o1          (s11);
+	d.i4          (s11);
+	
+	j.o1          (s12);
+	g.i2          (s12);
+	
+	g.o2          (s13);
+	i.i1          (s13);	
+	
+	l.o1          (s14);
+	d.i3          (s14);
+	
+	k.o1          (s15);
+	d.i2          (s15);
+
+	// Init & run
+	sc_initialize ();
+
+  if (argc == 1)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return EXIT_SUCCESS;
+  }
+
+	chrono_t chrono;
+	chrono.start ();
+
+  sc_start (atoi(argv[1]));
+
+	chrono.stop ();
+	unsigned int t = chrono;
+	cout << "Time elapsed (sec) : " << t << endl;
+	cout << "Cycles done        : " << sc_simulation_time () << endl;
+	cout << "Performance        : " << sc_simulation_time () / t << endl;
+	printf("\nPress <RETURN> to exit simulation.");
+	char buf_ret[2];
+	cin.getline(buf_ret,1);
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/30032005/Makefile
===================================================================
--- /latest/test_regression/30032005/Makefile	(revision 1)
+++ /latest/test_regression/30032005/Makefile	(revision 1)
@@ -0,0 +1,96 @@
+include ../env.mk
+
+SYSTEM    = system.cpp system2.cpp system3.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS} ${EXE_SC}
+LOG       = $(SYSTEM:.cpp=.log)
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+PREFIX = $(SYSTEM:.cpp=)
+
+#DIFF = $(SYSTEM:.cpp=.diff)
+
+.SECONDARY:
+
+#%.diff : %_module_graph_reference.dot %_module_graph.dot
+#	diff $*_module_graph_reference.dot $*_module_graph.dot
+#	diff $*_signal_graph_reference.dot $*_signal_graph.dot
+#	diff $*_module_order_reference.dot $*_module_order.dot
+#	diff $*_signal_order_reference.dot $*_signal_order.dot
+         
+#%_signal_graph_reference.dot %_signal_graph.dot \
+ #        %_module_order_reference.dot %_module_order.dot \
+  #       %_signal_order_reference.dot %_signal_order.dot
+
+#%_module_graph.dot : %_systemcass.x
+#	$*_systemcass.x --t
+#	mv module_graph.dot $*_module_graph.dot
+
+#%_module_order.dot %_signal_graph.dot %_signal_order.dot : %_systemcass.x
+#	$*_systemcass.x --t --p
+
+main : $(EXE) 
+
+#diff : ${DIFF}
+
+test : ${EXE}
+	for i in ${PREFIX} ; do \
+    echo Testing $$i... ; \
+    (./$${i}_systemcass.x --t) || eval ${failcom}; \
+    tail -n +3 module_graph.dot | diff $${i}_module_graph_reference.dot - || eval ${failcom}; \
+    ./$${i}_systemcass.x --p --t || eval ${failcom}; \
+    tail -n +3 signal_graph.dot | diff $${i}_signal_graph_reference.dot - \
+    || tail -n +3 signal_graph.dot | diff $${i}_signal_graph_reference2.dot - \
+    || eval ${failcom}; \
+    tail -n +3 process_order.dot | diff $${i}_process_order_reference.dot - || eval ${failcom}; \
+    diff signal_order.txt $${i}_signal_order_reference.txt \
+    || diff signal_order.txt $${i}_signal_order_reference2.txt \
+    || eval ${failcom}; \
+  done
+	(./system_systemc.x)  || eval ${failcom}
+	(./system2_systemc.x) || eval ${failcom}
+	(./system3_systemc.x) || eval ${failcom}
+	@echo Test OK.
+
+
+
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f *.o gmon.out
+	-rm -f *~
+	-rm -f ${LOG}
+	-rm -f signal_order.txt module_order.dot signal_graph.dot
+	-rm -f module_order.gif signal_graph.gif
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	-rm -rf tracesystem_systemcass.x.vcd tracesystem_systemc.x.vcd
+	
Index: /latest/test_regression/30032005/Makefile.deps
===================================================================
--- /latest/test_regression/30032005/Makefile.deps	(revision 1)
+++ /latest/test_regression/30032005/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/30032005/chrono.h
===================================================================
--- /latest/test_regression/30032005/chrono.h	(revision 1)
+++ /latest/test_regression/30032005/chrono.h	(revision 1)
@@ -0,0 +1,39 @@
+#ifndef __CHRONO_H__
+#define __CHRONO_H__
+
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+struct chrono_t {
+	unsigned int sec;
+	chrono_t () 
+	{
+		sec = 0;
+	}
+	void start () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec;
+	}
+	void cont () 
+	{
+		struct rusage usage;
+		getrusage(RUSAGE_SELF, &usage);
+		sec = usage.ru_utime.tv_sec - sec;
+	}
+	void stop ()
+	{
+		cont ();
+	}
+	operator unsigned int () const
+	{ return sec; }	
+	friend std::ostream& operator << (std::ostream& o, const chrono_t &c)
+	{
+		return o << c.sec << "sec";
+	}
+};
+
+#endif
+
Index: /latest/test_regression/30032005/system.cpp
===================================================================
--- /latest/test_regression/30032005/system.cpp	(revision 1)
+++ /latest/test_regression/30032005/system.cpp	(revision 1)
@@ -0,0 +1,174 @@
+#include <systemc.h>
+#include <signal.h>
+#include "chrono.h"
+
+using namespace std;
+	
+struct M1_3i3o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+	sc_out<bool>                    o3;
+
+  sc_signal<bool>                 reg;
+
+	void eval_mealy1 () {
+    o1 = ~i1;
+	}
+
+	void eval_mealy2 () {
+    o2 = ~i2;
+	}
+
+	void tr_moore () {
+    reg = i3;
+	}
+
+	void gen_moore () {
+    o3 = ~reg;
+	}
+
+	SC_CTOR (M1_3i3o) : clk("clk"), i1("i1"), o1("o1"), i2("i2"), o2("o2"),
+i3("i3"), o3("o3") {
+		SC_METHOD(eval_mealy1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+		SC_METHOD(eval_mealy2);
+		sensitive << clk.neg();
+		sensitive << i2;
+#ifdef SYSTEMCASS_SPECIFIC
+		o2(i2);
+#endif
+		SC_METHOD(tr_moore);
+		sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+		SC_METHOD(gen_moore);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+	};
+};
+
+
+struct M2_4i4o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_in<bool>                     i4;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+	sc_out<bool>                    o3;
+	sc_out<bool>                    o4;
+  sc_signal<sc_uint<2> >          reg;
+
+	void tr_moore () {
+    reg = ((i1.read() & i3.read())?2:0) + (i2.read() | i4.read());
+	}
+
+	void gen_moore () {
+    o1 = reg.read() & 1;
+    o2 = reg.read() & 2;
+    o3 = ~(reg.read() & 1);
+    o4 = ~(reg.read() & 2);
+	}
+
+	SC_CTOR (M2_4i4o) : clk ("clk"), i1 ("i1"), o1("o1"), i2 ("i2"), o2 ("o2"), i3 ("i3"), o3("o3"), i4 ("i4"), o4 ("o4")  {
+		SC_METHOD(tr_moore);
+		sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+    // no needs
+#endif
+		SC_METHOD(gen_moore);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+#endif
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1 ("s01"),
+                               s2 ("s02"),
+                               s3 ("s03"),
+                               s4 ("s04"),
+                               s5 ("s05"),
+                               s6 ("s06"),
+                               s7 ("s07"),
+                               s8 ("s08"),
+                               s9 ("s09"),
+                               s10("s10"),
+                               s11("s11"),
+                               s12("s12"),
+                               s13("s13"),
+                               s14("s14"),
+                               s15("s15");
+                               
+
+	M1_3i3o     a    ("a");
+	M1_3i3o     b    ("b");
+	M2_4i4o     Moore("Moore");
+	
+	a.clk         (signal_clk);
+	b.clk         (signal_clk);
+	Moore.clk     (signal_clk);
+		
+	Moore.o1      (s1);
+	a.i1          (s1);
+
+	a.o1          (s2);
+	b.i1          (s2);
+		
+	b.o1          (s3);
+	Moore.i1      (s3);
+
+	Moore.o2      (s4);
+	b.i2          (s4);
+	
+	b.o2          (s5);
+	a.i2          (s5);
+	
+	a.o2          (s6);
+	Moore.i2      (s6);
+	
+	Moore.o3      (s7);
+	b.i3          (s7);
+	
+	Moore.o4      (s8);
+	a.i3          (s8);
+	
+	b.o3          (s9);
+	Moore.i4      (s9);
+	
+	a.o3          (s10);
+	Moore.i3      (s10);
+	
+	// Init & run
+	sc_initialize ();
+
+  if (argc == 1)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return EXIT_SUCCESS;
+  }
+
+	chrono_t chrono;
+	chrono.start ();
+
+  sc_start (atoi(argv[1]));
+
+	chrono.stop ();
+	unsigned int t = chrono;
+	cout << "Time elapsed (sec) : " << t << endl;
+	cout << "Cycles done        : " << sc_simulation_time () << endl;
+	cout << "Performance        : " << sc_simulation_time () / t << endl;
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/30032005/system2.cpp
===================================================================
--- /latest/test_regression/30032005/system2.cpp	(revision 1)
+++ /latest/test_regression/30032005/system2.cpp	(revision 1)
@@ -0,0 +1,133 @@
+#include <systemc.h>
+#include <signal.h>
+#include "chrono.h"
+
+using namespace std;
+	
+struct M1_1i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_out<bool>                    o1;
+
+	void eval_mealy1 () {
+    o1 = ~i1;
+	};
+
+	SC_CTOR (M1_1i1o) : clk("clk"), i1("i1"), o1("o1") {
+		SC_METHOD(eval_mealy1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+	};
+};
+
+struct M2_1i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_out<bool>                    o1;
+
+  sc_signal<bool>                 reg;
+
+  void tr_moore1  () {
+    reg = ~i1;
+  }
+
+	void gen_moore1 () {
+    o1 = ~reg;
+	};
+
+	SC_CTOR (M2_1i1o) : clk("clk"), i1("i1"), o1("o1") {
+		SC_METHOD(tr_moore1);
+		sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+    // no needs
+#endif
+		SC_METHOD(gen_moore1);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+    // no needs
+#endif
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1 ("s01"),
+                               s2 ("s02"),
+                               s3 ("s03"),
+                               s4 ("s04"),
+                               s5 ("s05"),
+                               s6 ("s06"),
+                               s7 ("s07"),
+                               s8 ("s08"),
+                               s9 ("s09"),
+                               s10("s10"),
+                               s11("s11"),
+                               s12("s12"),
+                               s13("s13"),
+                               s14("s14"),
+                               s15("s15");
+                               
+
+	M1_1i1o     a    ("a");
+	M1_1i1o     b    ("b");
+	M1_1i1o     c    ("c");
+	M1_1i1o     d    ("d");
+	M1_1i1o     e    ("e");
+	M2_1i1o     f    ("f");
+	M1_1i1o     g    ("g");
+	
+	a.clk         (signal_clk);
+	b.clk         (signal_clk);
+	c.clk         (signal_clk);
+	d.clk         (signal_clk);
+	e.clk         (signal_clk);
+	f.clk         (signal_clk);
+	g.clk         (signal_clk);
+		
+	a.i1          (s1);
+
+	a.o1          (s2);
+	b.i1          (s2);
+	d.i1          (s2);
+		
+	b.o1          (s3);
+	c.i1          (s3);
+
+	c.o1          (s4);
+	
+	d.o1          (s5);
+	e.i1          (s5);
+	
+	e.o1          (s6);
+	f.i1          (s6);
+	
+	f.o1          (s7);
+	g.i1          (s7);
+	
+	g.o1          (s8);
+
+	// Init & run
+	sc_initialize ();
+
+  if (argc == 1)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return EXIT_SUCCESS;
+  }
+
+	chrono_t chrono;
+	chrono.start ();
+
+  sc_start (atoi(argv[1]));
+
+	chrono.stop ();
+	unsigned int t = chrono;
+	cout << "Time elapsed (sec) : " << t << endl;
+	cout << "Cycles done        : " << sc_simulation_time () << endl;
+	cout << "Performance        : " << sc_simulation_time () / t << endl;
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/30032005/system2_signal_order_reference.txt
===================================================================
--- /latest/test_regression/30032005/system2_signal_order_reference.txt	(revision 1)
+++ /latest/test_regression/30032005/system2_signal_order_reference.txt	(revision 1)
@@ -0,0 +1,8 @@
+s04 
+s03 
+s06 
+s05 
+s02 
+s01 
+s08 
+s07 
Index: /latest/test_regression/30032005/system2_signal_order_reference2.txt
===================================================================
--- /latest/test_regression/30032005/system2_signal_order_reference2.txt	(revision 1)
+++ /latest/test_regression/30032005/system2_signal_order_reference2.txt	(revision 1)
@@ -0,0 +1,8 @@
+s06 
+s05 
+s04 
+s03 
+s02 
+s01 
+s08 
+s07 
Index: /latest/test_regression/30032005/system3.cpp
===================================================================
--- /latest/test_regression/30032005/system3.cpp	(revision 1)
+++ /latest/test_regression/30032005/system3.cpp	(revision 1)
@@ -0,0 +1,160 @@
+#include <systemc.h>
+#include <signal.h>
+#include "chrono.h"
+
+using namespace std;
+	
+struct M1_1i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_out<bool>                    o1;
+
+	void eval_mealy1 () {
+    o1 = ~i1;
+	};
+
+	SC_CTOR (M1_1i1o) : clk("clk"), i1("i1"), o1("o1") {
+		SC_METHOD(eval_mealy1);
+		sensitive << clk.neg();
+		sensitive << i1;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+#endif
+	};
+};
+
+struct M1_3i2o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_in<bool>                     i2;
+	sc_in<bool>                     i3;
+	sc_out<bool>                    o1;
+	sc_out<bool>                    o2;
+
+	void eval_mealy1 () {
+    o1 = ~i1 & i2;
+    o2 = ~i2 & i3;
+	};
+
+	SC_CTOR (M1_3i2o) : clk("clk"), i1("i1"), o1("o1"), i2("i2"), o2("o2"), i3("i3") {
+		SC_METHOD(eval_mealy1);
+		sensitive << clk.neg();
+		sensitive << i1 << i2;
+    sensitive << i3;
+#ifdef SYSTEMCASS_SPECIFIC
+		o1(i1);
+		o1(i2);
+    o2(i2);
+    o2(i3);
+#endif
+	};
+};
+
+struct M2_1i1o : sc_module {
+	sc_in_clk                       clk;
+	sc_in<bool>                     i1;
+	sc_out<bool>                    o1;
+
+  sc_signal<bool>                 reg;
+
+  void tr_moore1  () {
+    reg = ~i1;
+  }
+
+	void gen_moore1 () {
+    o1 = ~reg;
+	};
+
+	SC_CTOR (M2_1i1o) : clk("clk"), i1("i1"), o1("o1") {
+		SC_METHOD(tr_moore1);
+		sensitive << clk.pos();
+#ifdef SYSTEMCASS_SPECIFIC
+    // no needs
+#endif
+		SC_METHOD(gen_moore1);
+		sensitive << clk.neg();
+#ifdef SYSTEMCASS_SPECIFIC
+    // no needs
+#endif
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock                     signal_clk("my_clock",1, 0.5);
+	sc_signal<bool>              s1 ("s01"),
+                               s2 ("s02"),
+                               s3 ("s03"),
+                               s4 ("s04"),
+                               s5 ("s05"),
+                               s6 ("s06"),
+                               s7 ("s07"),
+                               s8 ("s08"),
+                               s9 ("s09"),
+                               s10("s10"),
+                               s11("s11"),
+                               s12("s12"),
+                               s13("s13"),
+                               s14("s14"),
+                               s15("s15");
+                               
+
+	M1_3i2o     a    ("a");
+	M1_1i1o     b    ("b");
+	M1_3i2o     c    ("c");
+	M1_1i1o     d    ("d");
+	M1_1i1o     e    ("e");
+	
+	a.clk         (signal_clk);
+	b.clk         (signal_clk);
+	c.clk         (signal_clk);
+	d.clk         (signal_clk);
+	e.clk         (signal_clk);
+		
+	a.i1          (s1);
+
+	a.o1          (s2);
+	b.i1          (s2);
+
+	b.o1          (s3);
+	c.i1          (s3);
+
+	c.o1          (s4);
+	
+	a.i2          (s5);
+
+  a.o2          (s6);
+  c.i2          (s6);
+  d.i1          (s6);
+
+  c.o2          (s7);
+  
+	a.i3          (s8);
+
+  d.o1          (s9);
+  e.i1          (s9);
+
+  e.o1          (s10);
+  c.i3          (s10);
+
+	// Init & run
+	sc_initialize ();
+
+  if (argc == 1)
+  {
+    cout << "Usage :\n" << argv[0] << " [#cycles]\n";
+    return EXIT_SUCCESS;
+  }
+
+	chrono_t chrono;
+	chrono.start ();
+
+  sc_start (atoi(argv[1]));
+
+	chrono.stop ();
+	unsigned int t = chrono;
+	cout << "Time elapsed (sec) : " << t << endl;
+	cout << "Cycles done        : " << sc_simulation_time () << endl;
+	cout << "Performance        : " << sc_simulation_time () / t << endl;
+	return EXIT_SUCCESS;
+}
Index: /latest/test_regression/30032005/system3_signal_order_reference.txt
===================================================================
--- /latest/test_regression/30032005/system3_signal_order_reference.txt	(revision 1)
+++ /latest/test_regression/30032005/system3_signal_order_reference.txt	(revision 1)
@@ -0,0 +1,10 @@
+s04 
+s03 
+s02 
+s01 
+s07 
+s10 
+s09 
+s06 
+s05 
+s08 
Index: /latest/test_regression/30032005/system_signal_order_reference.txt
===================================================================
--- /latest/test_regression/30032005/system_signal_order_reference.txt	(revision 1)
+++ /latest/test_regression/30032005/system_signal_order_reference.txt	(revision 1)
@@ -0,0 +1,6 @@
+s03 
+s02 
+s01 
+s06 
+s05 
+s04 
Index: /latest/test_regression/31072006/Makefile
===================================================================
--- /latest/test_regression/31072006/Makefile	(revision 1)
+++ /latest/test_regression/31072006/Makefile	(revision 1)
@@ -0,0 +1,62 @@
+include ../env.mk
+
+SYSTEM    = system_bug.cpp system_ok.cpp
+EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
+EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
+EXE       = ${EXE_SCASS}
+OBJECTS   = $(EXE:.x=.o)
+LINKS     = $(OBJECTS:.o=.cpp)
+
+.SECONDARY:
+
+main : $(EXE)
+
+test : main
+	@./system_bug_systemcass.x --p ; \
+  if [ $$? -ne 6 ] ; then eval ${failcom} ; fi ; \
+  echo Bug detection OK
+	@./system_ok_systemcass.x --p || eval ${failcom}
+	
+%.gif : %.dot
+	dot -Tgif -o $*.gif $*.dot
+
+%_systemc.x : %_systemc.o $(SYSTEMC_LIB)
+	$(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC)
+
+%_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
+	$(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS)
+
+%_socview.x : %_socview.o  $(SOCVIEW_LIB)
+	$(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW)
+
+include Makefile.deps
+
+%_systemc.cpp : %.cpp 
+	ln -s $*.cpp $*_systemc.cpp
+
+%_systemcass.cpp : %.cpp 
+	ln -s $*.cpp $*_systemcass.cpp
+
+%_socview.cpp : %.cpp 
+	ln -s $*.cpp $*_socview.cpp
+
+%_systemc.o : %_systemc.cpp 
+	$(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
+
+%_systemcass.o : %_systemcass.cpp
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITING2PORT -MM $*_systemcass.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SYSTEMCASS) -DCHECK_MULTIWRITING2PORT -c $*_systemcass.cpp -o $*_systemcass.o
+
+%_socview.o : %_socview.cpp
+	$(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps
+	$(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o
+
+clean :
+	-echo > Makefile.deps
+	-rm -f gmon.out *~
+	-rm -f $(EXE) $(OBJECTS) 
+	-for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
+	-rm -f core*
+	-rm -rf generated_by_systemcass
+	
Index: /latest/test_regression/31072006/Makefile.deps
===================================================================
--- /latest/test_regression/31072006/Makefile.deps	(revision 1)
+++ /latest/test_regression/31072006/Makefile.deps	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /latest/test_regression/31072006/system_bug.cpp
===================================================================
--- /latest/test_regression/31072006/system_bug.cpp	(revision 1)
+++ /latest/test_regression/31072006/system_bug.cpp	(revision 1)
@@ -0,0 +1,77 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+  int                             reg;
+ 
+  sc_in_clk                       clk;
+  sc_in<bool>                     resetn;
+  
+  sc_out<int>                     o1;
+  sc_inout<bool>                    o2;
+
+  void trans ()
+  {
+    if (resetn.read() == true)
+    {
+      reg        = reg + 1;
+    } else {
+      reg        = 0;
+    }
+  }
+
+  void gen ()
+  {
+    o2 = 0;
+    o1 = reg;
+    o2 = reg & 1;
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+		SC_METHOD(gen);
+		sensitive << clk.neg();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<bool> resetn("resetn");
+  sc_signal<int > s01("s01");
+  sc_signal<bool> s02("s02");
+
+  test test1("test1");
+  test1.clk    (signal_clk);
+  test1.resetn (resetn);
+  test1.o1     (s01);
+  test1.o2     (s02);
+
+	// Init & run
+	sc_start (0);
+
+  resetn = false;
+	sc_start (4);
+  resetn = true;
+  sc_start (100);
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/31072006/system_ok.cpp
===================================================================
--- /latest/test_regression/31072006/system_ok.cpp	(revision 1)
+++ /latest/test_regression/31072006/system_ok.cpp	(revision 1)
@@ -0,0 +1,73 @@
+#include <systemc.h>
+
+#define ASSERT(x) \
+  { \
+    if (!(x)) \
+    { \
+    cerr << "ASSERT : " #x "\n"; \
+    exit (1); \
+    } \
+  }
+
+using namespace std;
+
+struct test : sc_module {
+  int                             reg;
+ 
+  sc_in_clk                       clk;
+  sc_in<bool>                     resetn;
+  
+  sc_out<int>                     o1;
+  sc_out<bool>                    o2;
+
+  void trans ()
+  {
+    if (resetn.read() == true)
+    {
+      reg        = reg + 1;
+    } else {
+      reg        = 0;
+    }
+  }
+
+  void gen ()
+  {
+    o1 = reg;
+    o2 = reg & 1;
+  }
+
+  SC_HAS_PROCESS(test);
+	test (sc_module_name n) : sc_module (n),
+    clk("clk")
+  {
+		SC_METHOD(trans);
+		sensitive << clk.pos();
+    dont_initialize();
+	};
+};
+
+int sc_main (int argc, char *argv[])
+{
+	sc_clock        signal_clk("my_clock",1, 0.5);
+  sc_signal<bool> resetn("resetn");
+  sc_signal<int > s01("s01");
+  sc_signal<bool> s02("s02");
+
+  test test1("test1");
+  test1.clk    (signal_clk);
+  test1.resetn (resetn);
+  test1.o1     (s01);
+  test1.o2     (s02);
+
+	// Init & run
+	sc_start (0);
+
+  resetn = false;
+	sc_start (4);
+  resetn = true;
+  sc_start (100);
+
+	return EXIT_SUCCESS;
+}
+
+#undef sc_inout
Index: /latest/test_regression/Makefile
===================================================================
--- /latest/test_regression/Makefile	(revision 1)
+++ /latest/test_regression/Makefile	(revision 1)
@@ -0,0 +1,98 @@
+# Number    : Notes
+# 17032005  : trace & basic arithmetic using sc_uint/sc_int types
+# 25032005  : check signal graph, module order, signal order (--p --t)
+#             simple architecture
+# 29032005  : check signal graph, module order, signal order (--p --t)
+#             advanced architecture
+# 30032005  : check signal graph, module order, signal order (--p --t)
+#             advanced architecture
+#             bit mask
+# 19042005  : check vcd trace 
+#             (bool, char, int, sc_uint<4 to 64>, sc_signal, sc_out, sc_in, 
+#             sc_in_clk)
+# 04052005  : check range function
+# 07052005  : check range function and concat operator
+# 16062005  : check all the functions to browse model hierarchy.
+# 21062005  : check to_bool, to_string() functions
+# 05092005  : trying to bind a signal to an unknown type
+# 08092005  : unable to select the best method to schedule
+# 09092005  : ~ operator
+# 09092005b : starting clock edge
+# 09092005c : 1 module with 1 sc_out connected to 3 inner IP. 
+#             (2 sc_in and 2 sc_out)
+# 14092005  : check vcd trace (sc_in, sc_out, sc_signal, bool, int)
+# 15092005  : check port dependency declaration. 3 different error messages.
+# 28102005  : check sc_time::to_string (), to_seconds (), to_double ().
+# 16112005  : check "sc_out and sc_in not bound" messages.
+# 16122005  : check sc_module_name casts.
+# 19122005  : check simulator state saving for Socview compatibility
+# 17022006  : check rename function for Socview compatibility
+# 05042006  : check number of writings into each out port
+#             check reading from an sc_out port
+# 02052006  : check sc_uint, sc_int, sc_signal<X> when X is double, char, 
+#             signed int, unsigned int and so on. (little/big endianness test)
+# 19072006  : SystemCASS allow 1 writing into each port for each delta cycle.
+#             This testbench checks CHECK_MULTIWRITING2PORT macro.
+# 31072006  : SystemCASS allow 1 writing into each register for each cycle.
+#             This testbench checks CHECK_MULTIWRITING2REGISTER macro.
+# 07122006  : check if we can declare an undefined external function as 
+#             a sc_method.
+#             check a virtual method as a sc_method => segmentation fault
+#             (Unable to check if sc_method is a virtual one)
+# 20122006  : check Petrot's scheduling (CASS, quasi static)
+#                   Mouchard's scheduling (FastSysC, incomplete static)
+#                   Buchmann's scheduling (SystemCASS, totally static)
+# 16022007  : check --nobanner option
+# 23032007  : check multiple execution on the same computer
+
+
+DIR = \
+      17032005 \
+      25032005 \
+      29032005 \
+      30032005 \
+      19042005 \
+      04052005 \
+      07052005 \
+      21062005 \
+      16062005 \
+      05092005 \
+      08092005 \
+      09092005 \
+      09092005b\
+      09092005c\
+      14092005 \
+      15092005 \
+      28102005 \
+      16112005 \
+      16122005 \
+      19122005 \
+      17022006 \
+      05042006 \
+      02052006 \
+      19072006 \
+      31072006 \
+      07122006 \
+      20122006 \
+      16022007 \
+
+
+failcom   = 'exit 1'
+
+compile : ${DIR}
+	@for i in ${DIR} ; do \
+    echo Testing $$i... ; \
+    ($(MAKE) -C $$i) || eval ${failcom} ; \
+  done;
+
+test : ${DIR}
+	@for i in ${DIR} ; do \
+    echo Testing $$i... ; \
+    ($(MAKE) -C $$i test) || eval ${failcom} ; ($(MAKE) -C $$i clean) ; \
+  done;
+	
+clean :
+	@for i in ${DIR} ; do \
+    echo Testing $$i... ; \
+    ($(MAKE) -C $$i clean) || eval ${failcom} ; \
+  done;
Index: /latest/test_regression/env.mk
===================================================================
--- /latest/test_regression/env.mk	(revision 1)
+++ /latest/test_regression/env.mk	(revision 1)
@@ -0,0 +1,69 @@
+#TARGET_ARCH  		=Linux.SLA4x
+#TARGET_ARCH  		= linux
+#TARGET_PLATFORM  =i386
+
+ifeq (${TARGET_ARCH},Darwin)
+DYNAMICLIB_FLAG = -dynamic
+ENDIANESS_FLAG  = #-mlittle-endian
+else
+DYNAMICLIB_FLAG = -rdynamic
+ENDIANESS_FLAG  = 
+endif
+ifndef SYSTEMC
+$(error SYSTEMC should be set to SystemC directory (OSCI version) \
+to compare simulation results.)
+endif
+
+#BFD_LIBERTY     = -lbfd -liberty
+#SYSTEMC         = /users/outil/systemc/systemc-2.0.1
+#SYSTEMC         = /dsk/l1/misc/richard/systemc_2_1.oct_12_2004.beta
+#SYSTEMCASS      = /users/cao/buchmann/systemcass/systemcass
+SYSTEMC_INC     = $(SYSTEMC)/include
+SYSTEMCASS_INC  = $(SYSTEMCASS)/include
+SYSTEMC_LIB     = $(SYSTEMC)/lib-${TARGET_PLATFORM}-${TARGET_ARCH}/libsystemc.a
+SYSTEMCASS_LIB  = $(SYSTEMCASS)/lib/libsystemc_$(firstword $(CXX))-d.a
+#CXX         		= g++
+#CXX          		= icc -w1
+CPPFILT     		= c++filt
+DEBUG           = -g -DDEBUG
+#OPT             = -O2
+#PROF        = -pg # gcc
+#PROF        = -qp # icc
+#EFENCE      = /users/cao/viaud/bin/lib/libefence.a -lpthread
+CFLAGS      = $(PROF) $(DEBUG) $(OPT) \
+              -UENABLE_TRACE -UENABLE_PAT -I. \
+              ${ENDIANESS_FLAG}
+
+LFLAGS      = $(PROF) $(BFD_LIBERTY) -ldl
+
+CFLAGS_SYSTEMC    = $(CFLAGS) \
+                    -I$(SYSTEMC_INC) \
+
+CFLAGS_SYSTEMCASS = $(CFLAGS) \
+                    -I$(SYSTEMCASS_INC) \
+                    ${DYNAMICLIB_FLAG} #-Wno-deprecated
+
+LFLAGS_SYSTEMC    = $(LFLAGS) \
+                    $(SYSTEMC_LIB)
+
+LFLAGS_SYSTEMCASS = $(LFLAGS) \
+                    ${DYNAMICLIB_FLAG} $(SYSTEMCASS_LIB) ${EFENCE}
+
+#ifndef TARGET_PLATFORM
+#$(error TARGET_PLATFORM is not defined.)
+#endif
+#ifndef TARGET_ARCH
+#$(error TARGET_ARCH is not defined.)
+#endif
+ifndef SYSTEMC
+$(error SYSTEMC is not defined.)
+endif
+ifndef SYSTEMCASS
+$(error SYSTEMCASS is not defined.)
+endif
+ifndef SOCVIEW
+$(error SOCVIEW is not defined.)
+endif
+
+failcom   = 'exit 1'
+
