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

bug iteration

parent fd62be22
No related branches found
No related tags found
No related merge requests found
......@@ -39,11 +39,11 @@ int main(int argc, char **argv) {
WorkSpace *ws = NULL;
//WorkSpace *ws_trivial = NULL;
WorkSpace *ws_trivial = NULL;
PropList conf;
//PropList conf_trivial;
PropList conf_trivial;
Manager manager;
//Manager manager_trivial;
Manager manager_trivial;
NO_SYSTEM(conf) = true;
TASK_ENTRY(conf) = "main";
VERBOSE(conf) = true;
......@@ -55,7 +55,7 @@ int main(int argc, char **argv) {
// Flow fact
std::cout << "-------------------- Configuration paths ----------------------" << std::endl;
FLOW_FACTS_PATH(conf) = argv[2];
//FLOW_FACTS_PATH(conf_trivial) = argv[2];
FLOW_FACTS_PATH(conf_trivial) = argv[2];
// Platform description
CACHE_CONFIG_PATH(conf) = "cache_simple.xml";
......@@ -69,17 +69,17 @@ int main(int argc, char **argv) {
std::cout << "----------------------------Workspace building----------------------------------" << std::endl;
ws = manager.load(argv[1], conf);
//ws_trivial = manager_trivial.load(argv[1], conf_trivial);
ws_trivial = manager_trivial.load(argv[1], conf_trivial);
// CFG Building
std::cout << "----------------------------run virtualizer--------------------------------------" << std::endl;
ws->run("otawa::Virtualizer", conf);
//ws_trivial->run("otawa::Virtualizer", conf_trivial);
ws_trivial->run("otawa::Virtualizer", conf_trivial);
std::cout << "-------------------------------cache configuration-----------------------------------------" << std::endl;
//ws->require(otawa::ICACHE_ONLY_CONSTRAINT2_FEATURE , conf);
std::cout << "-------------------------------edge time-----------------------------------------" << std::endl;
otawa::etime::RECORD_TIME(conf) = true;
//ws->require(otawa::ICACHE_ONLY_CONSTRAINT2_FEATURE, conf);
ws->require(otawa::ICACHE_ONLY_CONSTRAINT2_FEATURE, conf);
//ws->require(otawa::ICACHE_CONSTRAINT2_FEATURE , conf);
ws->require(otawa::etime::EDGE_TIME_FEATURE, conf);
......@@ -90,8 +90,8 @@ int main(int argc, char **argv) {
//ws_trivial->require(otawa::ipet::WCET_FEATURE, conf_trivial);
std::cout << "WCET:" << ipet::WCET(ws) << std::endl;
ws_trivial->require(otawa::ipet::WCET_FEATURE, conf_trivial);
std::cout << "WCET:" << ipet::WCET(ws) /*- ipet::WCET(ws_trivial)*/ << std::endl;
// std::cout << "WCET:" << ipet::WCET(ws_trivial) << std::endl;
return 0;
}
No preview for this file type
......@@ -128,6 +128,17 @@ void build_profile_file(char* name, WorkSpace *ws, std::vector<struct LBlock_vul
file.close();
}
/********************************
* FUNCTION print_vulnerability
*
*
********************************/
void print_vulnerability(std::vector<struct LBlock_vulnerability*> cf) {
for(int i = 0; i < cf.size(); i++) {
std::cout << cf[i]->addr.offset() << ":" << cf[i]->addr.page() << ":" << cf[i]->line << std::endl;
}
}
/********************************
* FUNCTION main
*
......@@ -174,17 +185,18 @@ int main(int argc, char **argv) {
ws = manager.load(argv[1], conf);
ws->run("otawa::Virtualizer", conf);
ws->require(otawa::ICACHE_CONSTRAINT2_FEATURE, conf);
ws->require(otawa::ICACHE_ONLY_CONSTRAINT2_FEATURE, conf);
ws->require(otawa::etime::EDGE_TIME_FEATURE, conf);
ws->require(otawa::ipet::WCET_FEATURE, conf);
ws->require(DynFeature("otawa::vulnerability::VULNERABILITY_FEATURE"), conf);
std::cout << "vulnerability:" << VUL(ws) << " WCET:" << ipet::WCET(ws) << std::endl;
std::ofstream file(argv[3]);
//std::vector<struct var_conf> configuration_vulnerability;
file << ipet::WCET(ws) << "," << VUL(ws) << std::endl;
long wcet = ipet::WCET(ws) /*- wcet_trivial*/;
file << wcet << "," << VUL(ws) << std::endl;
std::cout << "vulnerability:" << VUL(ws) << " WCET:" << wcet << std::endl;
const CFGCollection *coll = INVOLVED_CFGS(ws);
std::vector<struct LBlock_vulnerability*> configuration_vulnerability = List_LB_VUL(ws);
......@@ -249,6 +261,9 @@ int main(int argc, char **argv) {
// }
// }
// }
long wcet = ipet::WCET(ws) - wcet_trivial;
long wcet_vul = WCET_VUL(ws);
std::cout << "WCET_VUL:" << wcet_vul << std::endl;
build_profile_file(argv[4], ws, configuration_vulnerability, wcet);
print_vulnerability(configuration_vulnerability);
}
No preview for this file type
......@@ -36,6 +36,10 @@ namespace otawa { namespace vulnerability {
struct PVBlock{
Block* b;
long iteration;
PVBlock() {
iteration = 1;
b = NULL;
}
};
void explo_path(std::vector<std::vector<PVBlock>>& result, std::vector<PVBlock> path, Block* b, Address cb, const hard::Cache * cache, ilp::System* sys, std::vector<PVBlock> &blocks_on_path, std::vector<struct LBlock_vulnerability*> list_lv);
......@@ -76,6 +80,14 @@ namespace otawa { namespace vulnerability {
ilp::System *sys,
std::vector<PVBlock> &blocks_on_path);
std::vector<PVBlock> path_through_loop_wcet(BasicBlock *bh, ilp::System *sys);
std::vector<PVBlock> path_through_fct_wcet(CFG *fct, ilp::System *sys);
long miss_on_path_vulnerability(std::vector<otawa::cache::LBlock*> list, const hard::Cache *cache, ilp::System *sys);
long wcet_vulnerability(WorkSpace *ws, const hard::Cache *cache, ilp::System *sys);
class VulnerabilityProcessor : public Processor {
public:
static p::declare reg;
......@@ -104,6 +116,7 @@ extern p::feature VULNERABILITY_FEATURE;
struct LBlock_vulnerability{
bool selected;
long line;
otawa::Address addr;
cache::LBlock* lb;
long reload_cost;
......@@ -114,6 +127,7 @@ extern p::feature VULNERABILITY_FEATURE;
LBlock_vulnerability() {
selected = false;
lb = NULL;
line = -1;
reload_cost = 0;
vulnerability_max = 0;
vulnerable_data = 0;
......@@ -132,6 +146,7 @@ extern Identifier<DAGHNode*> DAG_HNODE;
extern Identifier<struct Memory_block *> MB_STRUCT;
extern Identifier<struct LBlock_vulnerability*> LB_VUL;
extern Identifier<std::vector<struct LBlock_vulnerability*>> List_LB_VUL;
extern Identifier<long> WCET_VUL;
}
}
#endif
This diff is collapsed.
This diff is collapsed.
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