Skip to content

Commit

Permalink
Fix traffic monitor in VHDL, improvements in script and makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mcruaro committed Jun 25, 2019
1 parent e32b910 commit 6a7673b
Show file tree
Hide file tree
Showing 22 changed files with 331 additions and 154 deletions.
10 changes: 9 additions & 1 deletion applications/synthetic/syn_std.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
#define SYN_STD_H_


#define SYNTHETIC_ITERATIONS 10
#define SYNTHETIC_ITERATIONS 100

void compute(unsigned int * data){
volatile int t;
for(t=0; t<1000; t++);
for (int i=0; i<128; i++){
data[i] = i;
}
}


#endif /* SYN_STD_H_ */
32 changes: 18 additions & 14 deletions applications/synthetic/taskA.c
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
#include <api.h>
#include <stdlib.h>

#include "syn_std.h"

Message msg;
//MEMPHIS message structure
Message msg1;
Message msg2;

int main()
void main()
{

int i, j,t;

Echo("synthetic task A started.");
Echo("Task A started at time ");
Echo(itoa(GetTick()));

for(i=0;i<SYNTHETIC_ITERATIONS;i++){
for(t=0;t<1000;t++){
for(int i=0;i<SYNTHETIC_ITERATIONS;i++)
{
//Compute and send something
compute(&msg1.msg);
msg1.length = 128;
Send(&msg1,taskB);

//Compute and send something
compute(&msg2.msg);
msg2.length = 128;
Send(&msg2,taskC);
}
msg.length = 30;
for(j=0;j<30;j++) msg.msg[j]=i;

Send(&msg,taskC);
}

Echo("Task A finished at time");
Echo(itoa(GetTick()));
Echo("synthetic task A finished.");
exit();
}
30 changes: 15 additions & 15 deletions applications/synthetic/taskB.c
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#include <api.h>
#include <stdlib.h>

#include "syn_std.h"

//MEMPHIS message structure
Message msg;

int main()
void main()
{

int i, j,t;

Echo("synthetic task B started.");
Echo("Task B started at time ");
Echo(itoa(GetTick()));

for(i=0;i<SYNTHETIC_ITERATIONS;i++){
for(t=0;t<1000;t++){
}
msg.length = 30;
for(j=0;j<30;j++) msg.msg[j]=i;

Send(&msg,taskC);
}

for(int i=0;i<SYNTHETIC_ITERATIONS;i++)
{

Receive(&msg, taskA);

compute(&msg.msg);

Send(&msg,taskD);
}

Echo("Task B finished at time");
Echo(itoa(GetTick()));
Echo("synthetic task B finished.");
exit();
}
36 changes: 12 additions & 24 deletions applications/synthetic/taskC.c
Original file line number Diff line number Diff line change
@@ -1,39 +1,27 @@
#include <api.h>
#include <stdlib.h>

#include "syn_std.h"

//MEMPHIS message structure
Message msg;

int main()
void main()
{

int i, j,t;

Echo("synthetic task C started.");
Echo("Task C started at time ");
Echo(itoa(GetTick()));

for(i=0;i<SYNTHETIC_ITERATIONS;i++){

msg.length = 30;
for(j=0;j<30;j++) msg.msg[j]=i;
for(int i=0;i<SYNTHETIC_ITERATIONS;i++)
{

Receive(&msg,taskA);

for(t=0;t<1000;t++){
}

Send(&msg,taskD);

Receive(&msg,taskB);

for(t=0;t<1000;t++){
Receive(&msg, taskA);

compute(&msg.msg);

Send(&msg,taskD);
}

Send(&msg,taskE);

}
Echo("Task C finished at time");
Echo(itoa(GetTick()));
Echo("synthetic task C finished.");

exit();
}
30 changes: 15 additions & 15 deletions applications/synthetic/taskD.c
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
#include <api.h>
#include <stdlib.h>

#include "syn_std.h"

//Message structure of MEMPHIS, provided by api.h
Message msg;

int main()
void main()
{
Echo("Task D started at time ");
Echo(itoa(GetTick()));

int i, j,t;
for(int i=0;i<SYNTHETIC_ITERATIONS;i++)
{

Echo("synthetic task D started.");
Echo(itoa(GetTick()));
Receive(&msg, taskB);
Receive(&msg, taskC);

for(i=0;i<SYNTHETIC_ITERATIONS;i++){
msg.length = 30;
for(j=0;j<30;j++) msg.msg[j]=i;

Receive(&msg,taskC);
for(t=0;t<1000;t++){
}
Send(&msg,taskF);
}

Echo("Final message");
for(int j=0; j<msg.length; j++){
Echo(itoa(msg.msg[j]));
}

Echo(itoa(GetTick()));
Echo("synthetic task D finished.");

Echo("Task D finished at time");
Echo(itoa(GetTick()));
exit();

}
15 changes: 15 additions & 0 deletions applications/synthetic1/syn_std.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* syn_std.h
*
* Created on: 09/07/2016
* Author: ruaro
*/

#ifndef SYN_STD_H_
#define SYN_STD_H_


#define SYNTHETIC_ITERATIONS 10


#endif /* SYN_STD_H_ */
File renamed without changes.
32 changes: 32 additions & 0 deletions applications/synthetic1/taskA.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <api.h>
#include <stdlib.h>

#include "../synthetic1/syn_std.h"

Message msg;

int main()
{

int i, j;
volatile int t;

Echo("Synthetic task A started.");
Echo(itoa(GetTick()));

for(i=0;i<SYNTHETIC_ITERATIONS;i++)
{
for(t=0;t<1000;t++);

msg.length = 30;
for(j=0;j<30;j++)
{
msg.msg[j]=i;
}
Send(&msg,taskC);
}

Echo(itoa(GetTick()));
Echo("Synthetic task A finished.");
exit();
}
28 changes: 28 additions & 0 deletions applications/synthetic1/taskB.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <api.h>
#include <stdlib.h>

#include "../synthetic1/syn_std.h"

Message msg;

int main()
{

int i, j,t;

Echo("synthetic task B started.");
Echo(itoa(GetTick()));

for(i=0;i<SYNTHETIC_ITERATIONS;i++){
for(t=0;t<1000;t++){
}
msg.length = 30;
for(j=0;j<30;j++) msg.msg[j]=i;

Send(&msg,taskC);
}

Echo(itoa(GetTick()));
Echo("synthetic task B finished.");
exit();
}
40 changes: 40 additions & 0 deletions applications/synthetic1/taskC.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <api.h>
#include <stdlib.h>

#include "../synthetic1/syn_std.h"

Message msg;

int main()
{

int i, j,t;

Echo("synthetic task C started.");
Echo(itoa(GetTick()));

for(i=0;i<SYNTHETIC_ITERATIONS;i++){

msg.length = 30;
for(j=0;j<30;j++) msg.msg[j]=i;

Receive(&msg,taskA);

for(t=0;t<1000;t++){
}

Send(&msg,taskD);

Receive(&msg,taskB);

for(t=0;t<1000;t++){
}

Send(&msg,taskE);

}
Echo(itoa(GetTick()));
Echo("synthetic task C finished.");

exit();
}
32 changes: 32 additions & 0 deletions applications/synthetic1/taskD.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <api.h>
#include <stdlib.h>

#include "../synthetic1/syn_std.h"

Message msg;

int main()
{

int i, j,t;

Echo("synthetic task D started.");
Echo(itoa(GetTick()));

for(i=0;i<SYNTHETIC_ITERATIONS;i++){
msg.length = 30;
for(j=0;j<30;j++) msg.msg[j]=i;

Receive(&msg,taskC);
for(t=0;t<1000;t++){
}
Send(&msg,taskF);

}

Echo(itoa(GetTick()));
Echo("synthetic task D finished.");

exit();

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <api.h>
#include <stdlib.h>
#include "syn_std.h"

#include "../synthetic1/syn_std.h"

Message msg;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <api.h>
#include <stdlib.h>
#include "syn_std.h"

#include "../synthetic1/syn_std.h"

Message msg;

Expand Down
9 changes: 8 additions & 1 deletion build_env/bin/memphis-all
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ except:
path_list = INPUT_TESTCASE_FILE_PATH.split("/") #The testcase path can have severals '/' into its composition
input_yaml_name = path_list[len(path_list)-1] #Gets the last element of the split list
TESTCASE_PATH = MEMPHIS_HOME + "/" + input_yaml_name.split(".")[0] #Creates a new path using the MEMPHIS_HOME + the YAML name


#Clean testcase and delete scenario
os.system("killall "+IMPUT_SCENARIO_FILE_PATH.split(".")[0])
#Commented for a while
#os.system("cd "+ TESTCASE_PATH+"; make clean")
#os.system("rm -rf "+TESTCASE_PATH+"/"+IMPUT_SCENARIO_FILE_PATH.split(".")[0])


exit_status = os.system("memphis-gen "+ INPUT_TESTCASE_FILE_PATH)
if exit_status != 0:
sys.exit("\nError in memphis-gen")
Expand Down
2 changes: 1 addition & 1 deletion build_env/bin/memphis-app
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ app_list = []
try:
arg2 = sys.argv[2]
except:
sys.exit("ERROR: Missing 2nd argument, e.g: memphis-app example.yaml mpeg\n")
sys.exit("ERROR: Missing 2nd argument. You have two options\n\t1 - Compile one single app: memphis-app my_testcase.yaml mpeg\n\t2 - Compile all apps of your scenario: memphis-app my_testcase.yaml -all my_scenario.yaml\n")


if arg2 == "-all":
Expand Down
Loading

0 comments on commit 6a7673b

Please sign in to comment.