treat AspectConfig like other configuration headers

This is temporary; we need a proper configuration tool for this.
 - AspectConfig.hpp moves to config/AspectConfig.hpp.in
 - generate configuration in build tree

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@958 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-03-08 22:54:05 +00:00
parent e5fea2dbcd
commit 97534f7a19
22 changed files with 98 additions and 80 deletions

View File

@ -1,30 +0,0 @@
#ifndef __ASPECT_CONFIG_HPP__
#define __ASPECT_CONFIG_HPP__
// The following configuration macros to disable (0) / enable (1) the various
// event sources, fault injection sinks, and miscellaneous other features.
// Event sources
#define CONFIG_EVENT_CPULOOP 0
#define CONFIG_EVENT_MEMREAD 0
#define CONFIG_EVENT_MEMWRITE 0
#define CONFIG_EVENT_GUESTSYS 0
#define CONFIG_EVENT_INTERRUPT 0
#define CONFIG_EVENT_TRAP 0
#define CONFIG_EVENT_JUMP 0
// Save/restore functionality
#define CONFIG_SR_RESTORE 0
#define CONFIG_SR_SAVE 0
#define CONFIG_SR_REBOOT 0
// Miscellaneous
#define CONFIG_STFU 0
#define CONFIG_SUPPRESS_INTERRUPTS 0
#define CONFIG_DISABLE_KEYB_INTERRUPTS 0
// Fault injection
#define CONFIG_FI_MEM_ACCESS_BITFLIP 0
#endif /* __ASPECT_CONFIG_HPP__ */

View File

@ -1,9 +1,9 @@
#ifndef __CPU_LOOP_AH__
#define __CPU_LOOP_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_EVENT_CPULOOP == 1
#ifdef CONFIG_EVENT_CPULOOP
#include "../../../bochs/bochs.h" // for "BX_CPU_C"
#include "../../../bochs/cpu/cpu.h" // for "bxInstruction_c"

View File

@ -1,9 +1,9 @@
#ifndef __GUESTSYS_COM_AH__
#define __GUESTSYS_COM_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_EVENT_GUESTSYS == 1
#ifdef CONFIG_EVENT_GUESTSYS
#include "../../../bochs/bochs.h"
#include "../../../bochs/cpu/cpu.h"

View File

@ -1,9 +1,9 @@
#ifndef __INTERRUPT_AH__
#define __INTERRUPT_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_EVENT_INTERRUPT == 1
#ifdef CONFIG_EVENT_INTERRUPT
#include "../../../bochs/bochs.h"
#include "../../../bochs/cpu/cpu.h"

View File

@ -1,9 +1,9 @@
#ifndef __INTERRUPT_SUPPRESSION_AH__
#define __INTERRUPT_SUPPRESSION_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_SUPPRESS_INTERRUPTS == 1
#ifdef CONFIG_SUPPRESS_INTERRUPTS
#include "../../../bochs/bochs.h"
#include "../../../bochs/cpu/cpu.h"

View File

@ -1,9 +1,9 @@
#ifndef __JUMP_AH__
#define __JUMP_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_EVENT_JUMP == 1
#ifdef CONFIG_EVENT_JUMP
#include <iostream>
#include <cstdlib>

View File

@ -1,10 +1,10 @@
#ifndef __JUMP_TO_PREVIOUS_CTX_AH__
#define __JUMP_TO_PREVIOUS_CTX_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if 0
// #if CONFIG_SR_RESTORE == 1 || CONFIG_SR_REBOOT == 1
// #if defined(CONFIG_SR_RESTORE) || defined(CONFIG_SR_REBOOT)
#include "bochs.h"
#include "../SALInst.hpp"
@ -28,6 +28,6 @@ aspect jumpToPreviousCtx
}
};
#endif // CONFIG_SR_RESTORE == 1 || CONFIG_SR_REBOOT
#endif // CONFIG_SR_RESTORE || CONFIG_SR_REBOOT
#endif // __JUMP_TO_PREVIOUS_CTX_AH__

View File

@ -1,9 +1,9 @@
#ifndef __MEM_ACCESS_BIT_FLIP_AH__
#define __MEM_ACCESS_BIT_FLIP_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_FI_MEM_ACCESS_BITFLIP == 1
#ifdef CONFIG_FI_MEM_ACCESS_BITFLIP
#include <iostream>
#include <cstdlib>

View File

@ -2,9 +2,9 @@
#define __MEM_EVENTS_AH__
#include <iostream>
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_EVENT_MEMREAD == 1 || CONFIG_EVENT_MEMWRITE == 1
#if defined(CONFIG_EVENT_MEMREAD) || defined(CONFIG_EVENT_MEMWRITE)
#include "../../../bochs/bochs.h"
#include "../../../bochs/cpu/cpu.h"
@ -57,7 +57,7 @@ aspect MemEvents
//
// Event source: "memory write access"
//
#if CONFIG_EVENT_MEMWRITE == 1
#ifdef CONFIG_EVENT_MEMWRITE
advice execution (write_methods()) : after () {
sal::simulator.onMemoryAccessEvent(
*(tjp->arg<1>()), sizeof(*(tjp->arg<2>())), true,
@ -103,7 +103,7 @@ aspect MemEvents
//
// Event source: "memory read access"
//
#if CONFIG_EVENT_MEMREAD == 1
#ifdef CONFIG_EVENT_MEMREAD
advice execution (read_methods()) : before () {
sal::simulator.onMemoryAccessEvent(
*(tjp->arg<1>()), sizeof(*(tjp->result())), false,
@ -119,14 +119,14 @@ aspect MemEvents
advice execution (read_methods_RMW()) : before () {
rmw_address = *(tjp->arg<1>());
#if CONFIG_EVENT_MEMREAD == 1
#ifdef CONFIG_EVENT_MEMREAD
sal::simulator.onMemoryAccessEvent(
*(tjp->arg<1>()), sizeof(*(tjp->result())), false,
getCPU(tjp->that())->prev_rip);
#endif
}
#if CONFIG_EVENT_MEMREAD == 1
#ifdef CONFIG_EVENT_MEMREAD
advice execution (read_methods_system()) : before () {
// We don't do anything here for now: This type of memory
// access is used when the hardware itself needs to access

View File

@ -1,9 +1,9 @@
#ifndef __TRAP_AH__
#define __TRAP_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_EVENT_TRAP == 1
#ifdef CONFIG_EVENT_TRAP
#include "../../../bochs/bochs.h"
#include "../../../bochs/cpu/cpu.h"

View File

@ -1,9 +1,9 @@
#ifndef __DISABLE_KEYBOARD_INTERRUPT_AH__
#define __DISABLE_KEYBOARD_INTERRUPT_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_DISABLE_KEYB_INTERRUPTS
#ifdef CONFIG_DISABLE_KEYB_INTERRUPTS
#include "../../../bochs/iodev/keyboard.h"

View File

@ -1,10 +1,10 @@
#ifndef __REBOOT_AH__
#define __REBOOT_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#include "../SALInst.hpp"
#if CONFIG_SR_REBOOT == 1
#ifdef CONFIG_SR_REBOOT
#include "bochs.h"

View File

@ -2,10 +2,10 @@
#define __RESTORE_AH__
#include <iostream>
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#include "../SALInst.hpp"
#if CONFIG_SR_RESTORE == 1
#ifdef CONFIG_SR_RESTORE
#include "bochs.h"

View File

@ -1,9 +1,9 @@
#ifndef __SAVE_AH__
#define __SAVE_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_SR_SAVE == 1
#ifdef CONFIG_SR_SAVE
#include "bochs.h"
#include "../SALInst.hpp"

View File

@ -1,9 +1,9 @@
#ifndef __NONVERBOSE_AH__
#define __NONVERBOSE_AH__
#include "../../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#if CONFIG_STFU == 1
#ifdef CONFIG_STFU
#include "bochs.h"

View File

@ -0,0 +1,30 @@
#ifndef __ASPECT_CONFIG_HPP__
#define __ASPECT_CONFIG_HPP__
// #define / #undef the following configuration macros to enable/disable the
// various event sources, fault injection sinks, and miscellaneous other
// features.
// Event sources
#cmakedefine CONFIG_EVENT_CPULOOP
#cmakedefine CONFIG_EVENT_MEMREAD
#cmakedefine CONFIG_EVENT_MEMWRITE
#cmakedefine CONFIG_EVENT_GUESTSYS
#cmakedefine CONFIG_EVENT_INTERRUPT
#cmakedefine CONFIG_EVENT_TRAP
#cmakedefine CONFIG_EVENT_JUMP
// Save/restore functionality
#cmakedefine CONFIG_SR_RESTORE
#cmakedefine CONFIG_SR_SAVE
#cmakedefine CONFIG_SR_REBOOT
// Miscellaneous
#cmakedefine CONFIG_STFU
#cmakedefine CONFIG_SUPPRESS_INTERRUPTS
#cmakedefine CONFIG_DISABLE_KEYB_INTERRUPTS
// Fault injection
#cmakedefine CONFIG_FI_MEM_ACCESS_BITFLIP
#endif /* __ASPECT_CONFIG_HPP__ */

View File

@ -1,3 +1,21 @@
#### Configuration file emitting BUILD_OVP/BOCHS defines ####
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/variant_config.h.in
${CMAKE_CURRENT_BINARY_DIR}/variant_config.h)
OPTION(CONFIG_EVENT_CPULOOP "Event source: Breakpoints" OFF)
OPTION(CONFIG_EVENT_MEMREAD "Event source: Memory reads" OFF)
OPTION(CONFIG_EVENT_MEMWRITE "Event source: Memory writes" OFF)
OPTION(CONFIG_EVENT_GUESTSYS "Event source: Outbound guest-system communication" OFF)
OPTION(CONFIG_EVENT_INTERRUPT "Event source: Interrupts" OFF)
OPTION(CONFIG_EVENT_TRAP "Event source: Traps" OFF)
OPTION(CONFIG_EVENT_JUMP "Event source: Branch instructions" OFF)
OPTION(CONFIG_SR_RESTORE "Target backend: State restore" OFF)
OPTION(CONFIG_SR_SAVE "Target backend: State saving" OFF)
OPTION(CONFIG_SR_REBOOT "Target backend: Reboot" OFF)
OPTION(CONFIG_STFU "Misc: Reduced verbosity" OFF)
OPTION(CONFIG_SUPPRESS_INTERRUPTS "Target backend: Suppress interrupts" OFF)
OPTION(CONFIG_DISABLE_KEYB_INTERRUPTS "Target backend: Suppress keyboard interrupts" OFF)
OPTION(CONFIG_FI_MEM_ACCESS_BITFLIP "deprecated something" OFF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/AspectConfig.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/AspectConfig.hpp)

View File

@ -4,7 +4,7 @@
#include <iostream>
#include <fstream>
#include "AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#include "controller/ExperimentFlow.hpp"
#define INST_ADDR_FUNC_START 0x4ae6
@ -12,8 +12,8 @@
/*
// Check if aspect dependencies are satisfied:
#if CONFIG_EVENT_CPULOOP != 1 || CONFIG_EVENT_TRAP != 1 || \
CONFIG_SR_RESTORE != 1 || CONFIG_SR_SAVE != 1
#if !defined(CONFIG_EVENT_CPULOOP) || !defined(CONFIG_EVENT_TRAP) || \
!defined(CONFIG_SR_RESTORE) || !defined(CONFIG_SR_SAVE)
#error At least one of the following aspect-dependencies are not satisfied: \
cpu loop, traps, save/restore. Enable aspects first (see AspectConfig.hpp)!
#endif

View File

@ -9,10 +9,10 @@
#include "../controller/ExperimentFlow.hpp"
#include "../SAL/SALInst.hpp"
#include "../SAL/bochs/BochsRegister.hpp"
#include "../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
// Check if aspect dependencies are satisfied:
#if CONFIG_EVENT_CPULOOP != 1 || CONFIG_EVENT_JUMP != 1
#if !defined(CONFIG_EVENT_CPULOOP) || !defined(CONFIG_EVENT_JUMP)
#error Breakpoint- and jump-events needed! Enable aspects first (see AspectConfig.hpp)!
#endif

View File

@ -8,10 +8,10 @@
#include "../controller/ExperimentFlow.hpp"
#include "../SAL/SALInst.hpp"
#include "../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
// Check aspect dependencies:
#if CONFIG_EVENT_CPULOOP != 1 || CONFIG_EVENT_MEMACCESS != 1 || CONFIG_SR_SAVE != 1 || CONFIG_FI_MEM_ACCESS_BITFLIP != 1
#if !defined(CONFIG_EVENT_CPULOOP) || !defined(CONFIG_EVENT_MEMACCESS) || !defined(CONFIG_SR_SAVE) || !defined(CONFIG_FI_MEM_ACCESS_BITFLIP)
#error Event dependecies not satisfied! Enabled needed aspects in AspectConfig.hpp!
#endif

View File

@ -8,11 +8,11 @@
#include "../controller/ExperimentFlow.hpp"
#include "../SAL/SALInst.hpp"
#include "../AspectConfig.hpp"
#include "config/AspectConfig.hpp"
#include "../SAL/bochs/BochsRegister.hpp"
// Check if aspect dependency is satisfied:
#if CONFIG_EVENT_CPULOOP != 1
#ifndef CONFIG_EVENT_CPULOOP
#error Breakpoint-events needed! Enable aspect first (see AspectConfig.hpp)!
#endif

View File

@ -97,14 +97,7 @@ Buildsystem:
brauchbaren Konfigurationswerkzeug mit Ausdrucksmöglichkeiten für
Merkmalmodelle, Abhängigkeiten, Mehrfachauswahl etc. (kconfig?)
* Bochs / OVP sind Alternativen, nicht beide anschaltbar (?)
- EXP*-options nur einmal in config/, nicht in drei verschiedenen Dateien
(config/CMakelists.txt, config/experiments.hpp.in,
experiments/CMakeLists.txt)
* Hinzufügen eines neuen Experiments konkreter dokumentieren (howto-build.txt?)
- AspectConfig.hpp in cmake-config einbinden (genauso behandeln wie experiments.hpp!)
-> generierte Datei landet in Buildtree, wird nicht mehr eingecheckt
- variant_config.h in cmake-config einbinden (genauso behandeln wie experiments.hpp!)
-> generierte Datei landet in Buildtree, wird nicht mehr eingecheckt
- Hinzufügen eines neuen Experiments konkreter dokumentieren (howto-build.txt?)
Dokumentation:
- Änderungen im Klassendiagramm nachziehen (hsc)
@ -156,6 +149,13 @@ Dokumentation:
-> siehe fail/experiments/coolchecksum/experiment.cc FIXME am Ende
-> Lösung: Löschliste
- ggf. zusammen mit Datenstruktur-Implementierungsdetails-TODO (s.u.) angehen
- AspectConfig.hpp in cmake-config einbinden (genauso behandeln wie experiments.hpp!)
-> generierte Datei landet in Buildtree, wird nicht mehr eingecheckt
- variant_config.h in cmake-config einbinden (genauso behandeln wie experiments.hpp!)
-> generierte Datei landet in Buildtree, wird nicht mehr eingecheckt
- EXP*-options nur einmal in config/, nicht in drei verschiedenen Dateien
(config/CMakelists.txt, config/experiments.hpp.in,
experiments/CMakeLists.txt)
==================================
Theorie TODO