cleanups
Change-Id: I8022d937477668253c613e97c3a579ae65084b1e
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -53,4 +53,3 @@ debuggers/openocd/src/startup.tcl
|
|||||||
debuggers/openocd/src/startup_tcl.c
|
debuggers/openocd/src/startup_tcl.c
|
||||||
debuggers/openocd/src/target/xscale_debug.h
|
debuggers/openocd/src/target/xscale_debug.h
|
||||||
debuggers/openocd/stamp-h1
|
debuggers/openocd/stamp-h1
|
||||||
|
|
||||||
|
|||||||
@ -45,10 +45,9 @@ if(BUILD_PANDA)
|
|||||||
|
|
||||||
# ensure, elf path is set for enabling openocd to read elf symbols
|
# ensure, elf path is set for enabling openocd to read elf symbols
|
||||||
if(EXISTS $ENV{FAIL_ELF_PATH})
|
if(EXISTS $ENV{FAIL_ELF_PATH})
|
||||||
SET(PANDA_ELF_PATH $ENV{FAIL_ELF_PATH})
|
message(STATUS "[Fail*] PandaBoard ELF under test: $ENV{FAIL_ELF_PATH}")
|
||||||
message(STATUS "[Fail*] PandaBoard ELF under test: ${PANDA_ELF_PATH}")
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Please set the FAIL_ELF_PATH enviroment variable to the binary under test.")
|
message(FATAL_ERROR "Please set the FAIL_ELF_PATH environment variable to the binary under test.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -678,7 +678,7 @@ int main(int argc, char *argv[])
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(!getHaltingWatchpoint(&halt)) {
|
if (!getHaltingWatchpoint(&halt)) {
|
||||||
LOG << "FATAL ERROR: Can't determine memory-access address of halt cause" << endl;
|
LOG << "FATAL ERROR: Can't determine memory-access address of halt cause" << endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
@ -1768,7 +1768,7 @@ static void merge_mem_ranges (std::vector<struct mem_range> &in_out)
|
|||||||
std::vector<struct mem_range>::iterator it, next_it;
|
std::vector<struct mem_range>::iterator it, next_it;
|
||||||
it = in_out.begin();
|
it = in_out.begin();
|
||||||
next_it = it; next_it++;
|
next_it = it; next_it++;
|
||||||
while(it != in_out.end() && next_it != in_out.end()) {
|
while (it != in_out.end() && next_it != in_out.end()) {
|
||||||
if ((it->address + it->width) >= next_it->address) {
|
if ((it->address + it->width) >= next_it->address) {
|
||||||
uint32_t additive_width = (next_it->address - it->address) + next_it->width;
|
uint32_t additive_width = (next_it->address - it->address) + next_it->width;
|
||||||
if (additive_width > it->width) {
|
if (additive_width > it->width) {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ set(PROTOS
|
|||||||
)
|
)
|
||||||
|
|
||||||
## Set concrete implementation of InjectionPointMessage
|
## Set concrete implementation of InjectionPointMessage
|
||||||
# ToDo: Define seperate symbol, so it can also be used in other build types
|
# TODO: Define separate symbol, so it can also be used in other build types
|
||||||
if(CONFIG_INJECTIONPOINT_HOPS)
|
if(CONFIG_INJECTIONPOINT_HOPS)
|
||||||
set(PROTOS ${PROTOS} InjectionPointHopsMessage.proto)
|
set(PROTOS ${PROTOS} InjectionPointHopsMessage.proto)
|
||||||
set(CONCRETE_INJECTION_POINT InjectionPointHopsMessage.proto)
|
set(CONCRETE_INJECTION_POINT InjectionPointHopsMessage.proto)
|
||||||
|
|||||||
@ -6,12 +6,12 @@ message InjectionPointMessage {
|
|||||||
// If checkpoint must be used for this hop chain, id is set properly
|
// If checkpoint must be used for this hop chain, id is set properly
|
||||||
optional uint32 checkpoint_id = 1;
|
optional uint32 checkpoint_id = 1;
|
||||||
|
|
||||||
// If we need to knwo the target dynamic instruction offset,
|
// If we need to know the target dynamic instruction offset,
|
||||||
// here it is
|
// here it is
|
||||||
optional uint32 target_trace_position = 4;
|
optional uint32 target_trace_position = 4;
|
||||||
|
|
||||||
|
|
||||||
// Repeated groups can't be defined as notempty, so a manual
|
// Repeated groups can't be defined as non-empty, so a manual
|
||||||
// non-empty check is required at usage
|
// non-empty check is required at usage
|
||||||
|
|
||||||
// As we assume hops to always watch addresses of length 1, we
|
// As we assume hops to always watch addresses of length 1, we
|
||||||
|
|||||||
@ -35,7 +35,7 @@ bool DatabaseCampaign::run() {
|
|||||||
CommandLine::option_handle PRUNER = cmd.addOption("p", "prune-method", Arg::Required,
|
CommandLine::option_handle PRUNER = cmd.addOption("p", "prune-method", Arg::Required,
|
||||||
"-p/--prune-method \tWhich import method to use (default: basic)");
|
"-p/--prune-method \tWhich import method to use (default: basic)");
|
||||||
|
|
||||||
if(!cmd.parse()) {
|
if (!cmd.parse()) {
|
||||||
log_send << "Error parsing arguments." << std::endl;
|
log_send << "Error parsing arguments." << std::endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ bool DatabaseCampaign::run() {
|
|||||||
std::vector<Database::Variant> variants = db->get_variants(variant, benchmark);
|
std::vector<Database::Variant> variants = db->get_variants(variant, benchmark);
|
||||||
for (std::vector<Database::Variant>::const_iterator it = variants.begin();
|
for (std::vector<Database::Variant>::const_iterator it = variants.begin();
|
||||||
it != variants.end(); ++it) {
|
it != variants.end(); ++it) {
|
||||||
if(!run_variant(*it)) {
|
if (!run_variant(*it)) {
|
||||||
log_send << "run_variant failed for " << it->variant << "/" << it->benchmark <<std::endl;
|
log_send << "run_variant failed for " << it->variant << "/" << it->benchmark <<std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -136,9 +136,10 @@ bool DatabaseCampaign::run_variant(Database::Variant variant) {
|
|||||||
log_send << "Found " << experiment_count << " unfinished experiments in database. ("
|
log_send << "Found " << experiment_count << " unfinished experiments in database. ("
|
||||||
<< variant.variant << "/" << variant.benchmark << ")" << std::endl;
|
<< variant.variant << "/" << variant.benchmark << ")" << std::endl;
|
||||||
|
|
||||||
// abstraction of injection point
|
// abstraction of injection point:
|
||||||
// must not be initialized in loop, because hop chain calculator would loose state after loop pass
|
// must not be initialized in loop, because hop chain calculator would lose
|
||||||
// and so for every hop chain it would have to begin calculating at trace instruction zero
|
// state after loop pass and so for every hop chain it would have to begin
|
||||||
|
// calculating at trace instruction zero
|
||||||
ConcreteInjectionPoint ip;
|
ConcreteInjectionPoint ip;
|
||||||
|
|
||||||
sent_pilots = 0;
|
sent_pilots = 0;
|
||||||
|
|||||||
@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
namespace fail {
|
namespace fail {
|
||||||
|
|
||||||
|
|
||||||
InjectionPointHops::~InjectionPointHops() {
|
InjectionPointHops::~InjectionPointHops() {
|
||||||
if (m_initialized)
|
if (m_initialized) {
|
||||||
delete m_sa;
|
delete m_sa;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InjectionPointHops::init()
|
void InjectionPointHops::init()
|
||||||
@ -17,11 +17,11 @@ void InjectionPointHops::init()
|
|||||||
m_sa = new SmartHops();
|
m_sa = new SmartHops();
|
||||||
|
|
||||||
char * elfpath = getenv("FAIL_TRACE_PATH");
|
char * elfpath = getenv("FAIL_TRACE_PATH");
|
||||||
if(elfpath == NULL){
|
if (elfpath == NULL) {
|
||||||
m_log << "FAIL_TRACE_PATH not set :(" << std::endl;
|
m_log << "FAIL_TRACE_PATH not set :(" << std::endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}else{
|
} else {
|
||||||
m_sa->init((const char*)elfpath);
|
m_sa->init((const char*) elfpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
@ -93,7 +93,7 @@ void InjectionPointHops::parseFromInjectionInstr(unsigned instr1, unsigned instr
|
|||||||
if (search == search_end) {
|
if (search == search_end) {
|
||||||
m_ip = *search;
|
m_ip = *search;
|
||||||
} else {
|
} else {
|
||||||
for(;search != search_end; search++) {
|
for (;search != search_end; search++) {
|
||||||
if (!search->has_costs()) {
|
if (!search->has_costs()) {
|
||||||
m_log << "FATAL ERROR: Costs must be delivered in order to calculate minimum costs" << std::endl;
|
m_log << "FATAL ERROR: Costs must be delivered in order to calculate minimum costs" << std::endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Architecture.hpp: wraps architecture definition headers
|
// Architecture.hpp: wraps architecture definition headers
|
||||||
#ifndef __ARCHITECTURE_HPP__
|
#ifndef __ARCHITECTURE_HPP__
|
||||||
#define __ARCHITECTURE_HPP__
|
#define __ARCHITECTURE_HPP__
|
||||||
|
|
||||||
#include "config/FailConfig.hpp"
|
#include "config/FailConfig.hpp"
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __PANDA_ARM_CPU_HPP__
|
#ifndef __PANDA_ARM_CPU_HPP__
|
||||||
#define __PANDA_ARM_CPU_HPP__
|
#define __PANDA_ARM_CPU_HPP__
|
||||||
|
|
||||||
#include "../arm/ArmArchitecture.hpp"
|
#include "../arm/ArmArchitecture.hpp"
|
||||||
#include "../arm/ArmCPUState.hpp"
|
#include "../arm/ArmCPUState.hpp"
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __PANDA_BREAKPOINTS_AH__
|
#ifndef __PANDA_BREAKPOINTS_AH__
|
||||||
#define __PANDA_BREAKPOINTS_AH__
|
#define __PANDA_BREAKPOINTS_AH__
|
||||||
|
|
||||||
#include "config/FailConfig.hpp"
|
#include "config/FailConfig.hpp"
|
||||||
#include "config/VariantConfig.hpp"
|
#include "config/VariantConfig.hpp"
|
||||||
@ -11,9 +11,10 @@
|
|||||||
|
|
||||||
aspect PandaBreakpoints
|
aspect PandaBreakpoints
|
||||||
{
|
{
|
||||||
advice "fail::BPSingleListener" : slice class
|
|
||||||
{
|
advice "fail::BPSingleListener" : slice class
|
||||||
public:
|
{
|
||||||
|
public:
|
||||||
bool onAddition()
|
bool onAddition()
|
||||||
{
|
{
|
||||||
// Setup Breakpoint on Pandaboard
|
// Setup Breakpoint on Pandaboard
|
||||||
@ -24,7 +25,7 @@ aspect PandaBreakpoints
|
|||||||
hc.type = HALT_TYPE_BP;
|
hc.type = HALT_TYPE_BP;
|
||||||
}
|
}
|
||||||
hc.address = m_WatchInstrPtr;
|
hc.address = m_WatchInstrPtr;
|
||||||
hc.addr_len= 4; // Thumb? => 2
|
hc.addr_len = 4; // Thumb? => 2
|
||||||
oocdw_set_halt_condition(&hc);
|
oocdw_set_halt_condition(&hc);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -39,10 +40,11 @@ aspect PandaBreakpoints
|
|||||||
hc.type = HALT_TYPE_BP;
|
hc.type = HALT_TYPE_BP;
|
||||||
}
|
}
|
||||||
hc.address = m_WatchInstrPtr;
|
hc.address = m_WatchInstrPtr;
|
||||||
hc.addr_len= 4; // Thumb? => 2
|
hc.addr_len = 4; // Thumb? => 2
|
||||||
oocdw_delete_halt_condition(&hc);
|
oocdw_delete_halt_condition(&hc);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BUILD_PANDA && CONFIG_EVENT_BREAKPOINTS
|
#endif // BUILD_PANDA && CONFIG_EVENT_BREAKPOINTS
|
||||||
|
|||||||
@ -5,13 +5,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __PANDA_CONFIG_HPP__
|
#ifndef __PANDA_CONFIG_HPP__
|
||||||
#define __PANDA_CONFIG_HPP__
|
#define __PANDA_CONFIG_HPP__
|
||||||
|
|
||||||
namespace fail {
|
namespace fail {
|
||||||
typedef uint32_t host_address_t; //!< the host memory address type
|
|
||||||
typedef uint32_t guest_address_t; //!< the guest memory address type
|
typedef uint32_t host_address_t; //!< the host memory address type
|
||||||
typedef uint32_t register_data_t; //!< register data type (32 bit)
|
typedef uint32_t guest_address_t; //!< the guest memory address type
|
||||||
typedef int timer_t; //!< type of timer IDs
|
typedef uint32_t register_data_t; //!< register data type (32 bit)
|
||||||
|
typedef int timer_t; //!< type of timer IDs
|
||||||
|
|
||||||
} // end-of-namespace: fail
|
} // end-of-namespace: fail
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
#include "openocd_wrapper.hpp"
|
#include "openocd_wrapper.hpp"
|
||||||
|
|
||||||
#if defined(CONFIG_FIRE_INTERRUPTS)
|
#if defined(CONFIG_FIRE_INTERRUPTS)
|
||||||
#error Firing intterupts not implemented for Pandaboard
|
#error Firing interrupts not implemented for Pandaboard
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SR_REBOOT) || defined(CONFIG_SR_RESTORE) || defined(CONFIG_SR_SAVE)
|
#if defined(CONFIG_SR_REBOOT) || defined(CONFIG_SR_RESTORE) || defined(CONFIG_SR_SAVE)
|
||||||
@ -56,16 +56,7 @@ void PandaController::onTimerTrigger(void* thisPtr)
|
|||||||
|
|
||||||
bool PandaController::save(const std::string& path)
|
bool PandaController::save(const std::string& path)
|
||||||
{
|
{
|
||||||
// ToDo (PORT): Save
|
// TODO
|
||||||
|
|
||||||
/*int stat;
|
|
||||||
|
|
||||||
stat = mkdir(path.c_str(), 0777);
|
|
||||||
if (!(stat == 0 || errno == EEXIST)) {
|
|
||||||
return false;
|
|
||||||
// std::cout << "[FAIL] Can not create target-directory to save!" << std::endl;
|
|
||||||
// TODO: (Non-)Verbose-Mode? Log-level? Maybe better: use return value to indicate failure?
|
|
||||||
}*/
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -73,11 +64,7 @@ bool PandaController::save(const std::string& path)
|
|||||||
void PandaController::restore(const std::string& path)
|
void PandaController::restore(const std::string& path)
|
||||||
{
|
{
|
||||||
clearListeners();
|
clearListeners();
|
||||||
/*restore_bochs_request = true;
|
// TODO
|
||||||
BX_CPU(0)->async_event |= 1;
|
|
||||||
sr_path = path;*/
|
|
||||||
|
|
||||||
// ToDo (PORT): Restore
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PandaController::reboot()
|
void PandaController::reboot()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __PANDA_CONTROLLER_HPP__
|
#ifndef __PANDA_CONTROLLER_HPP__
|
||||||
#define __PANDA_CONTROLLER_HPP__
|
#define __PANDA_CONTROLLER_HPP__
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __PANDA_LISTENER_HPP__
|
#ifndef __PANDA_LISTENER_HPP__
|
||||||
#define __PANDA_LISTENER_HPP__
|
#define __PANDA_LISTENER_HPP__
|
||||||
|
|
||||||
namespace fail {
|
namespace fail {
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __PANDA_MEMORY_HPP__
|
#ifndef __PANDA_MEMORY_HPP__
|
||||||
#define __PANDA_MEMORY_HPP__
|
#define __PANDA_MEMORY_HPP__
|
||||||
|
|
||||||
#include "../Memory.hpp"
|
#include "../Memory.hpp"
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __PANDA_TIMER_AH__
|
#ifndef __PANDA_TIMER_AH__
|
||||||
#define __PANDA_TIMER_AH__
|
#define __PANDA_TIMER_AH__
|
||||||
|
|
||||||
#include "config/VariantConfig.hpp"
|
#include "config/VariantConfig.hpp"
|
||||||
#include "config/FailConfig.hpp"
|
#include "config/FailConfig.hpp"
|
||||||
@ -10,8 +10,9 @@
|
|||||||
#include "PandaListener.hpp"
|
#include "PandaListener.hpp"
|
||||||
|
|
||||||
aspect PandaTimer {
|
aspect PandaTimer {
|
||||||
advice "fail::TimerListener" : slice class {
|
|
||||||
public:
|
advice "fail::TimerListener" : slice class {
|
||||||
|
public:
|
||||||
bool onAddition()
|
bool onAddition()
|
||||||
{
|
{
|
||||||
// Register the timer listener in the Bochs simulator:
|
// Register the timer listener in the Bochs simulator:
|
||||||
@ -28,7 +29,7 @@ aspect PandaTimer {
|
|||||||
// Unregister the time listener:
|
// Unregister the time listener:
|
||||||
m_unregisterTimer(this);
|
m_unregisterTimer(this);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
timer_id_t m_registerTimer(TimerListener* pev)
|
timer_id_t m_registerTimer(TimerListener* pev)
|
||||||
{
|
{
|
||||||
assert(pev != NULL && "FATAL ERROR: TimerListener object ptr cannot be NULL!");
|
assert(pev != NULL && "FATAL ERROR: TimerListener object ptr cannot be NULL!");
|
||||||
@ -43,7 +44,8 @@ aspect PandaTimer {
|
|||||||
oocdw_deactivate_timer(static_cast<unsigned>(pev->getId()));
|
oocdw_deactivate_timer(static_cast<unsigned>(pev->getId()));
|
||||||
return oocdw_unregisterTimer(static_cast<unsigned>(pev->getId()));
|
return oocdw_unregisterTimer(static_cast<unsigned>(pev->getId()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BUILD_PANDA && CONFIG_EVENT_BREAKPOINTS
|
#endif // BUILD_PANDA && CONFIG_EVENT_BREAKPOINTS
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __PANDA_WATCHPOINTS_AH__
|
#ifndef __PANDA_WATCHPOINTS_AH__
|
||||||
#define __PANDA_WATCHPOINTS_AH__
|
#define __PANDA_WATCHPOINTS_AH__
|
||||||
|
|
||||||
#include "config/FailConfig.hpp"
|
#include "config/FailConfig.hpp"
|
||||||
#include "config/VariantConfig.hpp"
|
#include "config/VariantConfig.hpp"
|
||||||
@ -11,19 +11,23 @@
|
|||||||
|
|
||||||
aspect PandaWatchpoints
|
aspect PandaWatchpoints
|
||||||
{
|
{
|
||||||
advice "fail::MemAccessListener" : slice class
|
|
||||||
{
|
advice "fail::MemAccessListener" : slice class
|
||||||
|
{
|
||||||
int m_t32access;
|
int m_t32access;
|
||||||
public:
|
public:
|
||||||
bool onAddition()
|
bool onAddition()
|
||||||
{
|
{
|
||||||
// Setup Watchpoint on Pandaboard (if it cant be realized as WP, mmu will be utilzed)
|
// Setup Watchpoint on Pandaboard (if it can't be realized as WP, MMU will be utilized)
|
||||||
struct halt_condition hc;
|
struct halt_condition hc;
|
||||||
|
|
||||||
switch(m_WatchType) {
|
switch (m_WatchType) {
|
||||||
case MemAccessEvent::MEM_READ: hc.type = HALT_TYPE_WP_READ; break;
|
case MemAccessEvent::MEM_READ:
|
||||||
case MemAccessEvent::MEM_WRITE: hc.type = HALT_TYPE_WP_WRITE; break;
|
hc.type = HALT_TYPE_WP_READ; break;
|
||||||
case MemAccessEvent::MEM_READWRITE: hc.type = HALT_TYPE_WP_READWRITE; break;
|
case MemAccessEvent::MEM_WRITE:
|
||||||
|
hc.type = HALT_TYPE_WP_WRITE; break;
|
||||||
|
case MemAccessEvent::MEM_READWRITE:
|
||||||
|
hc.type = HALT_TYPE_WP_READWRITE; break;
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,13 +41,16 @@ aspect PandaWatchpoints
|
|||||||
|
|
||||||
void onDeletion()
|
void onDeletion()
|
||||||
{
|
{
|
||||||
// Remove Watchpoint from Pandaboard (if it was realized by mmu, it will be reprogrammed)
|
// Remove Watchpoint from Pandaboard (if it was realized by MMU, it will be reprogrammed)
|
||||||
struct halt_condition hc;
|
struct halt_condition hc;
|
||||||
|
|
||||||
switch(m_WatchType) {
|
switch (m_WatchType) {
|
||||||
case MemAccessEvent::MEM_READ: hc.type = HALT_TYPE_WP_READ; break;
|
case MemAccessEvent::MEM_READ:
|
||||||
case MemAccessEvent::MEM_WRITE: hc.type = HALT_TYPE_WP_WRITE; break;
|
hc.type = HALT_TYPE_WP_READ; break;
|
||||||
case MemAccessEvent::MEM_READWRITE: hc.type = HALT_TYPE_WP_READWRITE; break;
|
case MemAccessEvent::MEM_WRITE:
|
||||||
|
hc.type = HALT_TYPE_WP_WRITE; break;
|
||||||
|
case MemAccessEvent::MEM_READWRITE:
|
||||||
|
hc.type = HALT_TYPE_WP_READWRITE; break;
|
||||||
default: return; // ToDo: Error handling
|
default: return; // ToDo: Error handling
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +60,7 @@ aspect PandaWatchpoints
|
|||||||
// ToDo: Error handling
|
// ToDo: Error handling
|
||||||
oocdw_delete_halt_condition(&hc);
|
oocdw_delete_halt_condition(&hc);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -78,4 +78,3 @@ option(BUILD_LLVM_DISASSEMBLER "Build the LLVM-based disassembler (LLVM 3.3 pref
|
|||||||
if (BUILD_LLVM_DISASSEMBLER)
|
if (BUILD_LLVM_DISASSEMBLER)
|
||||||
add_subdirectory(llvmdisassembler)
|
add_subdirectory(llvmdisassembler)
|
||||||
endif (BUILD_LLVM_DISASSEMBLER)
|
endif (BUILD_LLVM_DISASSEMBLER)
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ void SmartHops::convertToIPM(std::vector<result_tuple > &result, unsigned costs,
|
|||||||
}
|
}
|
||||||
ipm.set_costs(costs);
|
ipm.set_costs(costs);
|
||||||
|
|
||||||
for(;it_hop != result.end();
|
for (; it_hop != result.end();
|
||||||
it_hop++) {
|
it_hop++) {
|
||||||
InjectionPointMessage_Hops *hop = ipm.add_hops();
|
InjectionPointMessage_Hops *hop = ipm.add_hops();
|
||||||
hop->set_address(it_hop->first.first);
|
hop->set_address(it_hop->first.first);
|
||||||
@ -116,7 +116,7 @@ bool SmartHops::calculateFollowingHop(InjectionPointMessage &ip, unsigned instru
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deltion of unnecessary hops
|
// Deletion of unnecessary hops
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* |----------------|
|
* |----------------|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public:
|
|||||||
// m_use_checkpoints to true, but there will be additional changes needed for this to fully work.
|
// m_use_checkpoints to true, but there will be additional changes needed for this to fully work.
|
||||||
// The sal must, for example, generate CPs at the given positions
|
// The sal must, for example, generate CPs at the given positions
|
||||||
SmartHops() : m_trace_pos(0), m_costs(0), m_next_cp_id(0), m_log("SmartHops", false), m_use_watchpoints(true),
|
SmartHops() : m_trace_pos(0), m_costs(0), m_next_cp_id(0), m_log("SmartHops", false), m_use_watchpoints(true),
|
||||||
m_use_weights(true), m_use_checkpoints(false), m_cp_thresh(0), m_cost_cp(0), m_rollback_thresh(0){}
|
m_use_weights(true), m_use_checkpoints(false), m_cp_thresh(0), m_cost_cp(0), m_rollback_thresh(0) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the used TraceReader with given trace file path
|
* Initializes the used TraceReader with given trace file path
|
||||||
|
|||||||
@ -14,11 +14,11 @@
|
|||||||
namespace fail {
|
namespace fail {
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ACCESS_NONE ,
|
ACCESS_NONE,
|
||||||
ACCESS_READ ,
|
ACCESS_READ,
|
||||||
ACCESS_WRITE ,
|
ACCESS_WRITE,
|
||||||
ACCESS_READORWRITE , // some architectures can't distinguish read and write WPs in general (e.g. x86)
|
ACCESS_READORWRITE, // some architectures can't distinguish read and write WPs in general (e.g. x86)
|
||||||
ACCESS_CHECKPOINT ,
|
ACCESS_CHECKPOINT,
|
||||||
} mem_access_type_e;
|
} mem_access_type_e;
|
||||||
|
|
||||||
typedef uint32_t address_t;
|
typedef uint32_t address_t;
|
||||||
@ -26,8 +26,7 @@ typedef uint32_t trace_pos_t;
|
|||||||
typedef std::pair<address_t, mem_access_type_e> trace_event_tuple_t;
|
typedef std::pair<address_t, mem_access_type_e> trace_event_tuple_t;
|
||||||
|
|
||||||
class TraceReader {
|
class TraceReader {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TraceReader() : m_current_position(1),
|
TraceReader() : m_current_position(1),
|
||||||
ps(0),
|
ps(0),
|
||||||
normal_stream(0),
|
normal_stream(0),
|
||||||
@ -43,7 +42,7 @@ class TraceReader {
|
|||||||
std::vector<trace_event_tuple_t >& trace_events);
|
std::vector<trace_event_tuple_t >& trace_events);
|
||||||
|
|
||||||
bool openTraceFile(const char *filename, unsigned int num_inst = 0);
|
bool openTraceFile(const char *filename, unsigned int num_inst = 0);
|
||||||
private:
|
private:
|
||||||
unsigned int m_current_position;
|
unsigned int m_current_position;
|
||||||
ProtoIStream* ps;
|
ProtoIStream* ps;
|
||||||
std::ifstream *normal_stream;
|
std::ifstream *normal_stream;
|
||||||
|
|||||||
@ -11,9 +11,9 @@ using namespace std;
|
|||||||
using namespace fail;
|
using namespace fail;
|
||||||
using namespace google::protobuf;
|
using namespace google::protobuf;
|
||||||
|
|
||||||
void LraSimpleCampaign::cb_send_pilot(DatabaseCampaignMessage pilot) {
|
void LraSimpleCampaign::cb_send_pilot(DatabaseCampaignMessage pilot)
|
||||||
|
{
|
||||||
LraSimpleExperimentData *data = new LraSimpleExperimentData;
|
LraSimpleExperimentData *data = new LraSimpleExperimentData;
|
||||||
data->msg.mutable_fsppilot()->CopyFrom(pilot);
|
data->msg.mutable_fsppilot()->CopyFrom(pilot);
|
||||||
campaignmanager.addParam(data);
|
campaignmanager.addParam(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,6 @@ int32_t correct_result[100] = {
|
|||||||
0, 0, 0, 0
|
0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ToDo: Move this functionality to SimulatorController
|
// ToDo: Move this functionality to SimulatorController
|
||||||
bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &ip) {
|
bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &ip) {
|
||||||
Logger log_nav("navigator", false);
|
Logger log_nav("navigator", false);
|
||||||
@ -70,7 +69,6 @@ bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &
|
|||||||
simulator.terminate(1);
|
simulator.terminate(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
log_nav << "Navigating to next instruction at navigational costs of " << ipm.costs() << endl;
|
log_nav << "Navigating to next instruction at navigational costs of " << ipm.costs() << endl;
|
||||||
log_nav << "Length of hop-chain: " << ipm.hops_size() << endl;
|
log_nav << "Length of hop-chain: " << ipm.hops_size() << endl;
|
||||||
|
|
||||||
@ -110,7 +108,6 @@ bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &
|
|||||||
log_nav << "FATAL ERROR: Unexpected event while navigating!" << endl;
|
log_nav << "FATAL ERROR: Unexpected event while navigating!" << endl;
|
||||||
simulator.terminate(1);
|
simulator.terminate(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// Step nav
|
// Step nav
|
||||||
@ -195,7 +192,7 @@ bool LRASimplePandaExperiment::run()
|
|||||||
while (true) {
|
while (true) {
|
||||||
logger << "asking jobserver for parameters. Undone: "<<jobClient->getNumberOfUndoneJobs() << endl;
|
logger << "asking jobserver for parameters. Undone: "<<jobClient->getNumberOfUndoneJobs() << endl;
|
||||||
LraSimpleExperimentData param;
|
LraSimpleExperimentData param;
|
||||||
if(!jobClient->getParam(param)){
|
if (!jobClient->getParam(param)) {
|
||||||
logger << "Dying." << endl; // We were told to die.
|
logger << "Dying." << endl; // We were told to die.
|
||||||
simulator.terminate(1);
|
simulator.terminate(1);
|
||||||
}
|
}
|
||||||
@ -255,7 +252,6 @@ bool LRASimplePandaExperiment::run()
|
|||||||
// Alternatively for single-bit-flips:
|
// Alternatively for single-bit-flips:
|
||||||
// data ^= 1 << experiment_id;
|
// data ^= 1 << experiment_id;
|
||||||
|
|
||||||
|
|
||||||
logger << "Injection bitflips at address " << hex << data_address << dec << endl;
|
logger << "Injection bitflips at address " << hex << data_address << dec << endl;
|
||||||
|
|
||||||
timer.startTimer();
|
timer.startTimer();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __LRA_SIMPLE_PANDA_EXPERIMENT_HPP__
|
#ifndef __LRA_SIMPLE_PANDA_EXPERIMENT_HPP__
|
||||||
#define __LRA_SIMPLE_PANDA_EXPERIMENT_HPP__
|
#define __LRA_SIMPLE_PANDA_EXPERIMENT_HPP__
|
||||||
|
|
||||||
#include "efw/ExperimentFlow.hpp"
|
#include "efw/ExperimentFlow.hpp"
|
||||||
#include "cpn/InjectionPoint.hpp"
|
#include "cpn/InjectionPoint.hpp"
|
||||||
|
|||||||
@ -20,7 +20,6 @@ message LraSimpleProtoMsg {
|
|||||||
required uint32 experiment_number = 1 [(sql_primary_key) = true];
|
required uint32 experiment_number = 1 [(sql_primary_key) = true];
|
||||||
required ResultType resulttype = 2;
|
required ResultType resulttype = 2;
|
||||||
|
|
||||||
|
|
||||||
// Times for evaluation
|
// Times for evaluation
|
||||||
required float time_init = 3;
|
required float time_init = 3;
|
||||||
required float time_nav = 4;
|
required float time_nav = 4;
|
||||||
|
|||||||
@ -8,8 +8,9 @@
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
fail::CommandLine &cmd = fail::CommandLine::Inst();
|
fail::CommandLine &cmd = fail::CommandLine::Inst();
|
||||||
for (int i = 1; i < argc; ++i)
|
for (int i = 1; i < argc; ++i) {
|
||||||
cmd.add_args(argv[i]);
|
cmd.add_args(argv[i]);
|
||||||
|
}
|
||||||
|
|
||||||
LraSimpleCampaign c;
|
LraSimpleCampaign c;
|
||||||
if (fail::campaignmanager.runCampaign(&c)) {
|
if (fail::campaignmanager.runCampaign(&c)) {
|
||||||
|
|||||||
@ -5,19 +5,18 @@
|
|||||||
class ResultCollector;
|
class ResultCollector;
|
||||||
|
|
||||||
class BasicAlgorithm {
|
class BasicAlgorithm {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @returns boolean value for calculation success
|
* @returns boolean value for calculation success
|
||||||
*/
|
*/
|
||||||
virtual bool calculateAllHops(fail::TraceReader& trace) = 0;
|
virtual bool calculateAllHops(fail::TraceReader& trace) = 0;
|
||||||
|
|
||||||
BasicAlgorithm(ResultCollector *rc) {m_resultCollector = rc;}
|
BasicAlgorithm(ResultCollector *rc) { m_resultCollector = rc; }
|
||||||
virtual ~BasicAlgorithm() {}
|
virtual ~BasicAlgorithm() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ResultCollector *m_resultCollector;
|
ResultCollector *m_resultCollector;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __BASIC_ALGORITHM__HPP
|
#endif // __BASIC_ALGORITHM__HPP
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,7 @@ ResultCollector::addResult(std::vector<result_tuple >& res, unsigned int costs)
|
|||||||
it_hop++;
|
it_hop++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(;it_hop != res.end();
|
for (; it_hop != res.end();
|
||||||
it_hop++) {
|
it_hop++) {
|
||||||
InjectionPointMessage_Hops *hop = hc.add_hops();
|
InjectionPointMessage_Hops *hop = hc.add_hops();
|
||||||
hop->set_address(it_hop->first.first);
|
hop->set_address(it_hop->first.first);
|
||||||
@ -111,7 +111,7 @@ ResultCollector::addResult(std::vector<result_tuple >& res, unsigned int costs)
|
|||||||
}
|
}
|
||||||
ps->writeMessage(&hc);
|
ps->writeMessage(&hc);
|
||||||
} else {
|
} else {
|
||||||
for(std::vector<result_tuple >::iterator it_hop = res.begin();
|
for (std::vector<result_tuple >::iterator it_hop = res.begin();
|
||||||
it_hop != res.end();
|
it_hop != res.end();
|
||||||
it_hop++) {
|
it_hop++) {
|
||||||
address_t add = it_hop->first.first;
|
address_t add = it_hop->first.first;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ public:
|
|||||||
m_checkpoint_count(1),
|
m_checkpoint_count(1),
|
||||||
m_it_mean_costs(0),
|
m_it_mean_costs(0),
|
||||||
m_max_costs(0),
|
m_max_costs(0),
|
||||||
ps(0){}
|
ps(0) {}
|
||||||
|
|
||||||
void
|
void
|
||||||
addResult(std::vector<result_tuple >& res, unsigned int costs);
|
addResult(std::vector<result_tuple >& res, unsigned int costs);
|
||||||
@ -87,5 +87,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif /* STATISTICSCOLLECTOR_HPP_ */
|
#endif /* STATISTICSCOLLECTOR_HPP_ */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#ifndef SIMPLE_ALGORITHM__HPP
|
#ifndef SIMPLE_ALGORITHM__HPP
|
||||||
#define SIMPLE_ALGORITHM__HPP
|
#define SIMPLE_ALGORITHM__HPP
|
||||||
|
|
||||||
//#include <vector>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "BasicAlgorithm.hpp"
|
#include "BasicAlgorithm.hpp"
|
||||||
@ -21,10 +20,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
// Count occurences
|
// Count occurences
|
||||||
//map<trace_event_tuple_t, vector<trace_pos_t> > m_occurences;
|
//map<trace_event_tuple_t, vector<trace_pos_t> > m_occurences;
|
||||||
std::map<trace_event_tuple_t, unsigned long > m_occurences;
|
std::map<trace_event_tuple_t, unsigned long> m_occurences;
|
||||||
|
|
||||||
std::map<trace_event_tuple_t, unsigned long > m_occ_cp;
|
std::map<trace_event_tuple_t, unsigned long> m_occ_cp;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SIMPLE_ALGORITHM__HPP
|
#endif // SIMPLE_ALGORITHM__HPP
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,7 @@ bool SmartAlgorithm::calculateAllHops(TraceReader& trace)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deltion of unnecessary hops
|
// Deletion of unnecessary hops
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* |----------------|
|
* |----------------|
|
||||||
|
|||||||
@ -37,7 +37,6 @@ Logger LOG("hop-calculator", false);
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
// Manually fill the command line option parser
|
// Manually fill the command line option parser
|
||||||
CommandLine &cmd = CommandLine::Inst();
|
CommandLine &cmd = CommandLine::Inst();
|
||||||
|
|
||||||
@ -239,7 +238,7 @@ int main(int argc, char *argv[])
|
|||||||
if (cmd[CHECKPOINT_OUTPUT_FILE].count() > 0) {
|
if (cmd[CHECKPOINT_OUTPUT_FILE].count() > 0) {
|
||||||
std::string filename(cmd[CHECKPOINT_OUTPUT_FILE].first()->arg);
|
std::string filename(cmd[CHECKPOINT_OUTPUT_FILE].first()->arg);
|
||||||
g_cp_ofstream.open(filename.c_str());
|
g_cp_ofstream.open(filename.c_str());
|
||||||
if(!g_cp_ofstream.is_open()) {
|
if (!g_cp_ofstream.is_open()) {
|
||||||
LOG << "Unable to open cp_out_file " << filename << std::endl;
|
LOG << "Unable to open cp_out_file " << filename << std::endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user