Skip to content
Snippets Groups Projects
Commit a911ebb3 authored by Horst Schirmeier's avatar Horst Schirmeier
Browse files

Revert "explicit aspect activation"

Unfortunately, this does not (yet) work as advertised.  I need to fight another
round of CMake battles before retrying.  Reverting to previous state for now.

This reverts r1753.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1767 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
parent e05e80d2
No related branches found
No related tags found
No related merge requests found
Showing
with 130 additions and 113 deletions
......@@ -10,13 +10,6 @@ PROJECT(Fail*)
set(PROJECT_VERSION "0.0.1" CACHE STRING "Fail* version number")
#### Setup search path for custom cmake scripts ####
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# initialize list of active aspect headers
set(CMAKE_ASPECT_HEADERS "" CACHE INTERNAL "List of active aspect headers" FORCE)
include(macros)
#### Put all resulting library files in <your_build_dir>/lib ####
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
......@@ -26,6 +19,13 @@ SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
## (The autoconf'd Bochs instance is placed in the auto-configured path,
## as we still just call Bochs' Makefile's make install)
#### Setup search path for custom cmake scipts ####
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
#### Compiler configuration, see cmake/compilerconfig.cmake
include(compilerconfig)
#### Backend selection ####
OPTION( BUILD_BOCHS "Build Bochs Variant?" ON)
OPTION( BUILD_GEM5 "Build gem5 Variant?" OFF)
......@@ -66,17 +66,12 @@ include_directories(${CMAKE_BINARY_DIR}/src/core)
## Add CMakeLists from subdirectories:
add_subdirectory(src)
#### Compiler configuration, see cmake/compilerconfig.cmake
# Needs to come after source subdirectories, as we only now know all active .ah files.
include(compilerconfig)
#### Backend-related build system stuff
include(bochs)
include(gem5)
include(ovp)
include(qemu)
include(t32)
## Just for testing:
## Invoking bochs build via external project
# Setup configure call for bochs (-> make ebochs)
......
......@@ -71,7 +71,7 @@ if(BUILD_BOCHS)
set(bochs_src_dir ${PROJECT_SOURCE_DIR}/simulators/bochs)
add_custom_command(OUTPUT "${bochs_src_dir}/libfailbochs.a"
COMMAND +make -C ${bochs_src_dir} CXX=\"ag++ ${AGPP_PARAMETERS} -I${PROJECT_SOURCE_DIR}/src/core -I${CMAKE_BINARY_DIR}/src/core --Xcompiler\" LIBTOOL=\"/bin/sh ./libtool --tag=CXX\" libfailbochs.a
COMMAND +make -C ${bochs_src_dir} CXX=\"ag++ -p ${PROJECT_SOURCE_DIR} -I${PROJECT_SOURCE_DIR}/src/core -I${CMAKE_BINARY_DIR}/src/core ${CMAKE_AGPP_FLAGS} --Xcompiler\" LIBTOOL=\"/bin/sh ./libtool --tag=CXX\" libfailbochs.a
COMMENT "[${PROJECT_NAME}] Building libfailbochs"
)
......
......@@ -18,12 +18,8 @@ elseif(${COMPILER} STREQUAL "ag++")
set(CMAKE_C_COMPILER "ag++")
set(CMAKE_CXX_COMPILER "ag++")
set(CMAKE_AGPP_FLAGS "--real-instances" CACHE STRING "Additional ag++ flags, e.g. --real-instances --keep_woven")
foreach(aspect_header ${CMAKE_ASPECT_HEADERS})
list(APPEND AGPP_ASPECTLIST -a ${aspect_header})
endforeach(aspect_header)
set(AGPP_PARAMETERS ${AGPP_ASPECTLIST} -p ${CMAKE_SOURCE_DIR} ${CMAKE_AGPP_FLAGS})
unset(AGPP_ASPECTLIST)
add_definitions(${AGPP_PARAMETERS} --Xcompiler)
## Here we add the build dir holding the generated header files (protobuf)
add_definitions("-p ${CMAKE_SOURCE_DIR} ${CMAKE_AGPP_FLAGS} --Xcompiler")
else(${COMPILER} STREQUAL "clang")
message(FATAL_ERROR "COMPILER must be exactly one of clang/gcc/ag++. If unsure, use 'ag++'.")
......
macro(add_aspect_headers)
foreach(ah_path ${ARGN})
set(CMAKE_ASPECT_HEADERS ${CMAKE_ASPECT_HEADERS} ${ah_path} CACHE INTERNAL "List of active aspect headers")
endforeach()
endmacro()
......@@ -29,9 +29,6 @@ endforeach(plugin_name)
# (probably there's a smarter way to do that with cmake?)
add_library(fail dummy.cc)
# dummy .ah file to keep the aspect-header list non-empty
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/dummy.ah)
## Setup build dependencies of the Fail* lib
## -> the Fail* targets and user defined experiment targets
# start/end-group: ld must iterate over these archives more than once to figure
......
# common:
set(SRCS
Listener.cc
ListenerManager.cc
SALConfig.cc
Register.cc
SimulatorController.cc
perf/BreakpointBuffer.cc
)
if(CONFIG_FAST_BREAKPOINTS)
add_aspect_headers(
${CMAKE_CURRENT_SOURCE_DIR}/perf/BreakpointControllerSlice.ah
${CMAKE_CURRENT_SOURCE_DIR}/perf/BreakpointManagerSlice.ah
${CMAKE_CURRENT_SOURCE_DIR}/perf/FastBreakpoints.ah)
endif()
if(BUILD_BOCHS)
list(APPEND SRCS
set(SRCS
Listener.cc
ListenerManager.cc
SALConfig.cc
Register.cc
SimulatorController.cc
perf/BreakpointBuffer.cc
bochs/BochsController.cc
bochs/BochsListener.cc
)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/BochsListener.ah)
if(CONFIG_BOCHS_NO_ABORT)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/BochsNoAbort.ah)
endif()
if(CONFIG_BOCHS_NON_VERBOSE)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/BochsNonVerbose.ah)
endif()
if(CONFIG_EVENT_BREAKPOINTS)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/Breakpoints.ah)
endif()
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/Credits.ah)
if(CONFIG_DISABLE_KEYB_INTERRUPTS)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/DisableKeyboardInterrupt.ah)
endif()
add_aspect_headers(
${CMAKE_CURRENT_SOURCE_DIR}/bochs/DisableLogFunctions.ah
${CMAKE_CURRENT_SOURCE_DIR}/bochs/FailBochsInit.ah)
if(CONFIG_FIRE_INTERRUPTS)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/FireInterrupt.ah)
endif()
if(CONFIG_EVENT_GUESTSYS)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/GuestSysCom.ah)
endif()
if(CONFIG_EVENT_INTERRUPT)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/Interrupt.ah)
endif()
if(CONFIG_SUPPRESS_INTERRUPTS)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/InterruptSuppression.ah)
endif()
if(CONFIG_EVENT_IOPORT)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/IOPortCom.ah)
endif()
if(CONFIG_EVENT_JUMP)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/Jump.ah)
endif()
if(CONFIG_EVENT_MEMREAD OR CONFIG_EVENT_MEMWRITE)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/MemAccess.ah)
endif()
if(CONFIG_SR_REBOOT)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/Reboot.ah)
endif()
if(CONFIG_SR_RESTORE)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/RestoreState.ah)
endif()
if(CONFIG_SR_SAVE)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/SaveState.ah)
endif()
if(CONFIG_EVENT_TRAP)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/bochs/Trap.ah)
endif()
elseif(BUILD_GEM5)
list(APPEND SRCS
set(SRCS
Listener.cc
ListenerManager.cc
SALConfig.cc
Register.cc
SimulatorController.cc
perf/BreakpointBuffer.cc
gem5/Gem5Controller.cc
gem5/Gem5PCEvents.cc
)
# note: contrary to the original preprocessor conditional we do not
# depend on CONFIG_EVENT_BREAKPOINTS here (not necessary)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/gem5/Gem5Listener.ah)
elseif(BUILD_OVP)
list(APPEND SRCS
set(SRCS
Listener.cc
ListenerManager.cc
SALConfig.cc
Register.cc
SimulatorController.cc
perf/BreakpointBuffer.cc
${VARIANT}/OVPController.cc
)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/ovp/FailOVPInit.ah)
elseif(BUILD_QEMU)
list(APPEND SRCS
set(SRCS
Listener.cc
ListenerManager.cc
SALConfig.cc
Register.cc
perf/BreakpointBuffer.cc
SimulatorController.cc
qemu/QEMUController.cc
qemu/wrappers.cc
)
# note: contrary to the original preprocessor conditional we do not
# depend on CONFIG_EVENT_BREAKPOINTS here (not necessary)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/qemu/QEMUListener.ah)
elseif(BUILD_T32)
list(APPEND SRCS
set(SRCS
Listener.cc
ListenerManager.cc
SALConfig.cc
Register.cc
perf/BreakpointBuffer.cc
SimulatorController.cc
t32/T32Controller.cc
t32/wrappers.cc
)
# note: contrary to the original preprocessor conditional we do not
# depend on CONFIG_EVENT_BREAKPOINTS here (not necessary)
add_aspect_headers(${CMAKE_CURRENT_SOURCE_DIR}/t32/T32Listener.ah)
endif()
endif(BUILD_BOCHS)
add_library(fail-sal ${SRCS})
......
#ifndef __BOCHS_LISTENER_AH__
#define __BOCHS_LISTENER_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_EVENT_BREAKPOINTS)
#include <cassert>
#include "bochs.h"
#include "BochsListener.hpp"
/*
......@@ -47,4 +51,5 @@ aspect BochsListener {
};
};
#endif // BUILD_BOCHS && CONFIG_EVENT_BREAKPOINTS
#endif // __BOCHS_LISTENER_AH__
#ifndef __BOCHS_NO_ABORT_AH__
#define __BOCHS_NO_ABORT_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_BOCHS_NO_ABORT)
#include "bochs.h"
aspect BochsNoAbort {
......@@ -32,4 +37,5 @@ aspect BochsNoAbort {
}
};
#endif // CONFIG_BOCHS_NO_ABORT
#endif // __BOCHS_NO_ABORT_AH__
#ifndef __BOCHS_NON_VERBOSE_AH__
#define __BOCHS_NON_VERBOSE_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_BOCHS_NON_VERBOSE)
#include "bochs.h"
/*
......@@ -52,4 +57,5 @@ aspect BochsNonVerbose {
: around () { }
};
#endif // CONFIG_BOCHS_NON_VERBOSE
#endif // __BOCHS_NON_VERBOSE_AH__
#ifndef __BREAKPOINTS_AH__
#define __BREAKPOINTS_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_EVENT_BREAKPOINTS)
#include "bochs.h"
#include "cpu/cpu.h"
......@@ -24,4 +29,5 @@ aspect Breakpoints {
}
};
#endif // CONFIG_EVENT_BREAKPOINTS
#endif // __BREAKPOINTS_AH__
#ifndef __CREDITS_AH__
#define __CREDITS_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#ifdef BUILD_BOCHS
#include <string.h>
#include <stdio.h>
#include "config/FailConfig.hpp"
aspect Credits {
bool first;
Credits() : first(true) {}
......@@ -28,4 +31,5 @@ aspect Credits {
}
};
#endif // BUILD_BOCHS
#endif // __CREDITS_AH__
#ifndef __DISABLE_KEYBOARD_INTERRUPT_AH__
#define __DISABLE_KEYBOARD_INTERRUPT_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_DISABLE_KEYB_INTERRUPTS)
#include "iodev/iodev.h"
#include "iodev/keyboard.h"
......@@ -17,4 +22,5 @@ aspect DisableKeyboardInterrupt {
}
};
#endif // CONFIG_DISABLE_KEYB_INTERRUPTS
#endif // __DISABLE_KEYBOARD_INTERRUPT_AH__
#ifndef __DISABLE_ADD_REMOVE_LOGFN_AH__
#define __DISABLE_ADD_REMOVE_LOGFN_AH__
#include "config/VariantConfig.hpp"
#ifdef BUILD_BOCHS
/* Hack to prevent Bochs' logfunctions list (bochs.h) to overflow if the
* experiment restores simulator state more than ~1000 times.
*
......@@ -16,4 +20,5 @@ aspect DisableLogFunctions {
advice execution (add_remove_logfn()) : around () { }
};
#endif // BUILD_BOCHS
#endif // __DISABLE_ADD_REMOVE_LOGFN_AH__
#ifndef __FAIL_BOCHS_INIT_AH__
#define __FAIL_BOCHS_INIT_AH__
#include "config/VariantConfig.hpp"
#ifdef BUILD_BOCHS
#include "../SALInst.hpp"
aspect FailBochsInit {
......@@ -10,4 +14,5 @@ aspect FailBochsInit {
}
};
#endif
#endif // __FAIL_BOCHS_INIT_AH__
#ifndef __FIREINTERRUPT_AH__
#define __FIREINTERRUPT_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_FIRE_INTERRUPTS)
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev/iodev.h"
#include "../SALInst.hpp"
aspect FireInterrupt {
......@@ -37,4 +41,5 @@ aspect InterruptDone {
}
};
#endif // CONFIG_FIRE_INTERRUPTS
#endif // __FIREINTERRUPT_AH__
#ifndef __GUEST_SYS_COM_AH__
#define __GUEST_SYS_COM_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_EVENT_GUESTSYS)
#include "bochs.h"
#include "cpu/cpu.h"
......@@ -24,4 +29,5 @@ aspect GuestSysCom {
}
};
#endif // CONFIG_EVENT_GUESTSYS
#endif // __GUEST_SYS_COM_AH__
#ifndef __IOPORT_COM_AH__
#define __IOPORT_COM_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_EVENT_IOPORT)
#include "bochs.h"
#include "cpu/cpu.h"
#include "../SALInst.hpp"
#include "BochsHelpers.hpp"
// TODO: ATM only capturing bytewise output (most common, I suppose)
......@@ -29,4 +35,5 @@ aspect IOPortCom {
}
};
#endif // CONFIG_EVENT_IOPORT
#endif // __IOPORT_COM_AH__
#ifndef __INTERRUPT_AH__
#define __INTERRUPT_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_EVENT_INTERRUPT)
#include "bochs.h"
#include "cpu/cpu.h"
......@@ -30,4 +35,5 @@ aspect Interrupt {
}
};
#endif // CONFIG_EVENT_INTERRUPT
#endif // __INTERRUPT_AH__
#ifndef __INTERRUPT_SUPPRESSION_AH__
#define __INTERRUPT_SUPPRESSION_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_SUPPRESS_INTERRUPTS)
#include "bochs.h"
#include "cpu/cpu.h"
......@@ -18,4 +23,5 @@ aspect InterruptSuppression {
}
};
#endif // CONFIG_SUPPRESS_INTERRUPTS
#endif // __INTERRUPT_SUPPRESSION_AH__
#ifndef __JUMP_AH__
#define __JUMP_AH__
#include "config/VariantConfig.hpp"
#include "config/FailConfig.hpp"
#if defined(BUILD_BOCHS) && defined(CONFIG_EVENT_JUMP)
#include <iostream>
#include <cstdlib>
#include <string>
#include <ctime>
#include "bochs.h"
#include "../SALInst.hpp"
......@@ -129,4 +135,5 @@ aspect Jump {
}
};
#endif // CONFIG_EVENT_JUMP
#endif // __JUMP_AH__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment