From a159ef5fbbfdf497270d7e8948ac0e356ce25dc8 Mon Sep 17 00:00:00 2001
From: Daniela Genius <genius@debussy.soc.lip6.fr>
Date: Tue, 24 Jul 2018 12:27:08 +0200
Subject: [PATCH] major update but without clustered

---
 MPSoC/Makefile.forsoclib                      |   2 +-
 .../miniAsynchronousDeployClusteredVGMN.xml   | 325 ++++++++--------
 .../ddtranslatorSoclib/AvatarChannel.java     |  16 +-
 .../java/ddtranslatorSoclib/AvatarRAM.java    |  33 +-
 .../toTopCell/Declaration.java                |   8 +-
 .../toTopCell/MappingTable.java               |  16 +-
 .../ddtranslatorSoclib/toTopCell/NetList.java | 287 +++++++-------
 .../ddtranslatorSoclib/toTopCell/Signal.java  |  24 +-
 .../ui/AvatarDeploymentPanelTranslator.java   |   5 +-
 src/main/java/ui/avatardd/ADDMemoryNode.java  |   2 +
 .../java/ui/avatardd/ADDMemoryNode.java-new   | 335 +++++++++++++++++
 src/main/java/ui/avatardd/ADDRAMNode.java     |  14 +-
 src/main/java/ui/avatardd/ADDRAMNode.java-new | 167 +++++++++
 src/main/java/ui/avatardd/ADDTTYNode.java     |  25 +-
 src/main/java/ui/avatardd/ADDTTYNode.java-new | 328 ++++++++++++++++
 .../ui/window/JDialogADDMemoryNode.java-new   | 353 ++++++++++++++++++
 .../java/ui/window/JDialogADDTTYNode.java     |  13 +-
 .../java/ui/window/JDialogADDTTYNode.java-new | 202 ++++++++++
 18 files changed, 1777 insertions(+), 378 deletions(-)
 create mode 100755 src/main/java/ui/avatardd/ADDMemoryNode.java-new
 create mode 100755 src/main/java/ui/avatardd/ADDRAMNode.java-new
 create mode 100755 src/main/java/ui/avatardd/ADDTTYNode.java-new
 create mode 100644 src/main/java/ui/window/JDialogADDMemoryNode.java-new
 create mode 100644 src/main/java/ui/window/JDialogADDTTYNode.java-new

diff --git a/MPSoC/Makefile.forsoclib b/MPSoC/Makefile.forsoclib
index cbaca871c8..c19f4485d6 100755
--- a/MPSoC/Makefile.forsoclib
+++ b/MPSoC/Makefile.forsoclib
@@ -44,4 +44,4 @@ runsoclib:
 	echo "running soclib"
 	cd soclib/soclib/platform/topcells/caba-vgmn-mutekh_kernel_tutorial; make; SOCLIB_GDB=S ./system.x $(SOCLIB_CPU):$(SOCLIB_CPU_COUNT) ../../../../../mutekh/avatar-soclib-$(MUTEKH_CPU).out
 	
-allsoclib: updateruntime updategeneratedcode compilesoclib runsoclib
+allsoclib: updategeneratedcode compilesoclib runsoclib
diff --git a/modeling/LIP6/miniAsynchronousDeployClusteredVGMN.xml b/modeling/LIP6/miniAsynchronousDeployClusteredVGMN.xml
index 0cd1b89541..80dfba0726 100644
--- a/modeling/LIP6/miniAsynchronousDeployClusteredVGMN.xml
+++ b/modeling/LIP6/miniAsynchronousDeployClusteredVGMN.xml
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 
-<TURTLEGMODELING version="0.98-beta4">
+<TURTLEGMODELING version="1.0beta">
 
 <Modeling type="AVATAR Design" nameTab="AVATAR Design" >
-<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="1400" minY="10" maxY="900" >
+<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="1400" minY="10" maxY="900" zoom="1.0" >
 <MainCode value="void __user_init() {"/>
 <MainCode value="}"/>
 <Optimized value="true" />
-<Validated value="Block1;Block0;" />
+<Validated value="" />
 <Ignored value="" />
 
 <CONNECTOR type="5002" id="2" >
@@ -55,8 +55,9 @@
 <TGConnectingPoint num="22" id="25" />
 <TGConnectingPoint num="23" id="26" />
 <extraparam>
+<blockType data="block" color="-4072719" />
 <CryptoBlock value="false" />
-<Signal value="in val()" />
+<Signal value="in val()" attached="true" />
 </extraparam>
 </COMPONENT>
 
@@ -91,8 +92,9 @@
 <TGConnectingPoint num="22" id="50" />
 <TGConnectingPoint num="23" id="51" />
 <extraparam>
+<blockType data="block" color="-4072719" />
 <CryptoBlock value="false" />
-<Signal value="out val()" />
+<Signal value="out val()" attached="true" />
 </extraparam>
 </COMPONENT>
 
@@ -125,6 +127,7 @@
 <afterMax value="" />
 <computeMin value="" />
 <computeMax value="" />
+<probability value="" />
 </extraparam>
 </SUBCOMPONENT>
 
@@ -153,6 +156,7 @@
 <afterMax value="" />
 <computeMin value="" />
 <computeMax value="" />
+<probability value="" />
 </extraparam>
 </SUBCOMPONENT>
 
@@ -181,6 +185,7 @@
 <afterMax value="" />
 <computeMin value="" />
 <computeMax value="" />
+<probability value="" />
 </extraparam>
 </SUBCOMPONENT>
 
@@ -299,6 +304,7 @@
 <afterMax value="" />
 <computeMin value="" />
 <computeMax value="" />
+<probability value="" />
 </extraparam>
 </SUBCOMPONENT>
 
@@ -327,6 +333,7 @@
 <afterMax value="" />
 <computeMin value="" />
 <computeMax value="" />
+<probability value="" />
 </extraparam>
 </SUBCOMPONENT>
 
@@ -355,6 +362,7 @@
 <afterMax value="" />
 <computeMin value="" />
 <computeMax value="" />
+<probability value="" />
 </extraparam>
 </SUBCOMPONENT>
 
@@ -454,12 +462,59 @@
 
 <Modeling type="ADD" nameTab="Avatar Deployment" >
 <ADDDiagramPanel name="Deployment Diagram" minX="10" maxX="1400" minY="10" maxY="900" attributes="0" masterClockFrequency="200" >
-<COMPONENT type="5363" id="231" >
-<cdparam x="431" y="307" />
-<sizeparam width="250" height="50" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<CONNECTOR type="5350" id="435" >
+<cdparam x="351" y="402" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="{info}" />
+<P1  x="351" y="402" id="412" />
+<P2  x="281" y="335" id="288" />
+<AutomaticDrawing  data="true" />
+<extraparam>
+<spy value="false" />
+</extraparam>
+</CONNECTOR>
+<COMPONENT type="5355" id="410" >
+<cdparam x="251" y="402" />
+<sizeparam width="200" height="200" minWidth="100" minHeight="35" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
-<infoparam name="Vgmn0" value="name" />
+<infoparam name="Memory0" value="name" />
+<TGConnectingPoint num="0" id="411" />
+<TGConnectingPoint num="1" id="412" />
+<TGConnectingPoint num="2" id="413" />
+<TGConnectingPoint num="3" id="414" />
+<TGConnectingPoint num="4" id="415" />
+<TGConnectingPoint num="5" id="416" />
+<TGConnectingPoint num="6" id="417" />
+<TGConnectingPoint num="7" id="418" />
+<TGConnectingPoint num="8" id="419" />
+<TGConnectingPoint num="9" id="420" />
+<TGConnectingPoint num="10" id="421" />
+<TGConnectingPoint num="11" id="422" />
+<TGConnectingPoint num="12" id="423" />
+<TGConnectingPoint num="13" id="424" />
+<TGConnectingPoint num="14" id="425" />
+<TGConnectingPoint num="15" id="426" />
+<TGConnectingPoint num="16" id="427" />
+<TGConnectingPoint num="17" id="428" />
+<TGConnectingPoint num="18" id="429" />
+<TGConnectingPoint num="19" id="430" />
+<TGConnectingPoint num="20" id="431" />
+<TGConnectingPoint num="21" id="432" />
+<TGConnectingPoint num="22" id="433" />
+<TGConnectingPoint num="23" id="434" />
+<extraparam>
+<info stereotype="RAM" nodeName="Memory0" />
+<attributes byteDataSize="1024"  index="0"  cluster_index="0"  processCode="" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="5354" id="231" >
+<cdparam x="746" y="442" />
+<sizeparam width="250" height="200" minWidth="150" minHeight="100" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
+<infoparam name="TTY1" value="name" />
 <TGConnectingPoint num="0" id="207" />
 <TGConnectingPoint num="1" id="208" />
 <TGConnectingPoint num="2" id="209" />
@@ -485,14 +540,14 @@
 <TGConnectingPoint num="22" id="229" />
 <TGConnectingPoint num="23" id="230" />
 <extraparam>
-<info stereotype="VGMN" nodeName="Vgmn0" />
-<attributes index="0"  nbOfAttachedInitiators="0"  nbOfAttachedTargets="0"  minLatency="0"  fifoDepth="0" />
+<info stereotype="TTY" nodeName="TTY1" />
+<attributes index="1" cluster_index="0" />
 </extraparam>
 </COMPONENT>
 
 <COMPONENT type="5354" id="256" >
-<cdparam x="10" y="378" />
-<sizeparam width="163" height="176" minWidth="150" minHeight="100" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="17" y="356" />
+<sizeparam width="150" height="187" minWidth="150" minHeight="100" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
 <infoparam name="TTY0" value="name" />
@@ -522,16 +577,16 @@
 <TGConnectingPoint num="23" id="255" />
 <extraparam>
 <info stereotype="TTY" nodeName="TTY0" />
-<attributes index="0" />
+<attributes index="0" cluster_index="0" />
 </extraparam>
 </COMPONENT>
 
-<COMPONENT type="5364" id="281" >
-<cdparam x="156" y="285" />
+<COMPONENT type="5363" id="281" >
+<cdparam x="431" y="307" />
 <sizeparam width="250" height="50" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
-<infoparam name="Crossbar0" value="name" />
+<infoparam name="Vgmn0" value="name" />
 <TGConnectingPoint num="0" id="257" />
 <TGConnectingPoint num="1" id="258" />
 <TGConnectingPoint num="2" id="259" />
@@ -557,17 +612,17 @@
 <TGConnectingPoint num="22" id="279" />
 <TGConnectingPoint num="23" id="280" />
 <extraparam>
-<info stereotype="CROSSBAR" nodeName="Crossbar0" />
- cluster_index="0"  cluster_address="0" />
+<info stereotype="VGMN" nodeName="Vgmn0" />
+<attributes index="0"  nbOfAttachedInitiators="0"  nbOfAttachedTargets="0"  minLatency="10"  fifoDepth="8" />
 </extraparam>
 </COMPONENT>
 
 <COMPONENT type="5364" id="306" >
-<cdparam x="725" y="322" />
+<cdparam x="156" y="285" />
 <sizeparam width="250" height="50" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
-<infoparam name="Crossbar1" value="name" />
+<infoparam name="Crossbar0" value="name" />
 <TGConnectingPoint num="0" id="282" />
 <TGConnectingPoint num="1" id="283" />
 <TGConnectingPoint num="2" id="284" />
@@ -593,53 +648,17 @@
 <TGConnectingPoint num="22" id="304" />
 <TGConnectingPoint num="23" id="305" />
 <extraparam>
-<info stereotype="CROSSBAR" nodeName="Crossbar1" />
- cluster_index="0"  cluster_address="0" />
+<info stereotype="CROSSBAR" nodeName="Crossbar0" />
+<attributes cluster_index="0"  cluster_address="0" />
 </extraparam>
 </COMPONENT>
 
-<COMPONENT type="5355" id="340" >
-<cdparam x="218" y="386" />
-<sizeparam width="200" height="200" minWidth="100" minHeight="35" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<COMPONENT type="5364" id="331" >
+<cdparam x="725" y="322" />
+<sizeparam width="250" height="50" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
-<infoparam name="Memory0" value="name" />
-<TGConnectingPoint num="0" id="316" />
-<TGConnectingPoint num="1" id="317" />
-<TGConnectingPoint num="2" id="318" />
-<TGConnectingPoint num="3" id="319" />
-<TGConnectingPoint num="4" id="320" />
-<TGConnectingPoint num="5" id="321" />
-<TGConnectingPoint num="6" id="322" />
-<TGConnectingPoint num="7" id="323" />
-<TGConnectingPoint num="8" id="324" />
-<TGConnectingPoint num="9" id="325" />
-<TGConnectingPoint num="10" id="326" />
-<TGConnectingPoint num="11" id="327" />
-<TGConnectingPoint num="12" id="328" />
-<TGConnectingPoint num="13" id="329" />
-<TGConnectingPoint num="14" id="330" />
-<TGConnectingPoint num="15" id="331" />
-<TGConnectingPoint num="16" id="332" />
-<TGConnectingPoint num="17" id="333" />
-<TGConnectingPoint num="18" id="334" />
-<TGConnectingPoint num="19" id="335" />
-<TGConnectingPoint num="20" id="336" />
-<TGConnectingPoint num="21" id="337" />
-<TGConnectingPoint num="22" id="338" />
-<TGConnectingPoint num="23" id="339" />
-<extraparam>
-<info stereotype="RAM" nodeName="Memory0" />
-<attributes byteDataSize="1048576"  index="0" />
-</extraparam>
-</COMPONENT>
-<SUBCOMPONENT type="5362" id="315" >
-<father id="340" num="0" />
-<cdparam x="288" y="436" />
-<sizeparam width="122" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<hidden value="false" />
-<cdrectangleparam minX="0" maxX="78" minY="0" maxY="160" />
-<infoparam name="TGComponent" value="Block0/out val" />
+<infoparam name="Crossbar1" value="name" />
 <TGConnectingPoint num="0" id="307" />
 <TGConnectingPoint num="1" id="308" />
 <TGConnectingPoint num="2" id="309" />
@@ -648,17 +667,34 @@
 <TGConnectingPoint num="5" id="312" />
 <TGConnectingPoint num="6" id="313" />
 <TGConnectingPoint num="7" id="314" />
+<TGConnectingPoint num="8" id="315" />
+<TGConnectingPoint num="9" id="316" />
+<TGConnectingPoint num="10" id="317" />
+<TGConnectingPoint num="11" id="318" />
+<TGConnectingPoint num="12" id="319" />
+<TGConnectingPoint num="13" id="320" />
+<TGConnectingPoint num="14" id="321" />
+<TGConnectingPoint num="15" id="322" />
+<TGConnectingPoint num="16" id="323" />
+<TGConnectingPoint num="17" id="324" />
+<TGConnectingPoint num="18" id="325" />
+<TGConnectingPoint num="19" id="326" />
+<TGConnectingPoint num="20" id="327" />
+<TGConnectingPoint num="21" id="328" />
+<TGConnectingPoint num="22" id="329" />
+<TGConnectingPoint num="23" id="330" />
 <extraparam>
-<info value="Block0/out val" channelName="Block0/out val() #--# Block1/in val()" fullChannelName="" referenceDiagram="AVATAR Design" />
+<info stereotype="CROSSBAR" nodeName="Crossbar1" />
+<attributes cluster_index="1"  cluster_address="0" />
 </extraparam>
-</SUBCOMPONENT>
+</COMPONENT>
 
-<COMPONENT type="5354" id="365" >
-<cdparam x="639" y="474" />
+<COMPONENT type="5351" id="365" >
+<cdparam x="545" y="49" />
 <sizeparam width="250" height="200" minWidth="150" minHeight="100" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
-<infoparam name="TTY1" value="name" />
+<infoparam name="CPU1" value="name" />
 <TGConnectingPoint num="0" id="341" />
 <TGConnectingPoint num="1" id="342" />
 <TGConnectingPoint num="2" id="343" />
@@ -684,17 +720,36 @@
 <TGConnectingPoint num="22" id="363" />
 <TGConnectingPoint num="23" id="364" />
 <extraparam>
-<info stereotype="TTY" nodeName="TTY1" />
-<attributes index="1" />
+<info stereotype="CPU" nodeName="CPU1" />
+<attributes nbOfIrq="6"  iCacheWays="1"  iCacheSets="8"  iCacheWords="4"  dCacheWays="1"  dCacheSets="8"  dCacheWords="4" />
 </extraparam>
 </COMPONENT>
+<SUBCOMPONENT type="5352" id="340" >
+<father id="365" num="0" />
+<cdparam x="604" y="119" />
+<sizeparam width="175" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="0" maxX="75" minY="0" maxY="160" />
+<infoparam name="TGComponent" value="AVATAR Design::Block1" />
+<TGConnectingPoint num="0" id="332" />
+<TGConnectingPoint num="1" id="333" />
+<TGConnectingPoint num="2" id="334" />
+<TGConnectingPoint num="3" id="335" />
+<TGConnectingPoint num="4" id="336" />
+<TGConnectingPoint num="5" id="337" />
+<TGConnectingPoint num="6" id="338" />
+<TGConnectingPoint num="7" id="339" />
+<extraparam>
+<info value="AVATAR Design::Block1" taskName="Block1" referenceTaskName="AVATAR Design" />
+</extraparam>
+</SUBCOMPONENT>
 
 <COMPONENT type="5351" id="399" >
-<cdparam x="545" y="49" />
+<cdparam x="113" y="44" />
 <sizeparam width="250" height="200" minWidth="150" minHeight="100" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
 <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
-<infoparam name="CPU1" value="name" />
+<infoparam name="CPU0" value="name" />
 <TGConnectingPoint num="0" id="375" />
 <TGConnectingPoint num="1" id="376" />
 <TGConnectingPoint num="2" id="377" />
@@ -720,17 +775,17 @@
 <TGConnectingPoint num="22" id="397" />
 <TGConnectingPoint num="23" id="398" />
 <extraparam>
-<info stereotype="CPU" nodeName="CPU1" />
+<info stereotype="CPU" nodeName="CPU0" />
 <attributes nbOfIrq="6"  iCacheWays="1"  iCacheSets="8"  iCacheWords="4"  dCacheWays="1"  dCacheSets="8"  dCacheWords="4" />
 </extraparam>
 </COMPONENT>
 <SUBCOMPONENT type="5352" id="374" >
 <father id="399" num="0" />
-<cdparam x="604" y="119" />
-<sizeparam width="175" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="172" y="134" />
+<sizeparam width="176" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="75" minY="0" maxY="160" />
-<infoparam name="TGComponent" value="AVATAR Design::Block1" />
+<cdrectangleparam minX="0" maxX="74" minY="0" maxY="160" />
+<infoparam name="TGComponent" value="AVATAR Design::Block0" />
 <TGConnectingPoint num="0" id="366" />
 <TGConnectingPoint num="1" id="367" />
 <TGConnectingPoint num="2" id="368" />
@@ -740,122 +795,67 @@
 <TGConnectingPoint num="6" id="372" />
 <TGConnectingPoint num="7" id="373" />
 <extraparam>
-<info value="AVATAR Design::Block1" taskName="Block1" referenceTaskName="AVATAR Design" />
-</extraparam>
-</SUBCOMPONENT>
-
-<COMPONENT type="5351" id="433" >
-<cdparam x="113" y="44" />
-<sizeparam width="250" height="200" minWidth="150" minHeight="100" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<hidden value="false" />
-<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" />
-<infoparam name="CPU0" value="name" />
-<TGConnectingPoint num="0" id="409" />
-<TGConnectingPoint num="1" id="410" />
-<TGConnectingPoint num="2" id="411" />
-<TGConnectingPoint num="3" id="412" />
-<TGConnectingPoint num="4" id="413" />
-<TGConnectingPoint num="5" id="414" />
-<TGConnectingPoint num="6" id="415" />
-<TGConnectingPoint num="7" id="416" />
-<TGConnectingPoint num="8" id="417" />
-<TGConnectingPoint num="9" id="418" />
-<TGConnectingPoint num="10" id="419" />
-<TGConnectingPoint num="11" id="420" />
-<TGConnectingPoint num="12" id="421" />
-<TGConnectingPoint num="13" id="422" />
-<TGConnectingPoint num="14" id="423" />
-<TGConnectingPoint num="15" id="424" />
-<TGConnectingPoint num="16" id="425" />
-<TGConnectingPoint num="17" id="426" />
-<TGConnectingPoint num="18" id="427" />
-<TGConnectingPoint num="19" id="428" />
-<TGConnectingPoint num="20" id="429" />
-<TGConnectingPoint num="21" id="430" />
-<TGConnectingPoint num="22" id="431" />
-<TGConnectingPoint num="23" id="432" />
-<extraparam>
-<info stereotype="CPU" nodeName="CPU0" />
-<attributes nbOfIrq="6"  iCacheWays="1"  iCacheSets="8"  iCacheWords="4"  dCacheWays="1"  dCacheSets="8"  dCacheWords="4" />
-</extraparam>
-</COMPONENT>
-<SUBCOMPONENT type="5352" id="408" >
-<father id="433" num="0" />
-<cdparam x="172" y="134" />
-<sizeparam width="176" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<hidden value="false" />
-<cdrectangleparam minX="0" maxX="74" minY="0" maxY="160" />
-<infoparam name="TGComponent" value="AVATAR Design::Block0" />
-<TGConnectingPoint num="0" id="400" />
-<TGConnectingPoint num="1" id="401" />
-<TGConnectingPoint num="2" id="402" />
-<TGConnectingPoint num="3" id="403" />
-<TGConnectingPoint num="4" id="404" />
-<TGConnectingPoint num="5" id="405" />
-<TGConnectingPoint num="6" id="406" />
-<TGConnectingPoint num="7" id="407" />
-<extraparam>
 <info value="AVATAR Design::Block0" taskName="Block0" referenceTaskName="AVATAR Design" />
 </extraparam>
 </SUBCOMPONENT>
 
-<CONNECTOR type="5350" id="434" >
-<cdparam x="681" y="332" />
+<CONNECTOR type="5350" id="401" >
+<cdparam x="167" y="402" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector" value="{info}" />
-<P1  x="681" y="332" id="211" />
-<P2  x="725" y="347" id="285" />
+<P1  x="167" y="402" id="243" />
+<P2  x="218" y="335" id="296" />
 <AutomaticDrawing  data="true" />
 <extraparam>
 <spy value="false" />
 </extraparam>
 </CONNECTOR>
-<CONNECTOR type="5350" id="435" >
-<cdparam x="431" y="319" />
+<CONNECTOR type="5350" id="402" >
+<cdparam x="871" y="442" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector" value="{info}" />
-<P1  x="431" y="319" id="217" />
-<P2  x="406" y="310" id="261" />
+<P1  x="871" y="442" id="208" />
+<P2  x="850" y="372" id="313" />
 <AutomaticDrawing  data="true" />
 <extraparam>
 <spy value="false" />
 </extraparam>
 </CONNECTOR>
-<CONNECTOR type="5350" id="436" >
-<cdparam x="173" y="378" />
+<CONNECTOR type="5350" id="404" >
+<cdparam x="681" y="332" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector" value="{info}" />
-<P1  x="173" y="378" id="234" />
-<P2  x="218" y="335" id="271" />
+<P1  x="681" y="332" id="261" />
+<P2  x="725" y="347" id="310" />
 <AutomaticDrawing  data="true" />
 <extraparam>
 <spy value="false" />
 </extraparam>
 </CONNECTOR>
-<CONNECTOR type="5350" id="437" >
-<cdparam x="764" y="474" />
+<CONNECTOR type="5350" id="405" >
+<cdparam x="431" y="319" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector" value="{info}" />
-<P1  x="764" y="474" id="342" />
-<P2  x="850" y="372" id="288" />
+<P1  x="431" y="319" id="267" />
+<P2  x="406" y="310" id="286" />
 <AutomaticDrawing  data="true" />
 <extraparam>
 <spy value="false" />
 </extraparam>
 </CONNECTOR>
-<CONNECTOR type="5350" id="439" >
+<CONNECTOR type="5350" id="407" >
 <cdparam x="732" y="249" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector" value="{info}" />
-<P1  x="732" y="249" id="390" />
-<P2  x="787" y="322" id="290" />
+<P1  x="732" y="249" id="356" />
+<P2  x="787" y="322" id="315" />
 <Point x="788" y="318" />
 <AutomaticDrawing  data="true" />
 <extraparam>
 <spy value="false" />
 </extraparam>
-</CONNECTOR><SUBCOMPONENT type="-1" id="438" >
-<father id="439" num="0" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="406" >
+<father id="407" num="0" />
 <cdparam x="788" y="318" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
@@ -863,23 +863,12 @@
 <infoparam name="point " value="null" />
 </SUBCOMPONENT>
 
-<CONNECTOR type="5350" id="440" >
-<cdparam x="318" y="386" />
-<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector" value="{info}" />
-<P1  x="318" y="386" id="317" />
-<P2  x="281" y="335" id="263" />
-<AutomaticDrawing  data="true" />
-<extraparam>
-<spy value="false" />
-</extraparam>
-</CONNECTOR>
-<CONNECTOR type="5350" id="441" >
+<CONNECTOR type="5350" id="408" >
 <cdparam x="300" y="244" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector" value="{info}" />
-<P1  x="300" y="244" id="424" />
-<P2  x="281" y="285" id="258" />
+<P1  x="300" y="244" id="390" />
+<P2  x="281" y="285" id="283" />
 <AutomaticDrawing  data="true" />
 <extraparam>
 <spy value="false" />
diff --git a/src/main/java/ddtranslatorSoclib/AvatarChannel.java b/src/main/java/ddtranslatorSoclib/AvatarChannel.java
index d52a80f8c7..9bcbf9f098 100755
--- a/src/main/java/ddtranslatorSoclib/AvatarChannel.java
+++ b/src/main/java/ddtranslatorSoclib/AvatarChannel.java
@@ -50,25 +50,21 @@ public class AvatarChannel extends AvatarMappedObject{
 
     private AvatarRAM avatarRAMReference; 
     private String referenceDiagram ;
-	private String channelName ;
-    private int no_cluster;
+    private String channelName ;
+    private int cluster_index;
     private int  monitored;
 
-    public AvatarChannel(String _referenceDiagram,  String _channelName, AvatarRAM _avatarRAMReference, int _no_cluster, int _monitored){
+    public AvatarChannel(String _referenceDiagram,  String _channelName, AvatarRAM _avatarRAMReference, int _cluster_index, int _monitored){
       referenceDiagram =  _referenceDiagram;
       channelName = _channelName;
       avatarRAMReference = _avatarRAMReference;
-      no_cluster = _no_cluster;
+      cluster_index = _cluster_index;
       monitored = _monitored;
     }
 
     public AvatarRAM getAvatarRAMReference(){
       return  avatarRAMReference;
-    }
-
-    public int getRAMNo(){
-      return avatarRAMReference.getNo_ram();
-    }
+    } 
 
     public String getReferenceDiagram(){
       return referenceDiagram;
@@ -79,7 +75,7 @@ public class AvatarChannel extends AvatarMappedObject{
       } 
 
     public int getClusterIndex(){
-      return no_cluster;
+      return cluster_index;
     } 
 
     public int getMonitored(){
diff --git a/src/main/java/ddtranslatorSoclib/AvatarRAM.java b/src/main/java/ddtranslatorSoclib/AvatarRAM.java
index 6bd1bce026..d378575d39 100755
--- a/src/main/java/ddtranslatorSoclib/AvatarRAM.java
+++ b/src/main/java/ddtranslatorSoclib/AvatarRAM.java
@@ -53,22 +53,22 @@ import java.util.LinkedList;
 public class AvatarRAM extends AvatarComponent{
     
     private String memoryName ;
-    private int index;
+   
     private int dataSize; 
 
-    public int no_ram;
+    public int index;
+    public int cluster_index;
     public int no_target;
     public int no_target_local;
-    public int no_cluster;
     public int monitored;
 
     LinkedList<AvatarChannel> channelMapped ;
     
-    public AvatarRAM(String _memoryName, int _dataSize, int _no_cluster, int _no_ram, int _monitored)  {
+    public AvatarRAM(String _memoryName, int _dataSize, int _cluster_index, int _index, int _monitored)  {
       memoryName = _memoryName;
       dataSize = _dataSize;
-      no_cluster=_no_cluster;
-      no_ram = _no_ram;
+      index = _index;
+      cluster_index= _cluster_index;
       monitored=_monitored;
       channelMapped =  new LinkedList<AvatarChannel>();
     }
@@ -77,34 +77,23 @@ public class AvatarRAM extends AvatarComponent{
 	return memoryName;
     }
 
-    public int getNo_ram(){
-      return no_ram;
-    }
-
     public int getNo_target(){
       return no_target;
     }
 
+    public int getIndex(){
+	return index;
+	}
+    
     public int getClusterIndex(){	
-      return no_cluster;
+      return cluster_index;
     } 
 
-    public void setNo_ram(int _no_ram){
-      no_ram = _no_ram;
-    }
     /* the target number is set by the topcell generator*/
     public void setNo_target(int _no_target){
       no_target = _no_target;
     }
 
-    public void setNo_cluster(int _no_cluster){
-      no_cluster = _no_cluster;
-    }
-
-    public int getIndex(){
-	return index;
-    }
-
     public int getDataSize(){
 	return dataSize;
     }
diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Declaration.java b/src/main/java/ddtranslatorSoclib/toTopCell/Declaration.java
index 776243dbfd..3037d7ed69 100755
--- a/src/main/java/ddtranslatorSoclib/toTopCell/Declaration.java
+++ b/src/main/java/ddtranslatorSoclib/toTopCell/Declaration.java
@@ -1,3 +1,6 @@
+
+
+
 /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
  * Daniela Genius, Lip6, UMR 7606 
  * 
@@ -196,7 +199,7 @@ public class Declaration
 		    + CR2;
 	    }
 
-	//No DMA yet; planned to make it optional depending on deployment diagram
+	
 		if (nb_clusters == 0)
 	    {	
 		    //"caba::VciDma<vci_param> vcidma(\"vci_dma\", maptab,6,6,8);"
@@ -205,8 +208,7 @@ public class Declaration
 	    }
 	else
 	    {
-		declaration +=
-		    "caba::VciDma<vci_param> vcifdma(\"vci_dma\", IntTab(0,6), maptab);"
+		declaration +="caba::VciDma<vci_param> vcidma(\"vci_dma\", maptab,IntTab(0,cpus.size()+3),IntTab(0,6),8);"		  
 		    + CR;
 	    }
 	
diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/MappingTable.java b/src/main/java/ddtranslatorSoclib/toTopCell/MappingTable.java
index 6b0a5dcded..0d480f80f0 100755
--- a/src/main/java/ddtranslatorSoclib/toTopCell/MappingTable.java
+++ b/src/main/java/ddtranslatorSoclib/toTopCell/MappingTable.java
@@ -172,18 +172,18 @@ public class MappingTable {
 		int cacheability_bit= 2097152; //0x00200000	
 		      
 		/* Boot Ram segments 0,1,2 */
-		if(ram.getNo_ram() ==0){
+		if(ram.getIndex() ==0){
 		    ram.setNo_target(2);
 		   
-		    mapping += "maptab.add(Segment(\"cram" + ram.getNo_ram() + "\", 0x" +Integer.toHexString(address_start+i*step)+ ", 0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+(ram.getNo_target())+"), true));" + CR;
-		    mapping += "maptab.add(Segment(\"uram" + ram.getNo_ram() + "\", 0x" + Integer.toHexString(address_start+i*step+cacheability_bit+ram.getDataSize()/2)+ ", 0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+(ram.getNo_target())+"), false));" + CR;
+		    mapping += "maptab.add(Segment(\"cram" + ram.getIndex() + "\", 0x" +Integer.toHexString(address_start+i*step)+ ", 0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+(ram.getNo_target())+"), true));" + CR;
+		    mapping += "maptab.add(Segment(\"uram" + ram.getIndex() + "\", 0x" + Integer.toHexString(address_start+i*step+cacheability_bit+ram.getDataSize()/2)+ ", 0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+(ram.getNo_target())+"), false));" + CR;
 		    i++;
 		}
 		else{
 		    
 		    ram.setNo_target(10+i);		    
-		    mapping += "maptab.add(Segment(\"cram" + ram.getNo_ram() + "\", 0x" + Integer.toHexString(address_start+i*step)+ ",  0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+(ram.getNo_target())+"), true));" + CR;
-		    mapping += "maptab.add(Segment(\"uram" + ram.getNo_ram() + "\", 0x" + Integer.toHexString(address_start+i*step+ram.getDataSize()/2+cacheability_bit) + " ,  0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+(ram.getNo_target())+"), false));" + CR;
+		    mapping += "maptab.add(Segment(\"cram" + ram.getIndex() + "\", 0x" + Integer.toHexString(address_start+i*step)+ ",  0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+(ram.getNo_target())+"), true));" + CR;
+		    mapping += "maptab.add(Segment(\"uram" + ram.getIndex() + "\", 0x" + Integer.toHexString(address_start+i*step+ram.getDataSize()/2+cacheability_bit) + " ,  0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+(ram.getNo_target())+"), false));" + CR;
 		    	
 		    i++;	 
 		}
@@ -287,9 +287,9 @@ public class MappingTable {
 	       this is the memory space covered by the RAMs of a cluster */
     
 	    for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) {						      	
-		mapping += "maptab.add(Segment(\"cram" + ram.getNo_ram() + "\", 0x"+Integer.toHexString(SEG_RAM_BASE+ ram.getClusterIndex()*CLUSTER_SIZE)+",  0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+ram.getClusterIndex()+","+(ram.getNo_target())+"), true));" + CR;
+		mapping += "maptab.add(Segment(\"cram"+ram.getClusterIndex()+"_" + ram.getIndex() + "\", 0x"+Integer.toHexString(SEG_RAM_BASE+ ram.getClusterIndex()*CLUSTER_SIZE)+",  0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+ram.getClusterIndex()+","+(ram.getNo_target())+"), true));" + CR;
 	  
-		mapping += "maptab.add(Segment(\"uram" + ram.getNo_ram() + "\",  0x"+Integer.toHexString(SEG_RAM_BASE + ram.getClusterIndex()*CLUSTER_SIZE+cacheability_bit)+",  0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+ram.getClusterIndex()+","+(ram.getNo_target())+"), false));" + CR;	  
+		mapping += "maptab.add(Segment(\"uram" + ram.getClusterIndex()+"_" +ram.getIndex() + "\",  0x"+Integer.toHexString(SEG_RAM_BASE + ram.getClusterIndex()*CLUSTER_SIZE+cacheability_bit)+",  0x"+Integer.toHexString(ram.getDataSize()/2)+", IntTab("+ram.getClusterIndex()+","+(ram.getNo_target())+"), false));" + CR;	  
 	    }                     
          
 	    //Identify the TTYS in current cluster (as opposed to TTYs in total)
@@ -302,7 +302,7 @@ public class MappingTable {
 		int cluster_rams=rams_in_cluster(avatardd,cluster_no);
 	  
 		if(tty.getClusterIndex()==0){	  
-		    tty_no=6+cluster_rams;
+		    tty_no=10+cluster_rams;
 		}
 		else{	     
 		    tty_no=cluster_rams;	      
diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/NetList.java b/src/main/java/ddtranslatorSoclib/toTopCell/NetList.java
index 490d74414a..748f5b7c12 100755
--- a/src/main/java/ddtranslatorSoclib/toTopCell/NetList.java
+++ b/src/main/java/ddtranslatorSoclib/toTopCell/NetList.java
@@ -64,20 +64,20 @@ public class NetList
     private static boolean tracing;
 
 
- public static int cpus_in_cluster(AvatarddSpecification dd,int cluster_no){
+    public static int cpus_in_cluster(AvatarddSpecification dd,int cluster_no){
 	int cpus=0;
 	avatardd = dd;
 	for  (AvatarConnector connector : avatardd.getConnectors()){		
-		AvatarConnectingPoint my_p1= connector.get_p1(); 
-		AvatarConnectingPoint my_p2= connector.get_p2(); 
+	    AvatarConnectingPoint my_p1= connector.get_p1(); 
+	    AvatarConnectingPoint my_p2= connector.get_p2(); 
 				
-		AvatarComponent comp1 = my_p1.getComponent();
-		AvatarComponent comp2 = my_p2.getComponent(); 
-		if (comp1 instanceof AvatarCPU){ 
-			AvatarCPU comp1cpu = (AvatarCPU)comp1;
-			if(comp1cpu.getClusterIndex()==cluster_no)
-			cpus++;			
-		    }		    			
+	    AvatarComponent comp1 = my_p1.getComponent();
+	    AvatarComponent comp2 = my_p2.getComponent(); 
+	    if (comp1 instanceof AvatarCPU){ 
+		AvatarCPU comp1cpu = (AvatarCPU)comp1;
+		if(comp1cpu.getClusterIndex()==cluster_no)
+		    cpus++;			
+	    }		    			
 	}
 	return cpus;
     }
@@ -244,14 +244,14 @@ public class NetList
 	else{
 	    int j;
 	    for (AvatarCrossbar crossbar:TopCellGenerator.avatardd.getAllCrossbar ()){
-		    i=0;		   	      		      
-		    for (j=0;j< cpus_in_cluster(avatardd,i) ;j++){
-			netlist =
-			    netlist = netlist + "for ( size_t j = 0; j < " +  cpus_in_cluster(avatardd,i)  +"; ++j ){" + CR;
-			     netlist = netlist + "crossbar"+crossbar.getClusterIndex()+".p_to_initiator[i](signal_vci_m"+crossbar.getClusterIndex()+"[j]);" + CR;
-			netlist = netlist + "}"+CR;
-			i++;
-		    }  
+		i=0;		   	      		      
+		for (j=0;j< cpus_in_cluster(avatardd,i) ;j++){
+		    netlist =
+			netlist = netlist + "for ( size_t j = 0; j < " +  cpus_in_cluster(avatardd,i)  +"; ++j ){" + CR;
+		    netlist = netlist + "crossbar"+crossbar.getClusterIndex()+".p_to_initiator[i](signal_vci_m"+crossbar.getClusterIndex()+"[j]);" + CR;
+		    netlist = netlist + "}"+CR;
+		    i++;
+		}  
 	    }
 	}
 
@@ -366,13 +366,13 @@ public class NetList
 	    //in any case for clustered, initiators and targets are attached to crossbar
 
 	    if (nb_clusters == 0){
-	    netlist = netlist + " crossbar.p_clk(signal_clk);" + CR;
-	    netlist = netlist + "  crossbar.p_resetn(signal_resetn);" + CR;
+		netlist = netlist + " crossbar.p_clk(signal_clk);" + CR;
+		netlist = netlist + "  crossbar.p_resetn(signal_resetn);" + CR;
 	    }
 	    else{
 		for (  i = 0; i < nb_clusters; ++i ){
-		     netlist = netlist + " crossbar"+i+".p_clk(signal_clk);" + CR;
-		     netlist = netlist + "  crossbar"+i+".p_resetn(signal_resetn);" + CR;
+		    netlist = netlist + " crossbar"+i+".p_clk(signal_clk);" + CR;
+		    netlist = netlist + "  crossbar"+i+".p_resetn(signal_resetn);" + CR;
 		}
 	    }
 	}
@@ -432,24 +432,16 @@ public class NetList
 			    NAME_RST + ");" + CR;
 			netlist =
 			    netlist + ram.getMemoryName () +
-			    ".p_vci(signal_vci_vciram" + ram.getIndex () + ");" +
+			    ".p_vci(signal_vci_vciram" + ram.getClusterIndex () +"_"+ram.getIndex () + ");" +
 			    CR2;
 			//target number for local cluster: this is set at avatardd creation                         
 			netlist =
 			    netlist + "crossbar" + ram.getClusterIndex () +
 			    ".p_to_target[" + ram.getNo_target () +
-			    "](signal_vci_vciram" + ram.getIndex () + ");" + CR2;
+			    "](signal_vci_vciram"+ram.getClusterIndex()+"_"+ ram.getIndex () + ");" + CR2;
 		    }
 
-		/*convention for local target ids on cluster :
-		  channel: 0
-		  mwmr_ram: 1
-		  mwmrd_ram: 2
-		  locks: 3
-		  ram: 4
-		  tty: 5
-		*/
-
+	
 	    }
 
 	if (nb_clusters == 0)
@@ -536,16 +528,25 @@ public class NetList
 	for (AvatarTTY tty:TopCellGenerator.avatardd.getAllTTY ())
 	    {
 		if (no_irq_tty == 1){no_irq_tty+=5;}//all other TTYs have higher interrupt numbers; provisional; will later have to count DMAs if several; take into account clusters with one DMA each
-	
-		netlist =
-		    netlist + tty.getTTYName () + ".p_clk(signal_clk);" + CR;
-		netlist =
-		    netlist + tty.getTTYName () + ".p_resetn(signal_resetn);" +
-		    CR;
-		netlist =
-		    netlist + tty.getTTYName () + ".p_vci(signal_vci_tty" + i +
-		    ");" + CR2;
-		
+		if (nb_clusters == 0)
+		    {	netlist =
+			    netlist + tty.getTTYName () + ".p_clk(signal_clk);" + CR;
+			netlist =
+			    netlist + tty.getTTYName () + ".p_resetn(signal_resetn);" +
+			    CR;
+			netlist =
+			    netlist + tty.getTTYName () + ".p_vci(signal_vci_tty"+tty.getNo_tty() +
+			    ");" + CR2;}
+		else{
+		    netlist =
+			netlist + tty.getTTYName () + ".p_clk(signal_clk);" + CR;
+		    netlist =
+			netlist + tty.getTTYName () + ".p_resetn(signal_resetn);" +
+			CR;
+		    netlist =
+			netlist + tty.getTTYName () + ".p_vci(signal_vci_tty" + tty.getClusterIndex() +"_"+tty.getNo_tty() +
+			");" + CR2;
+		}
 		if (nb_clusters == 0)
 		    {
 
@@ -554,11 +555,11 @@ public class NetList
 				netlist =
 				    netlist +
 				    "vcifdtrom.begin_device_node(\"vci_multi_tty" +
-				    i + "\",\"soclib:vci_multi_tty" + i + "\");" +
+				    i + "\",\"soclib:vci_multi_tty"  + tty.getNo_tty() + "\");" +
 				    CR2;
 				netlist =
 				    netlist + "vgmn.p_to_target[" +
-				    tty.getNo_target () + "](signal_vci_tty" + i +
+				    tty.getNo_target () + "](signal_vci_tty" + tty.getNo_tty() +
 				    ");" + CR2;
 				netlist =
 				    netlist + tty.getTTYName () +
@@ -570,11 +571,12 @@ public class NetList
 				netlist =
 				    netlist +
 				    "vcifdtrom.begin_device_node(\"vci_multi_tty" +
-				    i + "\",\"soclib:vci_multi_tty" +
-				    tty.getNo_tty () + "\");" + CR2;
+				    i + "\",\"soclib:vci_multi_tty" +tty.getNo_tty ()+"_"+
+				    tty.getClusterIndex() + "\");" + CR2;
 				netlist =
 				    netlist + "vgsb.p_to_target[" +
-				    tty.getNo_target () + "](signal_vci_tty" + i +
+				    tty.getNo_target () + "](signal_vci_tty" +tty.getNo_tty ()+"_"+
+				    tty.getClusterIndex()  +  
 				    ");" + CR2;
 				netlist =
 				    netlist + tty.getTTYName () +
@@ -590,10 +592,11 @@ public class NetList
 			for (j = 0; j < nb_clusters; j++)
 			    {
 				netlist =
-				    netlist + "crossbar" + j + ".p_to_target[" +
-				    tty.getNo_target () + "](signal_vci_tty" + j +
+				    netlist + "crossbar" + tty.getClusterIndex() +  ".p_to_target["+tty.getNo_target ()
+				    + "](signal_vci_tty" +tty.getClusterIndex()  +"_"+tty.getNo_tty()+
 				    ");" + CR2;
 				//recalculate irq addresses, 5 devices generating irq per cluster
+				//there are still strong assumptions that have to be corrected
 				netlist =
 				    netlist + tty.getTTYName () +
 				    ".p_irq[0](signal_xicu_irq[" +
@@ -844,109 +847,109 @@ public class NetList
 	
 	//If there is a spy, add logger or stats to vci interface
 	if(nb_clusters==0){
-	i = 0;
-	for (AvatarCPU cpu:TopCellGenerator.avatardd.getAllCPU ())
-	    {
-		int number = cpu.getNo_proc ();
-		if (cpu.getMonitored () == 1)
-		    {
-			netlist = netlist + CR +
-			    "logger" + i + ".p_clk(signal_clk);" + CR +
-			    "logger" + i + ".p_resetn(signal_resetn);" + CR +
-			    "logger" + i + ".p_vci(signal_vci_m[" + number +
-			    "]);" + CR2;
-			i++;
-		    }
+	    i = 0;
+	    for (AvatarCPU cpu:TopCellGenerator.avatardd.getAllCPU ())
+		{
+		    int number = cpu.getNo_proc ();
+		    if (cpu.getMonitored () == 1)
+			{
+			    netlist = netlist + CR +
+				"logger" + i + ".p_clk(signal_clk);" + CR +
+				"logger" + i + ".p_resetn(signal_resetn);" + CR +
+				"logger" + i + ".p_vci(signal_vci_m[" + number +
+				"]);" + CR2;
+			    i++;
+			}
 
-	    }
-	j = 0;
+		}
+	    j = 0;
 	}
 	else{
-	i = 0;
-	for (AvatarCPU cpu:TopCellGenerator.avatardd.getAllCPU ())
-	    {
-		int number = cpu.getNo_proc ();
-		if (cpu.getMonitored () == 1)
-		    {
-			netlist = netlist + CR +
-			    "logger" + i + ".p_clk(signal_clk);" + CR +
-			    "logger" + i + ".p_resetn(signal_resetn);" + CR +
-			    "logger" + i + ".p_vci(signal_vci_m"+cpu.getClusterIndex()+"[" + number +
-			    "]);" + CR2;
-			i++;
-		    }
+	    i = 0;
+	    for (AvatarCPU cpu:TopCellGenerator.avatardd.getAllCPU ())
+		{
+		    int number = cpu.getNo_proc ();
+		    if (cpu.getMonitored () == 1)
+			{
+			    netlist = netlist + CR +
+				"logger" + i + ".p_clk(signal_clk);" + CR +
+				"logger" + i + ".p_resetn(signal_resetn);" + CR +
+				"logger" + i + ".p_vci(signal_vci_m"+cpu.getClusterIndex()+"[" + number +
+				"]);" + CR2;
+			    i++;
+			}
 
-	    }
-	j = 0;
+		}
+	    j = 0;
 	}
 
 	if(nb_clusters==0){
-	i = 0;
-	for (AvatarRAM ram:TopCellGenerator.avatardd.getAllRAM ())
-	    {
-		if (ram.getMonitored () == 1)
-		    {
-			int number = number = ram.getIndex ();
-			netlist += "logger" + i + ".p_clk(signal_clk);" + CR;
-			netlist +=
-			    "logger" + i + ".p_resetn(signal_resetn);" + CR;
-			netlist +=
-			    "logger" + i + ".p_vci(signal_vci_vciram"+ ram.getClusterIndex() +"_" + number +
-			    ");" + CR2;
-			i++;
-		    }
-		else
-		    {
+	    i = 0;
+	    for (AvatarRAM ram:TopCellGenerator.avatardd.getAllRAM ())
+		{
+		    if (ram.getMonitored () == 1)
+			{
+			    int number = number = ram.getIndex ();
+			    netlist += "logger" + i + ".p_clk(signal_clk);" + CR;
+			    netlist +=
+				"logger" + i + ".p_resetn(signal_resetn);" + CR;
+			    netlist +=
+				"logger" + i + ".p_vci(signal_vci_vciram"+ ram.getClusterIndex() +"_" + number +
+				");" + CR2;
+			    i++;
+			}
+		    else
+			{
 
-			if (ram.getMonitored () == 2)
-			    {
-				int number = number = ram.getIndex ();
-				netlist +=
-				    "mwmr_stats" + j + ".p_clk(signal_clk);" + CR;
-				netlist +=
-				    "mwmr_stats" + j + ".p_resetn(signal_resetn);" +
-				    CR;
-				netlist +=
-				    "mwmr_stats" + j + ".p_vci(signal_vci_vciram"+ ram.getClusterIndex() +"_" +
-				    number + ");" + CR2;
-				j++;
-			    }
-		    }
-	    }
+			    if (ram.getMonitored () == 2)
+				{
+				    int number = number = ram.getIndex ();
+				    netlist +=
+					"mwmr_stats" + j + ".p_clk(signal_clk);" + CR;
+				    netlist +=
+					"mwmr_stats" + j + ".p_resetn(signal_resetn);" +
+					CR;
+				    netlist +=
+					"mwmr_stats" + j + ".p_vci(signal_vci_vciram"+ ram.getClusterIndex() +"_" +
+					number + ");" + CR2;
+				    j++;
+				}
+			}
+		}
 	}
 	else{
-	   i = 0;
-	for (AvatarRAM ram:TopCellGenerator.avatardd.getAllRAM ())
-	    {
-		if (ram.getMonitored () == 1)
-		    {
-			int number = number = ram.getIndex ();
-			netlist += "logger" + i + ".p_clk(signal_clk);" + CR;
-			netlist +=
-			    "logger" + i + ".p_resetn(signal_resetn);" + CR;
-			netlist +=
-			    "logger" + i + ".p_vci(signal_vci_vciram" + number +
-			    ");" + CR2;
-			i++;
-		    }
-		else
-		    {
+	    i = 0;
+	    for (AvatarRAM ram:TopCellGenerator.avatardd.getAllRAM ())
+		{
+		    if (ram.getMonitored () == 1)
+			{
+			    int number = number = ram.getIndex ();
+			    netlist += "logger" + i + ".p_clk(signal_clk);" + CR;
+			    netlist +=
+				"logger" + i + ".p_resetn(signal_resetn);" + CR;
+			    netlist +=
+				"logger" + i + ".p_vci(signal_vci_vciram" + number +
+				");" + CR2;
+			    i++;
+			}
+		    else
+			{
 
-			if (ram.getMonitored () == 2)
-			    {
-				int number = number = ram.getIndex ();
-				netlist +=
-				    "mwmr_stats" + j + ".p_clk(signal_clk);" + CR;
-				netlist +=
-				    "mwmr_stats" + j + ".p_resetn(signal_resetn);" +
-				    CR;
-				netlist +=
-				    "mwmr_stats" + j + ".p_vci(signal_vci_vciram" +
-				    number + ");" + CR2;
-				j++;
-			    }
-		    }
-	    } 
+			    if (ram.getMonitored () == 2)
+				{
+				    int number = number = ram.getIndex ();
+				    netlist +=
+					"mwmr_stats" + j + ".p_clk(signal_clk);" + CR;
+				    netlist +=
+					"mwmr_stats" + j + ".p_resetn(signal_resetn);" +
+					CR;
+				    netlist +=
+					"mwmr_stats" + j + ".p_vci(signal_vci_vciram" +
+					number + ");" + CR2;
+				    j++;
+				}
+			}
+		} 
 	}
 
 	int p = 0;
diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Signal.java b/src/main/java/ddtranslatorSoclib/toTopCell/Signal.java
index 798630735f..e9cb7213a9 100755
--- a/src/main/java/ddtranslatorSoclib/toTopCell/Signal.java
+++ b/src/main/java/ddtranslatorSoclib/toTopCell/Signal.java
@@ -171,31 +171,27 @@ public class Signal {
 		signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_tty"+i+"(\"signal_vci_tty"+i+"\");" + CR2;
 		i++;
 	    }
-	    int p=0;    
-
+	    //int p=0;    
 	  
 	}
 	else{	     
-	    int j = 0;
-	    for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()){
-		//	signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_vciram" + ram.getIndex()
-		//		    + "(\"signal_vci_vciram" + ram.getIndex() + "\");" + CR2;
-		signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_vciram" + i
-		    + "(\"signal_vci_vciram" + i +"_"+ j + "\");" + CR2;	  
-		j++;
+	  
+	    for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()){	
+		signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_vciram" +ram.getClusterIndex() +"_"+ram.getIndex() 
+		    + "(\"signal_vci_vciram" + ram.getClusterIndex() +"_"+ ram.getIndex() + "\");" + CR2;	  
+	
 	    }							
-	    int k = 0;
+	   
 	    	  							
 	    for (AvatarTTY  tty :  TopCellGenerator.avatardd.getAllTTY()){	
-		signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_tty"+i+"_"+k+"(\"signal_vci_tty"+ i +"_"+k+"\");" + CR2; 
-		k++;		
+		signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_tty"+tty.getClusterIndex()+"_"+tty.getNo_tty()+"(\"signal_vci_tty"+ tty.getClusterIndex() +"_"+tty.getNo_tty()+"\");" + CR2; 
+			
 	    }			
 	    //	signal = signal + " sc_core::sc_signal<bool> signal_xicu_irq[xicu_n_irq];" + CR2;	   
-	    i++;
+	   
 	}
 
 	for (AvatarCrossbar crossbar:TopCellGenerator.avatardd.getAllCrossbar()){
-
 	    signal = signal + "soclib::caba::VciSignals<vci_param> signal_up"+crossbar.getClusterIndex()+"(\"signal_up"+crossbar.getClusterIndex()+"\");"+CR;
 	    signal = signal + "soclib::caba::VciSignals<vci_param> signal_down"+crossbar.getClusterIndex()+"(\"signal_down"+crossbar.getClusterIndex()+"\");"+CR;
 	}	
diff --git a/src/main/java/ui/AvatarDeploymentPanelTranslator.java b/src/main/java/ui/AvatarDeploymentPanelTranslator.java
index dd1e8445ba..8c8fdc6572 100644
--- a/src/main/java/ui/AvatarDeploymentPanelTranslator.java
+++ b/src/main/java/ui/AvatarDeploymentPanelTranslator.java
@@ -359,10 +359,7 @@ public class AvatarDeploymentPanelTranslator
 					     cluster_index,
 					     index,
 					     addRamNode.getMonitored ());
-			  avram.setNo_ram (index);
-			
-
-
+			  
 			  nb_target++;
 
 			  Vector < ADDChannelArtifact > channels =
diff --git a/src/main/java/ui/avatardd/ADDMemoryNode.java b/src/main/java/ui/avatardd/ADDMemoryNode.java
index 8ee0b58e0f..403be2baaf 100755
--- a/src/main/java/ui/avatardd/ADDMemoryNode.java
+++ b/src/main/java/ui/avatardd/ADDMemoryNode.java
@@ -255,6 +255,7 @@ public abstract class ADDMemoryNode extends ADDCommunicationNode implements With
         sb.append("\" />\n");
         sb.append("<attributes byteDataSize=\"" + byteDataSize + "\" ");
         sb.append(" index=\"" + index + "\" ");
+	 sb.append(" cluster_index=\"" + cluster_index + "\" ");
         if (stereotype.equals("RAM")) {
         	sb.append(" processCode=\"" + getProcessCode() + "\" ");
         }
@@ -298,6 +299,7 @@ public abstract class ADDMemoryNode extends ADDCommunicationNode implements With
                                 byteDataSize = Integer.decode(elt.getAttribute("byteDataSize")).intValue();
                                 //monitored = Integer.decode(elt.getAttribute("monitored")).intValue();
                                 index = Integer.decode(elt.getAttribute("index")).intValue();
+				//cluster_index = Integer.decode(elt.getAttribute("cluster_index")).intValue();
                                 if (sstereotype.equals("RAM")) {
                                 	processCode = elt.getAttribute("processCode");
                             		setProcessCode(processCode);
diff --git a/src/main/java/ui/avatardd/ADDMemoryNode.java-new b/src/main/java/ui/avatardd/ADDMemoryNode.java-new
new file mode 100755
index 0000000000..403be2baaf
--- /dev/null
+++ b/src/main/java/ui/avatardd/ADDMemoryNode.java-new
@@ -0,0 +1,335 @@
+/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
+ * 
+ * ludovic.apvrille AT enst.fr
+ * 
+ * This software is a computer program whose purpose is to allow the
+ * edition of TURTLE analysis, design and deployment diagrams, to
+ * allow the generation of RT-LOTOS or Java code from this diagram,
+ * and at last to allow the analysis of formal validation traces
+ * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+ * from INRIA Rhone-Alpes.
+ * 
+ * This software is governed by the CeCILL  license under French law and
+ * abiding by the rules of distribution of free software.  You can  use,
+ * modify and/ or redistribute the software under the terms of the CeCILL
+ * license as circulated by CEA, CNRS and INRIA at the following URL
+ * "http://www.cecill.info".
+ * 
+ * As a counterpart to the access to the source code and  rights to copy,
+ * modify and redistribute granted by the license, users are provided only
+ * with a limited warranty  and the software's author,  the holder of the
+ * economic rights,  and the successive licensors  have only  limited
+ * liability.
+ * 
+ * In this respect, the user's attention is drawn to the risks associated
+ * with loading,  using,  modifying and/or developing or reproducing the
+ * software by the user in light of its specific status of free software,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * requirements in conditions enabling the security of their systems and/or
+ * data to be ensured and,  more generally, to use and operate it in the
+ * same conditions as regards security.
+ * 
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL license and that you accept its terms.
+ */
+
+package ui.avatardd;
+
+import myutil.GraphicLib;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import tmltranslator.HwMemory;
+import ui.*;
+import ui.util.IconManager;
+import ui.window.JDialogADDMemoryNode;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+   * Class ADDMemoryNode
+   * Node. To be used in avatar deployment diagrams.
+   * Creation: 21/08/2014
+   * @version 1.0 21/08/2014
+   * @author Ludovic APVRILLE
+ */
+
+public abstract class ADDMemoryNode extends ADDCommunicationNode implements WithAttributes {
+    protected int textY1 = 15;
+    protected int textY2 = 30;
+    protected int derivationx = 2;
+    protected int derivationy = 3;
+    protected String stereotype = "RAM";
+
+    protected int index = 0;
+    protected int cluster_index = 0;
+    protected int monitored = 0;
+    protected int byteDataSize = HwMemory.DEFAULT_BYTE_DATA_SIZE;
+
+    private String processCode;
+    
+    public ADDMemoryNode(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp)  {
+        super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
+        
+        setProcessCode("");
+    }
+
+    public void internalDrawing(Graphics g) {
+        Color c = g.getColor();
+        g.draw3DRect(x, y, width, height, true);
+
+        // Top lines
+        g.drawLine(x, y, x + derivationx, y - derivationy);
+        g.drawLine(x + width, y, x + width + derivationx, y - derivationy);
+        g.drawLine(x + derivationx, y - derivationy, x + width + derivationx, y - derivationy);
+
+        // Right lines
+        g.drawLine(x + width, y + height, x + width + derivationx, y - derivationy + height);
+        g.drawLine(x + derivationx + width, y - derivationy, x + width + derivationx, y - derivationy + height);
+
+        // Filling color
+        g.setColor(ColorManager.MEMORY_BOX);
+        g.fill3DRect(x+1, y+1, width-1, height-1, true);
+        g.setColor(c);
+
+        // Strings
+        String ster = "<<" + stereotype + ">>";
+        int w  = g.getFontMetrics().stringWidth(ster);
+        Font f = g.getFont();
+        g.setFont(f.deriveFont(Font.BOLD));
+        g.drawString(ster, x + (width - w)/2, y + textY1);
+        w  = g.getFontMetrics().stringWidth(name);
+        g.setFont(f);
+        g.drawString(name, x + (width - w)/2, y + textY2);
+
+        // Icon
+        //g.drawImage(IconManager.imgic1108.getImage(), x + width - 20, y + 4, null);
+        g.drawImage(IconManager.imgic1108.getImage(), x + 4, y + 4, null);
+        g.drawImage(IconManager.img9, x + width - 20, y + 4, null);
+    }
+
+    public TGComponent isOnOnlyMe(int x1, int y1) {
+        Polygon pol = new Polygon();
+        pol.addPoint(x, y);
+        pol.addPoint(x + derivationx, y - derivationy);
+        pol.addPoint(x + derivationx + width, y - derivationy);
+        pol.addPoint(x + derivationx + width, y + height - derivationy);
+        pol.addPoint(x + width, y + height);
+        pol.addPoint(x, y + height);
+        if (pol.contains(x1, y1)) {
+            return this;
+        }
+        return null;
+    }
+
+    public String getStereotype() {
+        return stereotype;
+    }
+
+    public String getNodeName() {
+        return name;
+    }
+
+    public int getIndex() {
+        return index;
+    }
+
+    public int getClusterIndex() {
+        return cluster_index;
+    }
+    
+    public int getDataSize() {
+        return byteDataSize;
+    }
+
+    public int getMonitored() {
+        return monitored;
+    }
+
+    public boolean editOndoubleClick(JFrame frame) {
+        boolean error = false;
+        String errors = "";
+        int tmp;
+        String tmpName;
+
+        JDialogADDMemoryNode dialog = new JDialogADDMemoryNode(frame, "Setting " + stereotype + " attributes", this);
+       // dialog.setSize(500, 450);
+        GraphicLib.centerOnParent(dialog, 500, 450);
+        dialog.setVisible( true ); // blocked until dialog has been closed
+
+        if (!dialog.isRegularClose()) {
+            return false;
+        }
+
+        if (dialog.getNodeName().length() != 0) {
+            tmpName = dialog.getNodeName();
+            tmpName = tmpName.trim();
+            if (!TAttribute.isAValidId(tmpName, false, false)) {
+                error = true;
+                errors += "Name of the node  ";
+            } else {
+                name = tmpName;
+            }
+        }
+
+        if (dialog.getIndex().length() != 0) {
+            try {
+                tmp = index;
+                index = Integer.decode(dialog.getIndex()).intValue();
+                if (index < 0) {
+                    index = tmp;
+                    error = true;
+                    errors += "index ";
+                }
+            } catch (Exception e) {
+                error = true;
+                errors += "index  ";
+            }
+        }
+
+	if (dialog.getClusterIndex().length() != 0) {
+            try {
+                tmp = cluster_index;
+                index = Integer.decode(dialog.getClusterIndex()).intValue();
+                if (index < 0) {
+                    index = tmp;
+                    error = true;
+                    errors += "cluster index ";
+                }
+            } catch (Exception e) {
+                error = true;
+                errors += "cluster index  ";
+            }
+        }
+
+	
+
+        if (dialog.getDataSize().length() != 0) {
+            try {
+                tmp = byteDataSize;
+                byteDataSize = Integer.decode(dialog.getDataSize()).intValue();
+                if (index < 0) {
+                    byteDataSize = tmp;
+                    error = true;
+                    errors += "byteDataSize ";
+                }
+            } catch (Exception e) {
+                error = true;
+                errors += "byteDataSize  ";
+            }
+        }
+
+        //if (dialog.getMonitored().length() != 0) {
+	if (dialog.getMonitored() != 0) {
+            try {
+                tmp = monitored;
+                monitored = dialog.getMonitored();//Integer.decode(dialog.getMonitored()).intValue();
+                if (index < 0) {
+                    monitored = tmp;
+                    error = true;
+                    errors += "monitored ";
+                }
+            } catch (Exception e) {
+                error = true;
+                errors += "monitored  ";
+            }
+        }
+
+        if (error) {
+            JOptionPane.showMessageDialog(frame,
+                                          "Invalid value for the following attributes: " + errors,
+                                          "Error",
+                                          JOptionPane.INFORMATION_MESSAGE);
+            return false;
+        }
+        return true;
+    }
+
+    protected String translateExtraParam() {
+        StringBuffer sb = new StringBuffer("<extraparam>\n");
+        sb.append("<info stereotype=\"" + stereotype + "\" nodeName=\"" + name);
+        sb.append("\" />\n");
+        sb.append("<attributes byteDataSize=\"" + byteDataSize + "\" ");
+        sb.append(" index=\"" + index + "\" ");
+	 sb.append(" cluster_index=\"" + cluster_index + "\" ");
+        if (stereotype.equals("RAM")) {
+        	sb.append(" processCode=\"" + getProcessCode() + "\" ");
+        }
+    	sb.append("/>\n");
+        sb.append("</extraparam>\n");
+        return new String(sb);
+    }
+
+    public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{
+        //
+        try {
+            NodeList nli;
+            Node n1, n2;
+            Element elt;
+            //int t1id;
+            String sstereotype = null, snodeName = null;
+            monitored = 0;
+            String processCode;
+
+            for(int i=0; i<nl.getLength(); i++) {
+                n1 = nl.item(i);
+                //
+                if (n1.getNodeType() == Node.ELEMENT_NODE) {
+                    nli = n1.getChildNodes();
+                    for(int j=0; j<nli.getLength(); j++) {
+                        n2 = nli.item(j);
+                        //
+                        if (n2.getNodeType() == Node.ELEMENT_NODE) {
+                            elt = (Element) n2;
+                            if (elt.getTagName().equals("info")) {
+                                sstereotype = elt.getAttribute("stereotype");
+                                snodeName = elt.getAttribute("nodeName");
+                            }
+                            if (sstereotype != null) {
+                                stereotype = sstereotype;
+                            }
+                            if (snodeName != null){
+                                name = snodeName;
+                            }
+                            if (elt.getTagName().equals("attributes")) {
+                                byteDataSize = Integer.decode(elt.getAttribute("byteDataSize")).intValue();
+                                //monitored = Integer.decode(elt.getAttribute("monitored")).intValue();
+                                index = Integer.decode(elt.getAttribute("index")).intValue();
+				//cluster_index = Integer.decode(elt.getAttribute("cluster_index")).intValue();
+                                if (sstereotype.equals("RAM")) {
+                                	processCode = elt.getAttribute("processCode");
+                            		setProcessCode(processCode);
+                            	}
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            throw new MalformedModelingException();
+        }
+    }
+
+    public int getByteDataSize(){
+        return byteDataSize;
+    }
+
+    public String getAttributes() {
+        String attr = "";
+        attr += "Data size (in byte) = " + byteDataSize + "\n";
+        attr += "Index  = " + index + "\n";
+        return attr;
+    }
+
+	public String getProcessCode() {
+		return processCode;
+	}
+
+	public void setProcessCode(String _processCode) {
+		processCode = _processCode;
+	}
+}
diff --git a/src/main/java/ui/avatardd/ADDRAMNode.java b/src/main/java/ui/avatardd/ADDRAMNode.java
index 9076e1dd90..6fee322b5a 100755
--- a/src/main/java/ui/avatardd/ADDRAMNode.java
+++ b/src/main/java/ui/avatardd/ADDRAMNode.java
@@ -54,7 +54,9 @@ import java.util.Vector;
 public class ADDRAMNode extends ADDMemoryNode implements SwallowTGComponent, WithAttributes {
 
     protected int monitored = 0;
-
+    protected int index = 0;
+    protected int cluster_index = 0;
+    
     public ADDRAMNode(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp)  {
         super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
 
@@ -147,6 +149,14 @@ public class ADDRAMNode extends ADDMemoryNode implements SwallowTGComponent, Wit
         }
     }
 
+    public int getIndex() {
+	return index;
+	}
+
+    public int getClusterIndex() {
+        return cluster_index;
+       }
+    
     public int getMonitored() {
         return monitored;
     }
@@ -154,4 +164,4 @@ public class ADDRAMNode extends ADDMemoryNode implements SwallowTGComponent, Wit
     public void setMonitored(int _monitored){
     	monitored = _monitored;
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/ui/avatardd/ADDRAMNode.java-new b/src/main/java/ui/avatardd/ADDRAMNode.java-new
new file mode 100755
index 0000000000..6fee322b5a
--- /dev/null
+++ b/src/main/java/ui/avatardd/ADDRAMNode.java-new
@@ -0,0 +1,167 @@
+/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
+ * 
+ * ludovic.apvrille AT enst.fr
+ * 
+ * This software is a computer program whose purpose is to allow the
+ * edition of TURTLE analysis, design and deployment diagrams, to
+ * allow the generation of RT-LOTOS or Java code from this diagram,
+ * and at last to allow the analysis of formal validation traces
+ * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+ * from INRIA Rhone-Alpes.
+ * 
+ * This software is governed by the CeCILL  license under French law and
+ * abiding by the rules of distribution of free software.  You can  use,
+ * modify and/ or redistribute the software under the terms of the CeCILL
+ * license as circulated by CEA, CNRS and INRIA at the following URL
+ * "http://www.cecill.info".
+ * 
+ * As a counterpart to the access to the source code and  rights to copy,
+ * modify and redistribute granted by the license, users are provided only
+ * with a limited warranty  and the software's author,  the holder of the
+ * economic rights,  and the successive licensors  have only  limited
+ * liability.
+ * 
+ * In this respect, the user's attention is drawn to the risks associated
+ * with loading,  using,  modifying and/or developing or reproducing the
+ * software by the user in light of its specific status of free software,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * requirements in conditions enabling the security of their systems and/or
+ * data to be ensured and,  more generally, to use and operate it in the
+ * same conditions as regards security.
+ * 
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL license and that you accept its terms.
+ */
+
+package ui.avatardd;
+
+import ui.*;
+import ui.util.IconManager;
+
+import java.util.Vector;
+
+/**
+   * Class ADDRAMNode
+   * Node. To be used in avatar deployment diagrams.
+   * Creation: 01/07/2014
+   * @version 1.0 01/07/2014
+   * @author Ludovic APVRILLE
+ */
+
+public class ADDRAMNode extends ADDMemoryNode implements SwallowTGComponent, WithAttributes {
+
+    protected int monitored = 0;
+    protected int index = 0;
+    protected int cluster_index = 0;
+    
+    public ADDRAMNode(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp)  {
+        super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
+
+        width = 200;
+        height = 200;
+        minWidth = 100;
+        minHeight = 35;
+
+        nbConnectingPoint = 16;
+        connectingPoint = new TGConnectingPoint[16];
+
+        connectingPoint[0] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 0.0);
+        connectingPoint[1] = new ADDConnectingPoint(this, 0, 0, false, true, 0.5, 0.0);
+        connectingPoint[2] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 0.0);
+        connectingPoint[3] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 0.5);
+        connectingPoint[4] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 0.5);
+        connectingPoint[5] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 1.0);
+        connectingPoint[6] = new ADDConnectingPoint(this, 0, 0, false, true, 0.5, 1.0);
+        connectingPoint[7] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 1.0);
+
+        connectingPoint[8] = new ADDConnectingPoint(this, 0, 0, false, true, 0.25, 0.0);
+        connectingPoint[9] = new ADDConnectingPoint(this, 0, 0, false, true, 0.75, 0.0);
+        connectingPoint[10] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 0.25);
+        connectingPoint[11] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 0.25);
+        connectingPoint[12] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 0.75);
+        connectingPoint[13] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 0.75);
+        connectingPoint[14] = new ADDConnectingPoint(this, 0, 0, false, true, 0.25, 1.0);
+        connectingPoint[15] = new ADDConnectingPoint(this, 0, 0, false, true, 0.75, 1.0);
+
+        addTGConnectingPointsComment();
+
+        nbInternalTGComponent = 0;
+
+        moveable = true;
+        editable = true;
+        removable = true;
+        userResizable = true;
+
+        stereotype = "RAM";
+
+        name = tdp.findNodeName("Memory");
+        value = "name";
+
+        myImageIcon = IconManager.imgic700;
+    }
+
+    public int getType() {
+        return TGComponentManager.ADD_RAMNODE;
+    }
+
+    public boolean acceptSwallowedTGComponent(TGComponent tgc) {
+        //TraceManager.addDev("Accept swallowed?");
+        return tgc instanceof ADDBlockArtifact;
+    }
+
+    public boolean addSwallowedTGComponent(TGComponent tgc, int x, int y) {
+        //TraceManager.addDev("Add swallowed?");
+        //Set its coordinates
+        if (tgc instanceof ADDChannelArtifact) {
+            tgc.setFather(this);
+            tgc.setDrawingZone(true);
+            tgc.resizeWithFather();
+            //TraceManager.addDev("Add swallowed!!!");
+            addInternalComponent(tgc, 0);
+            return true;
+        }
+        return false;
+    }
+
+    public void removeSwallowedTGComponent(TGComponent tgc) {
+        removeInternalComponent(tgc);
+    }
+
+    public Vector<ADDChannelArtifact> getArtifactList() {
+        Vector<ADDChannelArtifact> v = new Vector<ADDChannelArtifact>();
+        
+        for(int i=0; i<nbInternalTGComponent; i++) {
+            if (tgcomponent[i] instanceof ADDChannelArtifact) {
+                v.add( (ADDChannelArtifact) tgcomponent[i] );
+            }
+        }
+        return v;
+    }
+
+    public void hasBeenResized() {
+        for(int i=0; i<nbInternalTGComponent; i++) {
+            if (tgcomponent[i] instanceof ADDChannelArtifact) {
+                tgcomponent[i].resizeWithFather();
+            }
+        }
+    }
+
+    public int getIndex() {
+	return index;
+	}
+
+    public int getClusterIndex() {
+        return cluster_index;
+       }
+    
+    public int getMonitored() {
+        return monitored;
+    }
+
+    public void setMonitored(int _monitored){
+    	monitored = _monitored;
+    }
+}
diff --git a/src/main/java/ui/avatardd/ADDTTYNode.java b/src/main/java/ui/avatardd/ADDTTYNode.java
index e42a5e0ff7..234c60314e 100755
--- a/src/main/java/ui/avatardd/ADDTTYNode.java
+++ b/src/main/java/ui/avatardd/ADDTTYNode.java
@@ -67,7 +67,7 @@ public class ADDTTYNode extends ADDNode implements WithAttributes {
 	private String stereotype = "TTY";
 	
 	private int index = 0;
-	
+	protected int cluster_index = 0;
 	
 	public ADDTTYNode(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp)  {
 		super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
@@ -175,7 +175,10 @@ public class ADDTTYNode extends ADDNode implements WithAttributes {
 	public int getIndex() {
 		return index;
 	}
-	
+
+       public int getClusterIndex() {
+        return cluster_index;
+       }
 	
 	public boolean editOndoubleClick(JFrame frame) {
 			boolean error = false;
@@ -220,6 +223,22 @@ public class ADDTTYNode extends ADDNode implements WithAttributes {
 					}
 			}
 			
+			if (dialog.getClusterIndex().length() != 0) {
+            try {
+                tmp = cluster_index;
+                index = Integer.decode(dialog.getClusterIndex()).intValue();
+                if (index < 0) {
+                    index = tmp;
+                    error = true;
+                    errors += "cluster index ";
+                }
+            } catch (Exception e) {
+                error = true;
+                errors += "cluster index  ";
+            }
+        }
+
+			
 			if (error) {
 					JOptionPane.showMessageDialog(frame,
 							"Invalid value for the following attributes: " + errors,
@@ -241,6 +260,7 @@ public class ADDTTYNode extends ADDNode implements WithAttributes {
 		sb.append("<info stereotype=\"" + stereotype + "\" nodeName=\"" + name);
 		sb.append("\" />\n");
 		sb.append("<attributes index=\"" + index + "\" ");
+		sb.append("cluster_index=\"" + cluster_index + "\" ");
 		//sb.append(" clockRatio=\"" + clockRatio + "\"");
 		sb.append("/>\n");
 		sb.append("</extraparam>\n");
@@ -282,6 +302,7 @@ public class ADDTTYNode extends ADDNode implements WithAttributes {
 							if (elt.getTagName().equals("attributes")) {
 								
 								index = Integer.decode(elt.getAttribute("index")).intValue();
+								cluster_index = Integer.decode(elt.getAttribute("cluster_index")).intValue();
 							}
 						}
 					}
diff --git a/src/main/java/ui/avatardd/ADDTTYNode.java-new b/src/main/java/ui/avatardd/ADDTTYNode.java-new
new file mode 100755
index 0000000000..234c60314e
--- /dev/null
+++ b/src/main/java/ui/avatardd/ADDTTYNode.java-new
@@ -0,0 +1,328 @@
+/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
+ * 
+ * ludovic.apvrille AT enst.fr
+ * 
+ * This software is a computer program whose purpose is to allow the
+ * edition of TURTLE analysis, design and deployment diagrams, to
+ * allow the generation of RT-LOTOS or Java code from this diagram,
+ * and at last to allow the analysis of formal validation traces
+ * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+ * from INRIA Rhone-Alpes.
+ * 
+ * This software is governed by the CeCILL  license under French law and
+ * abiding by the rules of distribution of free software.  You can  use,
+ * modify and/ or redistribute the software under the terms of the CeCILL
+ * license as circulated by CEA, CNRS and INRIA at the following URL
+ * "http://www.cecill.info".
+ * 
+ * As a counterpart to the access to the source code and  rights to copy,
+ * modify and redistribute granted by the license, users are provided only
+ * with a limited warranty  and the software's author,  the holder of the
+ * economic rights,  and the successive licensors  have only  limited
+ * liability.
+ * 
+ * In this respect, the user's attention is drawn to the risks associated
+ * with loading,  using,  modifying and/or developing or reproducing the
+ * software by the user in light of its specific status of free software,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * requirements in conditions enabling the security of their systems and/or
+ * data to be ensured and,  more generally, to use and operate it in the
+ * same conditions as regards security.
+ * 
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL license and that you accept its terms.
+ */
+
+
+
+
+package ui.avatardd;
+
+import myutil.GraphicLib;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import ui.*;
+import ui.util.IconManager;
+import ui.window.JDialogADDTTYNode;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+* Class ADDTTYNode
+* Node. To be used in Avatar deployment diagrams.
+* Creation: 01/07/2014
+* @version 1.0 01/07/2014
+* @author Ludovic APVRILLE
+ */
+public class ADDTTYNode extends ADDNode implements WithAttributes {
+	private int textY1 = 15;
+	private int textY2 = 30;
+	private int derivationx = 2;
+	private int derivationy = 3;
+	private String stereotype = "TTY";
+	
+	private int index = 0;
+	protected int cluster_index = 0;
+	
+	public ADDTTYNode(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp)  {
+		super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
+		
+		width = 250;
+		height = 200;
+		minWidth = 150;
+		minHeight = 100;
+		
+		nbConnectingPoint = 16;
+		connectingPoint = new TGConnectingPoint[16];
+		
+		connectingPoint[0] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 0.0);
+		connectingPoint[1] = new ADDConnectingPoint(this, 0, 0, false, true, 0.5, 0.0);
+		connectingPoint[2] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 0.0);
+		connectingPoint[3] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 0.5);
+		connectingPoint[4] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 0.5);
+		connectingPoint[5] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 1.0);
+		connectingPoint[6] = new ADDConnectingPoint(this, 0, 0, false, true, 0.5, 1.0);
+		connectingPoint[7] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 1.0);
+		
+		connectingPoint[8] = new ADDConnectingPoint(this, 0, 0, false, true, 0.25, 0.0);
+		connectingPoint[9] = new ADDConnectingPoint(this, 0, 0, false, true, 0.75, 0.0);
+		connectingPoint[10] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 0.25);
+		connectingPoint[11] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 0.25);
+		connectingPoint[12] = new ADDConnectingPoint(this, 0, 0, false, true, 0.0, 0.75);
+		connectingPoint[13] = new ADDConnectingPoint(this, 0, 0, false, true, 1.0, 0.75);
+		connectingPoint[14] = new ADDConnectingPoint(this, 0, 0, false, true, 0.25, 1.0);
+		connectingPoint[15] = new ADDConnectingPoint(this, 0, 0, false, true, 0.75, 1.0);
+		
+		addTGConnectingPointsComment();
+		
+		nbInternalTGComponent = 0;
+		
+		moveable = true;
+		editable = true;
+		removable = true;
+		userResizable = true;
+		
+		name = tdp.findNodeName("TTY");
+		value = "name";
+		
+		myImageIcon = IconManager.imgic700;
+	}
+	
+	public void internalDrawing(Graphics g) {
+		Color c = g.getColor();
+		g.draw3DRect(x, y, width, height, true);
+		
+		
+		// Top lines
+		g.drawLine(x, y, x + derivationx, y - derivationy);
+		g.drawLine(x + width, y, x + width + derivationx, y - derivationy);
+		g.drawLine(x + derivationx, y - derivationy, x + width + derivationx, y - derivationy);
+		
+		// Right lines
+		g.drawLine(x + width, y + height, x + width + derivationx, y - derivationy + height);
+		g.drawLine(x + derivationx + width, y - derivationy, x + width + derivationx, y - derivationy + height);
+		
+		// Filling color
+		g.setColor(ColorManager.CPU_BOX_1);
+		g.fill3DRect(x+1, y+1, width-1, height-1, true);
+		g.setColor(c);
+		
+		// Strings
+		String ster = "<<" + stereotype + ">>";
+		int w  = g.getFontMetrics().stringWidth(ster);
+		Font f = g.getFont();
+		g.setFont(f.deriveFont(Font.BOLD));
+		g.drawString(ster, x + (width - w)/2, y + textY1);
+		g.setFont(f);
+		w  = g.getFontMetrics().stringWidth(name);
+		g.drawString(name, x + (width - w)/2, y + textY2);
+		
+		// Icon
+		g.drawImage(IconManager.imgic1100.getImage(), x + 4, y + 4, null);
+		g.drawImage(IconManager.img9, x + width - 20, y + 4, null);
+	}
+	
+	public TGComponent isOnOnlyMe(int x1, int y1) {
+		
+		Polygon pol = new Polygon();
+		pol.addPoint(x, y);
+		pol.addPoint(x + derivationx, y - derivationy);
+		pol.addPoint(x + derivationx + width, y - derivationy);
+		pol.addPoint(x + derivationx + width, y + height - derivationy);
+		pol.addPoint(x + width, y + height);
+		pol.addPoint(x, y + height);
+		if (pol.contains(x1, y1)) {
+			return this;
+		}
+		
+		return null;
+	}
+	
+	public String getStereotype() {
+		return stereotype;
+		
+	}
+	
+	public String getNodeName() {
+		return name;
+	}
+	
+	public int getIndex() {
+		return index;
+	}
+
+       public int getClusterIndex() {
+        return cluster_index;
+       }
+	
+	public boolean editOndoubleClick(JFrame frame) {
+			boolean error = false;
+			String errors = "";
+			int tmp;
+			String tmpName;
+			
+			JDialogADDTTYNode dialog = new JDialogADDTTYNode(frame, "Setting TTY attributes", this);
+		//	dialog.setSize(500, 450);
+			GraphicLib.centerOnParent(dialog, 500, 450);
+			dialog.setVisible( true ); // blocked until dialog has been closed
+			
+			if (!dialog.isRegularClose()) {
+					return false;
+			}
+			
+			if (dialog.getNodeName().length() != 0) {
+					tmpName = dialog.getNodeName();
+					tmpName = tmpName.trim();
+					if (!TAttribute.isAValidId(tmpName, false, false)) {
+							error = true;
+							errors += "Name of the node  ";
+					} else {
+							name = tmpName;
+					}
+			}
+			
+			
+			
+			if (dialog.getIndex().length() != 0) {	
+					try {
+							tmp = index;
+							index = Integer.decode(dialog.getIndex()).intValue();
+							if (index < 0) {
+									index = tmp;
+									error = true;
+									errors += "index ";
+							}
+					} catch (Exception e) {
+							error = true;
+							errors += "index  ";
+					}
+			}
+			
+			if (dialog.getClusterIndex().length() != 0) {
+            try {
+                tmp = cluster_index;
+                index = Integer.decode(dialog.getClusterIndex()).intValue();
+                if (index < 0) {
+                    index = tmp;
+                    error = true;
+                    errors += "cluster index ";
+                }
+            } catch (Exception e) {
+                error = true;
+                errors += "cluster index  ";
+            }
+        }
+
+			
+			if (error) {
+					JOptionPane.showMessageDialog(frame,
+							"Invalid value for the following attributes: " + errors,
+							"Error",
+							JOptionPane.INFORMATION_MESSAGE);
+					return false;
+			}
+			
+			return true;
+	}
+	
+	
+	public int getType() {
+		return TGComponentManager.ADD_TTYNODE;
+	}
+	
+	protected String translateExtraParam() {
+		StringBuffer sb = new StringBuffer("<extraparam>\n");
+		sb.append("<info stereotype=\"" + stereotype + "\" nodeName=\"" + name);
+		sb.append("\" />\n");
+		sb.append("<attributes index=\"" + index + "\" ");
+		sb.append("cluster_index=\"" + cluster_index + "\" ");
+		//sb.append(" clockRatio=\"" + clockRatio + "\"");
+		sb.append("/>\n");
+		sb.append("</extraparam>\n");
+		return new String(sb);
+	}
+	
+    @Override
+	public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{
+		//
+		try {
+			
+			NodeList nli;
+			Node n1, n2;
+			Element elt;
+		//	int t1id;
+			String sstereotype = null, snodeName = null;
+			
+			for(int i=0; i<nl.getLength(); i++) {
+				n1 = nl.item(i);
+				//
+				if (n1.getNodeType() == Node.ELEMENT_NODE) {
+					nli = n1.getChildNodes();
+					for(int j=0; j<nli.getLength(); j++) {
+						n2 = nli.item(j);
+						//
+						if (n2.getNodeType() == Node.ELEMENT_NODE) {
+							elt = (Element) n2;
+							if (elt.getTagName().equals("info")) {
+								sstereotype = elt.getAttribute("stereotype");
+								snodeName = elt.getAttribute("nodeName");
+							}
+							if (sstereotype != null) {
+								stereotype = sstereotype;
+							} 
+							if (snodeName != null){
+								name = snodeName;
+							}
+							
+							if (elt.getTagName().equals("attributes")) {
+								
+								index = Integer.decode(elt.getAttribute("index")).intValue();
+								cluster_index = Integer.decode(elt.getAttribute("cluster_index")).intValue();
+							}
+						}
+					}
+				}
+			}
+			
+		} catch (Exception e) {
+			throw new MalformedModelingException();
+		}
+	}
+	
+	public int getDefaultConnector() {
+		return TGComponentManager.ADD_CONNECTOR;
+	}
+	
+	
+	public String getAttributes() {
+		String attr = "";
+		attr += "index = " + index + "\n";
+		return attr;	
+	}
+	
+}
diff --git a/src/main/java/ui/window/JDialogADDMemoryNode.java-new b/src/main/java/ui/window/JDialogADDMemoryNode.java-new
new file mode 100644
index 0000000000..d8c7aaaece
--- /dev/null
+++ b/src/main/java/ui/window/JDialogADDMemoryNode.java-new
@@ -0,0 +1,353 @@
+/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
+ * 
+ * ludovic.apvrille AT enst.fr
+ * 
+ * This software is a computer program whose purpose is to allow the
+ * edition of TURTLE analysis, design and deployment diagrams, to
+ * allow the generation of RT-LOTOS or Java code from this diagram,
+ * and at last to allow the analysis of formal validation traces
+ * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+ * from INRIA Rhone-Alpes.
+ * 
+ * This software is governed by the CeCILL  license under French law and
+ * abiding by the rules of distribution of free software.  You can  use,
+ * modify and/ or redistribute the software under the terms of the CeCILL
+ * license as circulated by CEA, CNRS and INRIA at the following URL
+ * "http://www.cecill.info".
+ * 
+ * As a counterpart to the access to the source code and  rights to copy,
+ * modify and redistribute granted by the license, users are provided only
+ * with a limited warranty  and the software's author,  the holder of the
+ * economic rights,  and the successive licensors  have only  limited
+ * liability.
+ * 
+ * In this respect, the user's attention is drawn to the risks associated
+ * with loading,  using,  modifying and/or developing or reproducing the
+ * software by the user in light of its specific status of free software,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * requirements in conditions enabling the security of their systems and/or
+ * data to be ensured and,  more generally, to use and operate it in the
+ * same conditions as regards security.
+ * 
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL license and that you accept its terms.
+ */
+
+package ui.window;
+
+import ui.util.IconManager;
+import ui.avatardd.ADDMemoryNode;
+import ui.avatardd.ADDRAMNode;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * Class JDialogADDMemoryNode
+ * Dialog for managing attributes of Memory nodes
+ * Creation: 21/08/2014
+ * @version 1.0 21/08/2014
+ * @author Ludovic APVRILLE
+ */
+
+public class JDialogADDMemoryNode extends JDialogBase implements ActionListener  {
+
+    //private static String[] tracemodeTab = {"vcd trace", "VCI logger", "VCI stats"};
+    private static String[] tracemodeTab = {"VCI logger","VCI stats"};
+    private boolean regularClose;
+    
+    private JPanel panel2, panel3;
+    private JTabbedPane tabbedPane;
+	private JTextArea processCodeTextArea;
+	private String finalString;
+    private Frame frame;
+    private ADDMemoryNode node;
+    
+    protected JComboBox<String> tracemode;
+    private static int  selectedTracemode = 0;
+	
+    // Panel1
+    protected JTextField nodeName;
+	
+	// Panel2
+    protected JTextField index;
+    protected JTextField cluster_index;
+    protected JTextField dataSize;
+    protected JTextField monitored;	
+    
+    private String memoryName;
+    
+    /** Creates new form  */
+    public JDialogADDMemoryNode(Frame _frame, String _title, ADDMemoryNode _node) {
+        super(_frame, _title, true);
+        frame = _frame;
+        node = _node;
+        memoryName = _title.split(" ")[1];
+        
+        initComponents();
+        myInitComponents();
+        pack();
+    }
+    
+    private void myInitComponents() {}
+    
+    public StringBuffer encode(String data) {
+    	StringBuffer databuf = new StringBuffer(data);
+    	StringBuffer buffer = new StringBuffer("");
+    	int endline = 0;
+    	int nb_arobase = 0;
+    	int condition = 0;
+    	
+        for(int pos = 0; pos != data.length(); pos++) {
+        	char c = databuf.charAt(pos);
+            switch(c) {
+                case '\n' :
+                	break;
+                case '\t' :
+                	break;
+                case '{'  : 
+                	buffer.append("{\n"); 
+                	endline = 1;
+                	nb_arobase++;
+                	break;
+                case '}'  : 
+                	if (nb_arobase == 1) {
+                		buffer.append("}\n"); 
+                		endline = 0;
+                	} else {
+                		int i = nb_arobase;
+                		while (i >= 1) {
+                			buffer.append("\t");
+                			i--;
+                		}
+                		buffer.append("}\n"); 
+                		endline = 1;
+                	}
+                	nb_arobase--;
+                	break;
+                case ';'  :
+                	if (condition == 1) {
+                		buffer.append(";");
+                	} else {
+                		buffer.append(";\n");
+                		endline = 1;
+                	}
+                	break;
+                case ' '  :
+                	if (endline == 0) {
+                		buffer.append(databuf.charAt(pos)); 
+                	}
+                	break;
+                case '(' :
+                	buffer.append("(");
+                	condition = 1;
+                	break;
+                case ')' :
+                	buffer.append(")");
+                	condition = 0;
+                	break;
+                default   : 
+                	if (endline == 1) {
+                		endline = 0;
+                		int i = nb_arobase;
+                		while (i >= 1) {
+                			buffer.append("\t");
+                			i--;
+                		}
+                	}
+                	buffer.append(databuf.charAt(pos)); 
+                	break;
+            }
+        }
+        return buffer;
+    }
+    
+    private void initComponents() {
+        Container c = getContentPane();
+        GridBagLayout gridbag0 = new GridBagLayout();
+        GridBagLayout gridbag1 = new GridBagLayout();
+        GridBagLayout gridbag2 = new GridBagLayout();
+        GridBagConstraints c0 = new GridBagConstraints();
+        GridBagConstraints c1 = new GridBagConstraints();
+        GridBagConstraints c2 = new GridBagConstraints();
+        
+        setFont(new Font("Helvetica", Font.PLAIN, 14));
+        c.setLayout(gridbag0);
+        
+        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+        
+        if (memoryName.equals("RAM")) {
+			panel3 = new JPanel();
+	        panel3.setLayout(new BorderLayout());
+			panel3.setBorder(new javax.swing.border.TitledBorder("C Code"));
+			panel3.setPreferredSize(new Dimension(400, 200));
+        }
+        
+        panel2 = new JPanel();
+        panel2.setLayout(gridbag2);
+        panel2.setBorder(new javax.swing.border.TitledBorder("Memory attributes"));
+        panel2.setPreferredSize(new Dimension(400, 200));
+        
+        if (memoryName.equals("RAM")) {
+        	tabbedPane = new JTabbedPane();
+        	tabbedPane.add("Attributes", panel2);
+			tabbedPane.add("C Code", panel3);
+        }
+        
+		c1.gridwidth = 1;
+        c1.gridheight = 1;
+        c1.weighty = 1.0;
+        c1.weightx = 1.0;
+        c1.fill = GridBagConstraints.HORIZONTAL;
+        panel2.add(new JLabel("Memory name:"), c2);
+        c1.gridwidth = GridBagConstraints.REMAINDER; //end row
+        nodeName = new JTextField(node.getNodeName(), 30);
+        nodeName.setEditable(true);
+        nodeName.setFont(new Font("times", Font.PLAIN, 12));
+		panel2.add(nodeName, c1);
+        
+        c2.gridwidth = 1;
+        c2.gridheight = 1;
+        c2.weighty = 1.0;
+        c2.weightx = 1.0;
+        c2.fill = GridBagConstraints.HORIZONTAL;
+        
+        c2.gridwidth = 1;
+        panel2.add(new JLabel("Index:"), c2);
+        c2.gridwidth = GridBagConstraints.REMAINDER; //end row
+        index = new JTextField(""+node.getIndex(), 15);
+        panel2.add(index, c2);
+
+	c2.gridwidth = 1;
+        panel2.add(new JLabel("Cluster Index:"), c2);
+        c2.gridwidth = GridBagConstraints.REMAINDER; //end row
+        cluster_index = new JTextField(""+node.getIndex(), 15);
+        panel2.add(cluster_index, c2);
+        
+	
+        c2.gridwidth = 1;
+        panel2.add(new JLabel("Data size (in byte):"), c2);
+        c2.gridwidth = GridBagConstraints.REMAINDER; //end row
+        dataSize = new JTextField(""+node.getDataSize(), 15);
+        panel2.add(dataSize, c2);
+        
+        /*c2.gridwidth = 1;
+        panel2.add(new JLabel("Monitored:"), c2);
+        c2.gridwidth = GridBagConstraints.REMAINDER; //end row
+        monitored = new JTextField(""+node.getMonitored(), 15);
+        panel2.add(monitored, c2);*/
+
+        c2.gridwidth = 1;
+        panel2.add(new JLabel("Monitored:"), c2);
+        //c2.gridwidth = GridBagConstraints.REMAINDER; //end row
+        //monitored = new JTextField(""+node.getMonitored(), 15);//DG 19.04.
+        tracemode = new JComboBox<>(tracemodeTab);
+        tracemode.setSelectedIndex(selectedTracemode);
+        tracemode.addActionListener(this);
+        panel2.add(tracemode, c2);
+        
+        if (memoryName.equals("RAM")) {
+			panel3.add(new JLabel("Behavior function of RAM : "), BorderLayout.NORTH);
+			StringBuffer stringbuf = encode(node.getProcessCode());
+			String beginString = stringbuf.toString();
+			finalString = beginString.replaceAll("\t}", "}");
+			
+			processCodeTextArea = new JTextArea(finalString);
+			processCodeTextArea.setSize(100, 100);
+			processCodeTextArea.setTabSize(2);
+	
+			processCodeTextArea.setFont(new Font("Arial", Font.PLAIN, 16));
+			processCodeTextArea.setLineWrap(true);
+			processCodeTextArea.setWrapStyleWord(true);
+	
+			JScrollPane processScrollPane = new JScrollPane(processCodeTextArea);
+			processScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+			processScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+			processScrollPane.setPreferredSize(new Dimension(200, 150));
+	
+			panel3.add(processScrollPane, BorderLayout.SOUTH);
+        }
+        
+        // main panel;
+        c0.gridheight = 10;
+        c0.weighty = 1.0;
+        c0.weightx = 1.0;
+        c0.gridwidth = GridBagConstraints.REMAINDER; //end row
+        
+        if (memoryName.equals("RAM")) {
+            c.add(tabbedPane, c0);
+    	} else {
+    		c.add(panel2, c0);
+    	}
+        
+        c0.gridwidth = 1;
+        c0.gridheight = 1;
+        c0.fill = GridBagConstraints.HORIZONTAL;
+        
+        initButtons(c0, c, this);
+    }
+    
+    public void	actionPerformed(ActionEvent evt)  {
+    	/*if (evt.getSource() == typeBox) {
+            boolean b = ((Boolean)(initValues.elementAt(typeBox.getSelectedIndex()))).booleanValue();
+            initialValue.setEnabled(b);
+            return;
+        }*/
+		if (evt.getSource() == tracemode) {
+	           selectedTracemode = tracemode.getSelectedIndex();                   
+		}
+        
+        String command = evt.getActionCommand();
+        
+        if (memoryName.equals("RAM")) {
+        	node.setProcessCode(processCodeTextArea.getText());
+        }
+        
+        // Compare the action command to the known actions.
+        if (command.equals("Save and Close"))  {
+            closeDialog();
+        } else if (command.equals("Cancel")) {
+            cancelDialog();
+        }
+    }
+    
+    public void closeDialog() {
+        regularClose = true;
+        dispose();
+    }
+    
+    public void cancelDialog() {
+        dispose();
+    }
+    
+    public boolean isRegularClose() {
+        return regularClose;
+    }
+	
+	public String getNodeName() {
+        return nodeName.getText();
+    }
+    
+    public String getIndex() {
+        return index.getText();
+    }
+
+    public String getClusterIndex() {
+        return cluster_index.getText();
+    }
+    
+    public String getDataSize() {
+        return dataSize.getText();
+    }
+
+    public int getMonitored() {
+    	//return tracemodeTab[tracemode.getSelectedIndex()];
+    	return tracemode.getSelectedIndex();
+        //return monitored.getText();
+    }
+}
diff --git a/src/main/java/ui/window/JDialogADDTTYNode.java b/src/main/java/ui/window/JDialogADDTTYNode.java
index ff8b91e8b0..60b30f07be 100644
--- a/src/main/java/ui/window/JDialogADDTTYNode.java
+++ b/src/main/java/ui/window/JDialogADDTTYNode.java
@@ -74,6 +74,7 @@ public class JDialogADDTTYNode extends JDialogBase implements ActionListener  {
 	
 	// Panel2
     protected JTextField index;
+    protected JTextField cluster_index;
     
     /** Creates new form  */
     public JDialogADDTTYNode(Frame _frame, String _title, ADDTTYNode _node) {
@@ -135,7 +136,13 @@ public class JDialogADDTTYNode extends JDialogBase implements ActionListener  {
         index = new JTextField(""+node.getIndex(), 15);
         panel2.add(index, c2);
         
-        
+	c2.gridwidth = 1;
+        panel2.add(new JLabel("Cluster Index:"), c2);
+        c2.gridwidth = GridBagConstraints.REMAINDER; //end row
+        cluster_index = new JTextField(""+node.getIndex(), 15);
+        panel2.add(cluster_index, c2);
+
+	
         // main panel;
         c0.gridheight = 10;
         c0.weighty = 1.0;
@@ -189,5 +196,7 @@ public class JDialogADDTTYNode extends JDialogBase implements ActionListener  {
         return index.getText();
     }
     
-    
+    public String getClusterIndex() {
+        return cluster_index.getText();
+    }
 }
diff --git a/src/main/java/ui/window/JDialogADDTTYNode.java-new b/src/main/java/ui/window/JDialogADDTTYNode.java-new
new file mode 100644
index 0000000000..60b30f07be
--- /dev/null
+++ b/src/main/java/ui/window/JDialogADDTTYNode.java-new
@@ -0,0 +1,202 @@
+/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
+ * 
+ * ludovic.apvrille AT enst.fr
+ * 
+ * This software is a computer program whose purpose is to allow the
+ * edition of TURTLE analysis, design and deployment diagrams, to
+ * allow the generation of RT-LOTOS or Java code from this diagram,
+ * and at last to allow the analysis of formal validation traces
+ * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+ * from INRIA Rhone-Alpes.
+ * 
+ * This software is governed by the CeCILL  license under French law and
+ * abiding by the rules of distribution of free software.  You can  use,
+ * modify and/ or redistribute the software under the terms of the CeCILL
+ * license as circulated by CEA, CNRS and INRIA at the following URL
+ * "http://www.cecill.info".
+ * 
+ * As a counterpart to the access to the source code and  rights to copy,
+ * modify and redistribute granted by the license, users are provided only
+ * with a limited warranty  and the software's author,  the holder of the
+ * economic rights,  and the successive licensors  have only  limited
+ * liability.
+ * 
+ * In this respect, the user's attention is drawn to the risks associated
+ * with loading,  using,  modifying and/or developing or reproducing the
+ * software by the user in light of its specific status of free software,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * requirements in conditions enabling the security of their systems and/or
+ * data to be ensured and,  more generally, to use and operate it in the
+ * same conditions as regards security.
+ * 
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL license and that you accept its terms.
+ */
+
+
+
+
+package ui.window;
+
+import ui.util.IconManager;
+import ui.avatardd.ADDTTYNode;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+//import javax.swing.event.*;
+//import java.util.*;
+
+
+/**
+ * Class JDialogADDTTYNode
+ * Dialog for managing attributes of TTY nodes
+ * Creation: 21/08/2014
+ * @version 1.0 21/08/2014
+ * @author Ludovic APVRILLE
+ */
+public class JDialogADDTTYNode extends JDialogBase implements ActionListener  {
+    
+    private boolean regularClose;
+    
+    private JPanel panel2;
+    private Frame frame;
+    private ADDTTYNode node;
+    
+	
+    // Panel1
+    protected JTextField nodeName;
+	
+	// Panel2
+    protected JTextField index;
+    protected JTextField cluster_index;
+    
+    /** Creates new form  */
+    public JDialogADDTTYNode(Frame _frame, String _title, ADDTTYNode _node) {
+        super(_frame, _title, true);
+        frame = _frame;
+        node = _node;
+        
+        initComponents();
+        myInitComponents();
+        pack();
+    }
+    
+    private void myInitComponents() {
+    }
+    
+    private void initComponents() {
+        Container c = getContentPane();
+        GridBagLayout gridbag0 = new GridBagLayout();
+        GridBagLayout gridbag1 = new GridBagLayout();
+        GridBagLayout gridbag2 = new GridBagLayout();
+        GridBagConstraints c0 = new GridBagConstraints();
+        GridBagConstraints c1 = new GridBagConstraints();
+        GridBagConstraints c2 = new GridBagConstraints();
+        
+        setFont(new Font("Helvetica", Font.PLAIN, 14));
+        c.setLayout(gridbag0);
+        
+        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+        
+        
+        panel2 = new JPanel();
+        panel2.setLayout(gridbag2);
+        panel2.setBorder(new javax.swing.border.TitledBorder("TTY attributes"));
+        panel2.setPreferredSize(new Dimension(400, 200));
+        
+		c1.gridwidth = 1;
+        c1.gridheight = 1;
+        c1.weighty = 1.0;
+        c1.weightx = 1.0;
+        c1.fill = GridBagConstraints.HORIZONTAL;
+        panel2.add(new JLabel("TTY name:"), c2);
+        c1.gridwidth = GridBagConstraints.REMAINDER; //end row
+        nodeName = new JTextField(node.getNodeName(), 30);
+        nodeName.setEditable(true);
+        nodeName.setFont(new Font("times", Font.PLAIN, 12));
+		panel2.add(nodeName, c1);
+ 
+        
+        c2.gridwidth = 1;
+        c2.gridheight = 1;
+        c2.weighty = 1.0;
+        c2.weightx = 1.0;
+        c2.fill = GridBagConstraints.HORIZONTAL;
+      
+        
+        c2.gridwidth = 1;
+        panel2.add(new JLabel("Index:"), c2);
+        c2.gridwidth = GridBagConstraints.REMAINDER; //end row
+        index = new JTextField(""+node.getIndex(), 15);
+        panel2.add(index, c2);
+        
+	c2.gridwidth = 1;
+        panel2.add(new JLabel("Cluster Index:"), c2);
+        c2.gridwidth = GridBagConstraints.REMAINDER; //end row
+        cluster_index = new JTextField(""+node.getIndex(), 15);
+        panel2.add(cluster_index, c2);
+
+	
+        // main panel;
+        c0.gridheight = 10;
+        c0.weighty = 1.0;
+        c0.weightx = 1.0;
+        c0.gridwidth = GridBagConstraints.REMAINDER; //end row
+        c.add(panel2, c0);
+        
+        c0.gridwidth = 1;
+        c0.gridheight = 1;
+        c0.fill = GridBagConstraints.HORIZONTAL;
+        
+        initButtons(c0, c, this);
+    }
+    
+    public void	actionPerformed(ActionEvent evt)  {
+       /* if (evt.getSource() == typeBox) {
+            boolean b = ((Boolean)(initValues.elementAt(typeBox.getSelectedIndex()))).booleanValue();
+            initialValue.setEnabled(b);
+            return;
+        }*/
+        
+        
+        String command = evt.getActionCommand();
+        
+        // Compare the action command to the known actions.
+        if (command.equals("Save and Close"))  {
+            closeDialog();
+        } else if (command.equals("Cancel")) {
+            cancelDialog();
+        }
+    }
+    
+    public void closeDialog() {
+        regularClose = true;
+        dispose();
+    }
+    
+    public void cancelDialog() {
+        dispose();
+    }
+    
+    public boolean isRegularClose() {
+        return regularClose;
+    }
+	
+	public String getNodeName() {
+        return nodeName.getText();
+    }
+    
+    public String getIndex() {
+        return index.getText();
+    }
+    
+    public String getClusterIndex() {
+        return cluster_index.getText();
+    }
+}
-- 
GitLab