Skip to content
Snippets Groups Projects
Commit efe988a3 authored by Bouquillon Fabien's avatar Bouquillon Fabien
Browse files

modificztion mineure

parent 2f3cbc2c
Branches
No related tags found
No related merge requests found
LDLIBS2=`otawa-config otawa/display otawa/classic_ecb otawa/ucb_cond otawa/classic_ucb --libs`
LDLIBS2=`otawa-config otawa/display otawa/classic_ucb otawa/classic_ecb otawa/ucb_cond --libs`
CXXFLAGS += -std=c++11 -O0 -g -I /home/fabien/cristal/otawa/include/ -I ../otawa-core2-build/otawa/include/elm/
ARMCC=arm-none-eabi-gcc
all: application
all: application test basic
application: application.o
$(CXX) -o application application.o $(LDLIBS2)
application.o: application.cpp
application.o: application.cpp application.h
basic: basic_f_l_c.c
$(ARMCC) -nostdlib -nostdinc -static -o basic basic_f_l_c.c
test: test.sh
./test.sh
No preview for this file type
......@@ -5,27 +5,32 @@
#include <otawa/proc/DynProcessor.h>
#include <otawa/cfg/Dominance.h>
#include <otawa/proc/DynFeature.h>
#include <otawa/ipet/features.h>
#include <otawa/ipet/FlowFactLoader.h>
#include <otawa/flowfact/features.h>
#include <fstream>
//includes pour l'affichage du CFG
#include <otawa/display/CFGOutput.h>
#include <otawa/ipet/features.h>
#include <elm/io/OutFileStream.h>
#include <otawa/flowfact/features.h>
#include <multiset.hpp>
#include "../ucb_cond/include/ucb_cond.h"
#include "../classic_ecb/include/classic_ecb.h"
#include "../classic_ucb/include/classic_ucb.h"
#include "application.h"
using namespace otawa; //comme import
using namespace otawa::classic_ecb;
using namespace otawa::classic_ucb;
using namespace otawa::ucb_cond;
using namespace Mathset;
int main(int argc, char **argv) {
if (argc != 2 && argc > 4) {
fprintf(stderr, "usage: %s <binary> <flow fact file> <sortie>\n", argv[0]);
exit(1);
}
WorkSpace *ws = NULL;
PropList conf;
Manager manager;
......@@ -33,8 +38,22 @@ int main(int argc, char **argv) {
TASK_ENTRY(conf) = "main";
VERBOSE(conf) = true;
if (argc < 4) {
fprintf(stderr, "usage: %s <binary> <flow fact file> <sortie>\n", argv[0]);
StringBuffer buf;
buf << argv[1] << "-decomp.c";
elm::io::OutFileStream s(buf.toString());
elm::io::Output out(s);
conf.print(out);
std::cout << "#### chargement tache ####" << std::endl;
ws = manager.load(argv[1], conf);
ws->require(otawa::ipet::FLOW_FACTS_FEATURE,conf);
exit(1);
}
std::cout << "#### chargement cache ####" << std::endl;
CACHE_CONFIG_PATH(conf) = "./cache.xml";
if(argc == 3) {
std::cout << "#### chargement flow fact ####" << std::endl;
if(argc == 4 || argc == 3) {
FLOW_FACTS_PATH(conf) = argv[2];
}
StringBuffer buf;
......@@ -42,7 +61,9 @@ int main(int argc, char **argv) {
elm::io::OutFileStream s(buf.toString());
elm::io::Output out(s);
conf.print(out);
std::cout << "#### chargement tache ####" << std::endl;
ws = manager.load(argv[1], conf);
std::cout << "#### execution plugin ####" << std::endl;
ws->require(DynFeature("otawa::ucb_cond::UCB_COND_FEATURE"), conf);
ws->require(DynFeature("otawa::classic_ucb::CLASSIC_UCB_PROCESSOR"), conf);
......@@ -53,10 +74,13 @@ int main(int argc, char **argv) {
// ws->require(otawa::ipet::WCET_FEATURE, conf);
//unsigned long wcet = ipet::WCET(ENTRY_CFG(ws));
std::cout << "#### result ####" << std::endl;
std::vector<Multiset<int>*> *ucbs = UCBS_MP(ws);
for(auto iter = (*ucbs).begin(); iter != (*ucbs).end(); iter++) {
(*iter)->print_vector();
}
std::vector<Multiset<int>*> ucbs_compr = compr_multiset(*ucbs);
// for(auto iter = (*ucbs).begin(); iter != (*ucbs).end(); iter++) {
// (*iter)->print_vector();
// }
Multiset<int> *ucbs_c = otawa::classic_ucb::UCBS(ws);
......@@ -65,25 +89,32 @@ int main(int argc, char **argv) {
//std::cout << "---------WCET: " << wcet << "--------------" << std::endl;
std::cout << "---------ECBS------------" << std::endl;
ecbs->print_vector();
// std::cout << "---------ECBS------------" << std::endl;
// ecbs->print_vector();
std::cout << "---------UCBs------------" << std::endl;
ucbs_c->print_vector();
// std::cout << "---------UCBs------------" << std::endl;
// ucbs_c->print_vector();
std::cout << "---------UCBS mp ms -----" << std::endl;
std::cout << "size: " << ucbs->size() << std::endl;
for(auto iter = (*ucbs).begin(); iter != (*ucbs).end(); iter++) {
(*iter)->print_vector();
}
// std::cout << "---------UCBS mp ms -----" << std::endl;
// std::cout << "size: " << ucbs->size() << std::endl;
// for(auto iter = (*ucbs).begin(); iter != (*ucbs).end(); iter++) {
// std::cout << " -- " << (*iter)->size() << std::endl;
// //(*iter)->print_vector();
// }
// std::cout << "---------UCBS mp ms -----" << std::endl;
// std::cout << "size: " << ucbs_compr.size() << std::endl;
// for(auto iter = (ucbs_compr).begin(); iter != (ucbs_compr).end(); iter++) {
// std::cout << " -- " << (*iter)->size() << std::endl;
// //(*iter)->print_vector();
// }
std::ofstream f(argv[3]);
f << "Task t(0, 10, 10, {";
for(int i = 0; i < ucbs->size(); i++) {
for(int i = 0; i < ucbs_compr.size(); i++) {
f << "{";
(*ucbs)[i]->to_string(f);
(ucbs_compr)[i]->to_string(f);
f << "}";
if(i != ucbs->size() - 1) {
if(i != ucbs_compr.size() - 1) {
f << ",";
}
}
......
No preview for this file type
Task t(0, 10, 10, {{}},{0,1,2,3,4,5,6,7,32,33,34,8,9,10,11,12,13,14,15,23,24,25,16,17,18,19,20,21,22,26,27,28,29,30,31,35,36,37,38,39,40,41,42},{32,33,34,8,9,10,11,12,13,14,15,23,24,25,16,17,18,19,20,21,22,26,27,28,29,30,31})
Task t(0, 10, 10, {{32,32,32,32,32,32,32,32,32,33,33,33,33,33,33,33,33,33,34,34,34,34,34,34,34,34,34,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,30,30,30,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31}},{0,1,2,3,4,5,6,7,32,33,34,8,9,10,11,12,13,14,15,23,24,25,16,17,18,19,20,21,22,26,27,28,29,30,31,35,36,37,38,39,40,41,42},{32,33,34,8,9,10,11,12,13,14,15,23,24,25,16,17,18,19,20,21,22,26,27,28,29,30,31})
{ ID(otawa::CACHE_CONFIG_PATH) = ./cache.xml, ID(otawa::VERBOSE) = true, ID(otawa::TASK_ENTRY) = main, ID(otawa::NO_SYSTEM) = true }
\ No newline at end of file
{ ID(otawa::FLOW_FACTS_PATH) = flow_fact_simple_code.ff, ID(otawa::CACHE_CONFIG_PATH) = ./cache.xml, ID(otawa::VERBOSE) = true, ID(otawa::TASK_ENTRY) = main, ID(otawa::NO_SYSTEM) = true }
\ No newline at end of file
......@@ -11,11 +11,14 @@ ARMCC=arm-none-eabi-gcc
CXXFLAGS += -std=c++11 -O0 -g -I ../otawa-core2-build/otawa/include/ -I ../otawa-core2-build/elm/include/
all: clean install application binaire
all: clean install application binaire simple_code
binaire: binaire.c
$(ARMCC) -nostdlib -nostdinc -static -o binaire binaire.c
simple_code: simple_code.c
$(ARMCC) -nostdlib -nostdinc -static -o simple_code simple_code.c
##debut
application: application.o
$(CXX) -o application application.o $(LDLIBS2)
......
No preview for this file type
......@@ -26,9 +26,10 @@ int main(int argc, char **argv) {
NO_SYSTEM(conf) = true;
TASK_ENTRY(conf) = "main";
VERBOSE(conf) = true;
std::cout << "#### chargement cache ####" << std::endl;
CACHE_CONFIG_PATH(conf) = "./cache.xml";
if(argc == 3) {
std::cout << "#### chargement flow fact ####" << std::endl;
FLOW_FACTS_PATH(conf) = argv[2];
}
StringBuffer buf;
......@@ -36,9 +37,11 @@ int main(int argc, char **argv) {
elm::io::OutFileStream s(buf.toString());
elm::io::Output out(s);
conf.print(out);
std::cout << "#### chargement tache ####" << std::endl;
ws = manager.load(argv[1], conf);
std::cout << "#### execution plugin ####" << std::endl;
ws->require(DynFeature("otawa::ucb_cond::UCB_COND_FEATURE"), conf);
std::cout << "#### result ####" << std::endl;
std::vector<Multiset<int>*> *ucbs = UCBS_MP(ws);
std::cout << "---------UCBS------------" << std::endl;
for(auto iter = (*ucbs).begin(); iter != (*ucbs).end(); iter++) {
......
No preview for this file type
......@@ -83,6 +83,7 @@ namespace otawa {
if(cb->isSynth())
{
//------------------------
// If there is a function call
//------------------------
......@@ -112,7 +113,7 @@ namespace otawa {
Edge *edge = *iter;
Block *target = edge->target();
explore_path(target, visited, paths);
explore_loop(target,id_loop , visited, paths);
}
}
......@@ -186,18 +187,6 @@ namespace otawa {
void explore_path(Block *cb, Multiset<Block*> visited, Multiset<Multiset<Block*>> &paths)
{
if(cb->isBasic()) {
AllocArray<LBlock*> *lblock_array = BB_LBLOCKS(cb);
for(int i = 0; i < lblock_array->count(); i++) {
LBlock *lb = (*lblock_array)[i];
const hard::Cache *cache = lb->lblockset()->cache();
std::cout << "CACHE LINE:" << cache->line(lb->address()) << std::endl;
}
}
if(cb->isExit())
{
......@@ -219,21 +208,22 @@ namespace otawa {
for(auto fp_iter = v_tmp_paths.begin(); fp_iter != v_tmp_paths.end(); fp_iter++)
{
fusion_path = math_multiset_fusion((*fp_iter).elem, fusion_path);
}
visited = math_multiset_union(visited, fusion_path);
//tmp_visited.clear();
//std::cout << "CLEAR" << std::endl;
Multiset<Block*> tmp_vis = math_multiset_union(visited, fp_iter->elem);
for(Block::EdgeIter iter(cb->outs()); iter(); iter++)
{
Edge *edge = *iter;
Block *target = edge->target();
explore_path(target, visited, paths);
explore_path(target, tmp_vis, paths);
}
}
}
else
......@@ -330,7 +320,7 @@ namespace otawa {
nt = 0;
break;
case FIRST_MISS:
nt = (iter_e->counter - 1) * lb->countInsts();
nt = (iter_e->counter * lb->countInsts()) - 1;
break;
case FIRST_HIT:
nt = lb->countInsts();
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment