Commit c5ac4a56 authored by Letitia Li's avatar Letitia Li
Browse files

Merge branch 'master' of gitlab.enst.fr:mbe-tools/TTool

parents 529b3021 241cdd0c
Module('caba:MyHWA0',
classname = 'dsx::caba::MyHWA0',
header_files = [
"my_hwa0.h",
],
interface_files = [
],
implementation_files = [
"my_hwa0.cpp",
],
ports = [
],
uses = [
Uses('caba:fifo_virtual_copro_wrapper'),
],
instance_parameters = [
],
tmpl_parameters = [
],
extensions = [
],
)
#ifndef _HWA0_H
#define _HWA0_H
#include <systemc>
#include "fifo_virtual_copro_wrapper.h"
namespace dsx { namespace caba {
class MyHWA0
: public dsx::caba::FifoVirtualCoprocessorWrapper
{
public:
~MyHWA0();
MyHWA0(sc_core::sc_module_name insname);
private:
void * task_func(); // Task code
};
}}
#endif
namespace dsx { namespace caba {
#define tmpl(...) __VA_ARGS__ MyHWA0
tmpl(/**/)::~MyHWA0()
{
}
//intArray(1,1) there is one element (here an integer) of size 4 OCTETs/Quentin: attention cela a change c'est un MOT dans la version VM
tmpl(/**/)::MyHWA0(sc_core::sc_module_name insname)
:dsx::caba::FifoVirtualCoprocessorWrapper(insname, stringArray("output", NULL), intArray(1,4), stringArray(NULL), NULL)
{
}
tmpl(void *)::task_func() {
struct mwmr_s *output;
// mwmr_t output = SRL_GET_MWMR(output);
uint32_t data;
while (true) {
for (int32_t i = 0; i < 8; i++) {
out=i;
mwmr_write(output, &data, 4; // Write integers 0 to 7 to output
}
}
}
}}
Module('caba:MyHWA0',
classname = 'dsx::caba::MyHWA0',
header_files = [
"my_hwa0.h",
],
interface_files = [
],
implementation_files = [
"my_hwa0.cpp",
],
ports = [
],
uses = [
Uses('caba:fifo_virtual_copro_wrapper'),
],
instance_parameters = [
],
tmpl_parameters = [
],
extensions = [
],
)
Module('caba:MyHWA1',
classname = 'dsx::caba::MyHWA1',
header_files = [
"my_hwa1.h",
],
interface_files = [
],
implementation_files = [
"my_hwa1.cpp",
],
ports = [
],
uses = [
Uses('caba:fifo_virtual_copro_wrapper'),
],
instance_parameters = [
],
tmpl_parameters = [
],
extensions = [
],
)
#ifndef _HWA0_H
#define _HWA0_H
#include <systemc>
#include "fifo_virtual_copro_wrapper.h"
namespace dsx { namespace caba {
class MyHWA0
: public dsx::caba::FifoVirtualCoprocessorWrapper
{
public:
~MyHWA0();
MyHWA0(sc_core::sc_module_name insname);
private:
void * task_func(); // Task code
};
}}
#endif
#ifndef _HWA1_H
#define _HWA1_H
#include <systemc>
#include "fifo_virtual_copro_wrapper.h"
namespace dsx { namespace caba {
class MyHWA1
: public dsx::caba::FifoVirtualCoprocessorWrapper
{
public:
~MyHWA1();
MyHWA1(sc_core::sc_module_name insname);
private:
void * task_func(); // Task code
};
}}
#endif
namespace dsx { namespace caba {
#define tmpl(...) __VA_ARGS__ MyHWA0
tmpl(/**/)::~MyHWA0()
{
}
//intArray(1,1) there is one element (here an integer) of size 4 OCTETs/Quentin: attention cela a change c'est un MOT dans la version VM
tmpl(/**/)::MyHWA0(sc_core::sc_module_name insname)
:dsx::caba::FifoVirtualCoprocessorWrapper(insname, stringArray("output", NULL), intArray(1,4), stringArray(NULL), NULL)
{
}
tmpl(void *)::task_func() {
struct mwmr_s *output;
// mwmr_t output = SRL_GET_MWMR(output);
uint32_t data;
while (true) {
for (int32_t i = 0; i < 8; i++) {
out=i;
mwmr_write(output, &data, 4; // Write integers 0 to 7 to output
}
}
}
}}
namespace dsx { namespace caba {
#define tmpl(...) __VA_ARGS__ MyHWA1
tmpl(/**/)::~MyHWA1()
{
}
//intArray(1,1) there is one element (here an integer) of size 4 OCTETs/Quentin: attention cela a change c'est un MOT dans la version VM
tmpl(/**/)::MyHWA1(sc_core::sc_module_name insname)
:dsx::caba::FifoVirtualCoprocessorWrapper(insname, stringArray(NULL), NULL, stringArray("input", NULL), intArray(1,4))
{
}
tmpl(void *)::task_func() {
struct mwmr_s *input;
uint32_t data;
while (true) {
for (int32_t i = 0; i < 8; i++) {
mwmr_read(input, &data, 1); // read 8 integers wich have been modified by the intermediate software task
}
}
}
}}
......@@ -53,7 +53,7 @@ public class AvatarCoproMWMR extends AvatarComponent{
private int tgtid ;
private int plaps ;
private int fifoToCoprocDepth;
private int fifoFromCoproDepth;
private int fifoFromCoprocDepth;
private int nToCopro;
private int nFromCopro;
private int nConfig;
......@@ -63,14 +63,14 @@ public class AvatarCoproMWMR extends AvatarComponent{
private AvatarConnectingPoint[] connectingsPoints;
private int nbConnectingPoint = 16 ;
public AvatarCoproMWMR(String _coprocName,int srcid, int _srcid, int _tgtid, int _plaps, int _fifoToCoprocDepth,int _fifoFromCoproDepth, int _nToCopro, int _nFromCopro, int _nConfig, int _nStatus, boolean _useLLSC)
public AvatarCoproMWMR(String _coprocName,int srcid, int _srcid, int _tgtid, int _plaps, int _fifoToCoprocDepth,int _fifoFromCoprocDepth, int _nToCopro, int _nFromCopro, int _nConfig, int _nStatus, boolean _useLLSC)
{
coprocName = _coprocName;
srcid = _srcid;
tgtid = _tgtid;
plaps = _plaps ;
fifoToCoprocDepth = _fifoToCoprocDepth;
fifoFromCoproDepth = _fifoFromCoproDepth;
fifoFromCoprocDepth = _fifoFromCoprocDepth;
nToCopro = _nToCopro;
nFromCopro = _nFromCopro;
nConfig = _nConfig;
......@@ -109,10 +109,14 @@ public class AvatarCoproMWMR extends AvatarComponent{
return plaps;
}
public int getFifoToCoProcDepth(){
public int getFifoToCoprocDepth(){
return fifoToCoprocDepth;
}
public int getFifoFromCoprocDepth(){
return fifoFromCoprocDepth;
}
public int getNToCopro(){
return nToCopro;
}
......
/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
* Daniela Genius, Lip6, UMR 7606
*
* ludovic.apvrille AT enst.fr
* daniela.genius@lip6.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.
*/
/* * @version 1.0 07/07/2015
* @author Julien Henon, Daniela Genius */
package ddtranslatorSoclib;
public class AvatarCoproMWMR extends AvatarComponent{
private String coprocName;
private int srcid ;
private int tgtid ;
private int plaps ;
private int fifoToCoprocDepth;
private int fifoFromCoproDepth;
private int nToCopro;
private int nFromCopro;
private int nConfig;
private int nStatus;
private boolean useLLSC;
private AvatarConnectingPoint[] connectingsPoints;
private int nbConnectingPoint = 16 ;
public AvatarDMA(String _Dmaname, int _srcid, int _tgtid)
{
DmaName = _DmaName;
srcid = _srcid;
tgtid = _tgtid;
connectingsPoints = new AvatarConnectingPoint[nbConnectingPoint] ;
}
AvatarConnectingPoint[] getAvatarConnectingPoints(){
return connectingsPoints;
}
int getnbConnectingPoint(){
return nbConnectingPoint;
}
void setConnectingPoint(int _indexConnectingPoint, AvatarConnector _connector){
connectingsPoints[_indexConnectingPoint].setConnector(_connector);
}
public String getDmaName(){
return coprocName;
}
public int getSrcid(){
return srcid;
}
public int getTgtid(){
return tgtid;
}
}
......@@ -52,8 +52,8 @@ package ddtranslatorSoclib;
public class AvatarTask extends AvatarMappedObject{
private AvatarCPU avatarCPUReference;
private String taskName ;
private String referenceTaskName;
private String taskName ;
private String referenceTaskName;
public AvatarTask(String _taskName , String _referenceTaskName, AvatarCPU _avatarCPUReference ){
......
......@@ -49,9 +49,8 @@ package ddtranslatorSoclib;
import java.util.LinkedList;
import java.util.List;
import ui.tmldd.TMLArchiHWANode;//DG 23.08.
public class AvatarddSpecification{
private List<AvatarComponent> components;
private List<AvatarConnector> connectors;
private List<AvatarMappedObject> mappedObjects;
......@@ -195,7 +194,7 @@ There always is a RAM0, a TTY and an interconnect (Bus or VGMN or crossbar) othe
return crossbars;
}
/* public LinkedList<AvatarBridge> getAllBridge(){
/* public LinkedList<AvatarBridge> getAllBridge(){
LinkedList<AvatarBridge> bridges = new LinkedList<AvatarBridge>();
for (AvatarComponent bridge : components )
{
......@@ -212,16 +211,37 @@ There always is a RAM0, a TTY and an interconnect (Bus or VGMN or crossbar) othe
return getAllCrossbar().size();
}
public List<AvatarCoproMWMR> getAllCoproMWMR(){
/* DG 23.08. les hardware accelerators proviennent en fait de la specification DIPLODOCUS */
// copro= new AvatarCoproMWMR("test",0,0,0,10,8,8,1,1,1,1,false);
public List<AvatarCoproMWMR> getAllCoproMWMR(){
List<AvatarCoproMWMR> copros = new LinkedList<AvatarCoproMWMR>();
for (AvatarComponent copro : components )
{
if (copro instanceof AvatarCoproMWMR)
copros.add((AvatarCoproMWMR)copro);
if (copro instanceof AvatarCoproMWMR){
System.out.println("Coproc added to specification");
copros.add((AvatarCoproMWMR)copro);
}
}
return copros;
}
}
/* to do, actuellement c'est un hwa generique */
/* the hardware accelerators must be taken from DIPLODOCUS specification */
/* public List<DiploHWA> getAllHWA(){
List<DiploHWA> hwas = new LinkedList<DiploHWA>();
for (DiploComponent hwa : diplocomponents )
{
if (hwa instanceof DiploHWA){
System.out.println("Hardware accelerator added to specification");
hwas.add((DiploHWA)hwa);
}
}
return hwas;
}*/
public int getNbCPU(){
return (getAllCPU()).size();
......
......@@ -114,22 +114,25 @@ public class Declaration {
declaration += "caba::VciFdtRom<vci_param> vcifdtrom(\"vci_fdt_rom\", IntTab(0,6), maptab);" + CR;
}
if(nb_clusters==0){
declaration += "caba::VciLocks<vci_param> vcilocks(\"vcilocks\", IntTab("+(TopCellGenerator.avatardd.getNb_target()+3)+"), maptab);" + CR;
}
else{
declaration += "caba::VciLocks<vci_param> vcilocks(\"vcilocks\", IntTab(0,8), maptab);" + CR;
}
int last_tty=0;
if(nb_clusters==0){
int i=0;
for (AvatarTTY tty : TopCellGenerator.avatardd.getAllTTY()){
declaration += "caba::VciMultiTty<vci_param> " + tty.getTTYName()+ "(\"" + tty.getTTYName()+ "\", IntTab(" + tty.getNo_target()+ "), maptab, \"vci_multi_tty"+i+"\", NULL);"+ CR;
i++;
last_tty=tty.getNo_target()+1;
}
//target address depends on number of TTYs and RAMs
if(nb_clusters==0){
// declaration += "caba::VciLocks<vci_param> vcilocks(\"vcilocks\", IntTab("+(TopCellGenerator.avatardd.getNb_target()+3)+"), maptab);" + CR;
declaration += "caba::VciLocks<vci_param> vcilocks(\"vcilocks\", IntTab("+(last_tty+3)+"), maptab);" + CR;
}
else{
declaration += "caba::VciLocks<vci_param> vcilocks(\"vcilocks\", IntTab(0,8), maptab);" + CR;
}
for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM())
if(ram.getIndex()==0){
declaration += "soclib::caba::VciRam<vci_param>" + ram.getMemoryName()+ "(\"" + ram.getMemoryName()+ "\"" + ", IntTab(2), maptab);" + CR;
......@@ -150,9 +153,35 @@ public class Declaration {
+ 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::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;
declaration += "caba::VciBlockDevice<vci_param> vcibd(\"vcibd\", maptab, IntTab(cpus.size()), IntTab("+(TopCellGenerator.avatardd.getNb_target()+2)+"),\"block0.iso\", 2048);" + CR;*/
declaration += "caba::VciFdAccess<vci_param> vcifd(\"vcifd\", maptab, IntTab(cpus.size()+1), IntTab("+last_tty +"));" + CR;
declaration += "caba::VciEthernet<vci_param> vcieth(\"vcieth\", maptab, IntTab(cpus.size()+2), IntTab("+(last_tty +1)+"), \"soclib0\");" + CR;
declaration += "caba::VciBlockDevice<vci_param> vcibd(\"vcibd\", maptab, IntTab(cpus.size()), IntTab("+(last_tty +2)+"),\"block0.iso\", 2048);" + CR;
//only non-clustered version
int hwa_no=0;
//int target_no = TopCellGenerator.avatardd.getNb_target();
int target_no = (last_tty +4);//DG 5.9.
int init_no = TopCellGenerator.avatardd.getNb_init();
for (AvatarCoproMWMR copro : TopCellGenerator.avatardd.getAllCoproMWMR()){
// declaration += "caba::VciMwmrController<vci_param> " + copro.getCoprocName()+ "(\"" + copro.getCoprocName()+ "\", maptab, IntTab("+copro.getSrcid() + "), IntTab("+copro.getTgtid() + "),copro.getPlaps(),copro.getFifoToCoProcDepth(),copro.getNToCopro(),copro.getNFromCopro(),copro.getNConfig(),copro.getNStatus(), copro.getUseLLSC());"+ CR;
declaration += "caba::VciMwmrController<vci_param> " + copro.getCoprocName()+ "(\"" + copro.getCoprocName()+ "\", maptab, IntTab("+(init_no-1)+"), IntTab("+target_no+ "),"+copro.getPlaps()+","+copro.getFifoToCoprocDepth()+","+copro.getFifoFromCoprocDepth()+","+copro.getNToCopro()+","+copro.getNFromCopro()+","+copro.getNConfig()+","+copro.getNStatus()+","+ copro.getUseLLSC()+");"+ CR2;
//one virtual component for each hardware accellerator, info from diplodocus (not yet implemented)
//DG 28.08.
// declaration += "soclib::caba::FifoVirtualCoprocessorWrapper hwa"+hwa_no+"(\"hwa"+hwa_no+"\",1,1,1,1);"+ CR2;
declaration += "dsx::caba::MyHWA"+hwa_no+" hwa"+hwa_no+"(\"hwa"+hwa_no+"\");"+ CR2;
target_no++;
init_no++;
hwa_no++;
}
}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;
......@@ -160,12 +189,15 @@ public class Declaration {
}
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());
//declaration += "soclib::caba::VciVgsb<vci_param> vgsb(\"" + bus.getBusName() + "\"" + " , maptab, cpus.size()+3," + (TopCellGenerator.avatardd.getNb_target()+4)+");" + CR2;
declaration += "soclib::caba::VciVgsb<vci_param> vgsb(\"" + bus.getBusName() + "\"" + " , maptab, cpus.size()+3," + (TopCellGenerator.avatardd.getNb_target()+4)+ ");" + CR2;
// declaration += "soclib::caba::VciVgsb<vci_param> vgsb(\"" + bus.getBusName() + "\"" + " , maptab, cpus.size()+3," + (TopCellGenerator.avatardd.getNb_target()+4)+ ");" + CR2;
declaration += "soclib::caba::VciVgsb<vci_param> vgsb(\"" + bus.getBusName() + "\"" + " , maptab,"+(3+TopCellGenerator.avatardd.getNb_init())+"," + (TopCellGenerator.avatardd.getNb_target()+4)+ ");" + CR2;//DG 28.08.
int i=0;
//if BUS was not last in input file, update here
......@@ -185,7 +217,10 @@ if(nb_clusters==0){
vgmn.setFifoDepth(8); //default value; must be > 2
declaration += "soclib::caba::VciVgmn<vci_param> vgmn(\"" + vgmn.getVgmnName() + "\"" + " , maptab, cpus.size()+3," + (TopCellGenerator.avatardd.getNb_target()+4)+ "," + vgmn.getMinLatency() + "," + vgmn.getFifoDepth() + ");" + CR2;
// declaration += "soclib::caba::VciVgmn<vci_param> vgmn(\"" + vgmn.getVgmnName() + "\"" + " , maptab, cpus.size()+3," + (TopCellGenerator.avatardd.getNb_target()+4)+ "," + vgmn.getMinLatency() + "," + vgmn.getFifoDepth() + ");" + CR2;
// declaration += "soclib::caba::VciVgmn<vci_param> vgmn(\"" + vgmn.getVgmnName() + "\"" + " , maptab, " +(3+TopCellGenerator.avatardd.getNb_init())+"," + (TopCellGenerator.avatardd.getNb_target()+4)+ "," + vgmn.getMinLatency() + "," + vgmn.getFifoDepth() + ");" + CR2;//DG 28.08.
declaration += "soclib::caba::VciVgmn<vci_param> vgmn(\"" + vgmn.getVgmnName() + "\"" + " , maptab, " +(3+TopCellGenerator.avatardd.getNb_init())+"," + (TopCellGenerator.avatardd.getNb_target()+3)+ "," + vgmn.getMinLatency() + "," + vgmn.getFifoDepth() + ");" + CR2;//DG 5.9.
// declaration += "soclib::caba::VciVgmn<vci_param> vgmn(\"" + vgmn.getVgmnName() + "\"" + " , maptab, cpus.size()+3," + (TopCellGenerator.avatardd.getNbRAM()+TopCellGenerator.avatardd.getNbTTY()+4)+ "," + vgmn.getMinLatency() + "," + vgmn.getFifoDepth() + ");" + CR2;
......@@ -212,11 +247,7 @@ if(nb_clusters==0){
const bool use_llsc );
*/
//only non-clustered version
for (AvatarCoproMWMR copro : TopCellGenerator.avatardd.getAllCoproMWMR()){
declaration += "caba::VciMwmrController<vci_param> " + copro.getCoprocName()+ "(\"" + copro.getCoprocName()+ "\", maptab, IntTab("+copro.getSrcid() + "), IntTab("+copro.getTgtid() + "),copro.getPlaps(),copro.getFifoToCoProcDepth(),copro.getNToCopro(),copro.getNFromCopro(),copro.getNConfig(),copro.getNStatus(), copro.getUseLLSC());"+ CR;
}
}
else {
......@@ -266,7 +297,6 @@ else {