DatabaseExperiment: add register FI
Calling the DatabaseCampaign with --inject-registers or --force-inject-registers now injects into CPU registers. This is achieved by reinterpreting data addresses in the DB as addresses within the register file. (The mapping between registers and data addresses is implemented in core/util/llvmdisassembler/LLVMtoFailTranslator.hpp.) The difference between --inject-registers and --force-inject-registers is what the experiment does when a data address is not interpretable as a register: the former option then injects into memory (DatabaseCampaignMessage, RegisterInjectionMode AUTO), the latter skips the injection altogether (FORCE). Currently only compiles together with the Bochs backend; the DatabaseExperiment's redecodeCurrentInstruction() function must be moved into the Bochs EEA to remedy this. Change-Id: I23f152ac0adf4cb6fbe82377ac871e654263fe57
This commit is contained in:
@ -21,7 +21,7 @@ static Logger log_send("DatabaseCampaign");
|
||||
bool DatabaseCampaign::run() {
|
||||
CommandLine &cmd = CommandLine::Inst();
|
||||
|
||||
cmd.addOption("", "", Arg::None, "USAGE: fail-server [options...]\n\n");
|
||||
cmd.addOption("", "", Arg::None, "USAGE: fail-server [options...]\n");
|
||||
CommandLine::option_handle HELP = cmd.addOption("h", "help", Arg::None, "-h,--help \tPrint usage and exit");
|
||||
|
||||
Database::cmdline_setup();
|
||||
@ -49,6 +49,12 @@ bool DatabaseCampaign::run() {
|
||||
CommandLine::option_handle BURST =
|
||||
cmd.addOption("","inject-bursts", Arg::None,
|
||||
"--inject-bursts \tinject burst faults (default: single bitflips)");
|
||||
CommandLine::option_handle REGISTERS =
|
||||
cmd.addOption("","inject-registers", Arg::None,
|
||||
"--inject-registers \tinject into ISA registers (default: memory)");
|
||||
CommandLine::option_handle REGISTERS_FORCE =
|
||||
cmd.addOption("","force-inject-registers", Arg::None,
|
||||
"--force-inject-registers \tinject into ISA registers only, ignore high addresses");
|
||||
|
||||
if (!cmd.parse()) {
|
||||
log_send << "Error parsing arguments." << std::endl;
|
||||
@ -103,6 +109,17 @@ bool DatabaseCampaign::run() {
|
||||
log_send << "fault model: single-bit flip" << std::endl;
|
||||
}
|
||||
|
||||
if (cmd[REGISTERS] && !cmd[REGISTERS_FORCE]) {
|
||||
m_register_injection_mode = DatabaseCampaignMessage::AUTO;
|
||||
log_send << "register injection: auto" << std::endl;
|
||||
} else if (cmd[REGISTERS_FORCE]) {
|
||||
m_register_injection_mode = DatabaseCampaignMessage::FORCE;
|
||||
log_send << "register injection: on" << std::endl;
|
||||
} else {
|
||||
m_register_injection_mode = DatabaseCampaignMessage::OFF;
|
||||
log_send << "register injection: off" << std::endl;
|
||||
}
|
||||
|
||||
if (cmd[PRUNER]) {
|
||||
m_fspmethod = std::string(cmd[PRUNER].first()->arg);
|
||||
} else {
|
||||
@ -238,6 +255,7 @@ bool DatabaseCampaign::run_variant(Database::Variant variant) {
|
||||
pilot.set_data_address(data_address);
|
||||
pilot.set_data_width(data_width);
|
||||
pilot.set_inject_bursts(m_inject_bursts);
|
||||
pilot.set_register_injection_mode(m_register_injection_mode);
|
||||
|
||||
this->cb_send_pilot(pilot);
|
||||
|
||||
|
||||
@ -40,6 +40,7 @@ class DatabaseCampaign : public Campaign {
|
||||
#endif
|
||||
|
||||
bool m_inject_bursts; // !< inject burst faults?
|
||||
DatabaseCampaignMessage::RegisterInjectionMode m_register_injection_mode; // !< inject into registers? OFF, ON, AUTO (= use registers if address is small)
|
||||
|
||||
public:
|
||||
DatabaseCampaign() {};
|
||||
|
||||
Reference in New Issue
Block a user