Change-Id: I8022d937477668253c613e97c3a579ae65084b1e
This commit is contained in:
Horst Schirmeier
2014-02-09 18:54:21 +01:00
parent 5df364dea2
commit 277958b31b
45 changed files with 430 additions and 444 deletions

1
.gitignore vendored
View File

@ -53,4 +53,3 @@ debuggers/openocd/src/startup.tcl
debuggers/openocd/src/startup_tcl.c
debuggers/openocd/src/target/xscale_debug.h
debuggers/openocd/stamp-h1

View File

@ -45,10 +45,9 @@ if(BUILD_PANDA)
# ensure, elf path is set for enabling openocd to read elf symbols
if(EXISTS $ENV{FAIL_ELF_PATH})
SET(PANDA_ELF_PATH $ENV{FAIL_ELF_PATH})
message(STATUS "[Fail*] PandaBoard ELF under test: ${PANDA_ELF_PATH}")
message(STATUS "[Fail*] PandaBoard ELF under test: $ENV{FAIL_ELF_PATH}")
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()

View File

@ -12,7 +12,7 @@ set(PROTOS
)
## 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)
set(PROTOS ${PROTOS} InjectionPointHopsMessage.proto)
set(CONCRETE_INJECTION_POINT InjectionPointHopsMessage.proto)

View File

@ -6,12 +6,12 @@ message InjectionPointMessage {
// If checkpoint must be used for this hop chain, id is set properly
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
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
// As we assume hops to always watch addresses of length 1, we

View File

@ -136,9 +136,10 @@ bool DatabaseCampaign::run_variant(Database::Variant variant) {
log_send << "Found " << experiment_count << " unfinished experiments in database. ("
<< variant.variant << "/" << variant.benchmark << ")" << std::endl;
// abstraction of injection point
// must not be initialized in loop, because hop chain calculator would loose state after loop pass
// and so for every hop chain it would have to begin calculating at trace instruction zero
// abstraction of injection point:
// must not be initialized in loop, because hop chain calculator would lose
// state after loop pass and so for every hop chain it would have to begin
// calculating at trace instruction zero
ConcreteInjectionPoint ip;
sent_pilots = 0;

View File

@ -6,11 +6,11 @@
namespace fail {
InjectionPointHops::~InjectionPointHops() {
if (m_initialized)
if (m_initialized) {
delete m_sa;
}
}
void InjectionPointHops::init()
{

View File

@ -11,6 +11,7 @@
aspect PandaBreakpoints
{
advice "fail::BPSingleListener" : slice class
{
public:
@ -43,6 +44,7 @@ aspect PandaBreakpoints
oocdw_delete_halt_condition(&hc);
}
};
};
#endif // BUILD_PANDA && CONFIG_EVENT_BREAKPOINTS

View File

@ -8,6 +8,7 @@
#define __PANDA_CONFIG_HPP__
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 register_data_t; //!< register data type (32 bit)

View File

@ -9,7 +9,7 @@
#include "openocd_wrapper.hpp"
#if defined(CONFIG_FIRE_INTERRUPTS)
#error Firing intterupts not implemented for Pandaboard
#error Firing interrupts not implemented for Pandaboard
#endif
#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)
{
// ToDo (PORT): Save
/*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?
}*/
// TODO
return true;
}
@ -73,11 +64,7 @@ bool PandaController::save(const std::string& path)
void PandaController::restore(const std::string& path)
{
clearListeners();
/*restore_bochs_request = true;
BX_CPU(0)->async_event |= 1;
sr_path = path;*/
// ToDo (PORT): Restore
// TODO
}
void PandaController::reboot()

View File

@ -10,6 +10,7 @@
#include "PandaListener.hpp"
aspect PandaTimer {
advice "fail::TimerListener" : slice class {
public:
bool onAddition()
@ -44,6 +45,7 @@ aspect PandaTimer {
return oocdw_unregisterTimer(static_cast<unsigned>(pev->getId()));
}
};
};
#endif // BUILD_PANDA && CONFIG_EVENT_BREAKPOINTS

View File

@ -11,19 +11,23 @@
aspect PandaWatchpoints
{
advice "fail::MemAccessListener" : slice class
{
int m_t32access;
public:
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;
switch (m_WatchType) {
case MemAccessEvent::MEM_READ: hc.type = HALT_TYPE_WP_READ; break;
case MemAccessEvent::MEM_WRITE: hc.type = HALT_TYPE_WP_WRITE; break;
case MemAccessEvent::MEM_READWRITE: hc.type = HALT_TYPE_WP_READWRITE; break;
case MemAccessEvent::MEM_READ:
hc.type = HALT_TYPE_WP_READ; 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;
}
@ -37,13 +41,16 @@ aspect PandaWatchpoints
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;
switch (m_WatchType) {
case MemAccessEvent::MEM_READ: hc.type = HALT_TYPE_WP_READ; break;
case MemAccessEvent::MEM_WRITE: hc.type = HALT_TYPE_WP_WRITE; break;
case MemAccessEvent::MEM_READWRITE: hc.type = HALT_TYPE_WP_READWRITE; break;
case MemAccessEvent::MEM_READ:
hc.type = HALT_TYPE_WP_READ; 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
}

View File

@ -78,4 +78,3 @@ option(BUILD_LLVM_DISASSEMBLER "Build the LLVM-based disassembler (LLVM 3.3 pref
if (BUILD_LLVM_DISASSEMBLER)
add_subdirectory(llvmdisassembler)
endif (BUILD_LLVM_DISASSEMBLER)

View File

@ -116,7 +116,7 @@ bool SmartHops::calculateFollowingHop(InjectionPointMessage &ip, unsigned instru
continue;
}
// Deltion of unnecessary hops
// Deletion of unnecessary hops
/*
* |----------------|

View File

@ -27,7 +27,6 @@ typedef std::pair<address_t, mem_access_type_e> trace_event_tuple_t;
class TraceReader {
public:
TraceReader() : m_current_position(1),
ps(0),
normal_stream(0),

View File

@ -11,9 +11,9 @@ using namespace std;
using namespace fail;
using namespace google::protobuf;
void LraSimpleCampaign::cb_send_pilot(DatabaseCampaignMessage pilot) {
void LraSimpleCampaign::cb_send_pilot(DatabaseCampaignMessage pilot)
{
LraSimpleExperimentData *data = new LraSimpleExperimentData;
data->msg.mutable_fsppilot()->CopyFrom(pilot);
campaignmanager.addParam(data);
}

View File

@ -54,7 +54,6 @@ int32_t correct_result[100] = {
0, 0, 0, 0
};
// ToDo: Move this functionality to SimulatorController
bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &ip) {
Logger log_nav("navigator", false);
@ -70,7 +69,6 @@ bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &
simulator.terminate(1);
}
log_nav << "Navigating to next instruction at navigational costs of " << ipm.costs() << 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;
simulator.terminate(1);
}
}
#else
// Step nav
@ -255,7 +252,6 @@ bool LRASimplePandaExperiment::run()
// Alternatively for single-bit-flips:
// data ^= 1 << experiment_id;
logger << "Injection bitflips at address " << hex << data_address << dec << endl;
timer.startTimer();

View File

@ -20,7 +20,6 @@ message LraSimpleProtoMsg {
required uint32 experiment_number = 1 [(sql_primary_key) = true];
required ResultType resulttype = 2;
// Times for evaluation
required float time_init = 3;
required float time_nav = 4;

View File

@ -8,8 +8,9 @@
int main(int argc, char **argv)
{
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]);
}
LraSimpleCampaign c;
if (fail::campaignmanager.runCampaign(&c)) {

View File

@ -20,4 +20,3 @@ class BasicAlgorithm {
};
#endif // __BASIC_ALGORITHM__HPP

View File

@ -87,5 +87,3 @@ private:
};
#endif /* STATISTICSCOLLECTOR_HPP_ */

View File

@ -1,7 +1,6 @@
#ifndef SIMPLE_ALGORITHM__HPP
#define SIMPLE_ALGORITHM__HPP
//#include <vector>
#include <map>
#include "BasicAlgorithm.hpp"
@ -27,4 +26,3 @@ private:
};
#endif // SIMPLE_ALGORITHM__HPP

View File

@ -71,7 +71,7 @@ bool SmartAlgorithm::calculateAllHops(TraceReader& trace)
continue;
}
// Deltion of unnecessary hops
// Deletion of unnecessary hops
/*
* |----------------|

View File

@ -37,7 +37,6 @@ Logger LOG("hop-calculator", false);
int main(int argc, char *argv[])
{
// Manually fill the command line option parser
CommandLine &cmd = CommandLine::Inst();