diff --git a/src/ddtranslatorSoclib/AvatarChannel.java b/src/ddtranslatorSoclib/AvatarChannel.java index 40bd778c904015d7358c343d99c50c363ec03a75..63491684d8dbfd7ae52deb4c1ed3c3bccef95502 100755 --- a/src/ddtranslatorSoclib/AvatarChannel.java +++ b/src/ddtranslatorSoclib/AvatarChannel.java @@ -8,11 +8,14 @@ public class AvatarChannel extends AvatarMappedObject{ private AvatarRAM avatarRAMReference; private String referenceDiagram ; private String channelName ; + private int no_cluster; - public AvatarChannel(String _referenceDiagram, String _channelName, AvatarRAM _avatarRAMReference ){ + + public AvatarChannel(String _referenceDiagram, String _channelName, AvatarRAM _avatarRAMReference, int _no_cluster){ referenceDiagram = _referenceDiagram; channelName = _channelName; avatarRAMReference = _avatarRAMReference; + no_cluster = _no_cluster; } public AvatarRAM getAvatarRAMReference(){ @@ -26,8 +29,17 @@ public class AvatarChannel extends AvatarMappedObject{ public String getReferenceDiagram(){ return referenceDiagram; } + + /*public String getChannelName(){ + String newChannelName = channelName.substring(0,10)+channelName.substring(channelName.length()-10,channelName.length()-1); + return newChannelName; + } */ - public String getChannelName(){ + public String getChannelName(){ return channelName; + } + + public int getNo_cluster(){ + return no_cluster; } } \ No newline at end of file diff --git a/src/ddtranslatorSoclib/AvatarRAM.java b/src/ddtranslatorSoclib/AvatarRAM.java index 43fb0be8d097dbbfb0de1ee226233e6181f1e494..18b9797c4b110316f06067cc7b0dfcd2083b1f36 100755 --- a/src/ddtranslatorSoclib/AvatarRAM.java +++ b/src/ddtranslatorSoclib/AvatarRAM.java @@ -13,15 +13,17 @@ public class AvatarRAM extends AvatarComponent{ public int no_ram; public int no_target; + public int no_target_local; + public int no_cluster; LinkedList<AvatarChannel> channelMapped ; - - public AvatarRAM(String _memoryName,int _index,int _dataSize,int _no_ram) { + //DG 4.4. we add a field cluster_index, for the time when a cluster will have more than one RAM + public AvatarRAM(String _memoryName,int _index,int _dataSize,int _no_ram, int _no_cluster) { memoryName = _memoryName; index = _index; dataSize = _dataSize; no_ram = _no_ram; - + no_cluster=_no_cluster; channelMapped = new LinkedList<AvatarChannel>(); } @@ -37,6 +39,10 @@ public class AvatarRAM extends AvatarComponent{ return no_target; } + public int getNo_cluster(){ + return no_cluster; + } + public void setNo_ram(int _no_ram){ no_ram = _no_ram; } @@ -44,6 +50,11 @@ public class AvatarRAM extends AvatarComponent{ 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; } diff --git a/src/ddtranslatorSoclib/AvatarTTY.java b/src/ddtranslatorSoclib/AvatarTTY.java index a38559f8f22b5e92f124f601e0bec2a4266fb3a5..4fa2c62fb7644137e1e19763d079e1e5c37f7028 100755 --- a/src/ddtranslatorSoclib/AvatarTTY.java +++ b/src/ddtranslatorSoclib/AvatarTTY.java @@ -12,11 +12,13 @@ public class AvatarTTY extends AvatarComponent { private String ttyName; private int no_tty; private int no_target; - - public AvatarTTY(String _ttyName,int _index, int _no_tty){ + private int no_cluster; +//DG 4.4. we add a field cluster_index, for the time where a cluster can have more tahn one TTY + public AvatarTTY(String _ttyName, int _index, int _no_tty, int _no_cluster){ index = _index; ttyName = _ttyName; no_tty = _no_tty; + no_cluster= _no_cluster; } public String getTTYName(){ @@ -35,6 +37,10 @@ public class AvatarTTY extends AvatarComponent { return no_target; } + public int getNo_cluster(){ + return no_cluster; + } + public void setNo_tty(int _no_tty){ no_tty = _no_tty; } @@ -43,5 +49,8 @@ public class AvatarTTY extends AvatarComponent { no_target = _no_target; } + public void setNo_cluster(int _no_cluster){ + no_cluster = _no_cluster; + } } diff --git a/src/ddtranslatorSoclib/AvatarddSpecification.java b/src/ddtranslatorSoclib/AvatarddSpecification.java index 612f30ceb6f8c001ac1dd95269586444d0053ae8..5357d74d2bde4d10df6d537dd402f639546f43d9 100755 --- a/src/ddtranslatorSoclib/AvatarddSpecification.java +++ b/src/ddtranslatorSoclib/AvatarddSpecification.java @@ -108,7 +108,6 @@ There always is a RAM0, a TTY and an interconnect (Bus or VGMN or crossbar) othe { if (bus instanceof AvatarBus) buss.add((AvatarBus)bus); - } return buss; } @@ -128,12 +127,19 @@ There always is a RAM0, a TTY and an interconnect (Bus or VGMN or crossbar) othe LinkedList<AvatarCrossbar> crossbars = new LinkedList<AvatarCrossbar>(); for (AvatarComponent crossbar : components ) { - if (crossbar instanceof AvatarCrossbar) - crossbars.add((AvatarCrossbar)crossbar); + if (crossbar instanceof AvatarCrossbar){ + System.out.println("@@@@@@@@@@@@@@@@@@@@@@ Clustered Interconnect @@@@@@@@@@@@@@@@@"); + crossbars.add((AvatarCrossbar)crossbar); + } } return crossbars; } + + //Currently, we define 1 crossbar = 1 cluster + public int getNbClusters(){ + return getAllCrossbar().size(); + } public LinkedList<AvatarCoproMWMR> getAllCoproMWMR(){ LinkedList<AvatarCoproMWMR> copros = new LinkedList<AvatarCoproMWMR>(); @@ -174,7 +180,8 @@ There always is a RAM0, a TTY and an interconnect (Bus or VGMN or crossbar) othe return (getAllCoproMWMR()).size(); } - // for construction of the central interconnect + // for construction of the central interconnect: currently unused, extracted from DDiagram + public int getNb_init(){ return nb_init ; } diff --git a/src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java b/src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java index 7d480e0f88700f71b2cb93c2bab525e4630b28ae..1dba064500d37d451d9c82d190d94264a39b2e20 100755 --- a/src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java +++ b/src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java @@ -185,6 +185,24 @@ public class TasksAndMainGenerator { mainFile.appendToMainCode("pthread_mutex_init(&__mainMutex, NULL);" +CR2); } + public String getReducedChannelName(AvatarRelation ar, int i){ + String newChannelName; + String channelName; + channelName=getChannelName(ar, i); + newChannelName = channelName; + //newChannelName = channelName.substring(0,10)+channelName.substring(channelName.length()-10,channelName.length()-1); + return newChannelName; + } + + public String getReducedChannelName(AvatarRelation ar, AvatarSignal as){ + String newChannelName; + String channelName; + channelName=getChannelName(ar, as); + newChannelName = channelName; + //newChannelName = channelName.substring(0,10)+channelName.substring(channelName.length()-10,channelName.length()-1); + return newChannelName; + } + public void makeSynchronousChannels() { int i=0; // Create a synchronous channel per relation/signal @@ -194,13 +212,13 @@ public class TasksAndMainGenerator { for(AvatarRelation ar: avspec.getRelations()) { if (!ar.isAsynchronous()) { for(i=0; i<ar.nbOfSignals(); i++) { - mainFile.appendToHCode("extern syncchannel __" + getChannelName(ar, i) + ";" + CR); - mainFile.appendToBeforeMainCode("syncchannel __" + getChannelName(ar, i) + ";" + CR); - mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".inname =\"" + ar.getInSignal(i).getName() + "\";" + CR); - mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".outname =\"" + ar.getOutSignal(i).getName() + "\";" + CR); + mainFile.appendToHCode("extern syncchannel __" + getReducedChannelName(ar, i) + ";" + CR); + mainFile.appendToBeforeMainCode("syncchannel __" + getReducedChannelName(ar, i) + ";" + CR); + mainFile.appendToMainCode("__" + getReducedChannelName(ar, i) + ".inname =\"" + ar.getInSignal(i).getName() + "\";" + CR); + mainFile.appendToMainCode("__" + getReducedChannelName(ar, i) + ".outname =\"" + ar.getOutSignal(i).getName() + "\";" + CR); if (ar.isBroadcast()) { - mainFile.appendToMainCode("setBroadcast(&__" + getChannelName(ar, i) + ", true);" + CR); + mainFile.appendToMainCode("setBroadcast(&__" + getReducedChannelName(ar, i) + ", true);" + CR); } } } @@ -219,26 +237,26 @@ public class TasksAndMainGenerator { for(AvatarRelation ar: avspec.getRelations()) { if (ar.isAsynchronous()) { for(int i=0; i<ar.nbOfSignals() ; i++) { - mainFile.appendToHCode("extern asyncchannel __" + getChannelName(ar, i) + ";" + CR); + mainFile.appendToHCode("extern asyncchannel __" + getReducedChannelName(ar, i) + ";" + CR); - mainFile.appendToBeforeMainCode("asyncchannel __" + getChannelName(ar, i) + ";" + CR); - mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".inname =\"" + ar.getInSignal(i).getName() + "\";" + CR); - mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".outname =\"" + ar.getOutSignal(i).getName() + "\";" + CR); + mainFile.appendToBeforeMainCode("asyncchannel __" +getReducedChannelName(ar, i) + ";" + CR); + mainFile.appendToMainCode("__" + getReducedChannelName(ar, i) + ".inname =\"" + ar.getInSignal(i).getName() + "\";" + CR); + mainFile.appendToMainCode("__" +getReducedChannelName(ar, i) + ".outname =\"" + ar.getOutSignal(i).getName() + "\";" + CR); if (ar.isBlocking()) { - mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".isBlocking = 1;" + CR); + mainFile.appendToMainCode("__" +getReducedChannelName(ar, i) + ".isBlocking = 1;" + CR); } else { - mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".isBlocking = 0;" + CR); + mainFile.appendToMainCode("__" + getReducedChannelName(ar, i) + ".isBlocking = 0;" + CR); } - mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".maxNbOfMessages = " + ar.getSizeOfFIFO() + ";" + CR); + mainFile.appendToMainCode("__" + getReducedChannelName(ar, i) + ".maxNbOfMessages = " + ar.getSizeOfFIFO() + ";" + CR); - mainFile.appendToMainCode("__" + getChannelName(ar, i) + ".mwmr_fifo = &" + getChannelName(ar, i) + ";" + CR);//DG 07.12 + mainFile.appendToMainCode("__" + getReducedChannelName(ar, i) + ".mwmr_fifo = &" + getReducedChannelName(ar, i) + ";" + CR); - mainFile.appendToBeforeMainCode("uint32_t *const "+ getChannelName(ar, i)+"_lock= LOCKSADDR+0x"+(i*20) +";" + CR); + mainFile.appendToBeforeMainCode("uint32_t *const "+ getReducedChannelName(ar, i)+"_lock= LOCKSADDR+0x"+(i*20) +";" + CR); //DG parameter <depth> should ultimately be generated; width is fixed as long as data is not explicitly modeled - mainFile.appendToBeforeMainCode("struct mwmr_status_s "+ getChannelName(ar, i) +"_status = MWMR_STATUS_INITIALIZER(1, 1);" + CR); - mainFile.appendToBeforeMainCode("uint8_t "+getChannelName(ar, i) +"_data[32*2];" + CR); - mainFile.appendToBeforeMainCode("struct mwmr_s "+getChannelName(ar, i) + "= MWMR_INITIALIZER(1, 1, "+getChannelName(ar, i)+"_data,&"+getChannelName(ar, i)+"_status,\""+getChannelName(ar, i)+"\","+getChannelName(ar, i)+"_lock);" + CR2); + mainFile.appendToBeforeMainCode("struct mwmr_status_s "+ getReducedChannelName(ar, i) +"_status = MWMR_STATUS_INITIALIZER(1, 1);" + CR); + mainFile.appendToBeforeMainCode("uint8_t "+getReducedChannelName(ar, i) +"_data[32*2];" + CR); + mainFile.appendToBeforeMainCode("struct mwmr_s "+getReducedChannelName(ar, i) + "= MWMR_INITIALIZER(1, 1, "+getReducedChannelName(ar, i)+"_data,&"+getReducedChannelName(ar, i)+"_status,\""+getReducedChannelName(ar, i)+"\","+getReducedChannelName(ar, i)+"_lock);" + CR2); } } } @@ -467,7 +485,7 @@ public class TasksAndMainGenerator { AvatarRelation ar = avspec.getAvatarRelationWithSignal(as); //DG if(ar.isAsynchronous()){ - ret2+= CR + "struct mwmr_s *" + getChannelName(ar, as); + ret2+= CR + "struct mwmr_s *" + getReducedChannelName(ar, as); } } @@ -682,8 +700,10 @@ public class TasksAndMainGenerator { } if (_asme instanceof AvatarState) { - //DG 05.10. - //ret += "printf(\"###Soclib cycle count %d \\n\",cpu_cycle_count());"+CR; + + //DG 29.03. + int cpuid = FindCPUidFromTask(_block); + ret += "printf(\"tracing cycles --- block: "+_block.getName()+" cpu: %d cycle count: %d \\n\","+ cpuid+", cpu_cycle_count());"+CR; if (!firstCall) { if (debug) { ret += "debug2Msg(__myname, \"-> (=====) Entering state + " + _asme.getName() + "\");" + CR; @@ -850,15 +870,15 @@ public class TasksAndMainGenerator { ret+="debugInt(\"channel address\", &__req"+_index+");" + CR; ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", SEND_ASYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; ret += "debug2Msg(__myname, \"-> (=====)after MakeNewRequest\");" + CR; - ret += "__req" + _index + ".asyncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "__req" + _index + ".asyncChannel = &__" + getReducedChannelName(ar, as) + ";" + CR; } else { if (ar.isBroadcast()) { ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID()+ ", SEND_BROADCAST_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "__req" + _index + ".syncChannel = &__" + getReducedChannelName(ar, as) + ";" + CR; } else { ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID()+ ", SEND_SYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "__req" + _index + ".syncChannel = &__" + getReducedChannelName(ar, as) + ";" + CR; } } @@ -872,14 +892,14 @@ public class TasksAndMainGenerator { //ret += "debug2Msg(__myname, \"-> (=====)before MakeNewRequest\");" + CR; //ret+="debugInt(\"channel address\", &__req"+_index+");" + CR; ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", RECEIVE_ASYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".asyncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "__req" + _index + ".asyncChannel = &__" + getReducedChannelName(ar, as) + ";" + CR; } else { if (ar.isBroadcast()) { ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", RECEIVE_BROADCAST_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "__req" + _index + ".syncChannel = &__" + getReducedChannelName(ar, as) + ";" + CR; } else { ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", RECEIVE_SYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "__req" + _index + ".syncChannel = &__" + getReducedChannelName(ar, as) + ";" + CR; } } } @@ -964,14 +984,12 @@ public class TasksAndMainGenerator { int j=0; for(AvatarRelation ar: avspec.getRelations()) { int i; - //unless there are channels associated, do nothing and pass NULL pointer in pthread_create - //DG 21.09. MWMRchannels only for asynchronous channels + if(ar.nbOfSignals()!=0){ for(i=0; i<ar.nbOfSignals() ; i++) { - //if((ar.block1.getName()==taskFile.getName())||(ar.block2.getName()==taskFile.getName())){ - //DG 21.09. des que la relation contient un signal, elle est synchrone - if(((ar.block1.getName()==taskFile.getName())||(ar.block2.getName()==taskFile.getName()))&&(ar.isAsynchronous())){ //DG 13.10. enleve - channelString+="channels_array_"+ taskFile.getName() +"["+j+"]=&"+getChannelName(ar, i)+";" + CR;//DG 06.12. added & before channel Name fixed bug + + if(((ar.block1.getName()==taskFile.getName())||(ar.block2.getName()==taskFile.getName()))&&(ar.isAsynchronous())){ + channelString+="channels_array_"+ taskFile.getName() +"["+j+"]=&"+getReducedChannelName(ar, i)+";" + CR; cptchannels_array ++; j++; } diff --git a/src/ddtranslatorSoclib/toTopCell/Declaration.java b/src/ddtranslatorSoclib/toTopCell/Declaration.java index fb5200dc4ecdc0e5b0f00e24919095e573d2c0af..85e703dcf86575ac3c07cd162aeec6858ec7540c 100755 --- a/src/ddtranslatorSoclib/toTopCell/Declaration.java +++ b/src/ddtranslatorSoclib/toTopCell/Declaration.java @@ -15,36 +15,103 @@ public class Declaration { String declaration = "//----------------------------Instantiation-------------------------------" + CR2; - // the following are present in every platform and their adresses fixed once and for all + // the following are present in every platform + + //Is the present architecture clustered? at least one crossbar + + int nb_clusters=5;//TopCellGenerator.avatardd.getAllCrossbar().size(); + System.out.println("@@@@@@@@@@nb_clusters@@@@@@@@: "+nb_clusters); + + if(nb_clusters==0){ declaration += CR + "caba::VciHeterogeneousRom<vci_param> vcihetrom(\"vcihetrom\", IntTab(0), maptab);" + CR; - + } + else{ + declaration += CR + + "caba::VciHeterogeneousRom<vci_param> vcihetrom(\"vcihetrom\", IntTab(0,0), maptab);" + CR; + } +if(nb_clusters==0){ declaration += "caba::VciRam<vci_param> vcirom(\"vcirom\", IntTab(1), maptab, data_ldr);" + CR; +} +else{ + declaration += "caba::VciRam<vci_param> vcirom(\"vcirom\", IntTab(0,1), maptab, data_ldr);" + CR; + + } + +if(nb_clusters==0){ + declaration += " caba::VciSimhelper<vci_param> vcisimhelper (\"vcisimhelper\", IntTab(3), maptab);" + CR; +} +else{ + declaration += " caba::VciSimhelper<vci_param> vcisimhelper (\"vcisimhelper\", IntTab(0,3), maptab);" + CR; + } - declaration += " caba::VciSimhelper<vci_param> vcisimhelper (\"vcisimhelper\", IntTab(3), maptab);" + CR; - //current hypothesis max. 1 (multi-) timer +if(nb_clusters==0){ declaration = declaration + "caba::VciXicu<vci_param> vcixicu(\"vci_xicu\", maptab, IntTab(4), 1, xicu_n_irq, cpus.size(), cpus.size());" + CR; +} +else{ + declaration = declaration + "caba::VciXicu<vci_param> vcixicu(\"vci_xicu\", maptab, IntTab(0,4), 1, xicu_n_irq, cpus.size(), cpus.size());" + CR; + } +if(nb_clusters==0){ declaration = declaration + "caba::VciRtTimer<vci_param> vcirttimer (\"vcirttimer\", IntTab(5), maptab, 1, true);" + CR2; - - declaration += "caba::VciFdtRom<vci_param> vcifdtrom(\"vci_fdt_rom\", IntTab(6), maptab);" + CR; +} +else{ + declaration = declaration + "caba::VciRtTimer<vci_param> vcirttimer (\"vcirttimer\", IntTab(0,5), maptab, 1, true);" + CR2; + } - declaration += "caba::VciLocks<vci_param> vci_locks(\"vci_locks\", IntTab("+(TopCellGenerator.avatardd.getNb_target()+3)+"), maptab);" + CR;//DG 04.12. - declaration += "caba::VciRam<vci_param>mwmr_ram(\"mwmr_ram\",IntTab("+(TopCellGenerator.avatardd.getNb_target()+3)+"),maptab);" + CR2; - declaration += "caba::VciRam<vci_param>mwmrd_ram(\"mwmrd_ram\", IntTab("+(TopCellGenerator.avatardd.getNb_target()+4)+"),maptab);" + CR2; - // There can be an arbitrary number of RAMS (at least one, RAM0 is distinguished) and TTY +if(nb_clusters==0){ + declaration += "caba::VciFdtRom<vci_param> vcifdtrom(\"vci_fdt_rom\", IntTab(6), maptab);" + CR; +} +else{ + declaration += "caba::VciFdtRom<vci_param> vcifdtrom(\"vci_fdt_rom\", IntTab(0,6), maptab);" + CR; + } + +if(nb_clusters==0){ + declaration += "caba::VciLocks<vci_param> vci_locks(\"vci_locks\", IntTab("+(TopCellGenerator.avatardd.getNb_target()+3)+"), maptab);" + CR; +} +else{ + declaration += "caba::VciLocks<vci_param> vci_locks(\"vci_locks\", IntTab(0,3), maptab);" + CR; + } + + // There can be an arbitrary number of RAMS (at least one, RAM0 is distinguished) and TTY + + if(nb_clusters==0){ + declaration += "caba::VciRam<vci_param>mwmr_ram(\"mwmr_ram\",IntTab(0,"+(TopCellGenerator.avatardd.getNb_target()+3)+"),maptab);" + CR2; + declaration += "caba::VciRam<vci_param>mwmrd_ram(\"mwmrd_ram\", IntTab("+(TopCellGenerator.avatardd.getNb_target()+4)+"),maptab);" + CR2; +} + else{ + // declaration += "caba::VciRam<vci_param>mwmr_ram(\"mwmr_ram\",IntTab(0,1),maptab);" + CR2; + // declaration += "caba::VciRam<vci_param>mwmrd_ram(\"mwmrd_ram\", IntTab(0,2),maptab);" + CR2; +} + if(nb_clusters==0){ for (AvatarTTY tty : TopCellGenerator.avatardd.getAllTTY()){ - declaration += "caba::VciMultiTty<vci_param> " + tty.getTTYName()+ "(\"" + tty.getTTYName()+ "\", IntTab(" + tty.getNo_target()+ "), maptab, \"vci_multi_tty"+"\", NULL);";} - - for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) - declaration += "soclib::caba::VciRam<vci_param>" + ram.getMemoryName()+ "(\"" + ram.getMemoryName()+ "\"" + ", IntTab(" - + ram.getNo_target() + "), maptab);" + CR2; - + declaration += "caba::VciMultiTty<vci_param> " + tty.getTTYName()+ "(\"" + tty.getTTYName()+ "\", IntTab(" + tty.getNo_target()+ "), maptab, \"vci_multi_tty"+"\", NULL);"+ CR;} + + for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) + declaration += "soclib::caba::VciRam<vci_param>" + ram.getMemoryName()+ "(\"" + ram.getMemoryName()+ "\"" + ", IntTab(" + + ram.getNo_target() + "), maptab);" + CR; + } + else{ + for (AvatarTTY tty : TopCellGenerator.avatardd.getAllTTY()){ + declaration += "caba::VciMultiTty<vci_param> " + tty.getTTYName()+ "(\"" + tty.getTTYName()+ "\", IntTab("+ tty.getNo_cluster()+"," + tty.getNo_target()+ "), maptab, \"vci_multi_tty"+"\", NULL);"+ CR;} + + for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) + declaration += "soclib::caba::VciRam<vci_param>" + ram.getMemoryName()+ "(\"" + ram.getMemoryName()+ "\"" + ", IntTab("+ram.getNo_cluster()+"," + + ram.getNo_target() + "), maptab);" + CR2; + + } + if(nb_clusters==0){ declaration += "caba::VciFdAccess<vci_param> vcifd(\"vcifd\", maptab, IntTab(cpus.size()+1), IntTab("+(TopCellGenerator.avatardd.getNb_target())+"));" + CR; declaration += "caba::VciEthernet<vci_param> vcieth(\"vcieth\", maptab, IntTab(cpus.size()+2), IntTab("+(TopCellGenerator.avatardd.getNb_target()+1)+"), \"soclib0\");" + CR; declaration += "caba::VciBlockDevice<vci_param> vcibd(\"vcibd\", maptab, IntTab(cpus.size()), IntTab("+(TopCellGenerator.avatardd.getNb_target()+2)+"),\"block0.iso\", 2048);" + CR; + }else{ + declaration += "caba::VciFdAccess<vci_param> vcifd(\"vcifd\", maptab, IntTab(0,cpus.size()+1), IntTab(0,7));" + CR; + declaration += "caba::VciEthernet<vci_param> vcieth(\"vcieth\", maptab, IntTab(0,cpus.size()+2), IntTab(0,8), \"soclib0\");" + CR; + declaration += "caba::VciBlockDevice<vci_param> vcibd(\"vcibd\", maptab, IntTab(0,cpus.size()), IntTab(0,9),\"block0.iso\", 2048);" + CR; + } +if(nb_clusters==0){ for (AvatarBus bus : TopCellGenerator.avatardd.getAllBus()) { System.out.println("initiators: "+TopCellGenerator.avatardd.getNb_init()); System.out.println("targets: "+TopCellGenerator.avatardd.getNb_target()); @@ -67,17 +134,37 @@ public class Declaration { // if VGMN was not last in input file, update here vgmn.setNbOfAttachedInitiators(TopCellGenerator.avatardd.getNb_init()); vgmn.setnbOfAttachedTargets(TopCellGenerator.avatardd.getNb_target()+4);//DG 04.12. two additionnal targets for channel mapping + } +}else + //clustered + { + for (AvatarBus bus : TopCellGenerator.avatardd.getAllBus()) { + + //for the moment we fix no init and no target + declaration += "soclib::caba::VciVgsb<vci_param> " + bus.getBusName() +"(\"" + bus.getBusName() + "\"" + " , maptab, "+ 1 +"," + 6+ ");" + CR2; + + //if BUS was not last in input file, update here + bus.setNbOfAttachedInitiators(1); + bus.setnbOfAttachedTargets(6); } - int cluster_index; - int cluster_address; - for (AvatarCrossbar crossbar : TopCellGenerator.avatardd.getAllCrossbar()) { + for (AvatarVgmn vgmn : TopCellGenerator.avatardd.getAllVgmn()) { System.out.println("initiators: "+TopCellGenerator.avatardd.getNb_init()); System.out.println("targets: "+TopCellGenerator.avatardd.getNb_target()); - cluster_index=crossbar.getClusterIndex(); - cluster_address=crossbar.getClusterAddress();//Adress doit etre calculee a terme - declaration += "soclib::caba::VciLocalCrossbar<vci_param> crossbar(\"" + crossbar.getCrossbarName() + "\"" + " , maptab, cluster_index, cluster_address, cpus.size()+3," + (TopCellGenerator.avatardd.getNb_target()+3)+ - ");" + CR2; + + declaration += "soclib::caba::VciVgmn<vci_param> "+ vgmn.getVgmnName() +" (\"" + vgmn.getVgmnName() + "\"" + " , maptab, "+ 1 +"," + 6 + + "," + vgmn.getMinLatency() + "," + vgmn.getFifoDepth() + ");" + CR2; + // if VGMN was not last in input file, update here + vgmn.setNbOfAttachedInitiators(1); + vgmn.setnbOfAttachedTargets(6); + } +} + + for (AvatarCrossbar crossbar : TopCellGenerator.avatardd.getAllCrossbar()) { + System.out.println("initiators: "+crossbar.getNbOfAttachedInitiators()); + System.out.println("targets: "+crossbar.getNbOfAttachedTargets()); + + declaration += "soclib::caba::VciLocalCrossbar<vci_param> crossbar(\"" + crossbar.getCrossbarName() + "\"" + " , maptab, IntTab("+ crossbar.getClusterIndex()+"),IntTab("+crossbar.getClusterAddress()+"), "+crossbar.getNbOfAttachedInitiators()+", "+crossbar.getNbOfAttachedTargets()+");" + CR2; //if CROSSBAR was not last in input file, update here crossbar.setNbOfAttachedInitiators(TopCellGenerator.avatardd.getNb_init()); diff --git a/src/ddtranslatorSoclib/toTopCell/Header.java b/src/ddtranslatorSoclib/toTopCell/Header.java index 7750f86cc5585c0e911cbb775b21056896ade2fb..09429209794bc524b923a25d3abd84f148e35392 100755 --- a/src/ddtranslatorSoclib/toTopCell/Header.java +++ b/src/ddtranslatorSoclib/toTopCell/Header.java @@ -10,7 +10,7 @@ import ddtranslatorSoclib.*; public class Header { static private String header; - +int nb_clusters=5; private final static String CR = "\n"; private final static String CR2 = "\n\n"; @@ -34,13 +34,19 @@ public class Header { + "#include \"vci_fdt_rom.h\"" + CR + "#include \"vci_xcache_wrapper.h\"" + CR + "#include \"vci_ram.h\"" + CR + "#include \"vci_heterogeneous_rom.h\"" + CR + "#include \"vci_multi_tty.h\"" + CR + "#include \"vci_locks.h\"" + CR + "#include \"vci_xicu.h\"" - + CR + "#include \"vci_vgmn.h\""+ CR + "#include \"vci_vgsb.h\"" + CR + "#include \"vci_block_device.h\"" + CR + + CR + "#include \"vci_vgmn.h\""+ CR + "#include \"vci_vgsb.h\"" + CR + "#include \"vci_local_crossbar.h\"" + CR + "#include \"vci_block_device.h\"" + CR + "#include \"vci_simhelper.h\"" + CR + "#include \"vci_fd_access.h\"" + CR + "#include \"vci_ethernet.h\"" + CR + "#include \"vci_rttimer.h\"" + CR2; header = header + "using namespace soclib;" + CR + "using common::IntTab;" + CR + "using common::Segment;"; + + if(TopCellGenerator.avatardd.getNbClusters()==0){ header = header + CR2 + "static common::MappingTable maptab(32, IntTab(8), IntTab(8), 0xfff00000);"; + } + else{ +header = header + CR2 + "static common::MappingTable maptab(32, IntTab(8,4), IntTab(8,4), 0xfff00000);"; + } return header; } } diff --git a/src/ddtranslatorSoclib/toTopCell/Loader.java b/src/ddtranslatorSoclib/toTopCell/Loader.java index 861141595e69cbcf8bf8d90831e5e1276018980e..2c2de8abac35a83d9efb7aff0df3f728ec3f3d91 100755 --- a/src/ddtranslatorSoclib/toTopCell/Loader.java +++ b/src/ddtranslatorSoclib/toTopCell/Loader.java @@ -19,6 +19,9 @@ public class Loader { public static String getLoader() { +int nb_clusters=5;//TopCellGenerator.avatardd.getAllCrossbar().size(); + System.out.println("@@@@@@@@@@nb_clusters@@@@@@@@: "+nb_clusters); + loader = CR2 + "//-------------------------Call Loader---------------------------------" + CR2 ; loader = loader + "std::cerr << \"caba-vgmn-mutekh_kernel_tutorial SoCLib simulator for MutekH\" << std::endl;" + CR2 ; @@ -77,7 +80,12 @@ public class Loader { loader = loader + " }" + CR ; loader = loader + " }" + CR2 ; int nb_tty =1; //DG currently only one (multi) tty - loader = loader + " const size_t xicu_n_irq = "+(1+nb_tty+3)+";" + CR2 ; + +if(nb_clusters==0){ + loader = loader + " const size_t xicu_n_irq = "+(1+nb_tty+3)+";" + CR2 ; +}else{ + loader = loader + " const size_t xicu_n_irq = "+(5*nb_clusters)+";" + CR2 ; +} return loader; } diff --git a/src/ddtranslatorSoclib/toTopCell/MappingTable.java b/src/ddtranslatorSoclib/toTopCell/MappingTable.java index b66bef653aa67e4ba27096b5cad55083c4d59166..b9526fc7454ec1329407a410e558af11ea93d20f 100755 --- a/src/ddtranslatorSoclib/toTopCell/MappingTable.java +++ b/src/ddtranslatorSoclib/toTopCell/MappingTable.java @@ -16,10 +16,16 @@ public class MappingTable { private final static String CR2 = "\n\n"; private static String mapping; + + //System.out.println("@@@@@@@@@@nb_clusters@@@@@@@@: "+nb_clusters); + public static String getMappingTable() { + int nb_clusters=5;//TopCellGenerator.avatardd.getAllCrossbar().size(); /* depending on the cpu type, the addresses of some segments (reset etc.) differ */ + if(nb_clusters == 0){ + mapping = CR2 + "//-----------------------mapping table------------------------" + CR2; mapping = mapping + "// ppc segments" + CR2; @@ -59,8 +65,11 @@ public class MappingTable { mapping = mapping + "maptab.add(Segment(\"vci_fdt_rom\", 0xe0000000, 0x00001000, IntTab(6), false));" + CR2; /* here we have a loop over the CHANNEL segments specified in the deployment diagram and we calculate their addresses in a loop; more intelligent algorithms will be proposed later */ - - int j=0; int k=0; int l=0; + +int j=0; int k=0; int l=0; + + if(TopCellGenerator.avatardd.getAllCrossbar().size()==0){ + for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { if(ram.getNo_ram() ==0){ ram.setNo_target(2); @@ -81,13 +90,102 @@ public class MappingTable { j++; l=tty.getNo_target(); } + } + + else{ + + for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { + if(ram.getNo_ram() ==0){ + ram.setNo_target(2); + } + else{ + ram.setNo_target(7+j); + mapping += "maptab.add(Segment(\"channel" + j + "\", 0x" + (6 - j) + "f000000, 0x01000000, IntTab("+j+","+ram.getNo_target()+"), false));" + CR; + j++; + } + } + int m=0; + for (AvatarTTY tty : TopCellGenerator.avatardd.getAllTTY()) { + /* we calculate the target number of one or several (multi-) ttys which come after the j rams and the 7 compulsory targets */ + tty.setNo_target(7+j+k); + k++; + /* we use a simple formula for calculating the TTY address in case of multiple (multi-) ttys */ + /* only one tty per cluster currently! */ + mapping += "maptab.add(Segment(\"vci_multi_tty\" , 0xd"+tty.getNo_tty()+"200000, 0x00000010, IntTab("+m+","+tty.getNo_target() +"), false));" + CR; + j++; m++; + l=tty.getNo_target(); + } + } + mapping = mapping + "maptab.add(Segment(\"vci_fd_access\", 0xd4200000, 0x00000100, IntTab("+(l+1)+"), false));" + CR; mapping = mapping + "maptab.add(Segment(\"vci_ethernet\", 0xd5000000, 0x00000020, IntTab("+(l+2)+"), false));" + CR; mapping = mapping + "maptab.add(Segment(\"vci_block_device\", 0xd1200000, 0x00000020, IntTab("+(l+3)+"), false));" + CR2; mapping = mapping + "maptab.add(Segment(\"vci_locks\", 0x30200000, 0x00000100, IntTab("+(l+4)+"), false));" + CR2;//DG 4.12. mapping = mapping + "maptab.add(Segment(\"mwmr_ram\", 0xA0200000, 0x00001000, IntTab("+(l+5)+"), false));" + CR2;//DG 4.12. mapping = mapping + "maptab.add(Segment(\"mwmrd_ram\", 0x20200000, 0x00003000, IntTab("+(l+6)+"), false));" + CR2;//DG 4.12. - return mapping; - } - + + } + else{ + //clustered version + + mapping = CR2 + "//-----------------------mapping table------------------------" + CR2; + mapping = mapping + "// ppc segments" + CR2; + + mapping = mapping + "maptab.add(Segment(\"resetppc\", 0xffffff80, 0x0080, IntTab(0,1), true));" + CR; + mapping = mapping + "maptab.add(Segment(\"resetnios\", 0x00802000, 0x1000, IntTab(0,1), true));" + CR; + mapping = mapping + "maptab.add(Segment(\"resetzero\", 0x00000000, 0x1000, IntTab(0,1), true));" + CR; + mapping = mapping + "maptab.add(Segment(\"resetmips\", 0xbfc00000, 0x1000, IntTab(0,1), true));" + CR; + + mapping += CR2 + "// RAM shared segments" + CR2; + mapping += "maptab.add(Segment(\"text\", 0x60000000, 0x00100000, IntTab(0,0), true));" + CR; + mapping += "maptab.add(Segment(\"rodata\", 0x80000000, 0x01000000, IntTab(0,1), true));" + CR; + mapping += "maptab.add(Segment(\"data\", 0x7f000000, 0x01000000, IntTab(0,2), false)); " + CR2; + + mapping = mapping + "maptab.add(Segment(\"simhelper\", 0xd3200000, 0x00000100, IntTab(0,3), false));" + CR; + mapping = mapping + " maptab.add(Segment(\"vci_xicu\", 0xd2200000, 0x00001000, IntTab(0,4), false));" + CR; + mapping = mapping + "maptab.add(Segment(\"vci_rttimer\", 0xd6000000, 0x00000100, IntTab(0,5), false));" + CR2; + mapping = mapping + "maptab.add(Segment(\"vci_fdt_rom\", 0xe0000000, 0x00001000, IntTab(0,6), false));" + CR2; + + //fixed adresses also for the following hidden components, all in cluster 0 exclusively + mapping = mapping + "maptab.add(Segment(\"vci_fd_access\", 0xd4200000, 0x00000100, IntTab(0,7), false));" + CR; + mapping = mapping + "maptab.add(Segment(\"vci_ethernet\", 0xd5000000, 0x00000020, IntTab(0,8), false));" + CR; + mapping = mapping + "maptab.add(Segment(\"vci_block_device\", 0xd1200000, 0x00000020, IntTab(0,9), false));" + CR2; + + //DG 4.4. deal with mapping of channels: has to be revised + //Attention: also ldscript becomes more complicated + + int j=0; int c; + for (AvatarChannel channel : TopCellGenerator.avatardd.getAllMappedChannels()) { + //we need to know on which cluster the channel is mapped + + //DG 5.4. calcul pas encore correct, il faut identifier compbien de canaux il y a par cluster, ou proceder par RAM et identifier les canaux mappe dessus puis incrementer si plusieurs canaux sur la meme ram + + mapping += "maptab.add(Segment(\"channel" + j+ "\", 0x" + channel.getNo_cluster() + "f000000, 0x00100000, IntTab("+channel.getNo_cluster()+","+channel.getRAMNo()+"), false));" + CR; + j++; + } + + for(c=0;c<nb_clusters;c++){ + mapping = mapping + "maptab.add(Segment(\"vci_locks"+c+"\", 0x30200000, 0x00000100, IntTab("+c+",3), false));" + CR2; + mapping = mapping + "maptab.add(Segment(\"mwmr_ram"+c+"\", 0xA"+c+"200000, 0x00001000, IntTab("+c+",1), false));" + CR2; + mapping = mapping + "maptab.add(Segment(\"mwmrd_ram"+c+"\", 0x2"+c+"200000, 0x00003000, IntTab("+c+",2), false));" + CR2; + } + + //now treat ram and tty + for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { + c=ram.getIndex(); + ram.setNo_target(4); + mapping += "maptab.add(Segment(\"vci_multi_ram"+ram.getIndex()+"\" , 0xd"+ram.getIndex()+"0200000, 0x00010000, IntTab("+ram.getIndex()+",5), false));" + CR; + } + + //one tty per cluster + for (AvatarTTY tty : TopCellGenerator.avatardd.getAllTTY()) { + c=tty.getIndex(); + tty.setNo_target(5); + + mapping += "maptab.add(Segment(\"vci_multi_tty"+tty.getIndex()+"\" , 0xd"+tty.getIndex()+"0200000, 0x00000010, IntTab("+tty.getIndex()+",5), false));" + CR; + } + } + + return mapping; + } } diff --git a/src/ddtranslatorSoclib/toTopCell/NetList.java b/src/ddtranslatorSoclib/toTopCell/NetList.java index 82f7f9618366472ebc3ba6c85d991a649133b909..185bc8e40c51eb075fc2d93b5f9535532a101a1b 100755 --- a/src/ddtranslatorSoclib/toTopCell/NetList.java +++ b/src/ddtranslatorSoclib/toTopCell/NetList.java @@ -12,7 +12,7 @@ public class NetList { private static final String NAME_RST = "signal_resetn"; public static String getNetlist(String icn) { - + int nb_clusters=5;//TopCellGenerator.avatardd.getAllCrossbar().size(); String netlist; netlist = CR2 + "//------------------------------Netlist---------------------------------" + CR2; @@ -122,8 +122,11 @@ public class NetList { netlist = netlist + " vgsb.p_to_initiator[cpus.size()+2](signal_vci_etherneti);" + CR2; } // There are several targets and we have to generate their numbers + if(nb_clusters==0){ netlist = netlist + "// RAM netlist" + CR2; - for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { + for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { + + netlist = netlist + ram.getMemoryName()+".p_clk(" + NAME_CLK + ");" + CR; netlist = netlist + ram.getMemoryName()+".p_resetn(" + NAME_RST + ");" + CR; netlist = netlist + ram.getMemoryName()+".p_vci(signal_vci_vciram"+ram.getNo_ram()+");" + CR2; @@ -135,8 +138,6 @@ public class NetList { netlist = netlist + "vgsb.p_to_target["+ram.getNo_target()+"](signal_vci_vciram"+ram.getNo_ram()+");" + CR2; } } - - netlist = netlist + "vci_locks.p_clk(" + NAME_CLK + ");" + CR; netlist = netlist + "vci_locks.p_resetn(" + NAME_RST + ");" + CR; netlist = netlist + "vci_locks.p_vci(signal_vci_vcilocks);" + CR2; @@ -150,13 +151,53 @@ public class NetList { netlist = netlist +"mwmrd_ram.p_resetn(" + NAME_RST + ");" + CR; netlist = netlist +"mwmrd_ram.p_vci(signal_vci_mwmrd_ram);" + CR2; netlist = netlist + "vgsb.p_to_target["+(TopCellGenerator.avatardd.getNb_target()+5)+"](signal_vci_mwmrd_ram);" + CR2; + } + //one or several ram, one locks engine, one mwmr ram and one mwmrd ram per cluster + else{ + int i; +netlist = netlist + "// RAM netlist" + CR2; + for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { + + netlist = netlist + ram.getMemoryName()+".p_clk(" + NAME_CLK + ");" + CR; + netlist = netlist + ram.getMemoryName()+".p_resetn(" + NAME_RST + ");" + CR; + netlist = netlist + ram.getMemoryName()+".p_vci(signal_vci_vciram"+ram.getNo_ram()+");" + CR2; + //target number for local cluster: this is set at avatardd creation + netlist = netlist + "local_crossbar.p_to_target["+ram.getNo_target()+"](signal_vci_vciram"+ram.getNo_ram()+");" + CR2; + } + //one locks engine per cluster is added transparently + for(i=0;i<nb_clusters;i++){ + netlist = netlist + "vci_locks"+i+".p_clk(" + NAME_CLK + ");" + CR; + netlist = netlist + "vci_locks"+i+".p_resetn(" + NAME_RST + ");" + CR; + netlist = netlist + "vci_locks"+i+".p_vci(signal_vci_vcilocks);" + CR2; + netlist = netlist + "vci_locks"+i+".p_to_target["+i+"](signal_vci_locks"+i+");" + CR2; + } + //one mwmr ram and one mwmrdram are added transparently + + /*convention local target ids on cluster : + channel: 0 + mwmr_ram: 1 + mwmrd_ram: 2 + locks: 3 + ram: 4 + tty: 5 + */ + + for(i=0;i<nb_clusters;i++){ + netlist = netlist + "local_crossbar"+i+".p_to_target["+1+"](signal_vci_mwmr_ram"+i+");" + CR2; + //netlist = netlist +"mwmr_ram"+i+".p_irq[0](signal_xicu_irq[0]);" + CR2; + netlist = netlist + "local_crossbar"+i+".p_to_target["+2+"](signal_vci_mwmrd_ram"+i+");" + CR2; + //netlist = netlist +"mwmr_ram"+i+".p_irq[0](signal_xicu_irq[0]);" + CR2; + } + } + for (AvatarTTY tty : TopCellGenerator.avatardd.getAllTTY()){ - + if(nb_clusters==0){ /* we can have several TTYs and each is associated to the fdtrom, for the moment limit to one (multi-) TTY */ + if(icn=="vgmn"){ netlist = netlist + "vgmn.p_to_target["+(TopCellGenerator.avatardd.getNb_target())+"](signal_vci_vcifdaccesst);" + CR; netlist = netlist + "vgmn.p_to_target["+(TopCellGenerator.avatardd.getNb_target()+1)+"](signal_vci_ethernett);" + CR; @@ -167,6 +208,23 @@ public class NetList { netlist = netlist + "vgsb.p_to_target["+(TopCellGenerator.avatardd.getNb_target()+2)+"](signal_vci_bdt);" + CR; netlist = netlist + "vgsb.p_to_target["+(TopCellGenerator.avatardd.getNb_target()+3)+"](signal_vci_vcilocks);" + CR; } + }else{ +//clustered case directly connected to VGSB/to VGMN + if(icn=="vgmn"){ + netlist = netlist + "vgmn.p_to_target["+//TopCellGenerator.avatardd.getAllCrossbar().size()) +5+"](signal_vci_vcifdaccesst);" + CR; + netlist = netlist + "vgmn.p_to_target["+//TopCellGenerator.avatardd.getAllCrossbar().size() ++6+"](signal_vci_ethernett);" + CR; + netlist = netlist + "vgmn.p_to_target["+//TopCellGenerator.avatardd.getAllCrossbar().size() ++7+"](signal_vci_bdt);" + CR; + }else{ //directly connected to VGSB/to VGMN + netlist = netlist + "vgsb.p_to_target["+//TopCellGenerator.avatardd.getAllCrossbar().size()) +5+"](signal_vci_vcifdaccesst);" + CR; + netlist = netlist + "vgsb.p_to_target["+//TopCellGenerator.avatardd.getAllCrossbar().size() ++6+"](signal_vci_ethernett);" + CR; netlist = netlist + "vgsb.p_to_target["+//TopCellGenerator.avatardd.getAllCrossbar().size() ++7+"](signal_vci_bdt);" + CR; + } +} netlist = netlist + "vcifdtrom.begin_device_node(\"vci_multi_tty\",\"soclib:vci_multi_tty\");" + CR2; netlist = netlist + "vcifdtrom.add_property(\"interrupts\", 0);" + CR2; @@ -177,13 +235,25 @@ public class NetList { 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; - if(icn=="vgmn"){ - netlist = netlist + "vgmn.p_to_target["+tty.getNo_target()+"](signal_vci_tty"+tty.getNo_tty()+");" + CR2; + if(nb_clusters==0){ + if(icn=="vgmn"){ + netlist = netlist + "vgmn.p_to_target["+tty.getNo_target()+"](signal_vci_tty"+tty.getNo_tty()+");" + CR2; + netlist = netlist + tty.getTTYName()+".p_irq[0](signal_xicu_irq[0]);" + CR2; }else{ - netlist = netlist + "vgsb.p_to_target["+tty.getNo_target()+"](signal_vci_tty"+tty.getNo_tty()+");" + CR2; + netlist = netlist + "vgsb.p_to_target["+tty.getNo_target()+"](signal_vci_tty"+tty.getNo_tty()+");" + CR2; + netlist = netlist + tty.getTTYName()+".p_irq[0](signal_xicu_irq[0]);" + CR2; } + } + //we have a clustered architecture: identify local crossbar + + else{ int i; + for(i=0;i<nb_clusters;i++){ + netlist = netlist + "local_crossbar"+i+".p_to_target["+tty.getNo_target()+"](signal_vci_tty"+i+");" + CR2; + //DG 4.4. recalculate irq addresses! Assumption 5 devices per cluster + netlist = netlist + tty.getTTYName()+".p_irq[0](signal_xicu_irq["+(tty.getNo_cluster()*5)+"]);" + CR2; + } } - netlist = netlist + tty.getTTYName()+".p_irq[0](signal_xicu_irq[0]);" + CR2; - } + } + netlist = netlist + "{" + CR2; netlist = netlist + " vcifdtrom.begin_node(\"aliases\");" + CR; netlist = netlist + " vcifdtrom.add_property(\"timer\", vcifdtrom.get_device_name(\"vci_rttimer\") + \"[0]\");" + CR; @@ -236,5 +306,5 @@ public class NetList { netlist = netlist + CR + " return EXIT_SUCCESS;"+ CR; netlist = netlist +"}" + CR; return netlist; - } + } } diff --git a/src/ddtranslatorSoclib/toTopCell/Signal.java b/src/ddtranslatorSoclib/toTopCell/Signal.java index 79501e7a3a39cf8184200dfe23f1801a9583d130..6b269563ace676c42cb1e6d86ee9c545f482924d 100755 --- a/src/ddtranslatorSoclib/toTopCell/Signal.java +++ b/src/ddtranslatorSoclib/toTopCell/Signal.java @@ -15,6 +15,9 @@ public class Signal { private static final String NAME_RST = "signal_resetn"; public static String getSignal() { + int nb_clusters=5;//TopCellGenerator.avatardd.getAllCrossbar().size(); +System.out.println("@@@@@@@@@@nb_clusters@@@@@@@@: "+nb_clusters); + String signal = CR2 + "//-------------------------------signaux------------------------------------" + CR2; @@ -39,6 +42,7 @@ signal = signal +"caba::VciSignals<vci_param> signal_vci_mwmrd_ram(\"signal_vci_ signal = signal + "sc_clock signal_clk(\"signal_clk\");" + CR; signal = signal + "sc_signal<bool> signal_resetn(\"" + NAME_RST + "\");" + CR2; +if(TopCellGenerator.avatardd.getAllCrossbar().size()==0){ for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_vciram" + ram.getNo_ram() + "(\"signal_vci_vciram" + ram.getNo_ram() + "\");" + CR2; @@ -47,6 +51,19 @@ signal = signal +"caba::VciSignals<vci_param> signal_vci_mwmrd_ram(\"signal_vci_ signal = signal + " sc_core::sc_signal<bool> signal_xicu_irq[xicu_n_irq];" + CR2; System.out.print("number of processors : " + TopCellGenerator.avatardd.getNbCPU()+"\n"); +} + +else{ + for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) + signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_vciram" + ram.getNo_ram() + + "(\"signal_vci_vciram" + ram.getNo_ram() + "\");" + CR2; + for (AvatarTTY tty : TopCellGenerator.avatardd.getAllTTY()) + signal = signal + "soclib::caba::VciSignals<vci_param> signal_vci_tty"+tty.getNo_tty()+"(\"signal_vci_tty"+tty.getNo_tty()+"\");" + CR2; + signal = signal + " sc_core::sc_signal<bool> signal_xicu_irq[xicu_n_irq];" + CR2; + //System.out.print("number of processors : " + TopCellGenerator.avatardd.getNbCPU()+"\n"); + System.out.print("number of clusters : " + TopCellGenerator.avatardd.getNbClusters()+"\n"); + +} return signal; } } diff --git a/src/ddtranslatorSoclib/toTopCell/TopCellGenerator.java b/src/ddtranslatorSoclib/toTopCell/TopCellGenerator.java index 86dd16cc5d49c0403a086b3a3f8564509ad0e203..db8c3fc5ea3a975f37c1f6e9395a750d743b51f5 100755 --- a/src/ddtranslatorSoclib/toTopCell/TopCellGenerator.java +++ b/src/ddtranslatorSoclib/toTopCell/TopCellGenerator.java @@ -73,8 +73,9 @@ public class TopCellGenerator icn="vgsb"; } /* More complicate dto detect : central crossbar or local crossbars : ToDo */ + if(TopCellGenerator.avatardd.getNbCrossbar()>0){ - System.out.println("***Possible Clustered Interconnect***"); + System.out.println("***Clustered Interconnect***"); } makeVCIparameters(); makeConfig(); diff --git a/src/ui/AvatarDeploymentPanelTranslator.java b/src/ui/AvatarDeploymentPanelTranslator.java index 64ea1149dc4eea62366ea20e4f015392a36a0501..1c3ccfc9a8d7580c9d3485ebad9c47b85d313ec1 100755 --- a/src/ui/AvatarDeploymentPanelTranslator.java +++ b/src/ui/AvatarDeploymentPanelTranslator.java @@ -35,7 +35,8 @@ public class AvatarDeploymentPanelTranslator{ private int nb_tty = 0; private int no_tty = 0; private int nb_mwmr_segments = 0; - + //private int no_cluster = 0;//DG 4.4. works for 1 RAM per cluster ans does nor respect the name given by the user + private int nb_clusters = 0; private LinkedList TGCComponents ; private LinkedList<AvatarComponent> avatarComponents ; @@ -95,8 +96,8 @@ public class AvatarDeploymentPanelTranslator{ int index = tty.getIndex(); String ttyName = tty.getNodeName(); - - AvatarTTY avtty = new AvatarTTY(ttyName,index,no_tty); + + AvatarTTY avtty = new AvatarTTY(ttyName,index,no_tty,index); nb_tty++; nb_target++; @@ -118,7 +119,7 @@ public class AvatarDeploymentPanelTranslator{ int nbOfAttachedTargets = bus.getNbOfAttachedTargets(); int fifoDepth = bus.getFifoDepth(); int minLatency = bus.getMinLatency(); - +System.out.println("$$$$$$$ vgsb read in"); AvatarBus avbus = new AvatarBus(busName,nbOfAttachedInitiators,nbOfAttachedTargets,fifoDepth,minLatency); avatarComponents.add(avbus); @@ -132,7 +133,7 @@ public class AvatarDeploymentPanelTranslator{ int nbOfAttachedTargets = vgmn.getNbOfAttachedTargets(); int fifoDepth = vgmn.getFifoDepth(); int minLatency = vgmn.getMinLatency(); - +System.out.println("$$$$$$$ vgmn read in"); AvatarVgmn avvgmn = new AvatarVgmn(vgmnName,nbOfAttachedInitiators,nbOfAttachedTargets,fifoDepth,minLatency); avatarComponents.add(avvgmn); @@ -148,6 +149,7 @@ public class AvatarDeploymentPanelTranslator{ int cluster_address = crossbar.getClusterAddress(); AvatarCrossbar avcrossbar = new AvatarCrossbar(crossbarName,nbOfAttachedInitiators,nbOfAttachedTargets,cluster_index,cluster_address); + nb_clusters++;System.out.println("$$$$$$$nb crossbars read in"+nb_clusters); avatarComponents.add(avcrossbar); } else if(dp instanceof ADDICUNode){ @@ -198,8 +200,9 @@ public class AvatarDeploymentPanelTranslator{ String name = addRamNode.getNodeName(); int index = addRamNode.getIndex(); int byteDataSize = addRamNode.getDataSize(); - - AvatarRAM avram = new AvatarRAM(name,index,byteDataSize,no_ram); + + AvatarRAM avram = new AvatarRAM(name,index,byteDataSize,no_ram,index); + int cluster_index = avram.getIndex(); no_ram++; nb_ram++; nb_target++; @@ -210,8 +213,10 @@ public class AvatarDeploymentPanelTranslator{ String referenceDiagram = c.getReferenceDiagram(); String channelName = c.getChannelName(); - - AvatarChannel avcl = new AvatarChannel(referenceDiagram,channelName,avram); + //DG channel is inevitably on same cluster as RAM it is mapped on :) + String newChannelName = channelName.substring(0,10)+channelName.substring(channelName.length()-10,channelName.length()-1); + //AvatarChannel avcl = new AvatarChannel(referenceDiagram,newChannelName,avram,cluster_index); + AvatarChannel avcl = new AvatarChannel(referenceDiagram,channelName,avram,cluster_index); avram.addChannel(avcl); avatarMappedObject.add(avcl); } diff --git a/src/ui/TGUIAction.java b/src/ui/TGUIAction.java index 9690d240a35cf9bd0e8895cec64a34d0657629ed..f16ad5e81e2d2125780a11fcabaf5e65ba0fd275 100755 --- a/src/ui/TGUIAction.java +++ b/src/ui/TGUIAction.java @@ -390,6 +390,7 @@ public class TGUIAction extends AbstractAction { public static final int ADD_CHANNELARTIFACT = 411; public static final int ADD_VGMNNODE = 401; public static final int ADD_CROSSBARNODE = 421; + // julien ------------------------------------------------------------- public static final int DEPLOY_AVATAR_DIAGRAM = 418; @@ -787,7 +788,7 @@ public class TGUIAction extends AbstractAction { actions[ADD_LINK] = new TAction("add-add-link", "Add a link", IconManager.imgic202, IconManager.imgic202, "Link", "Add a link between two nodes of the currently opened AVATAR deployment diagram", 0); actions[ADD_CPUNODE] = new TAction("add-add-cpunode", "Add a CPU", IconManager.imgic1100, IconManager.imgic1100, "CPU", "Add a cpu node to the currently opened AVATAR deployment diagram", 0); actions[ADD_BUSNODE] = new TAction("add-add-busnode", "Add a Bus", IconManager.imgic1102, IconManager.imgic1102, "Bus", "Add a bus node to the currently opened AVATAR deployment diagram", 0); -actions[ADD_VGMNNODE] = new TAction("add-add-vgmnnode", "Add a VGMN", IconManager.imgic1102, IconManager.imgic1102, "VGMN", "Add a VGMN node to the currently opened AVATAR deployment diagram", 0); + actions[ADD_VGMNNODE] = new TAction("add-add-vgmnnode", "Add a VGMN", IconManager.imgic1102, IconManager.imgic1102, "VGMN", "Add a VGMN node to the currently opened AVATAR deployment diagram", 0); actions[ADD_CROSSBARNODE] = new TAction("add-add-crossbarnode", "Add a CROSSBAR", IconManager.imgic1102, IconManager.imgic1102, "Crossbar", "Add a Crossbar node to the currently opened AVATAR deployment diagram", 0); actions[ADD_TTYNODE] = new TAction("add-add-tty", "Add a TTY node", IconManager.imgic1108, IconManager.imgic1108, "TTY", "Add a tty node to the currently opened AVATAR deployment diagram", 0); actions[ADD_BLOCKARTIFACT] = new TAction("add-add-blockartifact", "Map an AVATAR block", IconManager.imgic702, IconManager.imgic702, "Map an AVATAR block", "Map an AVATAR block onto a node in the currently opened AVATAR deployment diagram", 0); diff --git a/src/ui/avatardd/ADDBusNode.java b/src/ui/avatardd/ADDBusNode.java index 61a0c69c7c105933feaaff2256aa6da9696bde11..a3e858f5375196aff2f6162e2567aeeee1679201 100755 --- a/src/ui/avatardd/ADDBusNode.java +++ b/src/ui/avatardd/ADDBusNode.java @@ -63,7 +63,7 @@ public class ADDBusNode extends ADDCommunicationNode implements WithAttributes { private int textY2 = 30; private int derivationx = 2; private int derivationy = 3; - private String stereotype = "VGMN"; + private String stereotype = "VGSB"; private int index = 0; private int nbOfAttachedInitiators = 0; diff --git a/src/ui/avatardd/ADDCrossbarNode.java b/src/ui/avatardd/ADDCrossbarNode.java index 9f9e9c11bb8189e9525bce7a5cd934550fe14e88..f5d88f7acc650623e043d1627eab6f38835cb9a1 100755 --- a/src/ui/avatardd/ADDCrossbarNode.java +++ b/src/ui/avatardd/ADDCrossbarNode.java @@ -183,7 +183,7 @@ public class ADDCrossbarNode extends ADDCommunicationNode implements WithAttribu int tmp; String tmpName; - JDialogADDCrossbarNode dialog = new JDialogADDCrossbarNode(frame, "Setting vgmn attributes", this); + JDialogADDCrossbarNode dialog = new JDialogADDCrossbarNode(frame, "Setting crossbar attributes", this); dialog.setSize(500, 450); GraphicLib.centerOnParent(dialog); dialog.show(); // blocked until dialog has been closed diff --git a/src/ui/avatardd/ADDDiagramPanel.java b/src/ui/avatardd/ADDDiagramPanel.java index d61ac3d163a533dc0a9d8e17d8ee42285d77a821..d274bce761ed862adf5bdda295b96b476f65c5f3 100755 --- a/src/ui/avatardd/ADDDiagramPanel.java +++ b/src/ui/avatardd/ADDDiagramPanel.java @@ -270,7 +270,7 @@ public class ADDDiagramPanel extends TDiagramPanel implements TDPWithAttributes ADDChannelArtifact artifact; int i; String name = _ref + "::" + _name; - + while(iterator.hasNext()) { tgc = (TGComponent)(iterator.next()); if (tgc instanceof ADDRAMNode) {