diff --git a/build.txt b/build.txt index ffd3be0dc8482f4450d3bc1f4696463dce3cdbbc..9ae17bab7b39f1afef052c56b82eaacae2fb4752 100644 --- a/build.txt +++ b/build.txt @@ -1 +1 @@ -12134 \ No newline at end of file +12137 \ No newline at end of file diff --git a/doc/dev_infrastructure/.gitignore b/doc/dev_infrastructure/.gitignore index 36ebd4a6e0193ea882e36c6291eabdd52c9b9d03..9da617dc43eda9a79d5109ddfd03b9705cc95cd7 100644 --- a/doc/dev_infrastructure/.gitignore +++ b/doc/dev_infrastructure/.gitignore @@ -1,2 +1,3 @@ /tmp/ /ttool_development_infrastructure.synctex.gz +/ttool_development_infrastructure.pdf diff --git a/doc/dev_infrastructure/ttool_development_infrastructure.tex b/doc/dev_infrastructure/ttool_development_infrastructure.tex index 1cba63689a387ed14d618c0927953d09442f821b..34d7fcc1ed03504da91fa488802b089b5bc0cb66 100644 --- a/doc/dev_infrastructure/ttool_development_infrastructure.tex +++ b/doc/dev_infrastructure/ttool_development_infrastructure.tex @@ -36,7 +36,7 @@ \large \centering \begin{adjustbox}{width=\textwidth} -\begin{tabular}{ |p{0.79in}|p{2.56in}|p{1.87in}|p{1.45in}| } +\begin{tabular}{ |p{1.6cm}|p{6.0cm}|p{4.2cm}|p{4.2cm}| } \hhline{----} & \textbf{Document Manager} & \textbf{Contributors} & \textbf{Checked by} \\ \hhline{----} @@ -66,13 +66,14 @@ \large \centering \begin{adjustbox}{width=\textwidth} -\begin{tabular}{ |p{0.95in}|p{1.12in}|p{3.06in}|p{1.56in}| } +\begin{tabular}{ |p{1.5cm}|p{2.5cm}|p{9.0cm}|p{3.0cm}| } \hhline{----} \textbf{Version} & \textbf{Date} & \textbf{Description $ \& $ Rationale of Modifications} & \textbf{Sections Modified} \\ \hhline{----} 1.0 & 17/10/2016 & First draft & \\ -1.1 & 10/02/2017 & Added Eclipse IDE development + tests & \\ +1.1 & 10/02/2017 & Added Eclipse IDE development + tests & All \\ +1.2 & 11/02/2017 & Added more info on tests & Tests \\ \hline \end{tabular} \end{adjustbox} @@ -120,6 +121,7 @@ development process with basic editor and command lines, with the Eclipse IDE, as well as the testing, building and installation procedures. \section{Source Configuration Management} +\label{sec:scm} \subsection{Gitlab Server} @@ -456,53 +458,60 @@ can be changed by editing the debug launch configuration. \section{Testing} -It is planned to develop more and more tests for TTool in order to improve the product quality. +It is planned to develop more and more tests for TTool in order to improve the +product quality. Test architectures are defined for each languages used to +develop TTool; Java and C++. -\subsection{Java} +The testing code of TTool is located under the \textit{test} directory of the TTool +repository. A structure where a subdirectory is created for each +component of TTool to be tested (e.g.: Avatar, Diplodocus, shared utility +functions, etc.) is recommended. Each subdirectory can be further subdivided for +the different subcomponents of the component. For example, the Diplodocus component can be +further divided into its simulator and GUI components, which are not tested +under the same test environement and framework due to the different languages +used to develop these components. -The TTool Java code is tested using the JUnit framework. +A recommended practice consists of naming the folders containing the classes +with the same name of root package of the provided classes such as +$fr.tpt.ttool.tests.component\_name$, where $component\_name$ is the name of the +component of TTool being tested. -\subsubsection{Test Projects} +\subsection{Java} -Test projects can be found under the \textit{test} directory of the TTool -repository. The projects are typically named -fr.tpt.ttool.tests.\textit{component $ \_ $ name} where \textit{component $ -\_ $ name} is the name of the component of TTool being tested. +The TTool Java code is tested using JUnit (\url{http://junit.org/}), which is a +unit test framework allowing to write, execute and display the results of +repeatable tests. -An example project is \textit{fr.tpt.ttool.tests.util}, which provides test -cases for the TTool utility classes such as those for client-server remote -communication. +\subsubsection{Coding the Tests} -\subsubsection{Executing the Tests} +JUnit builds on a set of assertions for evaluating test results +and a set of annotations for qualifying test classes and methods. A test unit in +JUnit consists of a Java class grouping a set of test cases implemented as +methods of the class and identified with the $@Test$ annotation. +Other methods of the class to be executed only once before or after the +execution of all test cases of the classe can be identified from the annotations +$@BeforeClass$ and $@AfterClass$. Methods to be executed before or after each +test case is executed can be identified from the annotations $@Before$ and +$@After$. -\textbf{\emph{Manual Execution}} +When using the Eclipse IDE, test classes can be automatically generated for a +given class to be tested and will includ annotated methods for the selected +methods of the class to be tested. -Like for C++ and Java applications, JUnit launch configurations can be defined -in Eclipse as shown in figure~\ref{fig:image13}. This configuration will execute all unit tests -for class \textit{RSHClient} and display within the IDE a view of the status of -the tests (passed of failed) as shown in figure~\ref{fig:image14}. +See folder $test/fr.tpt.ttool.tests.util$ of the TTool source code repository +for an examp;e test class $TestRshClient$ providing test cases for the TTool +utility class $RshClient$ used for client-server remote communications. -\begin{figure}[H] -\begin{center} -\includegraphics[width=\textwidth]{images/image13.png} -\end{center} -\caption{} -\label{fig:image13} -\end{figure} - -\begin{figure}[H] -\begin{center} -\includegraphics[width=\textwidth]{images/image14.png} -\end{center} -\caption{} -\label{fig:image14} -\end{figure} +\subsubsection{Executing the Tests} -\textbf{\emph{Automated Execution}} +\textbf{\emph{Using the JUnit Execution API}} -JUnit tests can also be launched outside the IDE for automated tests executed -for example at the beginning of a tool release. An example code snippet is -provided in the following: +A JUnit test class can be executed automatically by passing +it to a JUnit test runner service that will take care of calling the appropriate +methods in the appropriate order to execute the tests, and return a test result +object that can be inspected to determine the succes or failure of the test +cases and provide more details in case of failure. An example code snippet is +showned below: \begin{verbatim} import org.junit.runner.JUnitCore; @@ -531,12 +540,47 @@ public class TToolUtilTestsRunner { } \end{verbatim} +\textbf{\emph{Within the Eclipse IDE}} + +Like for C++ and Java applications, JUnit launch configurations can be defined +in Eclipse as shown in figure~\ref{fig:image13}. This configuration will execute all unit tests +for class \textit{RSHClient} and display within the IDE a view of the status of +the tests (passed of failed) as shown in figure~\ref{fig:image14}. + +\begin{figure}[H] +\begin{center} +\includegraphics[width=\textwidth]{images/image13.png} +\end{center} +\caption{} +\label{fig:image13} +\end{figure} + +\begin{figure}[H] +\begin{center} +\includegraphics[width=\textwidth]{images/image14.png} +\end{center} +\caption{} +\label{fig:image14} +\end{figure} + \subsection{C++} TODO \section{Building} +\subsection{Compiling and Packaging} + +First obtain the TTool repository from the Gitlab server as explaines in section +\ref{sec:scm}. From a Linux shell, CD to the root TTool directory and execute +\emph{make all} to compile the code. If the compilation fails with the following error: +``unmappable character for encoding ASCII'', you need to do: + +\emph{export JAVA\_TOOL\_OPTIONS=-Dfile.encoding=UTF8} \\ + +For generating a release, execute \emph{make release}. + +\subsection{Automated Tests} TODO \section{Installing} diff --git a/src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java b/src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java index 73dcc23310ca43fb59cfb3389e9a18e6f459dec6..8210266f56438f54d4d17e2694924675cdd3b71e 100755 --- a/src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java +++ b/src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java @@ -244,9 +244,9 @@ public class TasksAndMainGenerator { mainFile.appendToMainCode(getChannelName(ar, i) + ".width = 4;" + CR); //DG 16.02. AvatarSignal sig = ar.getSignal1(0);//DG boucle? - int nbParams= sig.getNbParams(); - - mainFile.appendToMainCode(getChannelName(ar, i) + ".depth = "+(nbParams*4)+";" + CR); + int nbParams= sig.getNbParams(); + //DG 23.02. if getNbParams=0 transmit 1 word + mainFile.appendToMainCode(getChannelName(ar, i) + ".depth = "+((nbParams*4)+4)+";" + CR); mainFile.appendToMainCode(getChannelName(ar, i) + ".gdepth = " +getChannelName(ar, i)+".depth;" + CR); mainFile.appendToMainCode(getChannelName(ar, i) + ".buffer = "+getChannelName(ar, i)+"_data;" + CR); mainFile.appendToMainCode(getChannelName(ar, i) + ".status = &"+getChannelName(ar, i)+"_status;" + CR2); diff --git a/src/ddtranslatorSoclib/toTopCell/Code.java b/src/ddtranslatorSoclib/toTopCell/Code.java index 0dacf527b3764dec9e86ae6dcf81facaa2903307..2f361b1228d46d22efe119a15f02ed77c4c58c3b 100755 --- a/src/ddtranslatorSoclib/toTopCell/Code.java +++ b/src/ddtranslatorSoclib/toTopCell/Code.java @@ -47,20 +47,29 @@ package ddtranslatorSoclib.toTopCell; import java.util.*; import ddtranslatorSoclib.*; +import java.io.*; +import myutil.FileException; +import myutil.FileUtils; +import ui.*;//DG +import ui.MainGUI;//DG +import ui.avatardd.*;//DG +import ui.window.*;//DG +import tmltranslator.*;//DG +//import TGComponentManager.*;//DG public class Code { - + static private String creation; static private String creation2; private final static String CR = "\n"; - private final static String CR2 = "\n\n"; + private final static String CR2 = "\n\n"; + private final static String GENERATED_PATH = "generated_topcell" + File.separator; + + protected MainGUI mgui; - Code(){ - } - public static String getCode(){ - + creation = CR + "//**********************************************************************" + CR + "// Processor entry and connection code" + CR + @@ -96,30 +105,75 @@ public class Code { " cpu->p_vci(m);" +CR + " }" + CR2; - //If there is a spy, add spy to vci interface -for (AvatarCPU cpu : TopCellGenerator.avatardd.getAllCPU()) { - // if(){ - if(cpu.getMonitored()==1){ - creation=creation+ - "vci_logger0.p_clk(signal_clk);" +CR+ - "vci_logger0.p_resetn(signal_resetn);" +CR+ - "vci_logger0.p_vci(p_vci(m));" +CR2; - - } - else{ - if(cpu.getMonitored()==2){ - creation=creation+ - "mwmr_stats0.p_clk(signal_clk);" +CR+ - "mwmr_stats0.p_resetn(signal_resetn);" +CR+ - "mwmr_stats0.p_vci(p_vci(m));" +CR2; - } + + // If there is a spy, add spy component to vci interface + // both adjacent componants are spied + // currently applies to CPU and RAM + // RAM monitoring required for buffer size, RAM and CPU for latency + // of memory accesses other than channel + + /* ADDDiagramPanel panel = mgui.getFirstAvatarDeploymentPanelFound();//?? + + for (ADDConnector connector : TGComponentManager.getAllADDConnectors()) { + TGConnectingPoint my_p1= connector.get_p1(); + TGConnectingPoint my_p2= connector.get_p2(); + + TGComponent comp1 = panel.getComponentToWhichBelongs(my_p1) ; + TGComponent comp2 = panel.getComponentToWhichBelongs(my_p2) ; + + //If a spy glass symbol is found, and component itself not yet marked + + if (connector.hasASpy()){ + + if (comp1 instanceof ADDRAMNode){ + ADDRAMNode comp1ram = (ADDRAMNode)comp1; + comp1ram.setMonitored(1); } - } -//} + + if (comp1 instanceof ADDCPUNode){ + ADDCPUNode comp1cpu = (ADDCPUNode)comp1; + comp1cpu.setMonitored(1); + } + + if (comp2 instanceof ADDRAMNode){ + ADDRAMNode comp2ram = (ADDRAMNode)comp1; + comp2ram.setMonitored(1); + } + + if (comp2 instanceof ADDCPUNode){ + ADDCPUNode comp2cpu = (ADDCPUNode)comp2; + comp2cpu.setMonitored(1); + } + } + } */ + creation=creation+"template <class Iss>" + CR + - "INIT_TOOLS(initialize_tools){" + CR + - //"Iss::setBoostrapCpuId(0);" + CR + // ppc - "/* Only processor 0 starts execution on reset */" + CR + + "INIT_TOOLS(initialize_tools){" + CR ; + + int isMipsArchitecture = 0; + + try { + String path = ConfigurationTTool.AVATARMPSoCCodeDirectory; + BufferedReader in = new BufferedReader(new FileReader(path+"/Makefile.forsoclib")); + String line = null; + while ((line = in.readLine()) != null) { + + if( line.equals("SOCLIB_CPU=mips32el")) + { + isMipsArchitecture = 1; + } + } + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + +if(isMipsArchitecture == 1){ + creation=creation+ + "Iss::setBoostrapCpuId(0);" + CR + + "/* Only processor 0 starts execution on reset */" + CR; +} + creation=creation+ "#if defined(CONFIG_GDB_SERVER)" + CR + "ISS_NEST(Iss)::set_loader(ldr);" + CR + "#endif" + CR + diff --git a/src/ddtranslatorSoclib/toTopCell/Declaration.java b/src/ddtranslatorSoclib/toTopCell/Declaration.java index 155fe2e8657cec668f409a6b4f7cda643e024694..6127735a6488b276b4eccb8450ba6b7756f7c4b9 100755 --- a/src/ddtranslatorSoclib/toTopCell/Declaration.java +++ b/src/ddtranslatorSoclib/toTopCell/Declaration.java @@ -230,21 +230,21 @@ if(nb_clusters==0){ if (cpu.getMonitored()==1){ - declaration += "soclib::caba::VciLogger<vci_param> logger"+i+"(\"logger" + i+"\",maptab);" + CR2; + declaration += "soclib::caba::VciLogger<vci_param> vci_logger"+i+"(\"logger" + i+"\",maptab);" + CR2; i++; } - else{ - if (cpu.getMonitored()==2){ + /* else{ + if (cpu.getMonitored()==2){ String strArray=""; //DG 30.01. no channels in case of cpu monitoring; does this make sense? channels associated to RAM not CPU and potentially any CPU can access any RAM...think about declaration += "soclib::caba::VciMwmrStats<vci_param> mwmr_stats"+i+"(\"mwmr_stats" + i+"\",maptab, data_ldr, \"mwmr"+i+".log\",stringArray("+strArray+"NULL));" + CR2; i++; } - } + }*/ } - + i=0; //monitoring RAM either by logger(1) ou stats (2) for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { diff --git a/src/ddtranslatorSoclib/toTopCell/NetList.java b/src/ddtranslatorSoclib/toTopCell/NetList.java index 6dd593dee7c0d4c133c4f712e614247a6a39e9ba..b7a996c73fbf24c9cdf4d21137d13bc816603235 100755 --- a/src/ddtranslatorSoclib/toTopCell/NetList.java +++ b/src/ddtranslatorSoclib/toTopCell/NetList.java @@ -377,24 +377,25 @@ public class NetList { } }*/ -i=0; + //If there is a spy, add logger or stats to vci interface + + i=0; for (AvatarCPU cpu : TopCellGenerator.avatardd.getAllCPU()) { - // if(){ + int number = cpu.getNo_proc(); if(cpu.getMonitored()==1){ netlist=netlist+ - "vci_logger0.p_clk(signal_clk);" +CR+ - "vci_logger0.p_resetn(signal_resetn);" +CR+ - "vci_logger0.p_vci(p_vci(m));" +CR2; - + "vci_logger"+i+".p_clk(signal_clk);" +CR+ + "vci_logger"+i+".p_resetn(signal_resetn);" +CR+ + "vci_logger"+i+".p_vci(signal_vci_m["+number+"]);" +CR2; } - else{ + /* else{//stats pas encore pour CPU if(cpu.getMonitored()==2){ netlist=netlist+ - "mwmr_stats0.p_clk(signal_clk);" +CR+ - "mwmr_stats0.p_resetn(signal_resetn);" +CR+ - "mwmr_stats0.p_vci(p_vci(i));" +CR2; + "mwmr_stats"+i+".p_clk(signal_clk);" +CR+ + "mwmr_stats"+i+".p_resetn(signal_resetn);" +CR+ + "mwmr_stats"+i+".p_vci(signal_vci_m["+number+"]);" +CR2; } - } + }*/ i++; } diff --git a/src/ui/DefaultText.java b/src/ui/DefaultText.java index bc71fb144c4331049e582ac10a5c5f9e7039e40c..b080bba851e3caef87e73402dd183dbb3bc13706 100755 --- a/src/ui/DefaultText.java +++ b/src/ui/DefaultText.java @@ -49,8 +49,8 @@ package ui; public class DefaultText { - public static String BUILD = "12133"; - public static String DATE = "2017/02/21 02:01:05 CET"; + public static String BUILD = "12136"; + public static String DATE = "2017/02/23 18:23:40 CET"; public static StringBuffer sbAbout = makeAbout(); diff --git a/src/ui/TGComponentManager.java b/src/ui/TGComponentManager.java index cdac62bbe059b7fd27688a81c9dbb429889e359d..7dc5aa1a00abdae40f370e6fef4bca9084a67572 100755 --- a/src/ui/TGComponentManager.java +++ b/src/ui/TGComponentManager.java @@ -477,6 +477,13 @@ public class TGComponentManager { public static final int CONNECTOR = 1; + public static LinkedList<ADDConnector> addconnectors = new LinkedList<ADDConnector>(); //DG 21.02. + + +public static LinkedList<ADDConnector> getAllADDConnectors(){ + return addconnectors; + }//DG 21.02. + public final static TGComponent addComponent(int x, int y, int id, TDiagramPanel tdp) { TGComponent tgc = null; switch (id) { @@ -1936,6 +1943,7 @@ public class TGComponentManager { public final static TGConnector addConnector(int x, int y, int id, TDiagramPanel tdp, TGConnectingPoint p1, TGConnectingPoint p2, Vector listPoint) { TGConnector tgc = null; + switch(id) { // AVATAR // AVATAR BD @@ -2015,6 +2023,9 @@ public class TGComponentManager { // AVATAR DD case ADD_CONNECTOR: tgc = new ADDConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + //DG 21.02. + +addconnectors.add((ADDConnector)tgc);//DG 21.02. break; // AVATAR PD diff --git a/tests/diplodocus/fr.tpt.ttool.tests.diplodocus.simulator/.gitignore b/tests/diplodocus/fr.tpt.ttool.tests.diplodocus.simulator/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ae3c1726048cd06b9a143e0376ed46dd9b9a8d53 --- /dev/null +++ b/tests/diplodocus/fr.tpt.ttool.tests.diplodocus.simulator/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/tests/util/fr.tpt.ttool.tests.util/.gitignore b/tests/util/fr.tpt.ttool.tests.util/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ae3c1726048cd06b9a143e0376ed46dd9b9a8d53 --- /dev/null +++ b/tests/util/fr.tpt.ttool.tests.util/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/tests/util/fr.tpt.ttool.tests.util/bin/.gitignore b/tests/util/fr.tpt.ttool.tests.util/bin/.gitignore deleted file mode 100644 index 44fde9027b9415ffbb48dede03b1f60a754a152c..0000000000000000000000000000000000000000 --- a/tests/util/fr.tpt.ttool.tests.util/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/fr/