diff --git a/CMakeLists.txt b/CMakeLists.txt index 1181a107ed34be8afb08b7c46f41befa899661bb..631883664e960d9c0a0d8a158ece5da59ed67b7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ if(BUILD_OVP) else(BUILD_OVP) message(STATUS "[${PROJECT_NAME}] Building Bochs variant...") ## add necessary additional header search paths. - add_definitions(-I${CMAKE_SOURCE_DIR}/bochs/instrument/stubs/ -I${CMAKE_SOURCE_DIR}/bochs/) + add_definitions(-I${CMAKE_SOURCE_DIR}/simulators/bochs/instrument/stubs/ -I${CMAKE_SOURCE_DIR}/simulators/bochs) SET(VARIANT bochs) endif(BUILD_OVP) @@ -40,11 +40,16 @@ set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") ## Tell the linker where to find the libfail.a link_directories("${LIBRARY_OUTPUT_PATH}") -## Add CMakeLists from subdirectories (at the moment only core) -add_subdirectory(core) +# Add "simulators"-directory to the include path. This allows +# us to use simulator-specific headers in a comfortable way. +include_directories(${CMAKE_BINARY_DIR}/src/core) +# FIXME: this should be in src/core/CMakeLists.txt but actually doesn't work + +## Add CMakeLists from subdirectories: +add_subdirectory(src) if(BUILD_OVP) - add_subdirectory(ovp) + add_subdirectory(simulators/ovp) else(BUILD_OVP) endif(BUILD_OVP) @@ -63,3 +68,9 @@ endif(BUILD_OVP) # BUILD_IN_SOURCE 1 # PREFIX ${BOCHS_PREFIX_DIR} #) +# +#message(STATUS "Include directories are:") +#get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) +#foreach(dir ${dirs}) +# message(STATUS " ${dir}") +#endforeach(dir) diff --git a/cmake/compilerconfig.cmake b/cmake/compilerconfig.cmake index a8b1a3d48636ce14e6d6b0c8d52d5bee108c8929..63ca8599ea660ea06719164527d9893f92cec058 100644 --- a/cmake/compilerconfig.cmake +++ b/cmake/compilerconfig.cmake @@ -31,7 +31,7 @@ message(STATUS "[${PROJECT_NAME}] Compiler: ${CMAKE_C_COMPILER}/${CMAKE_CXX_COMP #### Add some custom targets for the autoconf-based Bochs if(BUILD_BOCHS) - set(bochs_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/bochs ) + set(bochs_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/simulators/bochs ) add_custom_target( bochsclean COMMAND +make -C ${bochs_src_dir} clean @@ -44,14 +44,14 @@ if(BUILD_BOCHS) ) add_custom_target( bochs - COMMAND +make -C ${bochs_src_dir} CXX=\"ag++ -p ${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/core -I${CMAKE_BINARY_DIR}/core --real-instances --Xcompiler\" LIBTOOL=\"/bin/sh ./libtool --tag=CXX\" + COMMAND +make -C ${bochs_src_dir} CXX=\"ag++ -p ${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/src/core -I${CMAKE_BINARY_DIR}/src/core --real-instances --Xcompiler\" LIBTOOL=\"/bin/sh ./libtool --tag=CXX\" COMMENT "[${PROJECT_NAME}] Building Bochs" ) add_dependencies(bochs fail) add_custom_target( bochsinstall - COMMAND +make -C ${bochs_src_dir} CXX=\"ag++ -p ${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/core -I${CMAKE_BINARY_DIR}/core --real-instances --Xcompiler\" LIBTOOL=\"/bin/sh ./libtool --tag=CXX\" install + COMMAND +make -C ${bochs_src_dir} CXX=\"ag++ -p ${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/src/core -I${CMAKE_BINARY_DIR}/src/core --real-instances --Xcompiler\" LIBTOOL=\"/bin/sh ./libtool --tag=CXX\" install COMMENT "[${PROJECT_NAME}] Installing Bochs..." ) diff --git a/cmake/config_failbochs.sh.in b/cmake/config_failbochs.sh.in index e6920b467065a61018796fbd9022c6a3d93d1278..7cbf7693723f769539b73c00286f13d7bf0264b3 100755 --- a/cmake/config_failbochs.sh.in +++ b/cmake/config_failbochs.sh.in @@ -15,5 +15,5 @@ if [ ! -d "$PREFIX_DIR" ]; then fi -./configure CXX="ag++ -p $SOURCE_DIR -I$SOURCE_DIR/core -I"$BINARY_DIR"/core --real-instances --Xcompiler" LIBTOOL="/bin/sh ./libtool --tag=CXX" --prefix=$PREFIX_DIR --enable-{a20-pin,x86-64,cpu-level=6,ne2000,acpi,pci,usb,repeat-speedups,trace-cache,fast-function-calls,host-specific-asms,disasm,all-optimizations,readline,clgd54xx,fpu,vmx=2,monitor-mwait,cdrom,sb16=linux,gdb-stub} --with-all-libs +./configure CXX="ag++ -p $SOURCE_DIR -I$SOURCE_DIR/src -I"$BINARY_DIR"/src --real-instances --Xcompiler" LIBTOOL="/bin/sh ./libtool --tag=CXX" --prefix=$PREFIX_DIR --enable-{a20-pin,x86-64,cpu-level=6,ne2000,acpi,pci,usb,repeat-speedups,trace-cache,fast-function-calls,host-specific-asms,disasm,all-optimizations,readline,clgd54xx,fpu,vmx=2,monitor-mwait,cdrom,sb16=linux,gdb-stub} --with-all-libs diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt deleted file mode 100644 index 059e661d955d08fe400693c2225b4b2f5a232f90..0000000000000000000000000000000000000000 --- a/core/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -### Setup search paths for headers ## -include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -### Add Boost and Threads -find_package(Boost 1.42 COMPONENTS thread REQUIRED) -find_package(Threads) -include_directories(${Boost_INCLUDE_DIRS}) -link_directories(${Boost_LIBRARY_DIRS}) - -### Setup doxygen documentation -# TODO put into helpers.cmake -find_package(Doxygen) -if(DOXYGEN_FOUND) -# Using a .in file means we can use CMake to insert project settings -# into the doxyfile. For example, CMake will replace @PROJECT_NAME@ in -# a configured file with the CMake PROJECT_NAME variable's value. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in - ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY} -) - -## call make doc to generate documentation -add_custom_target( doc - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "[${PROJECT_NAME}] Generating fail* documentation with Doxygen" VERBATIM -) -endif(DOXYGEN_FOUND) - -## Add CMakeLists from subdirectories ## -# The autogenerated header files -add_subdirectory(config) - -# fail* targets -add_subdirectory(jobserver) -add_subdirectory(controller) -add_subdirectory(SAL) -add_subdirectory(util) - -# Here we add all user-defined experiments (which fills the target list) -add_subdirectory(experiments/) -message(STATUS "[${PROJECT_NAME}] chosen experiment targets:") -foreach(experiment_name ${EXPERIMENTS_ACTIVATED}) - message(STATUS "[${PROJECT_NAME}] -> ${experiment_name}") -endforeach(experiment_name) - -# Here we add activated plugins -add_subdirectory(plugins/) -message(STATUS "[${PROJECT_NAME}] chosen plugin targets:") -foreach(plugin_name ${PLUGINS_ACTIVATED}) - message(STATUS "[${PROJECT_NAME}] -> ${plugin_name}") -endforeach(plugin_name) - -## Merge all resulting fail* libs into a single libfail.a and copy it into the fail source directory -add_custom_target(fail - COMMAND ${CMAKE_SOURCE_DIR}/cmake/mergelib.sh ${LIBRARY_OUTPUT_PATH} && ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/libfail.a ${CMAKE_SOURCE_DIR}/core -) -## Setup build dependencies of the fail* lib -## -> the fail* targets and user defined experiment targets -add_dependencies(fail SAL util controller jobserver protomessages ${EXPERIMENTS_ACTIVATED} ${PLUGINS_ACTIVATED}) - -# Let make clean also delete libfail.a -set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${LIBRARY_OUTPUT_PATH}/libfail.a) diff --git a/core/SAL/bochs/BochsController.hpp b/core/SAL/bochs/BochsController.hpp deleted file mode 100644 index e8e40f1694743361ccc8e6ae0a3e6257b98f7dcb..0000000000000000000000000000000000000000 --- a/core/SAL/bochs/BochsController.hpp +++ /dev/null @@ -1,197 +0,0 @@ -#ifndef __BOCHS_CONTROLLER_HPP__ - #define __BOCHS_CONTROLLER_HPP__ - -#define DEBUG - -#include <string> -#include <cassert> -#include <iostream> -#include <iomanip> -#include <string.h> - -#include "FailBochsGlobals.hpp" - -#include "../SimulatorController.hpp" -#include "../../controller/Event.hpp" - -#include "../../../bochs/bochs.h" -#include "../../../bochs/cpu/cpu.h" -#include "../../../bochs/config.h" -#include "../../../bochs/iodev/iodev.h" -#include "../../../bochs/pc_system.h" - -namespace fail { - -class ExperimentFlow; - -/** - * \class BochsController - * Bochs-specific implementation of a SimulatorController. - */ -class BochsController : public SimulatorController -{ - private: - ExperimentFlow* m_CurrFlow; //!< Stores the current flow for save/restore-operations - #ifdef DEBUG - unsigned m_Regularity; - unsigned m_Counter; - std::ostream* m_pDest; - #endif - /** - * Static internal event handler for TimerEvents. This static function is - * called when a previously registered (Bochs) timer triggers. This function - * searches for the provided TimerEvent object within the EventList and - * fires such an event by calling \c fireActiveEvents(). - * @param thisPtr a pointer to the TimerEvent-object triggered - * - * FIXME: Due to Bochs internal timer and ips-configuration related stuff, - * the simulator sometimes panics with "keyboard error:21" (see line - * 1777 in bios/rombios.c, function keyboard_init()) if a TimerEvent - * is added *before* the bios has been loaded and initialized. To - * reproduce this error, try adding a TimerEvent as the initial step - * in your experiment code and wait for it (addEventAndWait()). - */ - static void m_onTimerTrigger(void *thisPtr); - /** - * Registers a timer in the Bochs simulator. This timer fires \a TimerEvents - * to inform the corresponding experiment-flow. Note that the number of timers - * (in Bochs) is limited to \c BX_MAX_TIMERS (defaults to 64 in v2.4.6). - * @param pev a pointer to the (experiment flow-) allocated TimerEvent object, - * providing all required information to start the time, e.g. the - * timeout value. - * @return \c The unique id of the timer recently created. This id is carried - * along with the TimerEvent, @see getId(). On error, -1 is returned - * (e.g. because a timer with the same id is already existing) - */ - timer_id_t m_registerTimer(TimerEvent* pev); - /** - * Deletes a timer. No further events will be triggered by the timer. - * @param pev a pointer to the TimerEvent-object to be removed - * @return \c true if the timer with \a pev->getId() has been removed - * successfully, \c false otherwise - */ - bool m_unregisterTimer(TimerEvent* pev); - public: - // Initialize the controller. - BochsController(); - ~BochsController(); - /* ******************************************************************** - * Standard Event Handler API: - * ********************************************************************/ - /** - * Instruction pointer modification handler. This method is called (from - * the Breakpoints aspect) every time when the Bochs-internal IP changes. - * @param instrPtr the new instruction pointer - * @param address_space the address space the CPU is currently in - */ - void onInstrPtrChanged(address_t instrPtr, address_t address_space); - /** - * I/O port communication handler. This method is called (from - * the IOPortCom aspect) every time when Bochs performs a port I/O operation. - * @param data the data transmitted - * @param port the port it was transmitted on - * @param out true if the I/O traffic has been outbound, false otherwise - */ - void onIOPortEvent(unsigned char data, unsigned port, bool out); - /** - * This method is called when an experiment flow adds a new event by - * calling \c simulator.addEvent(pev) or \c simulator.addEventAndWait(pev). - * More specifically, the event will be added to the event-list first - * (buffer-list, to be precise) and then this event handler is called. - * @param pev the event which has been added - * @return You should return \c true to continue and \c false to prevent - * the addition of the event \a pev. - */ - bool onEventAddition(BaseEvent* pev); - /** - * This method is called when an experiment flow removes an event from - * the event-management by calling \c removeEvent(prev), \c clearEvents() - * or by deleting a complete flow (\c removeFlow). More specifically, - * this event handler will be called *before* the event is actually deleted. - * @param pev the event to be deleted when returning from the event handler - */ - void onEventDeletion(BaseEvent* pev); - /** - * This method is called when an previously added event is about to be - * triggered by the simulator-backend. More specifically, this event handler - * will be called *before* the event is actually triggered, i.e. before the - * corresponding coroutine is toggled. - * @param pev the event to be triggered when returning from the event handler - */ - void onEventTrigger(BaseEvent* pev); - /* ******************************************************************** - * Simulator Controller & Access API: - * ********************************************************************/ - /** - * Save simulator state. - * @param path Location to store state information - */ - void save(const std::string& path); - /** - * Save finished: Callback from Simulator - */ - void saveDone(); - /** - * Restore simulator state. Clears all Events. - * @param path Location to previously saved state information - */ - void restore(const std::string& path); - /** - * Restore finished: Callback from Simulator - */ - void restoreDone(); - /** - * Reboot simulator. Clears all Events. - */ - void reboot(); - /** - * Reboot finished: Callback from Simulator - */ - void rebootDone(); - /** - * Fire an interrupt. - * @param irq Interrupt to be fired - */ - void fireInterrupt(unsigned irq); - /** - * Fire done: Callback from Simulator - */ - void fireInterruptDone(); - #ifdef DEBUG - /** - * Enables instruction pointer debugging output. - * @param regularity the output regularity; 1 to display every - * instruction pointer, 0 to disable - * @param dest specifies the output destition; defaults to \c std::cout - */ - void dbgEnableInstrPtrOutput(unsigned regularity, std::ostream* dest = &std::cout); - #endif - /* ******************************************************************** - * BochsController-specific (not implemented in SimulatorController!): - * ********************************************************************/ - /** - * Retrieves the textual description (mnemonic) for the current - * instruction. The format of the returned string is Bochs-specific. - * @return the mnemonic of the current instruction whose address - * is given by \c Register::getInstructionPointer(). On - * errors, the returned string is empty - */ - const std::string& getMnemonic() const - { - static std::string str; - bxICacheEntry_c* pEntry = BX_CPU(0)->getICacheEntry(); - assert(pEntry != NULL && "FATAL ERROR: Bochs internal function returned NULL (not expected)!"); - bxInstruction_c* pInstr = pEntry->i; - assert(pInstr != NULL && "FATAL ERROR: Bochs internal member was NULL (not expected)!"); - const char* pszName = get_bx_opcode_name(pInstr->getIaOpcode()); - if (pszName != NULL) - str = pszName; - else - str.clear(); - return str; - } -}; - -} // end-of-namespace: fail - -#endif // __BOCHS_CONTROLLER_HPP__ diff --git a/core/SAL/bochs/BochsMemory.hpp b/core/SAL/bochs/BochsMemory.hpp deleted file mode 100644 index 176831b5b918a5cd36591294ba857df6e0dc58bd..0000000000000000000000000000000000000000 --- a/core/SAL/bochs/BochsMemory.hpp +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef __BOCHS_MEMORY_HPP__ - #define __BOCHS_MEMORY_HPP__ - -#include "../Memory.hpp" - -namespace fail { - -/** - * \class BochsMemoryManager - * Represents a concrete implemenation of the abstract - * MemoryManager to provide access to Bochs' memory pool. - */ -class BochsMemoryManager : public MemoryManager -{ - public: - /** - * Constructs a new MemoryManager object and initializes - * it's attributes appropriately. - */ - BochsMemoryManager() : MemoryManager() { } - /** - * Retrieves the size of the available simulated memory. - * @return the size of the memory pool in bytes - */ - size_t getPoolSize() const - { - return (static_cast<size_t>(BX_MEM(0)->get_memory_len())); - } - /** - * Retrieves the starting address of the host memory. This is the - * first valid address in memory. - * @return the starting address - */ - host_address_t getStartAddr() const - { - return (0); - } - /** - * Retrieves the byte at address \a addr in the memory. - * @param addr The guest address where the byte is located. - * The address is expected to be valid. - * @return the byte at \a addr - */ - byte_t getByte(guest_address_t addr) - { - host_address_t haddr = guestToHost(addr); - assert(haddr != (host_address_t)ADDR_INV && "FATAL ERROR: Invalid guest address provided!"); - return (static_cast<byte_t>(*reinterpret_cast<Bit8u*>(haddr))); - } - /** - * Retrieves \a cnt bytes at address \a addr from the memory. - * @param addr The guest address where the bytes are located. - * The address is expected to be valid. - * @param cnt The number of bytes to be retrieved. \a addr + \a cnt - * is expected to not exceed the memory limit. - * @param dest Pointer to destination buffer to copy the data to. - */ - void getBytes(guest_address_t addr, size_t cnt, void *dest) - { - char *d = static_cast<char *>(dest); - for (size_t i = 0; i < cnt; ++i) { - d[i] = getByte(addr + i); - } - } - /** - * Writes the byte \a data to memory. - * @param addr The guest address to write. - * The address is expected to be valid. - * @param data The new byte to write - */ - void setByte(guest_address_t addr, byte_t data) - { - host_address_t haddr = guestToHost(addr); - assert(haddr != (host_address_t)ADDR_INV && - "FATAL ERROR: Invalid guest address provided!"); - *reinterpret_cast<Bit8u*>(haddr) = data; - } - /** - * Copies data to memory. - * @param addr The guest address to write. - * The address is expected to be valid. - * @param cnt The number of bytes to be retrieved. \a addr + \a cnt - * is expected to not exceed the memory limit. - * @param src Pointer to data to be copied. - */ - void setBytes(guest_address_t addr, size_t cnt, void const *src) - { - char const *s = static_cast<char const *>(src); - for (size_t i = 0; i < cnt; ++i) { - setByte(addr + i, s[i]); - } - } - /** - * Transforms the guest address \a addr to a host address. - * @param addr The (logical) guest address to be transformed - * @return the transformed (host) address or \c ADDR_INV on errors - */ - host_address_t guestToHost(guest_address_t addr) - { - const unsigned SEGMENT_SELECTOR_IDX = 2; // always the code segment - const bx_address logicalAddr = static_cast<bx_address>(addr); // offset within the segment - // Get the linear address: - Bit32u linearAddr = BX_CPU(0)->get_laddr32(SEGMENT_SELECTOR_IDX/*seg*/, logicalAddr/*offset*/); - // Map the linear address to the physical address: - bx_phy_address physicalAddr; - bx_bool fValid = BX_CPU(0)->dbg_xlate_linear2phy(linearAddr, (bx_phy_address*)&physicalAddr); - // Determine the *host* address of the physical address: - Bit8u* hostAddr = BX_MEM(0)->getHostMemAddr(BX_CPU(0), physicalAddr, BX_READ); - // Now, hostAddr contains the "final" address - if(!fValid) - return ((host_address_t)ADDR_INV); // error - else - return (reinterpret_cast<host_address_t>(hostAddr)); // okay - } -}; - -} // end-of-namespace: fail - -#endif // __BOCHS_MEMORY_HPP__ diff --git a/core/SAL/bochs/BochsRegister.hpp b/core/SAL/bochs/BochsRegister.hpp deleted file mode 100644 index 9a74bb4ed6cd003e66837380b930c5020381c2c0..0000000000000000000000000000000000000000 --- a/core/SAL/bochs/BochsRegister.hpp +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __BOCHS_REGISTER_HPP__ - #define __BOCHS_REGISTER_HPP__ - -#include "../Register.hpp" -#include "../../../bochs/bochs.h" - -#include <iostream> -#include <cassert> - -namespace fail { - -/** - * \class BochsRegister - * Bochs-specific implementation of x86 registers. - */ -class BochsRegister : public Register -{ - protected: - regdata_t* m_pData; - public: - /** - * Constructs a new register object. - * @param id the global unique id - * @param width width of the register (8, 16, 32 or 64 bit should - * suffice) - * @param link pointer to bochs interal register memory - * @param t type of the register - */ - BochsRegister(unsigned int id, regwidth_t width, regdata_t* link, RegisterType t) - : Register(id, t, width), m_pData(link) { } - /** - * Retrieves the data of the register. - * @return the current register data - */ - regdata_t getData() { return (*m_pData); } - /** - * Sets the content of the register. - * @param data the new register data to be written - */ - void setData(regdata_t data) { *m_pData = data; } -}; - -/** - * \class BxGPReg - * Bochs-specific implementation of x86 general purpose (GP) registers. - */ -class BxGPReg : public BochsRegister -{ - public: - /** - * Constructs a new general purpose register. - * @param id the global unique id - * @param width width of the register (8, 16, 32 or 64 bit should - * suffice) - * @param link pointer to bochs interal register memory - */ - BxGPReg(unsigned int id, regwidth_t width, regdata_t* link) - : BochsRegister(id, width, link, RT_GP) { } -}; - -/** - * \enum GPRegisterId - * Symbolic identifier to access Bochs' general purpose register - * (within the corresponding GP set), e.g. - * \code - * // Print %eax register data: - * BochsController bc(...); - * cout << bc.getRegisterManager().getSetOfType(RT_GP) - * .getRegister(RID_EAX)->getData(); - * \endcode - */ -enum GPRegisterId -{ - #if BX_SUPPORT_X86_64 // 64 bit register id's: - RID_RAX = 0, RID_RCX, RID_RDX, RID_RBX, RID_RSP, RID_RBP, RID_RSI, RID_RDI, - RID_R8, RID_R9, RID_R10, RID_R11, RID_R12, RID_R13, RID_R14, RID_R15, - #else // 32 bit register id's: - RID_EAX = 0, RID_ECX, RID_EDX, RID_EBX, RID_ESP, RID_EBP, RID_ESI, RID_EDI, - #endif - RID_CAX = 0, RID_CCX, RID_CDX, RID_CBX, RID_CSP, RID_CBP, RID_CSI, RID_CDI, - RID_LAST_GP_ID -}; - -/** - * \enum PCRegisterId - * Symbolic identifier to access Bochs' program counter register. - */ -enum PCRegisterId { RID_PC = RID_LAST_GP_ID, RID_LAST_PC_ID }; - -/** - * \enum FlagsRegisterId - * Symbolic identifier to access Bochs' flags register. - */ -enum FlagsRegisterId { RID_FLAGS = RID_LAST_PC_ID }; - -/** - * \class BxPCReg - * Bochs-specific implementation of the x86 program counter register. - */ -class BxPCReg : public BochsRegister -{ - public: - /** - * Constructs a new program counter register. - * @param id the global unique id - * @param width width of the register (8, 16, 32 or 64 bit should - * suffice) - * @param link pointer to bochs internal register memory - */ - BxPCReg(unsigned int id, regwidth_t width, regdata_t* link) - : BochsRegister(id, width, link, RT_PC) { } -}; - -/** - * \class BxFlagsReg - * Bochs-specific implementation of the FLAGS status register. - */ -class BxFlagsReg : public BochsRegister -{ - public: - /** - * Constructs a new FLAGS status register. The refenced FLAGS are - * allocated as follows: - * -------------------------------------------------- - * 31|30|29|28| 27|26|25|24| 23|22|21|20| 19|18|17|16 - * ==|==|=====| ==|==|==|==| ==|==|==|==| ==|==|==|== - * 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|ID|VP| VF|AC|VM|RF - * - * 15|14|13|12| 11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0 - * ==|==|=====| ==|==|==|==| ==|==|==|==| ==|==|==|== - * 0|NT| IOPL| OF|DF|IF|TF| SF|ZF| 0|AF| 0|PF| 1|CF - * -------------------------------------------------- - * @param id the global unique id - * @param link pointer to bochs internal register memory - */ - BxFlagsReg(unsigned int id, regdata_t* link) - : BochsRegister(id, 32, link, RT_ST) { } - - /** - * Returns \c true if the corresponding flag is set, or \c false - * otherwise. - */ - bool getCarryFlag() const { return (BX_CPU(0)->get_CF()); } - bool getParityFlag() const { return (BX_CPU(0)->get_PF()); } - bool getZeroFlag() const { return (BX_CPU(0)->get_ZF()); } - bool getSignFlag() const { return (BX_CPU(0)->get_SF()); } - bool getOverflowFlag() const { return (BX_CPU(0)->get_OF()); } - - bool getTrapFlag() const { return (BX_CPU(0)->get_TF()); } - bool getInterruptFlag() const { return (BX_CPU(0)->get_IF()); } - bool getDirectionFlag() const { return (BX_CPU(0)->get_DF()); } - unsigned getIOPrivilegeLevel() const { return (BX_CPU(0)->get_IOPL()); } - bool getNestedTaskFlag() const { return (BX_CPU(0)->get_NT()); } - bool getResumeFlag() const { return (BX_CPU(0)->get_RF()); } - bool getVMFlag() const { return (BX_CPU(0)->get_VM()); } - bool getAlignmentCheckFlag() const { return (BX_CPU(0)->get_AC()); } - bool getVInterruptFlag() const { return (BX_CPU(0)->get_VIF()); } - bool getVInterruptPendingFlag() const { return (BX_CPU(0)->get_VIP()); } - bool getIdentificationFlag() const { return (BX_CPU(0)->get_ID()); } - - /** - * Sets/resets various status FLAGS. - */ - void setCarryFlag(bool bit) { BX_CPU(0)->set_CF(bit); } - void setParityFlag(bool bit) { BX_CPU(0)->set_PF(bit); } - void setZeroFlag(bool bit) { BX_CPU(0)->set_ZF(bit); } - void setSignFlag(bool bit) { BX_CPU(0)->set_SF(bit); } - void setOverflowFlag(bool bit) { BX_CPU(0)->set_OF(bit); } - - void setTrapFlag(bool bit) { BX_CPU(0)->set_TF(bit); } - void setInterruptFlag(bool bit) { BX_CPU(0)->set_IF(bit); } - void setDirectionFlag(bool bit) { BX_CPU(0)->set_DF(bit); } - void setIOPrivilegeLevel(unsigned lvl) { BX_CPU(0)->set_IOPL(lvl); } - void setNestedTaskFlag(bool bit) { BX_CPU(0)->set_NT(bit); } - void setResumeFlag(bool bit) { BX_CPU(0)->set_RF(bit); } - void setVMFlag(bool bit) { BX_CPU(0)->set_VM(bit); } - void setAlignmentCheckFlag(bool bit) { BX_CPU(0)->set_AC(bit); } - void setVInterruptFlag(bool bit) { BX_CPU(0)->set_VIF(bit); } - void setVInterruptPendingFlag(bool bit) { BX_CPU(0)->set_VIP(bit); } - void setIdentificationFlag(bool bit) { BX_CPU(0)->set_ID(bit); } - - /** - * Sets the content of the status register. - * @param data the new register data to be written; note that only the - * 32 lower bits are used (bits 32-63 are ignored in 64 bit mode) - */ - void setData(regdata_t data) - { - #ifdef BX_SUPPORT_X86_64 - // We are in 64 bit mode: Just assign the lower 32 bits! - (*m_pData) = ((*m_pData) & 0xFFFFFFFF00000000ULL) | - (data & 0xFFFFFFFFULL); - #else - *m_pData = data; - #endif - } -}; - -/** - * \class BochsRegister - * Bochs-specific implementation of the RegisterManager. - */ -class BochsRegisterManager : public RegisterManager -{ - public: - /** - * Returns the current instruction pointer. - * @return the current eip - */ - address_t getInstructionPointer() - { - return (static_cast<address_t>( - getSetOfType(RT_PC)->first()->getData() - )); - } - /** - * Retruns the top address of the stack. - * @return the starting address of the stack - */ - address_t getStackPointer() - { - #if BX_SUPPORT_X86_64 - return (static_cast<address_t>(getRegister(RID_RSP)->getData())); - #else - return (static_cast<address_t>(getRegister(RID_ESP)->getData())); - #endif - } - /** - * Retrieves the base ptr (holding the address of the - * current stack frame). - * @return the base pointer - */ - address_t getBasePointer() - { - #if BX_SUPPORT_X86_64 - return (static_cast<address_t>(getRegister(RID_RBP)->getData())); - #else - return (static_cast<address_t>(getRegister(RID_EBP)->getData())); - #endif - } -}; - -} // end-of-namespace: fail - -#endif // __BOCHS_REGISTER_HPP__ diff --git a/core/SAL/ovp/OVPController.hpp b/core/SAL/ovp/OVPController.hpp deleted file mode 100644 index 5faf10f391f250498cea34d47e2fb957857defcd..0000000000000000000000000000000000000000 --- a/core/SAL/ovp/OVPController.hpp +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __OVP_CONTROLLER_HPP__ - #define __OVP_CONTROLLER_HPP__ - -#include <string> -#include <cassert> -#include <string.h> -#include <string> - -#include "../SimulatorController.hpp" -#include "../../controller/Event.hpp" -#include "../../../ovp/OVPPlatform.hpp" -#include "../Register.hpp" - -extern OVPPlatform ovpplatform; - -namespace fail { - -/** - * \class OVPController - * OVP-specific implementation of a SimulatorController. - */ -class OVPController : public SimulatorController -{ - private: - //FIXME: This should be obsolete now... - //UniformRegisterSet *set; //(RT_GP); - //UniformRegisterSet *setStatus;//(RT_ST); - //UniformRegisterSet *setPC;//(RT_PC); - - // (FIXME: perhaps this should be declared as a static member) - unsigned int m_currentRegId; - // NOTE: Constants (such as GPRegisterId in SAL/bochs/BochsRegister.hpp) - // are much easier to read... - public: - // Initialize the controller. - OVPController(); - virtual ~OVPController(); - virtual void onInstrPtrChanged(address_t instrPtr); - /** - * Save simulator state. - * @param path Location to store state information - */ - virtual void save(const std::string& path); - /** - * Restore simulator state. - * @param path Location to previously saved state information - */ - virtual void restore(const std::string& path); - /** - * Reboot simulator. - */ - virtual void reboot(); - /** - * Returns the current instruction pointer. - * @return the current eip - */ - void makeGPRegister(int, void*, const std::string&); - void makeSTRegister(Register *, const std::string&); - void makePCRegister(int, void*, const std::string&); - - //DELETE-ME:This should be obsolete now... - /** - * Due to empty RegisterSets are not allowed, OVP platform - * must tell OVPController when it is finished - */ - //void finishedRegisterCreation(); -}; - -} - -#endif // __OVP_CONTROLLER_HPP__ diff --git a/core/SAL/ovp/OVPMemory.hpp b/core/SAL/ovp/OVPMemory.hpp deleted file mode 100644 index 900318c6577762c269905c77adac6e77249d10b2..0000000000000000000000000000000000000000 --- a/core/SAL/ovp/OVPMemory.hpp +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef __OVP_MEMORY_HPP__ - #define __OVP_MEMORY_HPP__ - -#include "../Memory.hpp" - -namespace fail { - -/** - * \class OVPMemoryManager - * Represents a concrete implemenation of the abstract - * MemoryManager to provide access to OVP's memory pool. - */ -class OVPMemoryManager : public MemoryManager -{ - public: - /** - * Constructs a new MemoryManager object and initializes - * it's attributes appropriately. - */ - OVPMemoryManager() : MemoryManager() { } - /** - * Retrieves the size of the available simulated memory. - * @return the size of the memory pool in bytes - */ - size_t getPoolSize() const - { - return 0; - } - /** - * Retrieves the starting address of the host memory. This is the - * first valid address in memory. - * @return the starting address - */ - host_address_t getStartAddr() const - { - return (0); - } - /** - * Retrieves the byte at address \a addr in the memory. - * @param addr The guest address where the byte is located. - * The address is expected to be valid. - * @return the byte at \a addr - */ - byte_t getByte(guest_address_t addr) - { - return (0); - } - /** - * Retrieves \a cnt bytes at address \a addr in the memory. - * @param addr The guest address where the bytes are located. - * The address is expected to be valid. - * @param cnt the number of bytes to be retrieved. \a addr + \a cnt - * is expected to not exceed the memory limit. - * @param dest Pointer to destination buffer to copy the data to. - */ - void getBytes(guest_address_t addr, size_t cnt, void *dest) - { - } - /** - * Writes the byte \a data to memory. - * @param addr The guest address to write. - * The address is expected to be valid. - * @param data The new byte to write - */ - void setByte(guest_address_t addr, byte_t data) - { - } - /** - * Copies data to memory. - * @param addr The guest address to write. - * The address is expected to be valid. - * @param cnt The number of bytes to be retrieved. \a addr + \a cnt - * is expected to not exceed the memory limit. - * @param src Pointer to data to be copied. - */ - void setBytes(guest_address_t addr, size_t cnt, void const *src) - { - } - /** - * Transforms the guest address \a addr to a host address. - * @param addr The (logical) guest address to be transformed - * @return the transformed (host) address or \c ADDR_INV on errors - */ - host_address_t guestToHost(guest_address_t addr) - { - return (0); - } -}; - -} - -#endif // __OVP_MEMORY_HPP__ diff --git a/core/SAL/ovp/OVPRegister.hpp b/core/SAL/ovp/OVPRegister.hpp deleted file mode 100644 index f5655f14f0258e56306df3c5cf24d90f0ac7af86..0000000000000000000000000000000000000000 --- a/core/SAL/ovp/OVPRegister.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __OVP_REGISTER_HPP__ - #define __OVP_REGISTER_HPP__ - -#include "../Register.hpp" -#include "../../../ovp/OVPPlatform.hpp" -//#include "../../../ovp/OVPStatusRegister.hpp" - -extern OVPPlatform ovpplatform; - -namespace fail { - -/** - * \class OVPRegister - * OVP-specific implementation of x86 registers. - */ -class OVPRegister : public Register -{ - private: - void *reg; - - public: - /** - * Constructs a new register object. - * @param id the unique id of this register (simulator specific) - * @param width width of the register (8, 16, 32 or 64 bit should suffice) - * @param link pointer to bochs internal register memory - * @param t type of the register - */ - OVPRegister(unsigned int id, regwidth_t width, void* link, RegisterType t) - : Register(id, t, width) { - reg = link; - } - /** - * Retrieves the data of the register. - * @return the current register data - */ - regdata_t getData() { return ovpplatform.getRegisterData(reg); } - /** - * Sets the content of the register. - * @param data the new register data to be written - */ - void setData(regdata_t data) { ovpplatform.setRegisterData(reg, data); } -}; - -/** - * \class OVPRegister - * OVP-specific implementation of the RegisterManager. - */ -class OVPRegisterManager : public RegisterManager -{ - public: - /** - * Returns the current instruction pointer. - * @return the current eip - */ - virtual address_t getInstructionPointer() - { - return ovpplatform.getPC(); - } - /** - * Retruns the top address of the stack. - * @return the starting address of the stack - */ - virtual address_t getStackPointer() - { - return ovpplatform.getSP(); - } - /** - * Retrieves the base ptr (holding the address of the - * current stack frame). - * @return the base pointer - */ - virtual address_t getBasePointer() - { - return 0; - } -}; - -} - -#endif // __OVP_REGISTER_HPP__ diff --git a/core/config/variant_config.hpp.in b/core/config/variant_config.hpp.in deleted file mode 100644 index f12fe4dda77870243821b2fc12e92be6ba750b50..0000000000000000000000000000000000000000 --- a/core/config/variant_config.hpp.in +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef VARIANT_CONFIG_H -#define VARIANT_CONFIG_H - -#cmakedefine BUILD_OVP -#cmakedefine BUILD_BOCHS - -#endif diff --git a/core/controller/CMakeLists.txt b/core/controller/CMakeLists.txt deleted file mode 100644 index bba45e8409e26a5f77d4b39dcfe276cf19a91789..0000000000000000000000000000000000000000 --- a/core/controller/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(SRCS - BufferCache.cc - CampaignManager.cc - CoroutineManager.cc - Event.cc - EventList.cc -) - -add_library(controller ${SRCS}) diff --git a/core/controller/CoroutineManager.hpp b/core/controller/CoroutineManager.hpp deleted file mode 100644 index de98bcf7d5e0813a601b1cc4afaa5f0a45826760..0000000000000000000000000000000000000000 --- a/core/controller/CoroutineManager.hpp +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef __COROUTINE_MANAGER_HPP__ - #define __COROUTINE_MANAGER_HPP__ - -#include <map> -#include <stack> - -#include <pcl.h> // the underlying "portable coroutine library" - -namespace fail { - -class ExperimentFlow; - -/** - * \class CoroutineManager - * Manages the experiments flow encapsulated in coroutines. Each - * experiment (flow) has it's associated data structure which is - * represented by the ExperimentData-class. - */ -class CoroutineManager -{ - private: - //! the default stack size for coroutines (= experiment flows) - static const unsigned STACK_SIZE_DEFAULT = 4096*4096; - //! the abstraction for coroutine identification - typedef coroutine_t corohandle_t; - typedef std::map<ExperimentFlow*,corohandle_t> flowmap_t; - //! the mapping "flows <-> coro-handle" - flowmap_t m_Flows; - //! the simulator/backend coroutine handle - corohandle_t m_simCoro; - //! stack of coroutines that explicitly activated another one with toggle() - std::stack<corohandle_t> m_togglerstack; - //! manages the run-calls for each ExperimentFlow-object - static void m_invoke(void* pData); - public: - static const ExperimentFlow* SIM_FLOW; //!< the simulator coroutine flow - - CoroutineManager() : m_simCoro(co_current()) { } - ~CoroutineManager(); - /** - * Creates a new coroutine for the specified experiment flow. - * @param flow the flow to be executed in the newly created coroutine - */ - void create(ExperimentFlow* flow); - /** - * Destroys coroutine for the specified experiment flow. - * @param flow the flow to be removed - */ - void remove(ExperimentFlow* flow); - /** - * Switches the control flow to the experiment \a flow. If \a flow is - * equal to \c SIM_FLOW, the control will be handed back to the - * simulator. The current control flow is pushed onto an - * internal stack. - * @param flow the destination control flow or \c SIM_FLOW (= \c NULL ) - */ - void toggle(ExperimentFlow* flow); - /** - * Gives the control back to the coroutine that toggle()d the - * current one, by drawing from the internal stack built from - * calls to toggle(). - */ - void resume(); - /** - * Retrieves the current (active) coroutine (= flow). - * @return the current experiment flow. - */ - ExperimentFlow* getCurrent(); -}; - -} // end-of-namespace: fail - -#endif // __COROUTINE_MANAGER_HPP__ diff --git a/core/controller/ExperimentFlow.hpp b/core/controller/ExperimentFlow.hpp deleted file mode 100644 index 30546c940c2556e46768221b427b44278f2ceec7..0000000000000000000000000000000000000000 --- a/core/controller/ExperimentFlow.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef __EXPERIMENT_FLOW_HPP__ - #define __EXPERIMENT_FLOW_HPP__ - -#include "../SAL/SALInst.hpp" - -namespace fail { - -/** - * \class ExperimentFlow - * Basic interface for user-defined experiments. To create a new experiment, - * derive your own class from ExperimentFlow and define the run method. - */ -class ExperimentFlow -{ - public: - ExperimentFlow() { } - /** - * Defines the experiment flow. - * @return \c true if the experiment was successful, \c false otherwise - */ - virtual bool run() = 0; - /** - * The entry point for this experiment's coroutine. - * Should do some cleanup afterwards. - */ - void coroutine_entry() - { - run(); - simulator.clearEvents(this); // remove residual events - // FIXME: Consider removing this call (see EventList.cc, void remove(ExperimentFlow* flow)) - // a) with the advantage that we will potentially prevent serious segfaults but - // b) with the drawback that we cannot enforce any cleanups. - } -}; - -} // end-of-namespace: fail - -#endif // __EXPERIMENT_FLOW_HPP__ diff --git a/core/controller/Minion.hpp b/core/controller/Minion.hpp deleted file mode 100644 index 915017fbc7143aec33278cd2d405d28a15fbd39f..0000000000000000000000000000000000000000 --- a/core/controller/Minion.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/** - * \brief The representation of a minion. - * - */ - -#ifndef __MINION_HPP__ - #define __MINION_HPP__ - -#include <string> - -#include "controller/ExperimentData.hpp" - -namespace fail { - -/** - * \class Minion - * - * Contains all informations about a minion. - */ -class Minion -{ - private: - std::string hostname; - bool isWorking; - ExperimentData* currentExperimentData; - int sockfd; - public: - Minion() : isWorking(false), currentExperimentData(0), sockfd(-1) { } - /** - * Sets the socket descriptor. - * @param sock the new socket descriptor (used internal) - */ - void setSocketDescriptor(int sock) { sockfd = sock; } - /** - * Retrives the socket descriptor. - * @return the socket descriptor - */ - int getSocketDescriptor() const { return (sockfd); } - /** - * Returns the hostname of the minion. - * @return the hostname - */ - const std::string& getHostname() { return (hostname); } - /** - * Sets the hostname of the minion. - * @param host the hostname - */ - void setHostname(const std::string& host) { hostname = host; } - /** - * Returns the current ExperimentData which the minion is working with. - * @return a pointer of the current ExperimentData - */ - ExperimentData* getCurrentExperimentData() { return currentExperimentData; } - /** - * Sets the current ExperimentData which the minion is working with. - * @param exp the current ExperimentData - */ - void setCurrentExperimentData(ExperimentData* exp) { currentExperimentData = exp; } - /** - * Returns the current state of the minion. - * @return the current state - */ - bool isBusy() { return (isWorking); } - /** - * Sets the current state of the minion - * @param state the current state - */ - void setBusy(bool state) { isWorking = state; } -}; - -} // end-of-namespace: fail - -#endif // __MINION_HPP__ diff --git a/core/experiments/fireinterrupt/experiment.hpp b/core/experiments/fireinterrupt/experiment.hpp deleted file mode 100644 index 8499611702b316b938b6d4820eb50f1af4fe92ed..0000000000000000000000000000000000000000 --- a/core/experiments/fireinterrupt/experiment.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __FIREINTERRUPT_EXPERIMENT_HPP__ - #define __FIREINTERRUPT_EXPERIMENT_HPP__ - -#include "controller/ExperimentFlow.hpp" - -class fireinterruptExperiment : public fail::ExperimentFlow -{ - public: - fireinterruptExperiment() { } - bool run(); -}; - -#endif // __FIREINTERRUPT_EXPERIMENT_HPP__ diff --git a/core/experiments/hscsimple/experiment.hpp b/core/experiments/hscsimple/experiment.hpp deleted file mode 100644 index 68c26204f65f92ab666e8c3ad49219f4ada0ab3b..0000000000000000000000000000000000000000 --- a/core/experiments/hscsimple/experiment.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __HSCSIMPLE_EXPERIMENT_HPP__ - #define __HSCSIMPLE_EXPERIMENT_HPP__ - -#include "controller/ExperimentFlow.hpp" - -class hscsimpleExperiment : public fail::ExperimentFlow -{ - public: - hscsimpleExperiment() { } - - bool run(); -}; - -#endif // __HSCSIMPLE_EXPERIMENT_HPP__ diff --git a/core/experiments/weathermonitor/campaign.hpp b/core/experiments/weathermonitor/campaign.hpp deleted file mode 100644 index d1c02f1ae064fe09e7406ed860ecc63f4d04025c..0000000000000000000000000000000000000000 --- a/core/experiments/weathermonitor/campaign.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __WEATHERMONITOR_CAMPAIGN_HPP__ - #define __WEATHERMONITOR_CAMPAIGN_HPP__ - -#include "controller/Campaign.hpp" -#include "controller/ExperimentData.hpp" -#include "weathermonitor.pb.h" - -class WeathermonitorExperimentData : public fail::ExperimentData { -public: - WeathermonitorProtoMsg msg; - WeathermonitorExperimentData() : fail::ExperimentData(&msg) {} -}; - -class WeathermonitorCampaign : public fail::Campaign { -public: - virtual bool run(); -}; - -#endif // __WEATHERMONITOR_CAMPAIGN_HPP__ diff --git a/core/experiments/weathermonitor/experiment.hpp b/core/experiments/weathermonitor/experiment.hpp deleted file mode 100644 index 9f1daad37d8311c7e46d7e17b1367f6530dfe35d..0000000000000000000000000000000000000000 --- a/core/experiments/weathermonitor/experiment.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __WEATHERMONITOR_EXPERIMENT_HPP__ - #define __WEATHERMONITOR_EXPERIMENT_HPP__ - -#include "controller/ExperimentFlow.hpp" -#include "jobserver/JobClient.hpp" - -class WeathermonitorExperiment : public fail::ExperimentFlow { - fail::JobClient m_jc; -public: - WeathermonitorExperiment() : m_jc("ios.cs.tu-dortmund.de") {} - bool run(); -}; - -#endif // __WEATHERMONITOR_EXPERIMENT_HPP__ diff --git a/core/jobserver/CMakeLists.txt b/core/jobserver/CMakeLists.txt deleted file mode 100644 index c95995ec5b64531e65e9d2853ad006e679d42be3..0000000000000000000000000000000000000000 --- a/core/jobserver/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(SRCS - JobClient.cc - JobServer.cc - SocketComm.cc -) -add_subdirectory(messagedefs) -add_library(jobserver ${SRCS}) -add_dependencies(jobserver protomessages) diff --git a/core/util/Logger.hpp b/core/util/Logger.hpp deleted file mode 100644 index ad5c27f48b85f90f491a7a4957140c642a3ee2a6..0000000000000000000000000000000000000000 --- a/core/util/Logger.hpp +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef __LOGGER_HPP__ - #define __LOGGER_HPP__ - -#include <iostream> -#include <sstream> - -namespace fail { - -/** - * \class Logger - * Provides logging mechanisms. - */ -class Logger -{ - private: - std::ostream* m_pDest; - std::string m_description; - bool m_showTime; - void timestamp(); - - public: - /** - * Constructor. - * @param description Description shown alongside each log entry in - * square brackets [ ]. Can be overridden in single add() calls. - * @param show_time Show a timestamp with each log entry. - * @param dest Stream to log into. - */ - Logger(const std::string& description = "Fail*", bool show_time = true, - std::ostream& dest = std::cout) - : m_pDest(&dest), m_description(description), m_showTime(show_time) { } - /** - * Change the default description which is shown alongside each log - * entry in square brackets [ ]. - * @param descr The description text. - */ - void setDescription(const std::string& descr) - { - m_description = descr; - } - /** - * Change the default option of show_time which shows a timestamp - * each log entry. - * @param choice The choice for show_time - */ - void showTime(bool choice) - { - m_showTime = choice; - } - /** - * Add a new log entry. Returns a std::ostream reference to continue - * streaming a longer log entry. - * @param v data to log - */ - template<class T> - inline std::ostream& operator <<(const T& v) - { - timestamp(); - return (*m_pDest) << v; - } -}; - -} // end-of-namespace: fail - -#endif // __LOGGER_HPP__ diff --git a/core/util/ProtoStream.hpp b/core/util/ProtoStream.hpp deleted file mode 100644 index b190ad3819d8cf3ceaae98404fc4ee13bdf21b11..0000000000000000000000000000000000000000 --- a/core/util/ProtoStream.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/** brief One way to manage large protobuf-messages - * - * Google protobuf is not designed for large messages. - * That leads to much memory which is consumed by processing large - * messages. To solve this problem the ProtoStream class stores the - * protobuf-messages in an other way. - * Instead of using the repeat-function the data is written - * sequentially in a file. - * Written in the format: - * |4 bytes length-information of the first message | first message - * |4 bytes length-information of the second message| second message - * | ... - */ - -#ifndef __PROTOSTREAM_HPP__ - #define __PROTOSTREAM_HPP__ - -#include <iostream> -#include <sys/types.h> -#include <netinet/in.h> -#include <google/protobuf/message.h> - -#include "Logger.hpp" - -namespace fail { - -/** - * \class ProtoOStream - * - * This class can be used to sequentially write a large number of protocol - * buffer messages to a std::ostream. - */ -class ProtoOStream -{ - private: - uint32_t m_size; - - Logger m_log; - std::ostream* m_outfile; - - public: - ProtoOStream(std::ostream *outfile); - virtual ~ProtoOStream() {}; - /** - * Writes a message to a file. - * @param m The protobuf-message to be written. - * @return Returns true on success. - */ - bool writeMessage(google::protobuf::Message* m); -}; - -/** - * \class ProtoIStream - * - * This class can be used to read protocol buffer messages sequentially from a - * std::istream. - */ -class ProtoIStream -{ - private: - uint32_t m_size; - long m_sizeOfInfile; - - Logger m_log; - std::istream *m_infile; - - - public: - ProtoIStream(std::istream *infile); - virtual ~ProtoIStream() {}; - /** - * Resets the position of the get pointer. After that getNext - * reads the first message again. - */ - void reset(); - /** - * Reads the next protobuf message from the input stream. - * @param m The output protobuf message. - * @return Returns true on success. - */ - bool getNext(google::protobuf::Message* m); -}; - -} // end-of-namespace: fail - -#endif // __PROTOSTREAM_HPP__ diff --git a/core/util/SynchronizedCounter.hpp b/core/util/SynchronizedCounter.hpp deleted file mode 100644 index e332609802aa877e90b901dd550d991e1a7c2622..0000000000000000000000000000000000000000 --- a/core/util/SynchronizedCounter.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// Thread safe counter - -#ifndef __SYNCHRONIZED_COUNTER_HPP__ - #define __SYNCHRONIZED_COUNTER_HPP__ - -#ifndef __puma -#include <boost/thread.hpp> -#include <sys/types.h> -#endif - -namespace fail { - -class SynchronizedCounter -{ -private: - int m_counter; -#ifndef __puma - boost::mutex m_mutex; // The mutex to synchronise on -#endif - public: - SynchronizedCounter() : m_counter(0) {}; - - int increment(); - int decrement(); - int getValue(); -}; - -} // end-of-namespace: fail - -#endif // __SYNCHRONIZED_COUNTER_HPP__ diff --git a/deprecated/old-aspects/fireTimer.ah b/deprecated/old-aspects/FireTimer.ah.old similarity index 100% rename from deprecated/old-aspects/fireTimer.ah rename to deprecated/old-aspects/FireTimer.ah.old diff --git a/deprecated/old-aspects/JumpToPreviousCtx.ah b/deprecated/old-aspects/JumpToPreviousCtx.ah.old similarity index 100% rename from deprecated/old-aspects/JumpToPreviousCtx.ah rename to deprecated/old-aspects/JumpToPreviousCtx.ah.old diff --git a/deprecated/old-aspects/MemAccessBitFlip.ah b/deprecated/old-aspects/MemAccessBitFlip.ah.old similarity index 100% rename from deprecated/old-aspects/MemAccessBitFlip.ah rename to deprecated/old-aspects/MemAccessBitFlip.ah.old diff --git a/deprecated/ExperimentDataQueue.cc b/deprecated/old-utils/ExperimentDataQueue.cc similarity index 100% rename from deprecated/ExperimentDataQueue.cc rename to deprecated/old-utils/ExperimentDataQueue.cc diff --git a/deprecated/ExperimentDataQueue.hpp b/deprecated/old-utils/ExperimentDataQueue.hpp similarity index 100% rename from deprecated/ExperimentDataQueue.hpp rename to deprecated/old-utils/ExperimentDataQueue.hpp diff --git a/bochs/.bochsrc b/simulators/bochs/.bochsrc similarity index 100% rename from bochs/.bochsrc rename to simulators/bochs/.bochsrc diff --git a/bochs/.conf.amigaos b/simulators/bochs/.conf.amigaos similarity index 100% rename from bochs/.conf.amigaos rename to simulators/bochs/.conf.amigaos diff --git a/bochs/.conf.beos b/simulators/bochs/.conf.beos similarity index 100% rename from bochs/.conf.beos rename to simulators/bochs/.conf.beos diff --git a/bochs/.conf.everything b/simulators/bochs/.conf.everything similarity index 100% rename from bochs/.conf.everything rename to simulators/bochs/.conf.everything diff --git a/bochs/.conf.linux b/simulators/bochs/.conf.linux similarity index 100% rename from bochs/.conf.linux rename to simulators/bochs/.conf.linux diff --git a/bochs/.conf.macos b/simulators/bochs/.conf.macos similarity index 100% rename from bochs/.conf.macos rename to simulators/bochs/.conf.macos diff --git a/bochs/.conf.macosx b/simulators/bochs/.conf.macosx similarity index 100% rename from bochs/.conf.macosx rename to simulators/bochs/.conf.macosx diff --git a/bochs/.conf.nothing b/simulators/bochs/.conf.nothing similarity index 100% rename from bochs/.conf.nothing rename to simulators/bochs/.conf.nothing diff --git a/bochs/.conf.sparc b/simulators/bochs/.conf.sparc similarity index 100% rename from bochs/.conf.sparc rename to simulators/bochs/.conf.sparc diff --git a/bochs/.conf.win32-cygwin b/simulators/bochs/.conf.win32-cygwin similarity index 100% rename from bochs/.conf.win32-cygwin rename to simulators/bochs/.conf.win32-cygwin diff --git a/bochs/.conf.win32-vcpp b/simulators/bochs/.conf.win32-vcpp similarity index 100% rename from bochs/.conf.win32-vcpp rename to simulators/bochs/.conf.win32-vcpp diff --git a/bochs/CHANGES b/simulators/bochs/CHANGES similarity index 100% rename from bochs/CHANGES rename to simulators/bochs/CHANGES diff --git a/bochs/COPYING b/simulators/bochs/COPYING similarity index 100% rename from bochs/COPYING rename to simulators/bochs/COPYING diff --git a/bochs/Makefile.in b/simulators/bochs/Makefile.in similarity index 98% rename from bochs/Makefile.in rename to simulators/bochs/Makefile.in index 6930d9bf503b4fa697f153480a572ee4802125c1..790ecee4b5e2ee0a2d3e117cf21f3bb5588ef258 100644 --- a/bochs/Makefile.in +++ b/simulators/bochs/Makefile.in @@ -174,12 +174,13 @@ all: @PRIMARY_TARGET@ @PLUGIN_TARGET@ bximage@EXE@ bxcommit@EXE@ @BUILD_DOCBOOK_ @EXTERNAL_DEPENDENCY@ +# DanceOS (added "../../src/libfail.a"): bochs@EXE@: @IODEV_LIB_VAR@ @DEBUGGER_VAR@ \ - cpu/libcpu.a memory/libmemory.a ../core/libfail.a gui/libgui.a \ + cpu/libcpu.a memory/libmemory.a ../../src/libfail.a gui/libgui.a \ @DISASM_VAR@ @INSTRUMENT_VAR@ $(BX_OBJS) \ $(SIMX86_OBJS) @FPU_VAR@ @GDBSTUB_VAR@ @PLUGIN_VAR@ @LINK@ @EXPORT_DYNAMIC@ $(BX_OBJS) $(SIMX86_OBJS) \ - @IODEV_LIB_VAR@ @DEBUGGER_VAR@ cpu/libcpu.a memory/libmemory.a ../core/libfail.a gui/libgui.a \ + @IODEV_LIB_VAR@ @DEBUGGER_VAR@ cpu/libcpu.a memory/libmemory.a ../../src/libfail.a gui/libgui.a \ @DISASM_VAR@ @INSTRUMENT_VAR@ @PLUGIN_VAR@ \ @GDBSTUB_VAR@ @FPU_VAR@ \ @NONPLUGIN_GUI_LINK_OPTS@ \ @@ -189,23 +190,25 @@ bochs@EXE@: @IODEV_LIB_VAR@ @DEBUGGER_VAR@ \ $(EXTRA_LINK_OPTS) \ $(LIBS) +# DanceOS (added ../../src/libfail.a): + # Special make target for cygwin/mingw using dlltool instead of # libtool. This creates a .DEF file, and exports file, an import library, # and then links bochs.exe with the exports file. .win32_dll_plugin_target: @IODEV_LIB_VAR@ @DEBUGGER_VAR@ \ - cpu/libcpu.a memory/libmemory.a ../core/libfail.a gui/libgui.a \ + cpu/libcpu.a memory/libmemory.a ../../src/libfail.a gui/libgui.a \ @DISASM_VAR@ @INSTRUMENT_VAR@ $(BX_OBJS) \ $(SIMX86_OBJS) @FPU_VAR@ @GDBSTUB_VAR@ @PLUGIN_VAR@ $(DLLTOOL) --export-all-symbols --output-def bochs.def \ $(BX_OBJS) $(SIMX86_OBJS) \ - @IODEV_LIB_VAR@ cpu/libcpu.a memory/libmemory.a ../core/libfail.a gui/libgui.a \ + @IODEV_LIB_VAR@ cpu/libcpu.a memory/libmemory.a ../../src/libfail.a gui/libgui.a \ @DEBUGGER_VAR@ @DISASM_VAR@ @INSTRUMENT_VAR@ @PLUGIN_VAR@ \ @GDBSTUB_VAR@ @FPU_VAR@ $(DLLTOOL) --dllname bochs.exe --def bochs.def --output-lib dllexports.a $(DLLTOOL) --dllname bochs.exe --output-exp bochs.exp --def bochs.def $(CXX) -o bochs.exe $(CXXFLAGS) $(LDFLAGS) -export-dynamic \ $(BX_OBJS) bochs.exp $(SIMX86_OBJS) \ - @IODEV_LIB_VAR@ cpu/libcpu.a memory/libmemory.a ../core/libfail.a gui/libgui.a \ + @IODEV_LIB_VAR@ cpu/libcpu.a memory/libmemory.a ../../src/libfail.a gui/libgui.a \ @DEBUGGER_VAR@ @DISASM_VAR@ @INSTRUMENT_VAR@ @PLUGIN_VAR@ \ @GDBSTUB_VAR@ @FPU_VAR@ \ $(GUI_LINK_OPTS) \ diff --git a/bochs/PARAM_TREE.txt b/simulators/bochs/PARAM_TREE.txt similarity index 100% rename from bochs/PARAM_TREE.txt rename to simulators/bochs/PARAM_TREE.txt diff --git a/bochs/README b/simulators/bochs/README similarity index 100% rename from bochs/README rename to simulators/bochs/README diff --git a/bochs/README-plugins b/simulators/bochs/README-plugins similarity index 100% rename from bochs/README-plugins rename to simulators/bochs/README-plugins diff --git a/bochs/README-wxWindows b/simulators/bochs/README-wxWindows similarity index 100% rename from bochs/README-wxWindows rename to simulators/bochs/README-wxWindows diff --git a/bochs/README.rfb b/simulators/bochs/README.rfb similarity index 100% rename from bochs/README.rfb rename to simulators/bochs/README.rfb diff --git a/bochs/TESTFORM.txt b/simulators/bochs/TESTFORM.txt similarity index 100% rename from bochs/TESTFORM.txt rename to simulators/bochs/TESTFORM.txt diff --git a/bochs/TODO b/simulators/bochs/TODO similarity index 100% rename from bochs/TODO rename to simulators/bochs/TODO diff --git a/bochs/aclocal.m4 b/simulators/bochs/aclocal.m4 similarity index 100% rename from bochs/aclocal.m4 rename to simulators/bochs/aclocal.m4 diff --git a/bochs/bios/BIOS-bochs-latest b/simulators/bochs/bios/BIOS-bochs-latest similarity index 100% rename from bochs/bios/BIOS-bochs-latest rename to simulators/bochs/bios/BIOS-bochs-latest diff --git a/bochs/bios/BIOS-bochs-legacy b/simulators/bochs/bios/BIOS-bochs-legacy similarity index 100% rename from bochs/bios/BIOS-bochs-legacy rename to simulators/bochs/bios/BIOS-bochs-legacy diff --git a/bochs/bios/Makefile.in b/simulators/bochs/bios/Makefile.in similarity index 100% rename from bochs/bios/Makefile.in rename to simulators/bochs/bios/Makefile.in diff --git a/bochs/bios/VGABIOS-elpin-2.40 b/simulators/bochs/bios/VGABIOS-elpin-2.40 similarity index 100% rename from bochs/bios/VGABIOS-elpin-2.40 rename to simulators/bochs/bios/VGABIOS-elpin-2.40 diff --git a/bochs/bios/VGABIOS-elpin-LICENSE b/simulators/bochs/bios/VGABIOS-elpin-LICENSE similarity index 100% rename from bochs/bios/VGABIOS-elpin-LICENSE rename to simulators/bochs/bios/VGABIOS-elpin-LICENSE diff --git a/bochs/bios/VGABIOS-lgpl-README b/simulators/bochs/bios/VGABIOS-lgpl-README similarity index 100% rename from bochs/bios/VGABIOS-lgpl-README rename to simulators/bochs/bios/VGABIOS-lgpl-README diff --git a/bochs/bios/VGABIOS-lgpl-latest b/simulators/bochs/bios/VGABIOS-lgpl-latest similarity index 100% rename from bochs/bios/VGABIOS-lgpl-latest rename to simulators/bochs/bios/VGABIOS-lgpl-latest diff --git a/bochs/bios/VGABIOS-lgpl-latest-cirrus b/simulators/bochs/bios/VGABIOS-lgpl-latest-cirrus similarity index 100% rename from bochs/bios/VGABIOS-lgpl-latest-cirrus rename to simulators/bochs/bios/VGABIOS-lgpl-latest-cirrus diff --git a/bochs/bios/VGABIOS-lgpl-latest-cirrus-debug b/simulators/bochs/bios/VGABIOS-lgpl-latest-cirrus-debug similarity index 100% rename from bochs/bios/VGABIOS-lgpl-latest-cirrus-debug rename to simulators/bochs/bios/VGABIOS-lgpl-latest-cirrus-debug diff --git a/bochs/bios/VGABIOS-lgpl-latest-debug b/simulators/bochs/bios/VGABIOS-lgpl-latest-debug similarity index 100% rename from bochs/bios/VGABIOS-lgpl-latest-debug rename to simulators/bochs/bios/VGABIOS-lgpl-latest-debug diff --git a/bochs/bios/acpi-dsdt.dsl b/simulators/bochs/bios/acpi-dsdt.dsl similarity index 100% rename from bochs/bios/acpi-dsdt.dsl rename to simulators/bochs/bios/acpi-dsdt.dsl diff --git a/bochs/bios/acpi-dsdt.hex b/simulators/bochs/bios/acpi-dsdt.hex similarity index 100% rename from bochs/bios/acpi-dsdt.hex rename to simulators/bochs/bios/acpi-dsdt.hex diff --git a/bochs/bios/apmbios.S b/simulators/bochs/bios/apmbios.S similarity index 100% rename from bochs/bios/apmbios.S rename to simulators/bochs/bios/apmbios.S diff --git a/bochs/bios/bios_usage b/simulators/bochs/bios/bios_usage similarity index 100% rename from bochs/bios/bios_usage rename to simulators/bochs/bios/bios_usage diff --git a/bochs/bios/biossums.c b/simulators/bochs/bios/biossums.c similarity index 100% rename from bochs/bios/biossums.c rename to simulators/bochs/bios/biossums.c diff --git a/bochs/bios/makesym.perl b/simulators/bochs/bios/makesym.perl similarity index 100% rename from bochs/bios/makesym.perl rename to simulators/bochs/bios/makesym.perl diff --git a/bochs/bios/notes b/simulators/bochs/bios/notes similarity index 100% rename from bochs/bios/notes rename to simulators/bochs/bios/notes diff --git a/bochs/bios/rombios.c b/simulators/bochs/bios/rombios.c similarity index 100% rename from bochs/bios/rombios.c rename to simulators/bochs/bios/rombios.c diff --git a/bochs/bios/rombios.h b/simulators/bochs/bios/rombios.h similarity index 100% rename from bochs/bios/rombios.h rename to simulators/bochs/bios/rombios.h diff --git a/bochs/bios/rombios32.c b/simulators/bochs/bios/rombios32.c similarity index 100% rename from bochs/bios/rombios32.c rename to simulators/bochs/bios/rombios32.c diff --git a/bochs/bios/rombios32.ld b/simulators/bochs/bios/rombios32.ld similarity index 100% rename from bochs/bios/rombios32.ld rename to simulators/bochs/bios/rombios32.ld diff --git a/bochs/bios/rombios32start.S b/simulators/bochs/bios/rombios32start.S similarity index 100% rename from bochs/bios/rombios32start.S rename to simulators/bochs/bios/rombios32start.S diff --git a/bochs/bios/usage.cc b/simulators/bochs/bios/usage.cc similarity index 100% rename from bochs/bios/usage.cc rename to simulators/bochs/bios/usage.cc diff --git a/bochs/bochs.h b/simulators/bochs/bochs.h similarity index 99% rename from bochs/bochs.h rename to simulators/bochs/bochs.h index 5445f1c31f7b635a9a91428d8322f2b821d116f2..9c1ebed3e3db0e92e6cff35174000dd9b024a78c 100644 --- a/bochs/bochs.h +++ b/simulators/bochs/bochs.h @@ -31,7 +31,7 @@ #include "config.h" /* generated by configure script from config.h.in */ //DanceOS -#include "../core/SAL/bochs/FailBochsGlobals.hpp" +#include "../../src/core/sal/bochs/FailBochsGlobals.hpp" #ifndef __QNXNTO__ extern "C" { diff --git a/bochs/bochsrc-multiple-ne2k b/simulators/bochs/bochsrc-multiple-ne2k similarity index 100% rename from bochs/bochsrc-multiple-ne2k rename to simulators/bochs/bochsrc-multiple-ne2k diff --git a/bochs/build/batch-build.perl b/simulators/bochs/build/batch-build.perl similarity index 100% rename from bochs/build/batch-build.perl rename to simulators/bochs/build/batch-build.perl diff --git a/bochs/build/beos/resource.zip b/simulators/bochs/build/beos/resource.zip similarity index 100% rename from bochs/build/beos/resource.zip rename to simulators/bochs/build/beos/resource.zip diff --git a/bochs/build/debian/README.Debian b/simulators/bochs/build/debian/README.Debian similarity index 100% rename from bochs/build/debian/README.Debian rename to simulators/bochs/build/debian/README.Debian diff --git a/bochs/build/debian/changelog b/simulators/bochs/build/debian/changelog similarity index 100% rename from bochs/build/debian/changelog rename to simulators/bochs/build/debian/changelog diff --git a/bochs/build/debian/conffiles.ex b/simulators/bochs/build/debian/conffiles.ex similarity index 100% rename from bochs/build/debian/conffiles.ex rename to simulators/bochs/build/debian/conffiles.ex diff --git a/bochs/build/debian/control b/simulators/bochs/build/debian/control similarity index 100% rename from bochs/build/debian/control rename to simulators/bochs/build/debian/control diff --git a/bochs/build/debian/copyright b/simulators/bochs/build/debian/copyright similarity index 100% rename from bochs/build/debian/copyright rename to simulators/bochs/build/debian/copyright diff --git a/bochs/build/debian/cron.d.ex b/simulators/bochs/build/debian/cron.d.ex similarity index 100% rename from bochs/build/debian/cron.d.ex rename to simulators/bochs/build/debian/cron.d.ex diff --git a/bochs/build/debian/dirs b/simulators/bochs/build/debian/dirs similarity index 100% rename from bochs/build/debian/dirs rename to simulators/bochs/build/debian/dirs diff --git a/bochs/build/debian/docs b/simulators/bochs/build/debian/docs similarity index 100% rename from bochs/build/debian/docs rename to simulators/bochs/build/debian/docs diff --git a/bochs/build/debian/emacsen-install.ex b/simulators/bochs/build/debian/emacsen-install.ex similarity index 100% rename from bochs/build/debian/emacsen-install.ex rename to simulators/bochs/build/debian/emacsen-install.ex diff --git a/bochs/build/debian/emacsen-remove.ex b/simulators/bochs/build/debian/emacsen-remove.ex similarity index 100% rename from bochs/build/debian/emacsen-remove.ex rename to simulators/bochs/build/debian/emacsen-remove.ex diff --git a/bochs/build/debian/emacsen-startup.ex b/simulators/bochs/build/debian/emacsen-startup.ex similarity index 100% rename from bochs/build/debian/emacsen-startup.ex rename to simulators/bochs/build/debian/emacsen-startup.ex diff --git a/bochs/build/debian/ex.doc-base.package b/simulators/bochs/build/debian/ex.doc-base.package similarity index 100% rename from bochs/build/debian/ex.doc-base.package rename to simulators/bochs/build/debian/ex.doc-base.package diff --git a/bochs/build/debian/init.d.ex b/simulators/bochs/build/debian/init.d.ex similarity index 100% rename from bochs/build/debian/init.d.ex rename to simulators/bochs/build/debian/init.d.ex diff --git a/bochs/build/debian/manpage.1.ex b/simulators/bochs/build/debian/manpage.1.ex similarity index 100% rename from bochs/build/debian/manpage.1.ex rename to simulators/bochs/build/debian/manpage.1.ex diff --git a/bochs/build/debian/manpage.sgml.ex b/simulators/bochs/build/debian/manpage.sgml.ex similarity index 100% rename from bochs/build/debian/manpage.sgml.ex rename to simulators/bochs/build/debian/manpage.sgml.ex diff --git a/bochs/build/debian/menu.ex b/simulators/bochs/build/debian/menu.ex similarity index 100% rename from bochs/build/debian/menu.ex rename to simulators/bochs/build/debian/menu.ex diff --git a/bochs/build/debian/postinst b/simulators/bochs/build/debian/postinst similarity index 100% rename from bochs/build/debian/postinst rename to simulators/bochs/build/debian/postinst diff --git a/bochs/build/debian/postinst.ex b/simulators/bochs/build/debian/postinst.ex similarity index 100% rename from bochs/build/debian/postinst.ex rename to simulators/bochs/build/debian/postinst.ex diff --git a/bochs/build/debian/postrm.ex b/simulators/bochs/build/debian/postrm.ex similarity index 100% rename from bochs/build/debian/postrm.ex rename to simulators/bochs/build/debian/postrm.ex diff --git a/bochs/build/debian/preinst.ex b/simulators/bochs/build/debian/preinst.ex similarity index 100% rename from bochs/build/debian/preinst.ex rename to simulators/bochs/build/debian/preinst.ex diff --git a/bochs/build/debian/prerm.ex b/simulators/bochs/build/debian/prerm.ex similarity index 100% rename from bochs/build/debian/prerm.ex rename to simulators/bochs/build/debian/prerm.ex diff --git a/bochs/build/debian/rules b/simulators/bochs/build/debian/rules similarity index 100% rename from bochs/build/debian/rules rename to simulators/bochs/build/debian/rules diff --git a/bochs/build/debian/watch.ex b/simulators/bochs/build/debian/watch.ex similarity index 100% rename from bochs/build/debian/watch.ex rename to simulators/bochs/build/debian/watch.ex diff --git a/bochs/build/linux/README.linux-binary b/simulators/bochs/build/linux/README.linux-binary similarity index 100% rename from bochs/build/linux/README.linux-binary rename to simulators/bochs/build/linux/README.linux-binary diff --git a/bochs/build/linux/bochs-dlx.in b/simulators/bochs/build/linux/bochs-dlx.in similarity index 100% rename from bochs/build/linux/bochs-dlx.in rename to simulators/bochs/build/linux/bochs-dlx.in diff --git a/bochs/build/macos/CWPro3_project.sit b/simulators/bochs/build/macos/CWPro3_project.sit similarity index 100% rename from bochs/build/macos/CWPro3_project.sit rename to simulators/bochs/build/macos/CWPro3_project.sit diff --git a/bochs/build/macos/bochs.rsrc b/simulators/bochs/build/macos/bochs.rsrc similarity index 100% rename from bochs/build/macos/bochs.rsrc rename to simulators/bochs/build/macos/bochs.rsrc diff --git a/bochs/build/macos/bochsico.bmp b/simulators/bochs/build/macos/bochsico.bmp similarity index 100% rename from bochs/build/macos/bochsico.bmp rename to simulators/bochs/build/macos/bochsico.bmp diff --git a/bochs/build/macos/macos_defines.h b/simulators/bochs/build/macos/macos_defines.h similarity index 100% rename from bochs/build/macos/macos_defines.h rename to simulators/bochs/build/macos/macos_defines.h diff --git a/bochs/build/macosx/Info.plist.in b/simulators/bochs/build/macosx/Info.plist.in similarity index 100% rename from bochs/build/macosx/Info.plist.in rename to simulators/bochs/build/macosx/Info.plist.in diff --git a/bochs/build/macosx/README.macosx-binary b/simulators/bochs/build/macosx/README.macosx-binary similarity index 100% rename from bochs/build/macosx/README.macosx-binary rename to simulators/bochs/build/macosx/README.macosx-binary diff --git a/bochs/build/macosx/bochs-icn.icns b/simulators/bochs/build/macosx/bochs-icn.icns similarity index 100% rename from bochs/build/macosx/bochs-icn.icns rename to simulators/bochs/build/macosx/bochs-icn.icns diff --git a/bochs/build/macosx/bochs.applescript b/simulators/bochs/build/macosx/bochs.applescript similarity index 100% rename from bochs/build/macosx/bochs.applescript rename to simulators/bochs/build/macosx/bochs.applescript diff --git a/bochs/build/macosx/bochs.r b/simulators/bochs/build/macosx/bochs.r similarity index 100% rename from bochs/build/macosx/bochs.r rename to simulators/bochs/build/macosx/bochs.r diff --git a/bochs/build/macosx/diskimage.pl b/simulators/bochs/build/macosx/diskimage.pl similarity index 100% rename from bochs/build/macosx/diskimage.pl rename to simulators/bochs/build/macosx/diskimage.pl diff --git a/bochs/build/macosx/make-dmg.sh b/simulators/bochs/build/macosx/make-dmg.sh similarity index 100% rename from bochs/build/macosx/make-dmg.sh rename to simulators/bochs/build/macosx/make-dmg.sh diff --git a/bochs/build/macosx/pbdevelopment.plist b/simulators/bochs/build/macosx/pbdevelopment.plist similarity index 100% rename from bochs/build/macosx/pbdevelopment.plist rename to simulators/bochs/build/macosx/pbdevelopment.plist diff --git a/bochs/build/macosx/script.data b/simulators/bochs/build/macosx/script.data similarity index 100% rename from bochs/build/macosx/script.data rename to simulators/bochs/build/macosx/script.data diff --git a/bochs/build/macosx/script.r b/simulators/bochs/build/macosx/script.r similarity index 100% rename from bochs/build/macosx/script.r rename to simulators/bochs/build/macosx/script.r diff --git a/bochs/build/makeall.sh b/simulators/bochs/build/makeall.sh similarity index 100% rename from bochs/build/makeall.sh rename to simulators/bochs/build/makeall.sh diff --git a/bochs/build/redhat/NOTES b/simulators/bochs/build/redhat/NOTES similarity index 100% rename from bochs/build/redhat/NOTES rename to simulators/bochs/build/redhat/NOTES diff --git a/bochs/build/redhat/bochs.rpmspec.template b/simulators/bochs/build/redhat/bochs.rpmspec.template similarity index 100% rename from bochs/build/redhat/bochs.rpmspec.template rename to simulators/bochs/build/redhat/bochs.rpmspec.template diff --git a/bochs/build/redhat/make-rpm b/simulators/bochs/build/redhat/make-rpm similarity index 100% rename from bochs/build/redhat/make-rpm rename to simulators/bochs/build/redhat/make-rpm diff --git a/bochs/build/win32/README.win32-binary b/simulators/bochs/build/win32/README.win32-binary similarity index 100% rename from bochs/build/win32/README.win32-binary rename to simulators/bochs/build/win32/README.win32-binary diff --git a/bochs/build/win32/bochs.win32.manifest b/simulators/bochs/build/win32/bochs.win32.manifest similarity index 100% rename from bochs/build/win32/bochs.win32.manifest rename to simulators/bochs/build/win32/bochs.win32.manifest diff --git a/bochs/build/win32/bochs.win64.manifest b/simulators/bochs/build/win32/bochs.win64.manifest similarity index 100% rename from bochs/build/win32/bochs.win64.manifest rename to simulators/bochs/build/win32/bochs.win64.manifest diff --git a/bochs/build/win32/cc2cpp b/simulators/bochs/build/win32/cc2cpp similarity index 100% rename from bochs/build/win32/cc2cpp rename to simulators/bochs/build/win32/cc2cpp diff --git a/bochs/build/win32/cpp2cc b/simulators/bochs/build/win32/cpp2cc similarity index 100% rename from bochs/build/win32/cpp2cc rename to simulators/bochs/build/win32/cpp2cc diff --git a/bochs/build/win32/diffcc2cpp b/simulators/bochs/build/win32/diffcc2cpp similarity index 100% rename from bochs/build/win32/diffcc2cpp rename to simulators/bochs/build/win32/diffcc2cpp diff --git a/bochs/build/win32/nsis/Makefile.in b/simulators/bochs/build/win32/nsis/Makefile.in similarity index 100% rename from bochs/build/win32/nsis/Makefile.in rename to simulators/bochs/build/win32/nsis/Makefile.in diff --git a/bochs/build/win32/nsis/bochs.ico b/simulators/bochs/build/win32/nsis/bochs.ico similarity index 100% rename from bochs/build/win32/nsis/bochs.ico rename to simulators/bochs/build/win32/nsis/bochs.ico diff --git a/bochs/build/win32/nsis/bochs.nsi.in b/simulators/bochs/build/win32/nsis/bochs.nsi.in similarity index 100% rename from bochs/build/win32/nsis/bochs.nsi.in rename to simulators/bochs/build/win32/nsis/bochs.nsi.in diff --git a/bochs/build/win32/nsis/lgban.ico b/simulators/bochs/build/win32/nsis/lgban.ico similarity index 100% rename from bochs/build/win32/nsis/lgban.ico rename to simulators/bochs/build/win32/nsis/lgban.ico diff --git a/bochs/build/win32/nsis/logo.ico b/simulators/bochs/build/win32/nsis/logo.ico similarity index 100% rename from bochs/build/win32/nsis/logo.ico rename to simulators/bochs/build/win32/nsis/logo.ico diff --git a/bochs/build/win32/nsis/penguin.ico b/simulators/bochs/build/win32/nsis/penguin.ico similarity index 100% rename from bochs/build/win32/nsis/penguin.ico rename to simulators/bochs/build/win32/nsis/penguin.ico diff --git a/bochs/build/win32/nsis/unbochs.ico b/simulators/bochs/build/win32/nsis/unbochs.ico similarity index 100% rename from bochs/build/win32/nsis/unbochs.ico rename to simulators/bochs/build/win32/nsis/unbochs.ico diff --git a/bochs/build/win32/vs2008ex-workspace.zip b/simulators/bochs/build/win32/vs2008ex-workspace.zip similarity index 100% rename from bochs/build/win32/vs2008ex-workspace.zip rename to simulators/bochs/build/win32/vs2008ex-workspace.zip diff --git a/bochs/bx_debug/Makefile.in b/simulators/bochs/bx_debug/Makefile.in similarity index 100% rename from bochs/bx_debug/Makefile.in rename to simulators/bochs/bx_debug/Makefile.in diff --git a/bochs/bx_debug/dbg_main.cc b/simulators/bochs/bx_debug/dbg_main.cc similarity index 100% rename from bochs/bx_debug/dbg_main.cc rename to simulators/bochs/bx_debug/dbg_main.cc diff --git a/bochs/bx_debug/debug.h b/simulators/bochs/bx_debug/debug.h similarity index 100% rename from bochs/bx_debug/debug.h rename to simulators/bochs/bx_debug/debug.h diff --git a/bochs/bx_debug/lexer.c b/simulators/bochs/bx_debug/lexer.c similarity index 100% rename from bochs/bx_debug/lexer.c rename to simulators/bochs/bx_debug/lexer.c diff --git a/bochs/bx_debug/lexer.l b/simulators/bochs/bx_debug/lexer.l similarity index 100% rename from bochs/bx_debug/lexer.l rename to simulators/bochs/bx_debug/lexer.l diff --git a/bochs/bx_debug/linux.cc b/simulators/bochs/bx_debug/linux.cc similarity index 100% rename from bochs/bx_debug/linux.cc rename to simulators/bochs/bx_debug/linux.cc diff --git a/bochs/bx_debug/make-syscalls-linux.pl b/simulators/bochs/bx_debug/make-syscalls-linux.pl similarity index 100% rename from bochs/bx_debug/make-syscalls-linux.pl rename to simulators/bochs/bx_debug/make-syscalls-linux.pl diff --git a/bochs/bx_debug/parser.c b/simulators/bochs/bx_debug/parser.c similarity index 100% rename from bochs/bx_debug/parser.c rename to simulators/bochs/bx_debug/parser.c diff --git a/bochs/bx_debug/parser.h b/simulators/bochs/bx_debug/parser.h similarity index 100% rename from bochs/bx_debug/parser.h rename to simulators/bochs/bx_debug/parser.h diff --git a/bochs/bx_debug/parser.y b/simulators/bochs/bx_debug/parser.y similarity index 100% rename from bochs/bx_debug/parser.y rename to simulators/bochs/bx_debug/parser.y diff --git a/bochs/bx_debug/symbols.cc b/simulators/bochs/bx_debug/symbols.cc similarity index 100% rename from bochs/bx_debug/symbols.cc rename to simulators/bochs/bx_debug/symbols.cc diff --git a/bochs/bx_debug/syscalls-linux.h b/simulators/bochs/bx_debug/syscalls-linux.h similarity index 100% rename from bochs/bx_debug/syscalls-linux.h rename to simulators/bochs/bx_debug/syscalls-linux.h diff --git a/bochs/bxversion.h.in b/simulators/bochs/bxversion.h.in similarity index 100% rename from bochs/bxversion.h.in rename to simulators/bochs/bxversion.h.in diff --git a/bochs/bxversion.rc.in b/simulators/bochs/bxversion.rc.in similarity index 100% rename from bochs/bxversion.rc.in rename to simulators/bochs/bxversion.rc.in diff --git a/bochs/config.cc b/simulators/bochs/config.cc similarity index 100% rename from bochs/config.cc rename to simulators/bochs/config.cc diff --git a/bochs/config.guess b/simulators/bochs/config.guess similarity index 100% rename from bochs/config.guess rename to simulators/bochs/config.guess diff --git a/bochs/config.h.in b/simulators/bochs/config.h.in similarity index 100% rename from bochs/config.h.in rename to simulators/bochs/config.h.in diff --git a/bochs/config.sub b/simulators/bochs/config.sub similarity index 100% rename from bochs/config.sub rename to simulators/bochs/config.sub diff --git a/bochs/configure b/simulators/bochs/configure similarity index 100% rename from bochs/configure rename to simulators/bochs/configure diff --git a/bochs/configure.in b/simulators/bochs/configure.in similarity index 100% rename from bochs/configure.in rename to simulators/bochs/configure.in diff --git a/bochs/cpu/3dnow.cc b/simulators/bochs/cpu/3dnow.cc similarity index 100% rename from bochs/cpu/3dnow.cc rename to simulators/bochs/cpu/3dnow.cc diff --git a/bochs/cpu/Makefile.in b/simulators/bochs/cpu/Makefile.in similarity index 100% rename from bochs/cpu/Makefile.in rename to simulators/bochs/cpu/Makefile.in diff --git a/bochs/cpu/access.cc b/simulators/bochs/cpu/access.cc similarity index 100% rename from bochs/cpu/access.cc rename to simulators/bochs/cpu/access.cc diff --git a/bochs/cpu/access32.cc b/simulators/bochs/cpu/access32.cc similarity index 100% rename from bochs/cpu/access32.cc rename to simulators/bochs/cpu/access32.cc diff --git a/bochs/cpu/access64.cc b/simulators/bochs/cpu/access64.cc similarity index 100% rename from bochs/cpu/access64.cc rename to simulators/bochs/cpu/access64.cc diff --git a/bochs/cpu/aes.cc b/simulators/bochs/cpu/aes.cc similarity index 100% rename from bochs/cpu/aes.cc rename to simulators/bochs/cpu/aes.cc diff --git a/bochs/cpu/apic.cc b/simulators/bochs/cpu/apic.cc similarity index 100% rename from bochs/cpu/apic.cc rename to simulators/bochs/cpu/apic.cc diff --git a/bochs/cpu/apic.h b/simulators/bochs/cpu/apic.h similarity index 100% rename from bochs/cpu/apic.h rename to simulators/bochs/cpu/apic.h diff --git a/bochs/cpu/arith16.cc b/simulators/bochs/cpu/arith16.cc similarity index 100% rename from bochs/cpu/arith16.cc rename to simulators/bochs/cpu/arith16.cc diff --git a/bochs/cpu/arith32.cc b/simulators/bochs/cpu/arith32.cc similarity index 100% rename from bochs/cpu/arith32.cc rename to simulators/bochs/cpu/arith32.cc diff --git a/bochs/cpu/arith64.cc b/simulators/bochs/cpu/arith64.cc similarity index 100% rename from bochs/cpu/arith64.cc rename to simulators/bochs/cpu/arith64.cc diff --git a/bochs/cpu/arith8.cc b/simulators/bochs/cpu/arith8.cc similarity index 100% rename from bochs/cpu/arith8.cc rename to simulators/bochs/cpu/arith8.cc diff --git a/bochs/cpu/bcd.cc b/simulators/bochs/cpu/bcd.cc similarity index 100% rename from bochs/cpu/bcd.cc rename to simulators/bochs/cpu/bcd.cc diff --git a/bochs/cpu/bit.cc b/simulators/bochs/cpu/bit.cc similarity index 100% rename from bochs/cpu/bit.cc rename to simulators/bochs/cpu/bit.cc diff --git a/bochs/cpu/bit16.cc b/simulators/bochs/cpu/bit16.cc similarity index 100% rename from bochs/cpu/bit16.cc rename to simulators/bochs/cpu/bit16.cc diff --git a/bochs/cpu/bit32.cc b/simulators/bochs/cpu/bit32.cc similarity index 100% rename from bochs/cpu/bit32.cc rename to simulators/bochs/cpu/bit32.cc diff --git a/bochs/cpu/bit64.cc b/simulators/bochs/cpu/bit64.cc similarity index 100% rename from bochs/cpu/bit64.cc rename to simulators/bochs/cpu/bit64.cc diff --git a/bochs/cpu/call_far.cc b/simulators/bochs/cpu/call_far.cc similarity index 100% rename from bochs/cpu/call_far.cc rename to simulators/bochs/cpu/call_far.cc diff --git a/bochs/cpu/cpu.cc b/simulators/bochs/cpu/cpu.cc similarity index 100% rename from bochs/cpu/cpu.cc rename to simulators/bochs/cpu/cpu.cc diff --git a/bochs/cpu/cpu.h b/simulators/bochs/cpu/cpu.h similarity index 100% rename from bochs/cpu/cpu.h rename to simulators/bochs/cpu/cpu.h diff --git a/bochs/cpu/cpuid.cc b/simulators/bochs/cpu/cpuid.cc similarity index 100% rename from bochs/cpu/cpuid.cc rename to simulators/bochs/cpu/cpuid.cc diff --git a/bochs/cpu/crc32.cc b/simulators/bochs/cpu/crc32.cc similarity index 100% rename from bochs/cpu/crc32.cc rename to simulators/bochs/cpu/crc32.cc diff --git a/bochs/cpu/crregs.cc b/simulators/bochs/cpu/crregs.cc similarity index 100% rename from bochs/cpu/crregs.cc rename to simulators/bochs/cpu/crregs.cc diff --git a/bochs/cpu/crregs.h b/simulators/bochs/cpu/crregs.h similarity index 100% rename from bochs/cpu/crregs.h rename to simulators/bochs/cpu/crregs.h diff --git a/bochs/cpu/ctrl_xfer16.cc b/simulators/bochs/cpu/ctrl_xfer16.cc similarity index 100% rename from bochs/cpu/ctrl_xfer16.cc rename to simulators/bochs/cpu/ctrl_xfer16.cc diff --git a/bochs/cpu/ctrl_xfer32.cc b/simulators/bochs/cpu/ctrl_xfer32.cc similarity index 100% rename from bochs/cpu/ctrl_xfer32.cc rename to simulators/bochs/cpu/ctrl_xfer32.cc diff --git a/bochs/cpu/ctrl_xfer64.cc b/simulators/bochs/cpu/ctrl_xfer64.cc similarity index 100% rename from bochs/cpu/ctrl_xfer64.cc rename to simulators/bochs/cpu/ctrl_xfer64.cc diff --git a/bochs/cpu/ctrl_xfer_pro.cc b/simulators/bochs/cpu/ctrl_xfer_pro.cc similarity index 100% rename from bochs/cpu/ctrl_xfer_pro.cc rename to simulators/bochs/cpu/ctrl_xfer_pro.cc diff --git a/bochs/cpu/data_xfer16.cc b/simulators/bochs/cpu/data_xfer16.cc similarity index 100% rename from bochs/cpu/data_xfer16.cc rename to simulators/bochs/cpu/data_xfer16.cc diff --git a/bochs/cpu/data_xfer32.cc b/simulators/bochs/cpu/data_xfer32.cc similarity index 100% rename from bochs/cpu/data_xfer32.cc rename to simulators/bochs/cpu/data_xfer32.cc diff --git a/bochs/cpu/data_xfer64.cc b/simulators/bochs/cpu/data_xfer64.cc similarity index 100% rename from bochs/cpu/data_xfer64.cc rename to simulators/bochs/cpu/data_xfer64.cc diff --git a/bochs/cpu/data_xfer8.cc b/simulators/bochs/cpu/data_xfer8.cc similarity index 100% rename from bochs/cpu/data_xfer8.cc rename to simulators/bochs/cpu/data_xfer8.cc diff --git a/bochs/cpu/debugstuff.cc b/simulators/bochs/cpu/debugstuff.cc similarity index 100% rename from bochs/cpu/debugstuff.cc rename to simulators/bochs/cpu/debugstuff.cc diff --git a/bochs/cpu/descriptor.h b/simulators/bochs/cpu/descriptor.h similarity index 100% rename from bochs/cpu/descriptor.h rename to simulators/bochs/cpu/descriptor.h diff --git a/bochs/cpu/exception.cc b/simulators/bochs/cpu/exception.cc similarity index 100% rename from bochs/cpu/exception.cc rename to simulators/bochs/cpu/exception.cc diff --git a/bochs/cpu/fetchdecode.cc b/simulators/bochs/cpu/fetchdecode.cc similarity index 100% rename from bochs/cpu/fetchdecode.cc rename to simulators/bochs/cpu/fetchdecode.cc diff --git a/bochs/cpu/fetchdecode.h b/simulators/bochs/cpu/fetchdecode.h similarity index 100% rename from bochs/cpu/fetchdecode.h rename to simulators/bochs/cpu/fetchdecode.h diff --git a/bochs/cpu/fetchdecode64.cc b/simulators/bochs/cpu/fetchdecode64.cc similarity index 100% rename from bochs/cpu/fetchdecode64.cc rename to simulators/bochs/cpu/fetchdecode64.cc diff --git a/bochs/cpu/fetchdecode_sse.h b/simulators/bochs/cpu/fetchdecode_sse.h similarity index 100% rename from bochs/cpu/fetchdecode_sse.h rename to simulators/bochs/cpu/fetchdecode_sse.h diff --git a/bochs/cpu/fetchdecode_x87.h b/simulators/bochs/cpu/fetchdecode_x87.h similarity index 100% rename from bochs/cpu/fetchdecode_x87.h rename to simulators/bochs/cpu/fetchdecode_x87.h diff --git a/bochs/cpu/flag_ctrl.cc b/simulators/bochs/cpu/flag_ctrl.cc similarity index 100% rename from bochs/cpu/flag_ctrl.cc rename to simulators/bochs/cpu/flag_ctrl.cc diff --git a/bochs/cpu/flag_ctrl_pro.cc b/simulators/bochs/cpu/flag_ctrl_pro.cc similarity index 100% rename from bochs/cpu/flag_ctrl_pro.cc rename to simulators/bochs/cpu/flag_ctrl_pro.cc diff --git a/bochs/cpu/fpu_emu.cc b/simulators/bochs/cpu/fpu_emu.cc similarity index 100% rename from bochs/cpu/fpu_emu.cc rename to simulators/bochs/cpu/fpu_emu.cc diff --git a/bochs/cpu/i387.h b/simulators/bochs/cpu/i387.h similarity index 100% rename from bochs/cpu/i387.h rename to simulators/bochs/cpu/i387.h diff --git a/bochs/cpu/ia_opcodes.h b/simulators/bochs/cpu/ia_opcodes.h similarity index 100% rename from bochs/cpu/ia_opcodes.h rename to simulators/bochs/cpu/ia_opcodes.h diff --git a/bochs/cpu/icache.cc b/simulators/bochs/cpu/icache.cc similarity index 100% rename from bochs/cpu/icache.cc rename to simulators/bochs/cpu/icache.cc diff --git a/bochs/cpu/icache.h b/simulators/bochs/cpu/icache.h similarity index 100% rename from bochs/cpu/icache.h rename to simulators/bochs/cpu/icache.h diff --git a/bochs/cpu/init.cc b/simulators/bochs/cpu/init.cc similarity index 100% rename from bochs/cpu/init.cc rename to simulators/bochs/cpu/init.cc diff --git a/bochs/cpu/instr.h b/simulators/bochs/cpu/instr.h similarity index 100% rename from bochs/cpu/instr.h rename to simulators/bochs/cpu/instr.h diff --git a/bochs/cpu/io.cc b/simulators/bochs/cpu/io.cc similarity index 100% rename from bochs/cpu/io.cc rename to simulators/bochs/cpu/io.cc diff --git a/bochs/cpu/iret.cc b/simulators/bochs/cpu/iret.cc similarity index 100% rename from bochs/cpu/iret.cc rename to simulators/bochs/cpu/iret.cc diff --git a/bochs/cpu/jmp_far.cc b/simulators/bochs/cpu/jmp_far.cc similarity index 100% rename from bochs/cpu/jmp_far.cc rename to simulators/bochs/cpu/jmp_far.cc diff --git a/bochs/cpu/lazy_flags.cc b/simulators/bochs/cpu/lazy_flags.cc similarity index 100% rename from bochs/cpu/lazy_flags.cc rename to simulators/bochs/cpu/lazy_flags.cc diff --git a/bochs/cpu/lazy_flags.h b/simulators/bochs/cpu/lazy_flags.h similarity index 100% rename from bochs/cpu/lazy_flags.h rename to simulators/bochs/cpu/lazy_flags.h diff --git a/bochs/cpu/load.cc b/simulators/bochs/cpu/load.cc similarity index 100% rename from bochs/cpu/load.cc rename to simulators/bochs/cpu/load.cc diff --git a/bochs/cpu/logical16.cc b/simulators/bochs/cpu/logical16.cc similarity index 100% rename from bochs/cpu/logical16.cc rename to simulators/bochs/cpu/logical16.cc diff --git a/bochs/cpu/logical32.cc b/simulators/bochs/cpu/logical32.cc similarity index 100% rename from bochs/cpu/logical32.cc rename to simulators/bochs/cpu/logical32.cc diff --git a/bochs/cpu/logical64.cc b/simulators/bochs/cpu/logical64.cc similarity index 100% rename from bochs/cpu/logical64.cc rename to simulators/bochs/cpu/logical64.cc diff --git a/bochs/cpu/logical8.cc b/simulators/bochs/cpu/logical8.cc similarity index 100% rename from bochs/cpu/logical8.cc rename to simulators/bochs/cpu/logical8.cc diff --git a/bochs/cpu/mmx.cc b/simulators/bochs/cpu/mmx.cc similarity index 100% rename from bochs/cpu/mmx.cc rename to simulators/bochs/cpu/mmx.cc diff --git a/bochs/cpu/model_specific.h b/simulators/bochs/cpu/model_specific.h similarity index 100% rename from bochs/cpu/model_specific.h rename to simulators/bochs/cpu/model_specific.h diff --git a/bochs/cpu/msr.cc b/simulators/bochs/cpu/msr.cc similarity index 100% rename from bochs/cpu/msr.cc rename to simulators/bochs/cpu/msr.cc diff --git a/bochs/cpu/mult16.cc b/simulators/bochs/cpu/mult16.cc similarity index 100% rename from bochs/cpu/mult16.cc rename to simulators/bochs/cpu/mult16.cc diff --git a/bochs/cpu/mult32.cc b/simulators/bochs/cpu/mult32.cc similarity index 100% rename from bochs/cpu/mult32.cc rename to simulators/bochs/cpu/mult32.cc diff --git a/bochs/cpu/mult64.cc b/simulators/bochs/cpu/mult64.cc similarity index 100% rename from bochs/cpu/mult64.cc rename to simulators/bochs/cpu/mult64.cc diff --git a/bochs/cpu/mult8.cc b/simulators/bochs/cpu/mult8.cc similarity index 100% rename from bochs/cpu/mult8.cc rename to simulators/bochs/cpu/mult8.cc diff --git a/bochs/cpu/paging.cc b/simulators/bochs/cpu/paging.cc similarity index 100% rename from bochs/cpu/paging.cc rename to simulators/bochs/cpu/paging.cc diff --git a/bochs/cpu/proc_ctrl.cc b/simulators/bochs/cpu/proc_ctrl.cc similarity index 100% rename from bochs/cpu/proc_ctrl.cc rename to simulators/bochs/cpu/proc_ctrl.cc diff --git a/bochs/cpu/protect_ctrl.cc b/simulators/bochs/cpu/protect_ctrl.cc similarity index 100% rename from bochs/cpu/protect_ctrl.cc rename to simulators/bochs/cpu/protect_ctrl.cc diff --git a/bochs/cpu/resolver.cc b/simulators/bochs/cpu/resolver.cc similarity index 100% rename from bochs/cpu/resolver.cc rename to simulators/bochs/cpu/resolver.cc diff --git a/bochs/cpu/ret_far.cc b/simulators/bochs/cpu/ret_far.cc similarity index 100% rename from bochs/cpu/ret_far.cc rename to simulators/bochs/cpu/ret_far.cc diff --git a/bochs/cpu/segment_ctrl.cc b/simulators/bochs/cpu/segment_ctrl.cc similarity index 100% rename from bochs/cpu/segment_ctrl.cc rename to simulators/bochs/cpu/segment_ctrl.cc diff --git a/bochs/cpu/segment_ctrl_pro.cc b/simulators/bochs/cpu/segment_ctrl_pro.cc similarity index 100% rename from bochs/cpu/segment_ctrl_pro.cc rename to simulators/bochs/cpu/segment_ctrl_pro.cc diff --git a/bochs/cpu/shift16.cc b/simulators/bochs/cpu/shift16.cc similarity index 100% rename from bochs/cpu/shift16.cc rename to simulators/bochs/cpu/shift16.cc diff --git a/bochs/cpu/shift32.cc b/simulators/bochs/cpu/shift32.cc similarity index 100% rename from bochs/cpu/shift32.cc rename to simulators/bochs/cpu/shift32.cc diff --git a/bochs/cpu/shift64.cc b/simulators/bochs/cpu/shift64.cc similarity index 100% rename from bochs/cpu/shift64.cc rename to simulators/bochs/cpu/shift64.cc diff --git a/bochs/cpu/shift8.cc b/simulators/bochs/cpu/shift8.cc similarity index 100% rename from bochs/cpu/shift8.cc rename to simulators/bochs/cpu/shift8.cc diff --git a/bochs/cpu/smm.cc b/simulators/bochs/cpu/smm.cc similarity index 100% rename from bochs/cpu/smm.cc rename to simulators/bochs/cpu/smm.cc diff --git a/bochs/cpu/smm.h b/simulators/bochs/cpu/smm.h similarity index 100% rename from bochs/cpu/smm.h rename to simulators/bochs/cpu/smm.h diff --git a/bochs/cpu/soft_int.cc b/simulators/bochs/cpu/soft_int.cc similarity index 100% rename from bochs/cpu/soft_int.cc rename to simulators/bochs/cpu/soft_int.cc diff --git a/bochs/cpu/sse.cc b/simulators/bochs/cpu/sse.cc similarity index 100% rename from bochs/cpu/sse.cc rename to simulators/bochs/cpu/sse.cc diff --git a/bochs/cpu/sse_move.cc b/simulators/bochs/cpu/sse_move.cc similarity index 100% rename from bochs/cpu/sse_move.cc rename to simulators/bochs/cpu/sse_move.cc diff --git a/bochs/cpu/sse_pfp.cc b/simulators/bochs/cpu/sse_pfp.cc similarity index 100% rename from bochs/cpu/sse_pfp.cc rename to simulators/bochs/cpu/sse_pfp.cc diff --git a/bochs/cpu/sse_rcp.cc b/simulators/bochs/cpu/sse_rcp.cc similarity index 100% rename from bochs/cpu/sse_rcp.cc rename to simulators/bochs/cpu/sse_rcp.cc diff --git a/bochs/cpu/sse_string.cc b/simulators/bochs/cpu/sse_string.cc similarity index 100% rename from bochs/cpu/sse_string.cc rename to simulators/bochs/cpu/sse_string.cc diff --git a/bochs/cpu/stack.h b/simulators/bochs/cpu/stack.h similarity index 100% rename from bochs/cpu/stack.h rename to simulators/bochs/cpu/stack.h diff --git a/bochs/cpu/stack16.cc b/simulators/bochs/cpu/stack16.cc similarity index 100% rename from bochs/cpu/stack16.cc rename to simulators/bochs/cpu/stack16.cc diff --git a/bochs/cpu/stack32.cc b/simulators/bochs/cpu/stack32.cc similarity index 100% rename from bochs/cpu/stack32.cc rename to simulators/bochs/cpu/stack32.cc diff --git a/bochs/cpu/stack64.cc b/simulators/bochs/cpu/stack64.cc similarity index 100% rename from bochs/cpu/stack64.cc rename to simulators/bochs/cpu/stack64.cc diff --git a/bochs/cpu/string.cc b/simulators/bochs/cpu/string.cc similarity index 100% rename from bochs/cpu/string.cc rename to simulators/bochs/cpu/string.cc diff --git a/bochs/cpu/tasking.cc b/simulators/bochs/cpu/tasking.cc similarity index 100% rename from bochs/cpu/tasking.cc rename to simulators/bochs/cpu/tasking.cc diff --git a/bochs/cpu/todo b/simulators/bochs/cpu/todo similarity index 100% rename from bochs/cpu/todo rename to simulators/bochs/cpu/todo diff --git a/bochs/cpu/vm8086.cc b/simulators/bochs/cpu/vm8086.cc similarity index 100% rename from bochs/cpu/vm8086.cc rename to simulators/bochs/cpu/vm8086.cc diff --git a/bochs/cpu/vmcs.cc b/simulators/bochs/cpu/vmcs.cc similarity index 100% rename from bochs/cpu/vmcs.cc rename to simulators/bochs/cpu/vmcs.cc diff --git a/bochs/cpu/vmexit.cc b/simulators/bochs/cpu/vmexit.cc similarity index 100% rename from bochs/cpu/vmexit.cc rename to simulators/bochs/cpu/vmexit.cc diff --git a/bochs/cpu/vmx.cc b/simulators/bochs/cpu/vmx.cc similarity index 100% rename from bochs/cpu/vmx.cc rename to simulators/bochs/cpu/vmx.cc diff --git a/bochs/cpu/vmx.h b/simulators/bochs/cpu/vmx.h similarity index 100% rename from bochs/cpu/vmx.h rename to simulators/bochs/cpu/vmx.h diff --git a/bochs/cpu/xmm.h b/simulators/bochs/cpu/xmm.h similarity index 100% rename from bochs/cpu/xmm.h rename to simulators/bochs/cpu/xmm.h diff --git a/bochs/cpu/xsave.cc b/simulators/bochs/cpu/xsave.cc similarity index 100% rename from bochs/cpu/xsave.cc rename to simulators/bochs/cpu/xsave.cc diff --git a/bochs/crc.cc b/simulators/bochs/crc.cc similarity index 100% rename from bochs/crc.cc rename to simulators/bochs/crc.cc diff --git a/bochs/disasm/Makefile.in b/simulators/bochs/disasm/Makefile.in similarity index 100% rename from bochs/disasm/Makefile.in rename to simulators/bochs/disasm/Makefile.in diff --git a/bochs/disasm/dis_decode.cc b/simulators/bochs/disasm/dis_decode.cc similarity index 100% rename from bochs/disasm/dis_decode.cc rename to simulators/bochs/disasm/dis_decode.cc diff --git a/bochs/disasm/dis_groups.cc b/simulators/bochs/disasm/dis_groups.cc similarity index 100% rename from bochs/disasm/dis_groups.cc rename to simulators/bochs/disasm/dis_groups.cc diff --git a/bochs/disasm/dis_tables.h b/simulators/bochs/disasm/dis_tables.h similarity index 100% rename from bochs/disasm/dis_tables.h rename to simulators/bochs/disasm/dis_tables.h diff --git a/bochs/disasm/dis_tables.inc b/simulators/bochs/disasm/dis_tables.inc similarity index 100% rename from bochs/disasm/dis_tables.inc rename to simulators/bochs/disasm/dis_tables.inc diff --git a/bochs/disasm/dis_tables_sse.inc b/simulators/bochs/disasm/dis_tables_sse.inc similarity index 100% rename from bochs/disasm/dis_tables_sse.inc rename to simulators/bochs/disasm/dis_tables_sse.inc diff --git a/bochs/disasm/dis_tables_x87.inc b/simulators/bochs/disasm/dis_tables_x87.inc similarity index 100% rename from bochs/disasm/dis_tables_x87.inc rename to simulators/bochs/disasm/dis_tables_x87.inc diff --git a/bochs/disasm/disasm.h b/simulators/bochs/disasm/disasm.h similarity index 100% rename from bochs/disasm/disasm.h rename to simulators/bochs/disasm/disasm.h diff --git a/bochs/disasm/opcodes.inc b/simulators/bochs/disasm/opcodes.inc similarity index 100% rename from bochs/disasm/opcodes.inc rename to simulators/bochs/disasm/opcodes.inc diff --git a/bochs/disasm/resolve.cc b/simulators/bochs/disasm/resolve.cc similarity index 100% rename from bochs/disasm/resolve.cc rename to simulators/bochs/disasm/resolve.cc diff --git a/bochs/disasm/syntax.cc b/simulators/bochs/disasm/syntax.cc similarity index 100% rename from bochs/disasm/syntax.cc rename to simulators/bochs/disasm/syntax.cc diff --git a/bochs/doc/docbook/Makefile.in b/simulators/bochs/doc/docbook/Makefile.in similarity index 100% rename from bochs/doc/docbook/Makefile.in rename to simulators/bochs/doc/docbook/Makefile.in diff --git a/bochs/doc/docbook/Makefile.jade b/simulators/bochs/doc/docbook/Makefile.jade similarity index 100% rename from bochs/doc/docbook/Makefile.jade rename to simulators/bochs/doc/docbook/Makefile.jade diff --git a/bochs/doc/docbook/README b/simulators/bochs/doc/docbook/README similarity index 100% rename from bochs/doc/docbook/README rename to simulators/bochs/doc/docbook/README diff --git a/bochs/doc/docbook/development/development.dbk b/simulators/bochs/doc/docbook/development/development.dbk similarity index 100% rename from bochs/doc/docbook/development/development.dbk rename to simulators/bochs/doc/docbook/development/development.dbk diff --git a/bochs/doc/docbook/documentation/documentation.dbk b/simulators/bochs/doc/docbook/documentation/documentation.dbk similarity index 100% rename from bochs/doc/docbook/documentation/documentation.dbk rename to simulators/bochs/doc/docbook/documentation/documentation.dbk diff --git a/bochs/doc/docbook/fixtitles.pl b/simulators/bochs/doc/docbook/fixtitles.pl similarity index 100% rename from bochs/doc/docbook/fixtitles.pl rename to simulators/bochs/doc/docbook/fixtitles.pl diff --git a/bochs/doc/docbook/images/dlxlinux-in-linux.png b/simulators/bochs/doc/docbook/images/dlxlinux-in-linux.png similarity index 100% rename from bochs/doc/docbook/images/dlxlinux-in-linux.png rename to simulators/bochs/doc/docbook/images/dlxlinux-in-linux.png diff --git a/bochs/doc/docbook/images/headerbar.png b/simulators/bochs/doc/docbook/images/headerbar.png similarity index 100% rename from bochs/doc/docbook/images/headerbar.png rename to simulators/bochs/doc/docbook/images/headerbar.png diff --git a/bochs/doc/docbook/images/undercon.png b/simulators/bochs/doc/docbook/images/undercon.png similarity index 100% rename from bochs/doc/docbook/images/undercon.png rename to simulators/bochs/doc/docbook/images/undercon.png diff --git a/bochs/doc/docbook/include/defs.sgm b/simulators/bochs/doc/docbook/include/defs.sgm similarity index 100% rename from bochs/doc/docbook/include/defs.sgm rename to simulators/bochs/doc/docbook/include/defs.sgm diff --git a/bochs/doc/docbook/index.html b/simulators/bochs/doc/docbook/index.html similarity index 100% rename from bochs/doc/docbook/index.html rename to simulators/bochs/doc/docbook/index.html diff --git a/bochs/doc/docbook/misc.txt b/simulators/bochs/doc/docbook/misc.txt similarity index 100% rename from bochs/doc/docbook/misc.txt rename to simulators/bochs/doc/docbook/misc.txt diff --git a/bochs/doc/docbook/outline.txt b/simulators/bochs/doc/docbook/outline.txt similarity index 100% rename from bochs/doc/docbook/outline.txt rename to simulators/bochs/doc/docbook/outline.txt diff --git a/bochs/doc/docbook/user/user.dbk b/simulators/bochs/doc/docbook/user/user.dbk similarity index 100% rename from bochs/doc/docbook/user/user.dbk rename to simulators/bochs/doc/docbook/user/user.dbk diff --git a/bochs/doc/man/bochs-dlx.1 b/simulators/bochs/doc/man/bochs-dlx.1 similarity index 100% rename from bochs/doc/man/bochs-dlx.1 rename to simulators/bochs/doc/man/bochs-dlx.1 diff --git a/bochs/doc/man/bochs.1 b/simulators/bochs/doc/man/bochs.1 similarity index 100% rename from bochs/doc/man/bochs.1 rename to simulators/bochs/doc/man/bochs.1 diff --git a/bochs/doc/man/bochsrc.5 b/simulators/bochs/doc/man/bochsrc.5 similarity index 100% rename from bochs/doc/man/bochsrc.5 rename to simulators/bochs/doc/man/bochsrc.5 diff --git a/bochs/doc/man/bxcommit.1 b/simulators/bochs/doc/man/bxcommit.1 similarity index 100% rename from bochs/doc/man/bxcommit.1 rename to simulators/bochs/doc/man/bxcommit.1 diff --git a/bochs/doc/man/bximage.1 b/simulators/bochs/doc/man/bximage.1 similarity index 100% rename from bochs/doc/man/bximage.1 rename to simulators/bochs/doc/man/bximage.1 diff --git a/bochs/docs-html/00README b/simulators/bochs/docs-html/00README similarity index 100% rename from bochs/docs-html/00README rename to simulators/bochs/docs-html/00README diff --git a/bochs/docs-html/biossums.txt b/simulators/bochs/docs-html/biossums.txt similarity index 100% rename from bochs/docs-html/biossums.txt rename to simulators/bochs/docs-html/biossums.txt diff --git a/bochs/docs-html/cosimulation.html b/simulators/bochs/docs-html/cosimulation.html similarity index 100% rename from bochs/docs-html/cosimulation.html rename to simulators/bochs/docs-html/cosimulation.html diff --git a/bochs/docs-html/enh_dbg_user_man.txt b/simulators/bochs/docs-html/enh_dbg_user_man.txt similarity index 100% rename from bochs/docs-html/enh_dbg_user_man.txt rename to simulators/bochs/docs-html/enh_dbg_user_man.txt diff --git a/bochs/docs-html/memory.txt b/simulators/bochs/docs-html/memory.txt similarity index 100% rename from bochs/docs-html/memory.txt rename to simulators/bochs/docs-html/memory.txt diff --git a/bochs/docs-html/random.txt b/simulators/bochs/docs-html/random.txt similarity index 100% rename from bochs/docs-html/random.txt rename to simulators/bochs/docs-html/random.txt diff --git a/bochs/dynamic/README b/simulators/bochs/dynamic/README similarity index 100% rename from bochs/dynamic/README rename to simulators/bochs/dynamic/README diff --git a/bochs/extplugin.h b/simulators/bochs/extplugin.h similarity index 100% rename from bochs/extplugin.h rename to simulators/bochs/extplugin.h diff --git a/bochs/font/vga.bitmap.h b/simulators/bochs/font/vga.bitmap.h similarity index 100% rename from bochs/font/vga.bitmap.h rename to simulators/bochs/font/vga.bitmap.h diff --git a/bochs/fpu/Makefile.in b/simulators/bochs/fpu/Makefile.in similarity index 100% rename from bochs/fpu/Makefile.in rename to simulators/bochs/fpu/Makefile.in diff --git a/bochs/fpu/control_w.h b/simulators/bochs/fpu/control_w.h similarity index 100% rename from bochs/fpu/control_w.h rename to simulators/bochs/fpu/control_w.h diff --git a/bochs/fpu/f2xm1.cc b/simulators/bochs/fpu/f2xm1.cc similarity index 100% rename from bochs/fpu/f2xm1.cc rename to simulators/bochs/fpu/f2xm1.cc diff --git a/bochs/fpu/ferr.cc b/simulators/bochs/fpu/ferr.cc similarity index 100% rename from bochs/fpu/ferr.cc rename to simulators/bochs/fpu/ferr.cc diff --git a/bochs/fpu/fpatan.cc b/simulators/bochs/fpu/fpatan.cc similarity index 100% rename from bochs/fpu/fpatan.cc rename to simulators/bochs/fpu/fpatan.cc diff --git a/bochs/fpu/fprem.cc b/simulators/bochs/fpu/fprem.cc similarity index 100% rename from bochs/fpu/fprem.cc rename to simulators/bochs/fpu/fprem.cc diff --git a/bochs/fpu/fpu.cc b/simulators/bochs/fpu/fpu.cc similarity index 100% rename from bochs/fpu/fpu.cc rename to simulators/bochs/fpu/fpu.cc diff --git a/bochs/fpu/fpu_arith.cc b/simulators/bochs/fpu/fpu_arith.cc similarity index 100% rename from bochs/fpu/fpu_arith.cc rename to simulators/bochs/fpu/fpu_arith.cc diff --git a/bochs/fpu/fpu_compare.cc b/simulators/bochs/fpu/fpu_compare.cc similarity index 100% rename from bochs/fpu/fpu_compare.cc rename to simulators/bochs/fpu/fpu_compare.cc diff --git a/bochs/fpu/fpu_const.cc b/simulators/bochs/fpu/fpu_const.cc similarity index 100% rename from bochs/fpu/fpu_const.cc rename to simulators/bochs/fpu/fpu_const.cc diff --git a/bochs/fpu/fpu_constant.h b/simulators/bochs/fpu/fpu_constant.h similarity index 100% rename from bochs/fpu/fpu_constant.h rename to simulators/bochs/fpu/fpu_constant.h diff --git a/bochs/fpu/fpu_load_store.cc b/simulators/bochs/fpu/fpu_load_store.cc similarity index 100% rename from bochs/fpu/fpu_load_store.cc rename to simulators/bochs/fpu/fpu_load_store.cc diff --git a/bochs/fpu/fpu_misc.cc b/simulators/bochs/fpu/fpu_misc.cc similarity index 100% rename from bochs/fpu/fpu_misc.cc rename to simulators/bochs/fpu/fpu_misc.cc diff --git a/bochs/fpu/fpu_tags.cc b/simulators/bochs/fpu/fpu_tags.cc similarity index 100% rename from bochs/fpu/fpu_tags.cc rename to simulators/bochs/fpu/fpu_tags.cc diff --git a/bochs/fpu/fpu_trans.cc b/simulators/bochs/fpu/fpu_trans.cc similarity index 100% rename from bochs/fpu/fpu_trans.cc rename to simulators/bochs/fpu/fpu_trans.cc diff --git a/bochs/fpu/fsincos.cc b/simulators/bochs/fpu/fsincos.cc similarity index 100% rename from bochs/fpu/fsincos.cc rename to simulators/bochs/fpu/fsincos.cc diff --git a/bochs/fpu/fyl2x.cc b/simulators/bochs/fpu/fyl2x.cc similarity index 100% rename from bochs/fpu/fyl2x.cc rename to simulators/bochs/fpu/fyl2x.cc diff --git a/bochs/fpu/poly.cc b/simulators/bochs/fpu/poly.cc similarity index 100% rename from bochs/fpu/poly.cc rename to simulators/bochs/fpu/poly.cc diff --git a/bochs/fpu/softfloat-compare.h b/simulators/bochs/fpu/softfloat-compare.h similarity index 100% rename from bochs/fpu/softfloat-compare.h rename to simulators/bochs/fpu/softfloat-compare.h diff --git a/bochs/fpu/softfloat-macros.h b/simulators/bochs/fpu/softfloat-macros.h similarity index 100% rename from bochs/fpu/softfloat-macros.h rename to simulators/bochs/fpu/softfloat-macros.h diff --git a/bochs/fpu/softfloat-round-pack.cc b/simulators/bochs/fpu/softfloat-round-pack.cc similarity index 100% rename from bochs/fpu/softfloat-round-pack.cc rename to simulators/bochs/fpu/softfloat-round-pack.cc diff --git a/bochs/fpu/softfloat-round-pack.h b/simulators/bochs/fpu/softfloat-round-pack.h similarity index 100% rename from bochs/fpu/softfloat-round-pack.h rename to simulators/bochs/fpu/softfloat-round-pack.h diff --git a/bochs/fpu/softfloat-specialize.cc b/simulators/bochs/fpu/softfloat-specialize.cc similarity index 100% rename from bochs/fpu/softfloat-specialize.cc rename to simulators/bochs/fpu/softfloat-specialize.cc diff --git a/bochs/fpu/softfloat-specialize.h b/simulators/bochs/fpu/softfloat-specialize.h similarity index 100% rename from bochs/fpu/softfloat-specialize.h rename to simulators/bochs/fpu/softfloat-specialize.h diff --git a/bochs/fpu/softfloat.cc b/simulators/bochs/fpu/softfloat.cc similarity index 100% rename from bochs/fpu/softfloat.cc rename to simulators/bochs/fpu/softfloat.cc diff --git a/bochs/fpu/softfloat.h b/simulators/bochs/fpu/softfloat.h similarity index 100% rename from bochs/fpu/softfloat.h rename to simulators/bochs/fpu/softfloat.h diff --git a/bochs/fpu/softfloatx80.cc b/simulators/bochs/fpu/softfloatx80.cc similarity index 100% rename from bochs/fpu/softfloatx80.cc rename to simulators/bochs/fpu/softfloatx80.cc diff --git a/bochs/fpu/softfloatx80.h b/simulators/bochs/fpu/softfloatx80.h similarity index 100% rename from bochs/fpu/softfloatx80.h rename to simulators/bochs/fpu/softfloatx80.h diff --git a/bochs/fpu/status_w.h b/simulators/bochs/fpu/status_w.h similarity index 100% rename from bochs/fpu/status_w.h rename to simulators/bochs/fpu/status_w.h diff --git a/bochs/fpu/tag_w.h b/simulators/bochs/fpu/tag_w.h similarity index 100% rename from bochs/fpu/tag_w.h rename to simulators/bochs/fpu/tag_w.h diff --git a/bochs/fpu/todo b/simulators/bochs/fpu/todo similarity index 100% rename from bochs/fpu/todo rename to simulators/bochs/fpu/todo diff --git a/bochs/gdbstub.cc b/simulators/bochs/gdbstub.cc similarity index 100% rename from bochs/gdbstub.cc rename to simulators/bochs/gdbstub.cc diff --git a/bochs/gui/Makefile.in b/simulators/bochs/gui/Makefile.in similarity index 100% rename from bochs/gui/Makefile.in rename to simulators/bochs/gui/Makefile.in diff --git a/bochs/gui/amigagui.h b/simulators/bochs/gui/amigagui.h similarity index 100% rename from bochs/gui/amigagui.h rename to simulators/bochs/gui/amigagui.h diff --git a/bochs/gui/amigaos.cc b/simulators/bochs/gui/amigaos.cc similarity index 100% rename from bochs/gui/amigaos.cc rename to simulators/bochs/gui/amigaos.cc diff --git a/bochs/gui/beos.cc b/simulators/bochs/gui/beos.cc similarity index 100% rename from bochs/gui/beos.cc rename to simulators/bochs/gui/beos.cc diff --git a/bochs/gui/bitmaps/cdromd.h b/simulators/bochs/gui/bitmaps/cdromd.h similarity index 100% rename from bochs/gui/bitmaps/cdromd.h rename to simulators/bochs/gui/bitmaps/cdromd.h diff --git a/bochs/gui/bitmaps/cdromd.xpm b/simulators/bochs/gui/bitmaps/cdromd.xpm similarity index 100% rename from bochs/gui/bitmaps/cdromd.xpm rename to simulators/bochs/gui/bitmaps/cdromd.xpm diff --git a/bochs/gui/bitmaps/configbutton.h b/simulators/bochs/gui/bitmaps/configbutton.h similarity index 100% rename from bochs/gui/bitmaps/configbutton.h rename to simulators/bochs/gui/bitmaps/configbutton.h diff --git a/bochs/gui/bitmaps/configbutton.xpm b/simulators/bochs/gui/bitmaps/configbutton.xpm similarity index 100% rename from bochs/gui/bitmaps/configbutton.xpm rename to simulators/bochs/gui/bitmaps/configbutton.xpm diff --git a/bochs/gui/bitmaps/copy.h b/simulators/bochs/gui/bitmaps/copy.h similarity index 100% rename from bochs/gui/bitmaps/copy.h rename to simulators/bochs/gui/bitmaps/copy.h diff --git a/bochs/gui/bitmaps/copy.xpm b/simulators/bochs/gui/bitmaps/copy.xpm similarity index 100% rename from bochs/gui/bitmaps/copy.xpm rename to simulators/bochs/gui/bitmaps/copy.xpm diff --git a/bochs/gui/bitmaps/floppya.h b/simulators/bochs/gui/bitmaps/floppya.h similarity index 100% rename from bochs/gui/bitmaps/floppya.h rename to simulators/bochs/gui/bitmaps/floppya.h diff --git a/bochs/gui/bitmaps/floppya.xpm b/simulators/bochs/gui/bitmaps/floppya.xpm similarity index 100% rename from bochs/gui/bitmaps/floppya.xpm rename to simulators/bochs/gui/bitmaps/floppya.xpm diff --git a/bochs/gui/bitmaps/floppyb.h b/simulators/bochs/gui/bitmaps/floppyb.h similarity index 100% rename from bochs/gui/bitmaps/floppyb.h rename to simulators/bochs/gui/bitmaps/floppyb.h diff --git a/bochs/gui/bitmaps/floppyb.xpm b/simulators/bochs/gui/bitmaps/floppyb.xpm similarity index 100% rename from bochs/gui/bitmaps/floppyb.xpm rename to simulators/bochs/gui/bitmaps/floppyb.xpm diff --git a/bochs/gui/bitmaps/mouse.h b/simulators/bochs/gui/bitmaps/mouse.h similarity index 100% rename from bochs/gui/bitmaps/mouse.h rename to simulators/bochs/gui/bitmaps/mouse.h diff --git a/bochs/gui/bitmaps/mouse.xpm b/simulators/bochs/gui/bitmaps/mouse.xpm similarity index 100% rename from bochs/gui/bitmaps/mouse.xpm rename to simulators/bochs/gui/bitmaps/mouse.xpm diff --git a/bochs/gui/bitmaps/paste.h b/simulators/bochs/gui/bitmaps/paste.h similarity index 100% rename from bochs/gui/bitmaps/paste.h rename to simulators/bochs/gui/bitmaps/paste.h diff --git a/bochs/gui/bitmaps/paste.xpm b/simulators/bochs/gui/bitmaps/paste.xpm similarity index 100% rename from bochs/gui/bitmaps/paste.xpm rename to simulators/bochs/gui/bitmaps/paste.xpm diff --git a/bochs/gui/bitmaps/power.h b/simulators/bochs/gui/bitmaps/power.h similarity index 100% rename from bochs/gui/bitmaps/power.h rename to simulators/bochs/gui/bitmaps/power.h diff --git a/bochs/gui/bitmaps/power.xpm b/simulators/bochs/gui/bitmaps/power.xpm similarity index 100% rename from bochs/gui/bitmaps/power.xpm rename to simulators/bochs/gui/bitmaps/power.xpm diff --git a/bochs/gui/bitmaps/reset.h b/simulators/bochs/gui/bitmaps/reset.h similarity index 100% rename from bochs/gui/bitmaps/reset.h rename to simulators/bochs/gui/bitmaps/reset.h diff --git a/bochs/gui/bitmaps/reset.xpm b/simulators/bochs/gui/bitmaps/reset.xpm similarity index 100% rename from bochs/gui/bitmaps/reset.xpm rename to simulators/bochs/gui/bitmaps/reset.xpm diff --git a/bochs/gui/bitmaps/saverestore.h b/simulators/bochs/gui/bitmaps/saverestore.h similarity index 100% rename from bochs/gui/bitmaps/saverestore.h rename to simulators/bochs/gui/bitmaps/saverestore.h diff --git a/bochs/gui/bitmaps/saverestore.xpm b/simulators/bochs/gui/bitmaps/saverestore.xpm similarity index 100% rename from bochs/gui/bitmaps/saverestore.xpm rename to simulators/bochs/gui/bitmaps/saverestore.xpm diff --git a/bochs/gui/bitmaps/snapshot.h b/simulators/bochs/gui/bitmaps/snapshot.h similarity index 100% rename from bochs/gui/bitmaps/snapshot.h rename to simulators/bochs/gui/bitmaps/snapshot.h diff --git a/bochs/gui/bitmaps/snapshot.xpm b/simulators/bochs/gui/bitmaps/snapshot.xpm similarity index 100% rename from bochs/gui/bitmaps/snapshot.xpm rename to simulators/bochs/gui/bitmaps/snapshot.xpm diff --git a/bochs/gui/bitmaps/userbutton.h b/simulators/bochs/gui/bitmaps/userbutton.h similarity index 100% rename from bochs/gui/bitmaps/userbutton.h rename to simulators/bochs/gui/bitmaps/userbutton.h diff --git a/bochs/gui/bitmaps/userbutton.xpm b/simulators/bochs/gui/bitmaps/userbutton.xpm similarity index 100% rename from bochs/gui/bitmaps/userbutton.xpm rename to simulators/bochs/gui/bitmaps/userbutton.xpm diff --git a/bochs/gui/carbon.cc b/simulators/bochs/gui/carbon.cc similarity index 100% rename from bochs/gui/carbon.cc rename to simulators/bochs/gui/carbon.cc diff --git a/bochs/gui/enh_dbg.cc b/simulators/bochs/gui/enh_dbg.cc similarity index 100% rename from bochs/gui/enh_dbg.cc rename to simulators/bochs/gui/enh_dbg.cc diff --git a/bochs/gui/enh_dbg.h b/simulators/bochs/gui/enh_dbg.h similarity index 100% rename from bochs/gui/enh_dbg.h rename to simulators/bochs/gui/enh_dbg.h diff --git a/bochs/gui/gtk_enh_dbg_osdep.cc b/simulators/bochs/gui/gtk_enh_dbg_osdep.cc similarity index 100% rename from bochs/gui/gtk_enh_dbg_osdep.cc rename to simulators/bochs/gui/gtk_enh_dbg_osdep.cc diff --git a/bochs/gui/gui.cc b/simulators/bochs/gui/gui.cc similarity index 100% rename from bochs/gui/gui.cc rename to simulators/bochs/gui/gui.cc diff --git a/bochs/gui/gui.h b/simulators/bochs/gui/gui.h similarity index 100% rename from bochs/gui/gui.h rename to simulators/bochs/gui/gui.h diff --git a/bochs/gui/icon_bochs.h b/simulators/bochs/gui/icon_bochs.h similarity index 100% rename from bochs/gui/icon_bochs.h rename to simulators/bochs/gui/icon_bochs.h diff --git a/bochs/gui/icon_bochs.xpm b/simulators/bochs/gui/icon_bochs.xpm similarity index 100% rename from bochs/gui/icon_bochs.xpm rename to simulators/bochs/gui/icon_bochs.xpm diff --git a/bochs/gui/keymap.cc b/simulators/bochs/gui/keymap.cc similarity index 100% rename from bochs/gui/keymap.cc rename to simulators/bochs/gui/keymap.cc diff --git a/bochs/gui/keymap.h b/simulators/bochs/gui/keymap.h similarity index 100% rename from bochs/gui/keymap.h rename to simulators/bochs/gui/keymap.h diff --git a/bochs/gui/keymaps/convertmap.pl b/simulators/bochs/gui/keymaps/convertmap.pl similarity index 100% rename from bochs/gui/keymaps/convertmap.pl rename to simulators/bochs/gui/keymaps/convertmap.pl diff --git a/bochs/gui/keymaps/sdl-pc-de.map b/simulators/bochs/gui/keymaps/sdl-pc-de.map similarity index 100% rename from bochs/gui/keymaps/sdl-pc-de.map rename to simulators/bochs/gui/keymaps/sdl-pc-de.map diff --git a/bochs/gui/keymaps/sdl-pc-us.map b/simulators/bochs/gui/keymaps/sdl-pc-us.map similarity index 100% rename from bochs/gui/keymaps/sdl-pc-us.map rename to simulators/bochs/gui/keymaps/sdl-pc-us.map diff --git a/bochs/gui/keymaps/x11-pc-be.map b/simulators/bochs/gui/keymaps/x11-pc-be.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-be.map rename to simulators/bochs/gui/keymaps/x11-pc-be.map diff --git a/bochs/gui/keymaps/x11-pc-da.map b/simulators/bochs/gui/keymaps/x11-pc-da.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-da.map rename to simulators/bochs/gui/keymaps/x11-pc-da.map diff --git a/bochs/gui/keymaps/x11-pc-de.map b/simulators/bochs/gui/keymaps/x11-pc-de.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-de.map rename to simulators/bochs/gui/keymaps/x11-pc-de.map diff --git a/bochs/gui/keymaps/x11-pc-es.map b/simulators/bochs/gui/keymaps/x11-pc-es.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-es.map rename to simulators/bochs/gui/keymaps/x11-pc-es.map diff --git a/bochs/gui/keymaps/x11-pc-fr.map b/simulators/bochs/gui/keymaps/x11-pc-fr.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-fr.map rename to simulators/bochs/gui/keymaps/x11-pc-fr.map diff --git a/bochs/gui/keymaps/x11-pc-it.map b/simulators/bochs/gui/keymaps/x11-pc-it.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-it.map rename to simulators/bochs/gui/keymaps/x11-pc-it.map diff --git a/bochs/gui/keymaps/x11-pc-ru.map b/simulators/bochs/gui/keymaps/x11-pc-ru.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-ru.map rename to simulators/bochs/gui/keymaps/x11-pc-ru.map diff --git a/bochs/gui/keymaps/x11-pc-se.map b/simulators/bochs/gui/keymaps/x11-pc-se.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-se.map rename to simulators/bochs/gui/keymaps/x11-pc-se.map diff --git a/bochs/gui/keymaps/x11-pc-si.map b/simulators/bochs/gui/keymaps/x11-pc-si.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-si.map rename to simulators/bochs/gui/keymaps/x11-pc-si.map diff --git a/bochs/gui/keymaps/x11-pc-uk.map b/simulators/bochs/gui/keymaps/x11-pc-uk.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-uk.map rename to simulators/bochs/gui/keymaps/x11-pc-uk.map diff --git a/bochs/gui/keymaps/x11-pc-us.map b/simulators/bochs/gui/keymaps/x11-pc-us.map similarity index 100% rename from bochs/gui/keymaps/x11-pc-us.map rename to simulators/bochs/gui/keymaps/x11-pc-us.map diff --git a/bochs/gui/macintosh.cc b/simulators/bochs/gui/macintosh.cc similarity index 100% rename from bochs/gui/macintosh.cc rename to simulators/bochs/gui/macintosh.cc diff --git a/bochs/gui/nogui.cc b/simulators/bochs/gui/nogui.cc similarity index 100% rename from bochs/gui/nogui.cc rename to simulators/bochs/gui/nogui.cc diff --git a/bochs/gui/paramtree.cc b/simulators/bochs/gui/paramtree.cc similarity index 100% rename from bochs/gui/paramtree.cc rename to simulators/bochs/gui/paramtree.cc diff --git a/bochs/gui/paramtree.h b/simulators/bochs/gui/paramtree.h similarity index 100% rename from bochs/gui/paramtree.h rename to simulators/bochs/gui/paramtree.h diff --git a/bochs/gui/rfb.cc b/simulators/bochs/gui/rfb.cc similarity index 100% rename from bochs/gui/rfb.cc rename to simulators/bochs/gui/rfb.cc diff --git a/bochs/gui/rfb.h b/simulators/bochs/gui/rfb.h similarity index 100% rename from bochs/gui/rfb.h rename to simulators/bochs/gui/rfb.h diff --git a/bochs/gui/rfbkeys.h b/simulators/bochs/gui/rfbkeys.h similarity index 100% rename from bochs/gui/rfbkeys.h rename to simulators/bochs/gui/rfbkeys.h diff --git a/bochs/gui/sdl.cc b/simulators/bochs/gui/sdl.cc similarity index 100% rename from bochs/gui/sdl.cc rename to simulators/bochs/gui/sdl.cc diff --git a/bochs/gui/sdl.h b/simulators/bochs/gui/sdl.h similarity index 100% rename from bochs/gui/sdl.h rename to simulators/bochs/gui/sdl.h diff --git a/bochs/gui/sdlkeys.h b/simulators/bochs/gui/sdlkeys.h similarity index 100% rename from bochs/gui/sdlkeys.h rename to simulators/bochs/gui/sdlkeys.h diff --git a/bochs/gui/siminterface.cc b/simulators/bochs/gui/siminterface.cc similarity index 100% rename from bochs/gui/siminterface.cc rename to simulators/bochs/gui/siminterface.cc diff --git a/bochs/gui/siminterface.h b/simulators/bochs/gui/siminterface.h similarity index 100% rename from bochs/gui/siminterface.h rename to simulators/bochs/gui/siminterface.h diff --git a/bochs/gui/svga.cc b/simulators/bochs/gui/svga.cc similarity index 100% rename from bochs/gui/svga.cc rename to simulators/bochs/gui/svga.cc diff --git a/bochs/gui/term.cc b/simulators/bochs/gui/term.cc similarity index 100% rename from bochs/gui/term.cc rename to simulators/bochs/gui/term.cc diff --git a/bochs/gui/textconfig.cc b/simulators/bochs/gui/textconfig.cc similarity index 100% rename from bochs/gui/textconfig.cc rename to simulators/bochs/gui/textconfig.cc diff --git a/bochs/gui/textconfig.h b/simulators/bochs/gui/textconfig.h similarity index 100% rename from bochs/gui/textconfig.h rename to simulators/bochs/gui/textconfig.h diff --git a/bochs/gui/wenhdbg_res.h b/simulators/bochs/gui/wenhdbg_res.h similarity index 100% rename from bochs/gui/wenhdbg_res.h rename to simulators/bochs/gui/wenhdbg_res.h diff --git a/bochs/gui/win32.cc b/simulators/bochs/gui/win32.cc similarity index 100% rename from bochs/gui/win32.cc rename to simulators/bochs/gui/win32.cc diff --git a/bochs/gui/win32_enh_dbg_osdep.cc b/simulators/bochs/gui/win32_enh_dbg_osdep.cc similarity index 100% rename from bochs/gui/win32_enh_dbg_osdep.cc rename to simulators/bochs/gui/win32_enh_dbg_osdep.cc diff --git a/bochs/gui/win32dialog.cc b/simulators/bochs/gui/win32dialog.cc similarity index 100% rename from bochs/gui/win32dialog.cc rename to simulators/bochs/gui/win32dialog.cc diff --git a/bochs/gui/win32dialog.h b/simulators/bochs/gui/win32dialog.h similarity index 100% rename from bochs/gui/win32dialog.h rename to simulators/bochs/gui/win32dialog.h diff --git a/bochs/gui/win32paramdlg.cc b/simulators/bochs/gui/win32paramdlg.cc similarity index 100% rename from bochs/gui/win32paramdlg.cc rename to simulators/bochs/gui/win32paramdlg.cc diff --git a/bochs/gui/win32paramdlg.h b/simulators/bochs/gui/win32paramdlg.h similarity index 100% rename from bochs/gui/win32paramdlg.h rename to simulators/bochs/gui/win32paramdlg.h diff --git a/bochs/gui/win32res.h b/simulators/bochs/gui/win32res.h similarity index 100% rename from bochs/gui/win32res.h rename to simulators/bochs/gui/win32res.h diff --git a/bochs/gui/wx.cc b/simulators/bochs/gui/wx.cc similarity index 100% rename from bochs/gui/wx.cc rename to simulators/bochs/gui/wx.cc diff --git a/bochs/gui/wxdialog.cc b/simulators/bochs/gui/wxdialog.cc similarity index 100% rename from bochs/gui/wxdialog.cc rename to simulators/bochs/gui/wxdialog.cc diff --git a/bochs/gui/wxdialog.h b/simulators/bochs/gui/wxdialog.h similarity index 100% rename from bochs/gui/wxdialog.h rename to simulators/bochs/gui/wxdialog.h diff --git a/bochs/gui/wxmain.cc b/simulators/bochs/gui/wxmain.cc similarity index 100% rename from bochs/gui/wxmain.cc rename to simulators/bochs/gui/wxmain.cc diff --git a/bochs/gui/wxmain.h b/simulators/bochs/gui/wxmain.h similarity index 100% rename from bochs/gui/wxmain.h rename to simulators/bochs/gui/wxmain.h diff --git a/bochs/gui/x.cc b/simulators/bochs/gui/x.cc similarity index 100% rename from bochs/gui/x.cc rename to simulators/bochs/gui/x.cc diff --git a/bochs/host/linux/pcidev/Make.kbuild b/simulators/bochs/host/linux/pcidev/Make.kbuild similarity index 100% rename from bochs/host/linux/pcidev/Make.kbuild rename to simulators/bochs/host/linux/pcidev/Make.kbuild diff --git a/bochs/host/linux/pcidev/Makefile.in b/simulators/bochs/host/linux/pcidev/Makefile.in similarity index 100% rename from bochs/host/linux/pcidev/Makefile.in rename to simulators/bochs/host/linux/pcidev/Makefile.in diff --git a/bochs/host/linux/pcidev/kernel_pcidev.h b/simulators/bochs/host/linux/pcidev/kernel_pcidev.h similarity index 100% rename from bochs/host/linux/pcidev/kernel_pcidev.h rename to simulators/bochs/host/linux/pcidev/kernel_pcidev.h diff --git a/bochs/host/linux/pcidev/pcidev.c b/simulators/bochs/host/linux/pcidev/pcidev.c similarity index 100% rename from bochs/host/linux/pcidev/pcidev.c rename to simulators/bochs/host/linux/pcidev/pcidev.c diff --git a/bochs/install-sh b/simulators/bochs/install-sh similarity index 100% rename from bochs/install-sh rename to simulators/bochs/install-sh diff --git a/bochs/instrument/example0/Makefile.in b/simulators/bochs/instrument/example0/Makefile.in similarity index 100% rename from bochs/instrument/example0/Makefile.in rename to simulators/bochs/instrument/example0/Makefile.in diff --git a/bochs/instrument/example0/instrument.cc b/simulators/bochs/instrument/example0/instrument.cc similarity index 100% rename from bochs/instrument/example0/instrument.cc rename to simulators/bochs/instrument/example0/instrument.cc diff --git a/bochs/instrument/example0/instrument.h b/simulators/bochs/instrument/example0/instrument.h similarity index 100% rename from bochs/instrument/example0/instrument.h rename to simulators/bochs/instrument/example0/instrument.h diff --git a/bochs/instrument/example1/Makefile.in b/simulators/bochs/instrument/example1/Makefile.in similarity index 100% rename from bochs/instrument/example1/Makefile.in rename to simulators/bochs/instrument/example1/Makefile.in diff --git a/bochs/instrument/example1/instrument.cc b/simulators/bochs/instrument/example1/instrument.cc similarity index 100% rename from bochs/instrument/example1/instrument.cc rename to simulators/bochs/instrument/example1/instrument.cc diff --git a/bochs/instrument/example1/instrument.h b/simulators/bochs/instrument/example1/instrument.h similarity index 100% rename from bochs/instrument/example1/instrument.h rename to simulators/bochs/instrument/example1/instrument.h diff --git a/bochs/instrument/example2/Makefile.in b/simulators/bochs/instrument/example2/Makefile.in similarity index 100% rename from bochs/instrument/example2/Makefile.in rename to simulators/bochs/instrument/example2/Makefile.in diff --git a/bochs/instrument/example2/instrument.cc b/simulators/bochs/instrument/example2/instrument.cc similarity index 100% rename from bochs/instrument/example2/instrument.cc rename to simulators/bochs/instrument/example2/instrument.cc diff --git a/bochs/instrument/example2/instrument.h b/simulators/bochs/instrument/example2/instrument.h similarity index 100% rename from bochs/instrument/example2/instrument.h rename to simulators/bochs/instrument/example2/instrument.h diff --git a/bochs/instrument/instrumentation.txt b/simulators/bochs/instrument/instrumentation.txt similarity index 100% rename from bochs/instrument/instrumentation.txt rename to simulators/bochs/instrument/instrumentation.txt diff --git a/bochs/instrument/stubs/Makefile.in b/simulators/bochs/instrument/stubs/Makefile.in similarity index 100% rename from bochs/instrument/stubs/Makefile.in rename to simulators/bochs/instrument/stubs/Makefile.in diff --git a/bochs/instrument/stubs/instrument.cc b/simulators/bochs/instrument/stubs/instrument.cc similarity index 100% rename from bochs/instrument/stubs/instrument.cc rename to simulators/bochs/instrument/stubs/instrument.cc diff --git a/bochs/instrument/stubs/instrument.h b/simulators/bochs/instrument/stubs/instrument.h similarity index 100% rename from bochs/instrument/stubs/instrument.h rename to simulators/bochs/instrument/stubs/instrument.h diff --git a/bochs/iodev/Makefile.in b/simulators/bochs/iodev/Makefile.in similarity index 100% rename from bochs/iodev/Makefile.in rename to simulators/bochs/iodev/Makefile.in diff --git a/bochs/iodev/acpi.cc b/simulators/bochs/iodev/acpi.cc similarity index 100% rename from bochs/iodev/acpi.cc rename to simulators/bochs/iodev/acpi.cc diff --git a/bochs/iodev/acpi.h b/simulators/bochs/iodev/acpi.h similarity index 100% rename from bochs/iodev/acpi.h rename to simulators/bochs/iodev/acpi.h diff --git a/bochs/iodev/aspi-win32.h b/simulators/bochs/iodev/aspi-win32.h similarity index 100% rename from bochs/iodev/aspi-win32.h rename to simulators/bochs/iodev/aspi-win32.h diff --git a/bochs/iodev/biosdev.cc b/simulators/bochs/iodev/biosdev.cc similarity index 100% rename from bochs/iodev/biosdev.cc rename to simulators/bochs/iodev/biosdev.cc diff --git a/bochs/iodev/biosdev.h b/simulators/bochs/iodev/biosdev.h similarity index 100% rename from bochs/iodev/biosdev.h rename to simulators/bochs/iodev/biosdev.h diff --git a/bochs/iodev/busmouse.cc b/simulators/bochs/iodev/busmouse.cc similarity index 100% rename from bochs/iodev/busmouse.cc rename to simulators/bochs/iodev/busmouse.cc diff --git a/bochs/iodev/busmouse.h b/simulators/bochs/iodev/busmouse.h similarity index 100% rename from bochs/iodev/busmouse.h rename to simulators/bochs/iodev/busmouse.h diff --git a/bochs/iodev/cdrom.cc b/simulators/bochs/iodev/cdrom.cc similarity index 100% rename from bochs/iodev/cdrom.cc rename to simulators/bochs/iodev/cdrom.cc diff --git a/bochs/iodev/cdrom.h b/simulators/bochs/iodev/cdrom.h similarity index 100% rename from bochs/iodev/cdrom.h rename to simulators/bochs/iodev/cdrom.h diff --git a/bochs/iodev/cdrom_amigaos.cc b/simulators/bochs/iodev/cdrom_amigaos.cc similarity index 100% rename from bochs/iodev/cdrom_amigaos.cc rename to simulators/bochs/iodev/cdrom_amigaos.cc diff --git a/bochs/iodev/cdrom_beos.cc b/simulators/bochs/iodev/cdrom_beos.cc similarity index 100% rename from bochs/iodev/cdrom_beos.cc rename to simulators/bochs/iodev/cdrom_beos.cc diff --git a/bochs/iodev/cdrom_beos.h b/simulators/bochs/iodev/cdrom_beos.h similarity index 100% rename from bochs/iodev/cdrom_beos.h rename to simulators/bochs/iodev/cdrom_beos.h diff --git a/bochs/iodev/cmos.cc b/simulators/bochs/iodev/cmos.cc similarity index 100% rename from bochs/iodev/cmos.cc rename to simulators/bochs/iodev/cmos.cc diff --git a/bochs/iodev/cmos.h b/simulators/bochs/iodev/cmos.h similarity index 100% rename from bochs/iodev/cmos.h rename to simulators/bochs/iodev/cmos.h diff --git a/bochs/iodev/crc32.cc b/simulators/bochs/iodev/crc32.cc similarity index 100% rename from bochs/iodev/crc32.cc rename to simulators/bochs/iodev/crc32.cc diff --git a/bochs/iodev/crc32.h b/simulators/bochs/iodev/crc32.h similarity index 100% rename from bochs/iodev/crc32.h rename to simulators/bochs/iodev/crc32.h diff --git a/bochs/iodev/devices.cc b/simulators/bochs/iodev/devices.cc similarity index 100% rename from bochs/iodev/devices.cc rename to simulators/bochs/iodev/devices.cc diff --git a/bochs/iodev/devices.txt b/simulators/bochs/iodev/devices.txt similarity index 100% rename from bochs/iodev/devices.txt rename to simulators/bochs/iodev/devices.txt diff --git a/bochs/iodev/dma.cc b/simulators/bochs/iodev/dma.cc similarity index 100% rename from bochs/iodev/dma.cc rename to simulators/bochs/iodev/dma.cc diff --git a/bochs/iodev/dma.h b/simulators/bochs/iodev/dma.h similarity index 100% rename from bochs/iodev/dma.h rename to simulators/bochs/iodev/dma.h diff --git a/bochs/iodev/eth.cc b/simulators/bochs/iodev/eth.cc similarity index 100% rename from bochs/iodev/eth.cc rename to simulators/bochs/iodev/eth.cc diff --git a/bochs/iodev/eth.h b/simulators/bochs/iodev/eth.h similarity index 100% rename from bochs/iodev/eth.h rename to simulators/bochs/iodev/eth.h diff --git a/bochs/iodev/eth_arpback.cc b/simulators/bochs/iodev/eth_arpback.cc similarity index 100% rename from bochs/iodev/eth_arpback.cc rename to simulators/bochs/iodev/eth_arpback.cc diff --git a/bochs/iodev/eth_fbsd.cc b/simulators/bochs/iodev/eth_fbsd.cc similarity index 100% rename from bochs/iodev/eth_fbsd.cc rename to simulators/bochs/iodev/eth_fbsd.cc diff --git a/bochs/iodev/eth_linux.cc b/simulators/bochs/iodev/eth_linux.cc similarity index 100% rename from bochs/iodev/eth_linux.cc rename to simulators/bochs/iodev/eth_linux.cc diff --git a/bochs/iodev/eth_null.cc b/simulators/bochs/iodev/eth_null.cc similarity index 100% rename from bochs/iodev/eth_null.cc rename to simulators/bochs/iodev/eth_null.cc diff --git a/bochs/iodev/eth_packetmaker.cc b/simulators/bochs/iodev/eth_packetmaker.cc similarity index 100% rename from bochs/iodev/eth_packetmaker.cc rename to simulators/bochs/iodev/eth_packetmaker.cc diff --git a/bochs/iodev/eth_packetmaker.h b/simulators/bochs/iodev/eth_packetmaker.h similarity index 100% rename from bochs/iodev/eth_packetmaker.h rename to simulators/bochs/iodev/eth_packetmaker.h diff --git a/bochs/iodev/eth_tap.cc b/simulators/bochs/iodev/eth_tap.cc similarity index 100% rename from bochs/iodev/eth_tap.cc rename to simulators/bochs/iodev/eth_tap.cc diff --git a/bochs/iodev/eth_tuntap.cc b/simulators/bochs/iodev/eth_tuntap.cc similarity index 100% rename from bochs/iodev/eth_tuntap.cc rename to simulators/bochs/iodev/eth_tuntap.cc diff --git a/bochs/iodev/eth_vde.cc b/simulators/bochs/iodev/eth_vde.cc similarity index 100% rename from bochs/iodev/eth_vde.cc rename to simulators/bochs/iodev/eth_vde.cc diff --git a/bochs/iodev/eth_vnet.cc b/simulators/bochs/iodev/eth_vnet.cc similarity index 100% rename from bochs/iodev/eth_vnet.cc rename to simulators/bochs/iodev/eth_vnet.cc diff --git a/bochs/iodev/eth_win32.cc b/simulators/bochs/iodev/eth_win32.cc similarity index 100% rename from bochs/iodev/eth_win32.cc rename to simulators/bochs/iodev/eth_win32.cc diff --git a/bochs/iodev/extfpuirq.cc b/simulators/bochs/iodev/extfpuirq.cc similarity index 100% rename from bochs/iodev/extfpuirq.cc rename to simulators/bochs/iodev/extfpuirq.cc diff --git a/bochs/iodev/extfpuirq.h b/simulators/bochs/iodev/extfpuirq.h similarity index 100% rename from bochs/iodev/extfpuirq.h rename to simulators/bochs/iodev/extfpuirq.h diff --git a/bochs/iodev/floppy.cc b/simulators/bochs/iodev/floppy.cc similarity index 100% rename from bochs/iodev/floppy.cc rename to simulators/bochs/iodev/floppy.cc diff --git a/bochs/iodev/floppy.h b/simulators/bochs/iodev/floppy.h similarity index 100% rename from bochs/iodev/floppy.h rename to simulators/bochs/iodev/floppy.h diff --git a/bochs/iodev/gameport.cc b/simulators/bochs/iodev/gameport.cc similarity index 100% rename from bochs/iodev/gameport.cc rename to simulators/bochs/iodev/gameport.cc diff --git a/bochs/iodev/gameport.h b/simulators/bochs/iodev/gameport.h similarity index 100% rename from bochs/iodev/gameport.h rename to simulators/bochs/iodev/gameport.h diff --git a/bochs/iodev/guest2host.cc b/simulators/bochs/iodev/guest2host.cc similarity index 100% rename from bochs/iodev/guest2host.cc rename to simulators/bochs/iodev/guest2host.cc diff --git a/bochs/iodev/guest2host.h b/simulators/bochs/iodev/guest2host.h similarity index 100% rename from bochs/iodev/guest2host.h rename to simulators/bochs/iodev/guest2host.h diff --git a/bochs/iodev/harddrv.cc b/simulators/bochs/iodev/harddrv.cc similarity index 100% rename from bochs/iodev/harddrv.cc rename to simulators/bochs/iodev/harddrv.cc diff --git a/bochs/iodev/harddrv.h b/simulators/bochs/iodev/harddrv.h similarity index 100% rename from bochs/iodev/harddrv.h rename to simulators/bochs/iodev/harddrv.h diff --git a/bochs/iodev/hdimage.cc b/simulators/bochs/iodev/hdimage.cc similarity index 100% rename from bochs/iodev/hdimage.cc rename to simulators/bochs/iodev/hdimage.cc diff --git a/bochs/iodev/hdimage.h b/simulators/bochs/iodev/hdimage.h similarity index 100% rename from bochs/iodev/hdimage.h rename to simulators/bochs/iodev/hdimage.h diff --git a/bochs/iodev/ioapic.cc b/simulators/bochs/iodev/ioapic.cc similarity index 100% rename from bochs/iodev/ioapic.cc rename to simulators/bochs/iodev/ioapic.cc diff --git a/bochs/iodev/ioapic.h b/simulators/bochs/iodev/ioapic.h similarity index 100% rename from bochs/iodev/ioapic.h rename to simulators/bochs/iodev/ioapic.h diff --git a/bochs/iodev/iodebug.cc b/simulators/bochs/iodev/iodebug.cc similarity index 100% rename from bochs/iodev/iodebug.cc rename to simulators/bochs/iodev/iodebug.cc diff --git a/bochs/iodev/iodebug.h b/simulators/bochs/iodev/iodebug.h similarity index 100% rename from bochs/iodev/iodebug.h rename to simulators/bochs/iodev/iodebug.h diff --git a/bochs/iodev/iodev.h b/simulators/bochs/iodev/iodev.h similarity index 100% rename from bochs/iodev/iodev.h rename to simulators/bochs/iodev/iodev.h diff --git a/bochs/iodev/keyboard.cc b/simulators/bochs/iodev/keyboard.cc similarity index 100% rename from bochs/iodev/keyboard.cc rename to simulators/bochs/iodev/keyboard.cc diff --git a/bochs/iodev/keyboard.h b/simulators/bochs/iodev/keyboard.h similarity index 100% rename from bochs/iodev/keyboard.h rename to simulators/bochs/iodev/keyboard.h diff --git a/bochs/iodev/ne2k.cc b/simulators/bochs/iodev/ne2k.cc similarity index 100% rename from bochs/iodev/ne2k.cc rename to simulators/bochs/iodev/ne2k.cc diff --git a/bochs/iodev/ne2k.h b/simulators/bochs/iodev/ne2k.h similarity index 100% rename from bochs/iodev/ne2k.h rename to simulators/bochs/iodev/ne2k.h diff --git a/bochs/iodev/parallel.cc b/simulators/bochs/iodev/parallel.cc similarity index 100% rename from bochs/iodev/parallel.cc rename to simulators/bochs/iodev/parallel.cc diff --git a/bochs/iodev/parallel.h b/simulators/bochs/iodev/parallel.h similarity index 100% rename from bochs/iodev/parallel.h rename to simulators/bochs/iodev/parallel.h diff --git a/bochs/iodev/pci.cc b/simulators/bochs/iodev/pci.cc similarity index 100% rename from bochs/iodev/pci.cc rename to simulators/bochs/iodev/pci.cc diff --git a/bochs/iodev/pci.h b/simulators/bochs/iodev/pci.h similarity index 100% rename from bochs/iodev/pci.h rename to simulators/bochs/iodev/pci.h diff --git a/bochs/iodev/pci2isa.cc b/simulators/bochs/iodev/pci2isa.cc similarity index 100% rename from bochs/iodev/pci2isa.cc rename to simulators/bochs/iodev/pci2isa.cc diff --git a/bochs/iodev/pci2isa.h b/simulators/bochs/iodev/pci2isa.h similarity index 100% rename from bochs/iodev/pci2isa.h rename to simulators/bochs/iodev/pci2isa.h diff --git a/bochs/iodev/pci_ide.cc b/simulators/bochs/iodev/pci_ide.cc similarity index 100% rename from bochs/iodev/pci_ide.cc rename to simulators/bochs/iodev/pci_ide.cc diff --git a/bochs/iodev/pci_ide.h b/simulators/bochs/iodev/pci_ide.h similarity index 100% rename from bochs/iodev/pci_ide.h rename to simulators/bochs/iodev/pci_ide.h diff --git a/bochs/iodev/pcidev.cc b/simulators/bochs/iodev/pcidev.cc similarity index 100% rename from bochs/iodev/pcidev.cc rename to simulators/bochs/iodev/pcidev.cc diff --git a/bochs/iodev/pcidev.h b/simulators/bochs/iodev/pcidev.h similarity index 100% rename from bochs/iodev/pcidev.h rename to simulators/bochs/iodev/pcidev.h diff --git a/bochs/iodev/pcipnic.cc b/simulators/bochs/iodev/pcipnic.cc similarity index 100% rename from bochs/iodev/pcipnic.cc rename to simulators/bochs/iodev/pcipnic.cc diff --git a/bochs/iodev/pcipnic.h b/simulators/bochs/iodev/pcipnic.h similarity index 100% rename from bochs/iodev/pcipnic.h rename to simulators/bochs/iodev/pcipnic.h diff --git a/bochs/iodev/pcivga.cc b/simulators/bochs/iodev/pcivga.cc similarity index 100% rename from bochs/iodev/pcivga.cc rename to simulators/bochs/iodev/pcivga.cc diff --git a/bochs/iodev/pcivga.h b/simulators/bochs/iodev/pcivga.h similarity index 100% rename from bochs/iodev/pcivga.h rename to simulators/bochs/iodev/pcivga.h diff --git a/bochs/iodev/pic.cc b/simulators/bochs/iodev/pic.cc similarity index 100% rename from bochs/iodev/pic.cc rename to simulators/bochs/iodev/pic.cc diff --git a/bochs/iodev/pic.h b/simulators/bochs/iodev/pic.h similarity index 100% rename from bochs/iodev/pic.h rename to simulators/bochs/iodev/pic.h diff --git a/bochs/iodev/pit82c54.cc b/simulators/bochs/iodev/pit82c54.cc similarity index 100% rename from bochs/iodev/pit82c54.cc rename to simulators/bochs/iodev/pit82c54.cc diff --git a/bochs/iodev/pit82c54.h b/simulators/bochs/iodev/pit82c54.h similarity index 100% rename from bochs/iodev/pit82c54.h rename to simulators/bochs/iodev/pit82c54.h diff --git a/bochs/iodev/pit_wrap.cc b/simulators/bochs/iodev/pit_wrap.cc similarity index 100% rename from bochs/iodev/pit_wrap.cc rename to simulators/bochs/iodev/pit_wrap.cc diff --git a/bochs/iodev/pit_wrap.h b/simulators/bochs/iodev/pit_wrap.h similarity index 100% rename from bochs/iodev/pit_wrap.h rename to simulators/bochs/iodev/pit_wrap.h diff --git a/bochs/iodev/pnic_api.h b/simulators/bochs/iodev/pnic_api.h similarity index 100% rename from bochs/iodev/pnic_api.h rename to simulators/bochs/iodev/pnic_api.h diff --git a/bochs/iodev/sb16.cc b/simulators/bochs/iodev/sb16.cc similarity index 100% rename from bochs/iodev/sb16.cc rename to simulators/bochs/iodev/sb16.cc diff --git a/bochs/iodev/sb16.h b/simulators/bochs/iodev/sb16.h similarity index 100% rename from bochs/iodev/sb16.h rename to simulators/bochs/iodev/sb16.h diff --git a/bochs/iodev/scancodes.cc b/simulators/bochs/iodev/scancodes.cc similarity index 100% rename from bochs/iodev/scancodes.cc rename to simulators/bochs/iodev/scancodes.cc diff --git a/bochs/iodev/scancodes.h b/simulators/bochs/iodev/scancodes.h similarity index 100% rename from bochs/iodev/scancodes.h rename to simulators/bochs/iodev/scancodes.h diff --git a/bochs/iodev/scsi_commands.h b/simulators/bochs/iodev/scsi_commands.h similarity index 100% rename from bochs/iodev/scsi_commands.h rename to simulators/bochs/iodev/scsi_commands.h diff --git a/bochs/iodev/scsi_device.cc b/simulators/bochs/iodev/scsi_device.cc similarity index 100% rename from bochs/iodev/scsi_device.cc rename to simulators/bochs/iodev/scsi_device.cc diff --git a/bochs/iodev/scsi_device.h b/simulators/bochs/iodev/scsi_device.h similarity index 100% rename from bochs/iodev/scsi_device.h rename to simulators/bochs/iodev/scsi_device.h diff --git a/bochs/iodev/scsidefs.h b/simulators/bochs/iodev/scsidefs.h similarity index 100% rename from bochs/iodev/scsidefs.h rename to simulators/bochs/iodev/scsidefs.h diff --git a/bochs/iodev/scsipt.h b/simulators/bochs/iodev/scsipt.h similarity index 100% rename from bochs/iodev/scsipt.h rename to simulators/bochs/iodev/scsipt.h diff --git a/bochs/iodev/serial.cc b/simulators/bochs/iodev/serial.cc similarity index 100% rename from bochs/iodev/serial.cc rename to simulators/bochs/iodev/serial.cc diff --git a/bochs/iodev/serial.h b/simulators/bochs/iodev/serial.h similarity index 100% rename from bochs/iodev/serial.h rename to simulators/bochs/iodev/serial.h diff --git a/bochs/iodev/serial_raw.cc b/simulators/bochs/iodev/serial_raw.cc similarity index 100% rename from bochs/iodev/serial_raw.cc rename to simulators/bochs/iodev/serial_raw.cc diff --git a/bochs/iodev/serial_raw.h b/simulators/bochs/iodev/serial_raw.h similarity index 100% rename from bochs/iodev/serial_raw.h rename to simulators/bochs/iodev/serial_raw.h diff --git a/bochs/iodev/slowdown_timer.cc b/simulators/bochs/iodev/slowdown_timer.cc similarity index 100% rename from bochs/iodev/slowdown_timer.cc rename to simulators/bochs/iodev/slowdown_timer.cc diff --git a/bochs/iodev/slowdown_timer.h b/simulators/bochs/iodev/slowdown_timer.h similarity index 100% rename from bochs/iodev/slowdown_timer.h rename to simulators/bochs/iodev/slowdown_timer.h diff --git a/bochs/iodev/soundlnx.cc b/simulators/bochs/iodev/soundlnx.cc similarity index 100% rename from bochs/iodev/soundlnx.cc rename to simulators/bochs/iodev/soundlnx.cc diff --git a/bochs/iodev/soundlnx.h b/simulators/bochs/iodev/soundlnx.h similarity index 100% rename from bochs/iodev/soundlnx.h rename to simulators/bochs/iodev/soundlnx.h diff --git a/bochs/iodev/soundmod.cc b/simulators/bochs/iodev/soundmod.cc similarity index 100% rename from bochs/iodev/soundmod.cc rename to simulators/bochs/iodev/soundmod.cc diff --git a/bochs/iodev/soundmod.h b/simulators/bochs/iodev/soundmod.h similarity index 100% rename from bochs/iodev/soundmod.h rename to simulators/bochs/iodev/soundmod.h diff --git a/bochs/iodev/soundosx.cc b/simulators/bochs/iodev/soundosx.cc similarity index 100% rename from bochs/iodev/soundosx.cc rename to simulators/bochs/iodev/soundosx.cc diff --git a/bochs/iodev/soundosx.h b/simulators/bochs/iodev/soundosx.h similarity index 100% rename from bochs/iodev/soundosx.h rename to simulators/bochs/iodev/soundosx.h diff --git a/bochs/iodev/soundwin.cc b/simulators/bochs/iodev/soundwin.cc similarity index 100% rename from bochs/iodev/soundwin.cc rename to simulators/bochs/iodev/soundwin.cc diff --git a/bochs/iodev/soundwin.h b/simulators/bochs/iodev/soundwin.h similarity index 100% rename from bochs/iodev/soundwin.h rename to simulators/bochs/iodev/soundwin.h diff --git a/bochs/iodev/speaker.cc b/simulators/bochs/iodev/speaker.cc similarity index 100% rename from bochs/iodev/speaker.cc rename to simulators/bochs/iodev/speaker.cc diff --git a/bochs/iodev/speaker.h b/simulators/bochs/iodev/speaker.h similarity index 100% rename from bochs/iodev/speaker.h rename to simulators/bochs/iodev/speaker.h diff --git a/bochs/iodev/svga_cirrus.cc b/simulators/bochs/iodev/svga_cirrus.cc similarity index 100% rename from bochs/iodev/svga_cirrus.cc rename to simulators/bochs/iodev/svga_cirrus.cc diff --git a/bochs/iodev/svga_cirrus.h b/simulators/bochs/iodev/svga_cirrus.h similarity index 100% rename from bochs/iodev/svga_cirrus.h rename to simulators/bochs/iodev/svga_cirrus.h diff --git a/bochs/iodev/unmapped.cc b/simulators/bochs/iodev/unmapped.cc similarity index 100% rename from bochs/iodev/unmapped.cc rename to simulators/bochs/iodev/unmapped.cc diff --git a/bochs/iodev/unmapped.h b/simulators/bochs/iodev/unmapped.h similarity index 100% rename from bochs/iodev/unmapped.h rename to simulators/bochs/iodev/unmapped.h diff --git a/bochs/iodev/usb_common.cc b/simulators/bochs/iodev/usb_common.cc similarity index 100% rename from bochs/iodev/usb_common.cc rename to simulators/bochs/iodev/usb_common.cc diff --git a/bochs/iodev/usb_common.h b/simulators/bochs/iodev/usb_common.h similarity index 100% rename from bochs/iodev/usb_common.h rename to simulators/bochs/iodev/usb_common.h diff --git a/bochs/iodev/usb_hid.cc b/simulators/bochs/iodev/usb_hid.cc similarity index 100% rename from bochs/iodev/usb_hid.cc rename to simulators/bochs/iodev/usb_hid.cc diff --git a/bochs/iodev/usb_hid.h b/simulators/bochs/iodev/usb_hid.h similarity index 100% rename from bochs/iodev/usb_hid.h rename to simulators/bochs/iodev/usb_hid.h diff --git a/bochs/iodev/usb_hub.cc b/simulators/bochs/iodev/usb_hub.cc similarity index 100% rename from bochs/iodev/usb_hub.cc rename to simulators/bochs/iodev/usb_hub.cc diff --git a/bochs/iodev/usb_hub.h b/simulators/bochs/iodev/usb_hub.h similarity index 100% rename from bochs/iodev/usb_hub.h rename to simulators/bochs/iodev/usb_hub.h diff --git a/bochs/iodev/usb_msd.cc b/simulators/bochs/iodev/usb_msd.cc similarity index 100% rename from bochs/iodev/usb_msd.cc rename to simulators/bochs/iodev/usb_msd.cc diff --git a/bochs/iodev/usb_msd.h b/simulators/bochs/iodev/usb_msd.h similarity index 100% rename from bochs/iodev/usb_msd.h rename to simulators/bochs/iodev/usb_msd.h diff --git a/bochs/iodev/usb_ohci.cc b/simulators/bochs/iodev/usb_ohci.cc similarity index 100% rename from bochs/iodev/usb_ohci.cc rename to simulators/bochs/iodev/usb_ohci.cc diff --git a/bochs/iodev/usb_ohci.h b/simulators/bochs/iodev/usb_ohci.h similarity index 100% rename from bochs/iodev/usb_ohci.h rename to simulators/bochs/iodev/usb_ohci.h diff --git a/bochs/iodev/usb_printer.cc b/simulators/bochs/iodev/usb_printer.cc similarity index 100% rename from bochs/iodev/usb_printer.cc rename to simulators/bochs/iodev/usb_printer.cc diff --git a/bochs/iodev/usb_printer.h b/simulators/bochs/iodev/usb_printer.h similarity index 100% rename from bochs/iodev/usb_printer.h rename to simulators/bochs/iodev/usb_printer.h diff --git a/bochs/iodev/usb_uhci.cc b/simulators/bochs/iodev/usb_uhci.cc similarity index 100% rename from bochs/iodev/usb_uhci.cc rename to simulators/bochs/iodev/usb_uhci.cc diff --git a/bochs/iodev/usb_uhci.h b/simulators/bochs/iodev/usb_uhci.h similarity index 100% rename from bochs/iodev/usb_uhci.h rename to simulators/bochs/iodev/usb_uhci.h diff --git a/bochs/iodev/vga.cc b/simulators/bochs/iodev/vga.cc similarity index 100% rename from bochs/iodev/vga.cc rename to simulators/bochs/iodev/vga.cc diff --git a/bochs/iodev/vga.h b/simulators/bochs/iodev/vga.h similarity index 100% rename from bochs/iodev/vga.h rename to simulators/bochs/iodev/vga.h diff --git a/bochs/iodev/virt_timer.cc b/simulators/bochs/iodev/virt_timer.cc similarity index 100% rename from bochs/iodev/virt_timer.cc rename to simulators/bochs/iodev/virt_timer.cc diff --git a/bochs/iodev/virt_timer.h b/simulators/bochs/iodev/virt_timer.h similarity index 100% rename from bochs/iodev/virt_timer.h rename to simulators/bochs/iodev/virt_timer.h diff --git a/bochs/iodev/vmware3.cc b/simulators/bochs/iodev/vmware3.cc similarity index 100% rename from bochs/iodev/vmware3.cc rename to simulators/bochs/iodev/vmware3.cc diff --git a/bochs/iodev/vmware3.h b/simulators/bochs/iodev/vmware3.h similarity index 100% rename from bochs/iodev/vmware3.h rename to simulators/bochs/iodev/vmware3.h diff --git a/bochs/iodev/vmware4.cc b/simulators/bochs/iodev/vmware4.cc similarity index 100% rename from bochs/iodev/vmware4.cc rename to simulators/bochs/iodev/vmware4.cc diff --git a/bochs/iodev/vmware4.h b/simulators/bochs/iodev/vmware4.h similarity index 100% rename from bochs/iodev/vmware4.h rename to simulators/bochs/iodev/vmware4.h diff --git a/bochs/iodev/vvfat.cc b/simulators/bochs/iodev/vvfat.cc similarity index 100% rename from bochs/iodev/vvfat.cc rename to simulators/bochs/iodev/vvfat.cc diff --git a/bochs/iodev/vvfat.h b/simulators/bochs/iodev/vvfat.h similarity index 100% rename from bochs/iodev/vvfat.h rename to simulators/bochs/iodev/vvfat.h diff --git a/bochs/load32bitOShack.cc b/simulators/bochs/load32bitOShack.cc similarity index 100% rename from bochs/load32bitOShack.cc rename to simulators/bochs/load32bitOShack.cc diff --git a/bochs/logio.cc b/simulators/bochs/logio.cc similarity index 100% rename from bochs/logio.cc rename to simulators/bochs/logio.cc diff --git a/bochs/ltdl.c b/simulators/bochs/ltdl.c similarity index 100% rename from bochs/ltdl.c rename to simulators/bochs/ltdl.c diff --git a/bochs/ltdl.h b/simulators/bochs/ltdl.h similarity index 100% rename from bochs/ltdl.h rename to simulators/bochs/ltdl.h diff --git a/bochs/ltdlconf.h.in b/simulators/bochs/ltdlconf.h.in similarity index 100% rename from bochs/ltdlconf.h.in rename to simulators/bochs/ltdlconf.h.in diff --git a/bochs/ltmain.sh b/simulators/bochs/ltmain.sh similarity index 100% rename from bochs/ltmain.sh rename to simulators/bochs/ltmain.sh diff --git a/bochs/main.cc b/simulators/bochs/main.cc similarity index 100% rename from bochs/main.cc rename to simulators/bochs/main.cc diff --git a/bochs/make-ag++.sh b/simulators/bochs/make-ag++.sh similarity index 100% rename from bochs/make-ag++.sh rename to simulators/bochs/make-ag++.sh diff --git a/bochs/memory/Makefile.in b/simulators/bochs/memory/Makefile.in similarity index 100% rename from bochs/memory/Makefile.in rename to simulators/bochs/memory/Makefile.in diff --git a/bochs/memory/memory.cc b/simulators/bochs/memory/memory.cc similarity index 100% rename from bochs/memory/memory.cc rename to simulators/bochs/memory/memory.cc diff --git a/bochs/memory/memory.h b/simulators/bochs/memory/memory.h similarity index 100% rename from bochs/memory/memory.h rename to simulators/bochs/memory/memory.h diff --git a/bochs/memory/misc_mem.cc b/simulators/bochs/memory/misc_mem.cc similarity index 100% rename from bochs/memory/misc_mem.cc rename to simulators/bochs/memory/misc_mem.cc diff --git a/bochs/misc/Makefile.in b/simulators/bochs/misc/Makefile.in similarity index 100% rename from bochs/misc/Makefile.in rename to simulators/bochs/misc/Makefile.in diff --git a/bochs/misc/bxcommit.c b/simulators/bochs/misc/bxcommit.c similarity index 100% rename from bochs/misc/bxcommit.c rename to simulators/bochs/misc/bxcommit.c diff --git a/bochs/misc/bximage.c b/simulators/bochs/misc/bximage.c similarity index 100% rename from bochs/misc/bximage.c rename to simulators/bochs/misc/bximage.c diff --git a/bochs/misc/make_cmos_image.cc b/simulators/bochs/misc/make_cmos_image.cc similarity index 100% rename from bochs/misc/make_cmos_image.cc rename to simulators/bochs/misc/make_cmos_image.cc diff --git a/bochs/misc/niclist.c b/simulators/bochs/misc/niclist.c similarity index 100% rename from bochs/misc/niclist.c rename to simulators/bochs/misc/niclist.c diff --git a/bochs/misc/sb16/sb16ctrl.c b/simulators/bochs/misc/sb16/sb16ctrl.c similarity index 100% rename from bochs/misc/sb16/sb16ctrl.c rename to simulators/bochs/misc/sb16/sb16ctrl.c diff --git a/bochs/misc/sb16/sb16ctrl.example b/simulators/bochs/misc/sb16/sb16ctrl.example similarity index 100% rename from bochs/misc/sb16/sb16ctrl.example rename to simulators/bochs/misc/sb16/sb16ctrl.example diff --git a/bochs/misc/sb16/sb16ctrl.exe b/simulators/bochs/misc/sb16/sb16ctrl.exe similarity index 100% rename from bochs/misc/sb16/sb16ctrl.exe rename to simulators/bochs/misc/sb16/sb16ctrl.exe diff --git a/bochs/misc/spoolpipe.c b/simulators/bochs/misc/spoolpipe.c similarity index 100% rename from bochs/misc/spoolpipe.c rename to simulators/bochs/misc/spoolpipe.c diff --git a/bochs/misc/test-access-check.cc b/simulators/bochs/misc/test-access-check.cc similarity index 100% rename from bochs/misc/test-access-check.cc rename to simulators/bochs/misc/test-access-check.cc diff --git a/bochs/msrs.def b/simulators/bochs/msrs.def similarity index 100% rename from bochs/msrs.def rename to simulators/bochs/msrs.def diff --git a/bochs/osdep.cc b/simulators/bochs/osdep.cc similarity index 100% rename from bochs/osdep.cc rename to simulators/bochs/osdep.cc diff --git a/bochs/osdep.h b/simulators/bochs/osdep.h similarity index 100% rename from bochs/osdep.h rename to simulators/bochs/osdep.h diff --git a/bochs/param_names.h b/simulators/bochs/param_names.h similarity index 100% rename from bochs/param_names.h rename to simulators/bochs/param_names.h diff --git a/bochs/patches/HEADER b/simulators/bochs/patches/HEADER similarity index 100% rename from bochs/patches/HEADER rename to simulators/bochs/patches/HEADER diff --git a/bochs/patches/NOTES b/simulators/bochs/patches/NOTES similarity index 100% rename from bochs/patches/NOTES rename to simulators/bochs/patches/NOTES diff --git a/bochs/patches/beos-gui-fabo.capture-filter b/simulators/bochs/patches/beos-gui-fabo.capture-filter similarity index 100% rename from bochs/patches/beos-gui-fabo.capture-filter rename to simulators/bochs/patches/beos-gui-fabo.capture-filter diff --git a/bochs/patches/beos-gui-fabo.capture-filter.README b/simulators/bochs/patches/beos-gui-fabo.capture-filter.README similarity index 100% rename from bochs/patches/beos-gui-fabo.capture-filter.README rename to simulators/bochs/patches/beos-gui-fabo.capture-filter.README diff --git a/bochs/patches/bochs-bios-win32.diff b/simulators/bochs/patches/bochs-bios-win32.diff similarity index 100% rename from bochs/patches/bochs-bios-win32.diff rename to simulators/bochs/patches/bochs-bios-win32.diff diff --git a/bochs/patches/patch.beos-gui-fabo b/simulators/bochs/patches/patch.beos-gui-fabo similarity index 100% rename from bochs/patches/patch.beos-gui-fabo rename to simulators/bochs/patches/patch.beos-gui-fabo diff --git a/bochs/patches/patch.beos-gui-fabo-template b/simulators/bochs/patches/patch.beos-gui-fabo-template similarity index 100% rename from bochs/patches/patch.beos-gui-fabo-template rename to simulators/bochs/patches/patch.beos-gui-fabo-template diff --git a/bochs/patches/patch.cosimulation b/simulators/bochs/patches/patch.cosimulation similarity index 100% rename from bochs/patches/patch.cosimulation rename to simulators/bochs/patches/patch.cosimulation diff --git a/bochs/patches/patch.decode-interrupts.gz b/simulators/bochs/patches/patch.decode-interrupts.gz similarity index 100% rename from bochs/patches/patch.decode-interrupts.gz rename to simulators/bochs/patches/patch.decode-interrupts.gz diff --git a/bochs/patches/patch.example-override-ask b/simulators/bochs/patches/patch.example-override-ask similarity index 100% rename from bochs/patches/patch.example-override-ask rename to simulators/bochs/patches/patch.example-override-ask diff --git a/bochs/patches/patch.example-user-plugin b/simulators/bochs/patches/patch.example-user-plugin similarity index 100% rename from bochs/patches/patch.example-user-plugin rename to simulators/bochs/patches/patch.example-user-plugin diff --git a/bochs/patches/patch.fast-dma-cbothamy b/simulators/bochs/patches/patch.fast-dma-cbothamy similarity index 100% rename from bochs/patches/patch.fast-dma-cbothamy rename to simulators/bochs/patches/patch.fast-dma-cbothamy diff --git a/bochs/patches/patch.floppy-athiel b/simulators/bochs/patches/patch.floppy-athiel similarity index 100% rename from bochs/patches/patch.floppy-athiel rename to simulators/bochs/patches/patch.floppy-athiel diff --git a/bochs/patches/patch.hosttime-port b/simulators/bochs/patches/patch.hosttime-port similarity index 100% rename from bochs/patches/patch.hosttime-port rename to simulators/bochs/patches/patch.hosttime-port diff --git a/bochs/patches/patch.marklog b/simulators/bochs/patches/patch.marklog similarity index 100% rename from bochs/patches/patch.marklog rename to simulators/bochs/patches/patch.marklog diff --git a/bochs/patches/patch.mingw-resources b/simulators/bochs/patches/patch.mingw-resources similarity index 100% rename from bochs/patches/patch.mingw-resources rename to simulators/bochs/patches/patch.mingw-resources diff --git a/bochs/pc_system.cc b/simulators/bochs/pc_system.cc similarity index 100% rename from bochs/pc_system.cc rename to simulators/bochs/pc_system.cc diff --git a/bochs/pc_system.h b/simulators/bochs/pc_system.h similarity index 100% rename from bochs/pc_system.h rename to simulators/bochs/pc_system.h diff --git a/bochs/plex86-interface.cc b/simulators/bochs/plex86-interface.cc similarity index 100% rename from bochs/plex86-interface.cc rename to simulators/bochs/plex86-interface.cc diff --git a/bochs/plex86-interface.h b/simulators/bochs/plex86-interface.h similarity index 100% rename from bochs/plex86-interface.h rename to simulators/bochs/plex86-interface.h diff --git a/bochs/plex86/COPYING b/simulators/bochs/plex86/COPYING similarity index 100% rename from bochs/plex86/COPYING rename to simulators/bochs/plex86/COPYING diff --git a/bochs/plex86/Makefile.in b/simulators/bochs/plex86/Makefile.in similarity index 100% rename from bochs/plex86/Makefile.in rename to simulators/bochs/plex86/Makefile.in diff --git a/bochs/plex86/PERFORMANCE b/simulators/bochs/plex86/PERFORMANCE similarity index 100% rename from bochs/plex86/PERFORMANCE rename to simulators/bochs/plex86/PERFORMANCE diff --git a/bochs/plex86/TODO b/simulators/bochs/plex86/TODO similarity index 100% rename from bochs/plex86/TODO rename to simulators/bochs/plex86/TODO diff --git a/bochs/plex86/config.h.in b/simulators/bochs/plex86/config.h.in similarity index 100% rename from bochs/plex86/config.h.in rename to simulators/bochs/plex86/config.h.in diff --git a/bochs/plex86/configure b/simulators/bochs/plex86/configure similarity index 100% rename from bochs/plex86/configure rename to simulators/bochs/plex86/configure diff --git a/bochs/plex86/configure.in b/simulators/bochs/plex86/configure.in similarity index 100% rename from bochs/plex86/configure.in rename to simulators/bochs/plex86/configure.in diff --git a/bochs/plex86/descriptor.h b/simulators/bochs/plex86/descriptor.h similarity index 100% rename from bochs/plex86/descriptor.h rename to simulators/bochs/plex86/descriptor.h diff --git a/bochs/plex86/kernel/Makefile.in b/simulators/bochs/plex86/kernel/Makefile.in similarity index 100% rename from bochs/plex86/kernel/Makefile.in rename to simulators/bochs/plex86/kernel/Makefile.in diff --git a/bochs/plex86/kernel/fault-mon.c b/simulators/bochs/plex86/kernel/fault-mon.c similarity index 100% rename from bochs/plex86/kernel/fault-mon.c rename to simulators/bochs/plex86/kernel/fault-mon.c diff --git a/bochs/plex86/kernel/freebsd/Makefile b/simulators/bochs/plex86/kernel/freebsd/Makefile similarity index 100% rename from bochs/plex86/kernel/freebsd/Makefile rename to simulators/bochs/plex86/kernel/freebsd/Makefile diff --git a/bochs/plex86/kernel/host-beos.c b/simulators/bochs/plex86/kernel/host-beos.c similarity index 100% rename from bochs/plex86/kernel/host-beos.c rename to simulators/bochs/plex86/kernel/host-beos.c diff --git a/bochs/plex86/kernel/host-freebsd.c b/simulators/bochs/plex86/kernel/host-freebsd.c similarity index 100% rename from bochs/plex86/kernel/host-freebsd.c rename to simulators/bochs/plex86/kernel/host-freebsd.c diff --git a/bochs/plex86/kernel/host-linux.c b/simulators/bochs/plex86/kernel/host-linux.c similarity index 100% rename from bochs/plex86/kernel/host-linux.c rename to simulators/bochs/plex86/kernel/host-linux.c diff --git a/bochs/plex86/kernel/host-netbsd.c b/simulators/bochs/plex86/kernel/host-netbsd.c similarity index 100% rename from bochs/plex86/kernel/host-netbsd.c rename to simulators/bochs/plex86/kernel/host-netbsd.c diff --git a/bochs/plex86/kernel/host-null.c b/simulators/bochs/plex86/kernel/host-null.c similarity index 100% rename from bochs/plex86/kernel/host-null.c rename to simulators/bochs/plex86/kernel/host-null.c diff --git a/bochs/plex86/kernel/include/descriptor2.h b/simulators/bochs/plex86/kernel/include/descriptor2.h similarity index 100% rename from bochs/plex86/kernel/include/descriptor2.h rename to simulators/bochs/plex86/kernel/include/descriptor2.h diff --git a/bochs/plex86/kernel/include/eflags.h b/simulators/bochs/plex86/kernel/include/eflags.h similarity index 100% rename from bochs/plex86/kernel/include/eflags.h rename to simulators/bochs/plex86/kernel/include/eflags.h diff --git a/bochs/plex86/kernel/include/guest_context.h b/simulators/bochs/plex86/kernel/include/guest_context.h similarity index 100% rename from bochs/plex86/kernel/include/guest_context.h rename to simulators/bochs/plex86/kernel/include/guest_context.h diff --git a/bochs/plex86/kernel/include/monitor.h b/simulators/bochs/plex86/kernel/include/monitor.h similarity index 100% rename from bochs/plex86/kernel/include/monitor.h rename to simulators/bochs/plex86/kernel/include/monitor.h diff --git a/bochs/plex86/kernel/include/paging.h b/simulators/bochs/plex86/kernel/include/paging.h similarity index 100% rename from bochs/plex86/kernel/include/paging.h rename to simulators/bochs/plex86/kernel/include/paging.h diff --git a/bochs/plex86/kernel/include/tss.h b/simulators/bochs/plex86/kernel/include/tss.h similarity index 100% rename from bochs/plex86/kernel/include/tss.h rename to simulators/bochs/plex86/kernel/include/tss.h diff --git a/bochs/plex86/kernel/monitor-host.c b/simulators/bochs/plex86/kernel/monitor-host.c similarity index 100% rename from bochs/plex86/kernel/monitor-host.c rename to simulators/bochs/plex86/kernel/monitor-host.c diff --git a/bochs/plex86/kernel/monitor-mon.c b/simulators/bochs/plex86/kernel/monitor-mon.c similarity index 100% rename from bochs/plex86/kernel/monitor-mon.c rename to simulators/bochs/plex86/kernel/monitor-mon.c diff --git a/bochs/plex86/kernel/nexus.S b/simulators/bochs/plex86/kernel/nexus.S similarity index 100% rename from bochs/plex86/kernel/nexus.S rename to simulators/bochs/plex86/kernel/nexus.S diff --git a/bochs/plex86/kernel/paging-mon.c b/simulators/bochs/plex86/kernel/paging-mon.c similarity index 100% rename from bochs/plex86/kernel/paging-mon.c rename to simulators/bochs/plex86/kernel/paging-mon.c diff --git a/bochs/plex86/kernel/panic-mon.c b/simulators/bochs/plex86/kernel/panic-mon.c similarity index 100% rename from bochs/plex86/kernel/panic-mon.c rename to simulators/bochs/plex86/kernel/panic-mon.c diff --git a/bochs/plex86/kernel/print-mon.c b/simulators/bochs/plex86/kernel/print-mon.c similarity index 100% rename from bochs/plex86/kernel/print-mon.c rename to simulators/bochs/plex86/kernel/print-mon.c diff --git a/bochs/plex86/kernel/util-nexus.c b/simulators/bochs/plex86/kernel/util-nexus.c similarity index 100% rename from bochs/plex86/kernel/util-nexus.c rename to simulators/bochs/plex86/kernel/util-nexus.c diff --git a/bochs/plex86/misc/load_module.sh b/simulators/bochs/plex86/misc/load_module.sh similarity index 100% rename from bochs/plex86/misc/load_module.sh rename to simulators/bochs/plex86/misc/load_module.sh diff --git a/bochs/plex86/misc/netbsd_post.sh b/simulators/bochs/plex86/misc/netbsd_post.sh similarity index 100% rename from bochs/plex86/misc/netbsd_post.sh rename to simulators/bochs/plex86/misc/netbsd_post.sh diff --git a/bochs/plex86/misc/unload_module.sh b/simulators/bochs/plex86/misc/unload_module.sh similarity index 100% rename from bochs/plex86/misc/unload_module.sh rename to simulators/bochs/plex86/misc/unload_module.sh diff --git a/bochs/plex86/plex86.h b/simulators/bochs/plex86/plex86.h similarity index 100% rename from bochs/plex86/plex86.h rename to simulators/bochs/plex86/plex86.h diff --git a/bochs/plugin.cc b/simulators/bochs/plugin.cc similarity index 100% rename from bochs/plugin.cc rename to simulators/bochs/plugin.cc diff --git a/bochs/plugin.h b/simulators/bochs/plugin.h similarity index 100% rename from bochs/plugin.h rename to simulators/bochs/plugin.h diff --git a/bochs/win32_enh_dbg.rc b/simulators/bochs/win32_enh_dbg.rc similarity index 100% rename from bochs/win32_enh_dbg.rc rename to simulators/bochs/win32_enh_dbg.rc diff --git a/bochs/win32res.rc b/simulators/bochs/win32res.rc similarity index 100% rename from bochs/win32res.rc rename to simulators/bochs/win32res.rc diff --git a/bochs/wxbochs.rc b/simulators/bochs/wxbochs.rc similarity index 100% rename from bochs/wxbochs.rc rename to simulators/bochs/wxbochs.rc diff --git a/ovp/CMakeLists.txt b/simulators/ovp/CMakeLists.txt similarity index 93% rename from ovp/CMakeLists.txt rename to simulators/ovp/CMakeLists.txt index 034d9ff45a7bd8058520678b3e211899256b2c56..a93a566c3e9edf8a600f58092adcd8cf04275a62 100644 --- a/ovp/CMakeLists.txt +++ b/simulators/ovp/CMakeLists.txt @@ -36,9 +36,9 @@ set(SIM_LDFLAGS $ENV{IMPERAS_HOME}/bin/$ENV{IMPERAS_ARCH}/libRuntimeLoader.so) include_directories(${CMAKE_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/core) +include_directories(${CMAKE_SOURCE_DIR}/src/core) include_directories(${CMAKE_BINARY_DIR}) -include_directories(${CMAKE_BINARY_DIR}/core) +include_directories(${CMAKE_BINARY_DIR}/src/core) include_directories($ENV{IMPERAS_HOME}/ImpPublic/include/host) #add_subdirectory(ovpworld.org/mmc/flakyMemory/1.0/model) diff --git a/ovp/OVPCpu.hpp b/simulators/ovp/OVPCpu.hpp similarity index 99% rename from ovp/OVPCpu.hpp rename to simulators/ovp/OVPCpu.hpp index 6ecee3f33a0d9cc2752d22d888ef93513623770a..512a60d5a691cb4adac7288e1ff9adcb273e6c65 100644 --- a/ovp/OVPCpu.hpp +++ b/simulators/ovp/OVPCpu.hpp @@ -2,7 +2,7 @@ #define _OVPCpu_HPP_ #include "icm/icmCpuManager.hpp" -#include "SAL/Register.hpp" +#include "sal/Register.hpp" #include "OVPPlatform.hpp" extern OVPPlatform ovpplatform; diff --git a/ovp/OVPPlatform.cc b/simulators/ovp/OVPPlatform.cc similarity index 95% rename from ovp/OVPPlatform.cc rename to simulators/ovp/OVPPlatform.cc index 218c90ca45a73fea35ea6c18b6b55d2dcf261c59..05cb5802ba626a73bbd4acd1519119b506781662 100644 --- a/ovp/OVPPlatform.cc +++ b/simulators/ovp/OVPPlatform.cc @@ -1,8 +1,8 @@ #include "OVPCpu.hpp" #include "OVPStatusRegister.hpp" #include "OVPPlatform.hpp" -#include "SAL/Register.hpp" -#include "SAL/SALInst.hpp" +#include "sal/Register.hpp" +#include "sal/SALInst.hpp" OVPPlatform ovpplatform; diff --git a/ovp/OVPPlatform.hpp b/simulators/ovp/OVPPlatform.hpp similarity index 100% rename from ovp/OVPPlatform.hpp rename to simulators/ovp/OVPPlatform.hpp diff --git a/ovp/OVPStatusRegister.hpp b/simulators/ovp/OVPStatusRegister.hpp similarity index 96% rename from ovp/OVPStatusRegister.hpp rename to simulators/ovp/OVPStatusRegister.hpp index 5acf424d6b4e79f631ab205ee1bfadc5a88d54f2..c18894b83ae594a4ea2536a86a4df020449f73d6 100644 --- a/ovp/OVPStatusRegister.hpp +++ b/simulators/ovp/OVPStatusRegister.hpp @@ -1,14 +1,13 @@ #ifndef __OVP_STATUS_REGISTER_HPP__ #define __OVP_STATUS_REGISTER_HPP__ -#include "SAL/ovp/OVPRegister.hpp" +#include "sal/ovp/OVPRegister.hpp" /** * \class OVPStatusRegister * Abstract class for status register implementation */ class OVPStatusRegister : public fail::OVPRegister { - protected: public: diff --git a/ovp/README b/simulators/ovp/README similarity index 100% rename from ovp/README rename to simulators/ovp/README diff --git a/ovp/armmModel/CMakeLists.txt b/simulators/ovp/armmModel/CMakeLists.txt similarity index 100% rename from ovp/armmModel/CMakeLists.txt rename to simulators/ovp/armmModel/CMakeLists.txt diff --git a/ovp/armmModel/Makefile b/simulators/ovp/armmModel/Makefile similarity index 100% rename from ovp/armmModel/Makefile rename to simulators/ovp/armmModel/Makefile diff --git a/ovp/armmModel/armAttributeEntriesThumb16.h b/simulators/ovp/armmModel/armAttributeEntriesThumb16.h similarity index 100% rename from ovp/armmModel/armAttributeEntriesThumb16.h rename to simulators/ovp/armmModel/armAttributeEntriesThumb16.h diff --git a/ovp/armmModel/armAttributeEntriesThumb32.h b/simulators/ovp/armmModel/armAttributeEntriesThumb32.h similarity index 100% rename from ovp/armmModel/armAttributeEntriesThumb32.h rename to simulators/ovp/armmModel/armAttributeEntriesThumb32.h diff --git a/ovp/armmModel/armBitMacros.h b/simulators/ovp/armmModel/armBitMacros.h similarity index 100% rename from ovp/armmModel/armBitMacros.h rename to simulators/ovp/armmModel/armBitMacros.h diff --git a/ovp/armmModel/armBus.c b/simulators/ovp/armmModel/armBus.c similarity index 100% rename from ovp/armmModel/armBus.c rename to simulators/ovp/armmModel/armBus.c diff --git a/ovp/armmModel/armConfig.h b/simulators/ovp/armmModel/armConfig.h similarity index 100% rename from ovp/armmModel/armConfig.h rename to simulators/ovp/armmModel/armConfig.h diff --git a/ovp/armmModel/armDebug.h b/simulators/ovp/armmModel/armDebug.h similarity index 100% rename from ovp/armmModel/armDebug.h rename to simulators/ovp/armmModel/armDebug.h diff --git a/ovp/armmModel/armDecode.h b/simulators/ovp/armmModel/armDecode.h similarity index 100% rename from ovp/armmModel/armDecode.h rename to simulators/ovp/armmModel/armDecode.h diff --git a/ovp/armmModel/armDecodeEntriesThumb16.h b/simulators/ovp/armmModel/armDecodeEntriesThumb16.h similarity index 100% rename from ovp/armmModel/armDecodeEntriesThumb16.h rename to simulators/ovp/armmModel/armDecodeEntriesThumb16.h diff --git a/ovp/armmModel/armDecodeEntriesThumb32.h b/simulators/ovp/armmModel/armDecodeEntriesThumb32.h similarity index 100% rename from ovp/armmModel/armDecodeEntriesThumb32.h rename to simulators/ovp/armmModel/armDecodeEntriesThumb32.h diff --git a/ovp/armmModel/armDecodeThumb.h b/simulators/ovp/armmModel/armDecodeThumb.h similarity index 100% rename from ovp/armmModel/armDecodeThumb.h rename to simulators/ovp/armmModel/armDecodeThumb.h diff --git a/ovp/armmModel/armDecodeTypes.h b/simulators/ovp/armmModel/armDecodeTypes.h similarity index 100% rename from ovp/armmModel/armDecodeTypes.h rename to simulators/ovp/armmModel/armDecodeTypes.h diff --git a/ovp/armmModel/armDisassemble.h b/simulators/ovp/armmModel/armDisassemble.h similarity index 100% rename from ovp/armmModel/armDisassemble.h rename to simulators/ovp/armmModel/armDisassemble.h diff --git a/ovp/armmModel/armDisassembleFormats.h b/simulators/ovp/armmModel/armDisassembleFormats.h similarity index 100% rename from ovp/armmModel/armDisassembleFormats.h rename to simulators/ovp/armmModel/armDisassembleFormats.h diff --git a/ovp/armmModel/armEmit.h b/simulators/ovp/armmModel/armEmit.h similarity index 100% rename from ovp/armmModel/armEmit.h rename to simulators/ovp/armmModel/armEmit.h diff --git a/ovp/armmModel/armExceptionTypes.h b/simulators/ovp/armmModel/armExceptionTypes.h similarity index 100% rename from ovp/armmModel/armExceptionTypes.h rename to simulators/ovp/armmModel/armExceptionTypes.h diff --git a/ovp/armmModel/armExceptions.h b/simulators/ovp/armmModel/armExceptions.h similarity index 100% rename from ovp/armmModel/armExceptions.h rename to simulators/ovp/armmModel/armExceptions.h diff --git a/ovp/armmModel/armFPConstants.h b/simulators/ovp/armmModel/armFPConstants.h similarity index 100% rename from ovp/armmModel/armFPConstants.h rename to simulators/ovp/armmModel/armFPConstants.h diff --git a/ovp/armmModel/armFunctions.h b/simulators/ovp/armmModel/armFunctions.h similarity index 100% rename from ovp/armmModel/armFunctions.h rename to simulators/ovp/armmModel/armFunctions.h diff --git a/ovp/armmModel/armInfo.c b/simulators/ovp/armmModel/armInfo.c similarity index 100% rename from ovp/armmModel/armInfo.c rename to simulators/ovp/armmModel/armInfo.c diff --git a/ovp/armmModel/armMessage.h b/simulators/ovp/armmModel/armMessage.h similarity index 100% rename from ovp/armmModel/armMessage.h rename to simulators/ovp/armmModel/armMessage.h diff --git a/ovp/armmModel/armMode.h b/simulators/ovp/armmModel/armMode.h similarity index 100% rename from ovp/armmModel/armMode.h rename to simulators/ovp/armmModel/armMode.h diff --git a/ovp/armmModel/armMorph.h b/simulators/ovp/armmModel/armMorph.h similarity index 100% rename from ovp/armmModel/armMorph.h rename to simulators/ovp/armmModel/armMorph.h diff --git a/ovp/armmModel/armMorphEntries.h b/simulators/ovp/armmModel/armMorphEntries.h similarity index 100% rename from ovp/armmModel/armMorphEntries.h rename to simulators/ovp/armmModel/armMorphEntries.h diff --git a/ovp/armmModel/armMorphFunctions.h b/simulators/ovp/armmModel/armMorphFunctions.h similarity index 100% rename from ovp/armmModel/armMorphFunctions.h rename to simulators/ovp/armmModel/armMorphFunctions.h diff --git a/ovp/armmModel/armRegisters.h b/simulators/ovp/armmModel/armRegisters.h similarity index 100% rename from ovp/armmModel/armRegisters.h rename to simulators/ovp/armmModel/armRegisters.h diff --git a/ovp/armmModel/armStructure.h b/simulators/ovp/armmModel/armStructure.h similarity index 100% rename from ovp/armmModel/armStructure.h rename to simulators/ovp/armmModel/armStructure.h diff --git a/ovp/armmModel/armSys.h b/simulators/ovp/armmModel/armSys.h similarity index 100% rename from ovp/armmModel/armSys.h rename to simulators/ovp/armmModel/armSys.h diff --git a/ovp/armmModel/armSysRegisters.h b/simulators/ovp/armmModel/armSysRegisters.h similarity index 100% rename from ovp/armmModel/armSysRegisters.h rename to simulators/ovp/armmModel/armSysRegisters.h diff --git a/ovp/armmModel/armTypeRefs.h b/simulators/ovp/armmModel/armTypeRefs.h similarity index 100% rename from ovp/armmModel/armTypeRefs.h rename to simulators/ovp/armmModel/armTypeRefs.h diff --git a/ovp/armmModel/armUtils.h b/simulators/ovp/armmModel/armUtils.h similarity index 100% rename from ovp/armmModel/armUtils.h rename to simulators/ovp/armmModel/armUtils.h diff --git a/ovp/armmModel/armVFP.h b/simulators/ovp/armmModel/armVFP.h similarity index 100% rename from ovp/armmModel/armVFP.h rename to simulators/ovp/armmModel/armVFP.h diff --git a/ovp/armmModel/armVM.h b/simulators/ovp/armmModel/armVM.h similarity index 100% rename from ovp/armmModel/armVM.h rename to simulators/ovp/armmModel/armVM.h diff --git a/ovp/armmModel/armVariant.h b/simulators/ovp/armmModel/armVariant.h similarity index 100% rename from ovp/armmModel/armVariant.h rename to simulators/ovp/armmModel/armVariant.h diff --git a/ovp/armmModel/armmAttrs.c b/simulators/ovp/armmModel/armmAttrs.c similarity index 100% rename from ovp/armmModel/armmAttrs.c rename to simulators/ovp/armmModel/armmAttrs.c diff --git a/ovp/armmModel/armmConfigList.c b/simulators/ovp/armmModel/armmConfigList.c similarity index 100% rename from ovp/armmModel/armmConfigList.c rename to simulators/ovp/armmModel/armmConfigList.c diff --git a/ovp/armmModel/armmDebug.c b/simulators/ovp/armmModel/armmDebug.c similarity index 100% rename from ovp/armmModel/armmDebug.c rename to simulators/ovp/armmModel/armmDebug.c diff --git a/ovp/armmModel/armmDecode.c b/simulators/ovp/armmModel/armmDecode.c similarity index 100% rename from ovp/armmModel/armmDecode.c rename to simulators/ovp/armmModel/armmDecode.c diff --git a/ovp/armmModel/armmDecodeThumb.c b/simulators/ovp/armmModel/armmDecodeThumb.c similarity index 100% rename from ovp/armmModel/armmDecodeThumb.c rename to simulators/ovp/armmModel/armmDecodeThumb.c diff --git a/ovp/armmModel/armmDisassemble.c b/simulators/ovp/armmModel/armmDisassemble.c similarity index 100% rename from ovp/armmModel/armmDisassemble.c rename to simulators/ovp/armmModel/armmDisassemble.c diff --git a/ovp/armmModel/armmDoc.c b/simulators/ovp/armmModel/armmDoc.c similarity index 100% rename from ovp/armmModel/armmDoc.c rename to simulators/ovp/armmModel/armmDoc.c diff --git a/ovp/armmModel/armmDoc.h b/simulators/ovp/armmModel/armmDoc.h similarity index 100% rename from ovp/armmModel/armmDoc.h rename to simulators/ovp/armmModel/armmDoc.h diff --git a/ovp/armmModel/armmEmit.c b/simulators/ovp/armmModel/armmEmit.c similarity index 100% rename from ovp/armmModel/armmEmit.c rename to simulators/ovp/armmModel/armmEmit.c diff --git a/ovp/armmModel/armmExceptions.c b/simulators/ovp/armmModel/armmExceptions.c similarity index 100% rename from ovp/armmModel/armmExceptions.c rename to simulators/ovp/armmModel/armmExceptions.c diff --git a/ovp/armmModel/armmMain.c b/simulators/ovp/armmModel/armmMain.c similarity index 100% rename from ovp/armmModel/armmMain.c rename to simulators/ovp/armmModel/armmMain.c diff --git a/ovp/armmModel/armmMorphFunctions.c b/simulators/ovp/armmModel/armmMorphFunctions.c similarity index 100% rename from ovp/armmModel/armmMorphFunctions.c rename to simulators/ovp/armmModel/armmMorphFunctions.c diff --git a/ovp/armmModel/armmMorphTable.c b/simulators/ovp/armmModel/armmMorphTable.c similarity index 100% rename from ovp/armmModel/armmMorphTable.c rename to simulators/ovp/armmModel/armmMorphTable.c diff --git a/ovp/armmModel/armmParameters.c b/simulators/ovp/armmModel/armmParameters.c similarity index 100% rename from ovp/armmModel/armmParameters.c rename to simulators/ovp/armmModel/armmParameters.c diff --git a/ovp/armmModel/armmParameters.h b/simulators/ovp/armmModel/armmParameters.h similarity index 100% rename from ovp/armmModel/armmParameters.h rename to simulators/ovp/armmModel/armmParameters.h diff --git a/ovp/armmModel/armmSemiHost.c b/simulators/ovp/armmModel/armmSemiHost.c similarity index 100% rename from ovp/armmModel/armmSemiHost.c rename to simulators/ovp/armmModel/armmSemiHost.c diff --git a/ovp/armmModel/armmSys.c b/simulators/ovp/armmModel/armmSys.c similarity index 100% rename from ovp/armmModel/armmSys.c rename to simulators/ovp/armmModel/armmSys.c diff --git a/ovp/armmModel/armmUtils.c b/simulators/ovp/armmModel/armmUtils.c similarity index 100% rename from ovp/armmModel/armmUtils.c rename to simulators/ovp/armmModel/armmUtils.c diff --git a/ovp/armmModel/armmVFP.c b/simulators/ovp/armmModel/armmVFP.c similarity index 100% rename from ovp/armmModel/armmVFP.c rename to simulators/ovp/armmModel/armmVFP.c diff --git a/ovp/armmModel/armmVM.c b/simulators/ovp/armmModel/armmVM.c similarity index 100% rename from ovp/armmModel/armmVM.c rename to simulators/ovp/armmModel/armmVM.c diff --git a/ovp/armmModel/export.def b/simulators/ovp/armmModel/export.def similarity index 100% rename from ovp/armmModel/export.def rename to simulators/ovp/armmModel/export.def diff --git a/ovp/armmModel/failSALlink.cc b/simulators/ovp/armmModel/failSALlink.cc similarity index 87% rename from ovp/armmModel/failSALlink.cc rename to simulators/ovp/armmModel/failSALlink.cc index 8fcada3e2e52c8e3fdee6e12d859c7c68f67720a..cdc59403e6e946fff68df3281f7834938bf21b32 100644 --- a/ovp/armmModel/failSALlink.cc +++ b/simulators/ovp/armmModel/failSALlink.cc @@ -1,5 +1,5 @@ #include <iostream> -//#include "SAL/SimulatorController.hpp" +//#include "sal/SimulatorController.hpp" using namespace std; diff --git a/ovp/cortexM3/CMakeLists.txt b/simulators/ovp/cortexM3/CMakeLists.txt similarity index 80% rename from ovp/cortexM3/CMakeLists.txt rename to simulators/ovp/cortexM3/CMakeLists.txt index 49b8393a72839b9f7ce6b0e769aabc5fd93908bd..32eff41d9381c12df3de5955b1f45c8f6a772bdd 100644 --- a/ovp/cortexM3/CMakeLists.txt +++ b/simulators/ovp/cortexM3/CMakeLists.txt @@ -10,6 +10,6 @@ add_executable(ovp_cortexM3 ${SRCS}) add_dependencies(ovp_cortexM3 ovpstatusmessages ) -target_link_libraries(ovp_cortexM3 ${SIM_LDFLAGS} SAL controller jobserver util ovpstatusmessages) +target_link_libraries(ovp_cortexM3 ${SIM_LDFLAGS} sal cpn comm efw util ovpstatusmessages) ## OVP links all needed shared libraries via a runtimeloader set_target_properties(ovp_cortexM3 PROPERTIES LINK_FLAGS "-L${CMAKE_BINARY_DIR}/lib -lpcl -lprotobuf -m32 ") diff --git a/ovp/cortexM3/platform/platform.cc b/simulators/ovp/cortexM3/platform/platform.cc similarity index 99% rename from ovp/cortexM3/platform/platform.cc rename to simulators/ovp/cortexM3/platform/platform.cc index 93454023d2f5efd5a29d6129cae6001769ad9a57..ac05e7aa9a105170fb7e393c978bd37321b8d1be 100644 --- a/ovp/cortexM3/platform/platform.cc +++ b/simulators/ovp/cortexM3/platform/platform.cc @@ -24,7 +24,7 @@ #include "platform.hpp" #include "statreg.hpp" -#include "SAL/SALInst.hpp" +#include "sal/SALInst.hpp" #include "icm/icmCpuManager.h" #include "icm/icmQuery.h" diff --git a/ovp/cortexM3/platform/platform.hpp b/simulators/ovp/cortexM3/platform/platform.hpp similarity index 100% rename from ovp/cortexM3/platform/platform.hpp rename to simulators/ovp/cortexM3/platform/platform.hpp diff --git a/ovp/cortexM3/platform/statreg.hpp b/simulators/ovp/cortexM3/platform/statreg.hpp similarity index 100% rename from ovp/cortexM3/platform/statreg.hpp rename to simulators/ovp/cortexM3/platform/statreg.hpp diff --git a/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/CMakeLists.txt b/simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/CMakeLists.txt similarity index 82% rename from ovp/ovpworld.org/mmc/flakyMemory/1.0/model/CMakeLists.txt rename to simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/CMakeLists.txt index c915107f49ecd044ac692e556221e8fd81187e73..5f48a2f4d0be152a8e79760f931b7b75c8056afe 100644 --- a/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/CMakeLists.txt +++ b/simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/CMakeLists.txt @@ -6,8 +6,8 @@ add_definitions("-m32") message(STATUS "flaky ld flags: ${HOST_LDFLAGS}") add_library(flaky SHARED ${SRCS}) -add_dependencies(flaky protomessages SAL) +add_dependencies(flaky msg sal) set_target_properties(flaky PROPERTIES LINK_FLAGS "${HOST_LDFLAGS} -m32") -target_link_libraries(flaky ${IMPERAS_VMISTUBS} ${LIBRARY_OUTPUT_PATH}/libSAL.a) +target_link_libraries(flaky ${IMPERAS_VMISTUBS} ${LIBRARY_OUTPUT_PATH}/libsal.a) diff --git a/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/flipBits.cpp b/simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/flipBits.cpp similarity index 100% rename from ovp/ovpworld.org/mmc/flakyMemory/1.0/model/flipBits.cpp rename to simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/flipBits.cpp diff --git a/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/flipBits.h b/simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/flipBits.h similarity index 100% rename from ovp/ovpworld.org/mmc/flakyMemory/1.0/model/flipBits.h rename to simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/flipBits.h diff --git a/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/model.cpp b/simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/model.cpp similarity index 98% rename from ovp/ovpworld.org/mmc/flakyMemory/1.0/model/model.cpp rename to simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/model.cpp index 26960297c416ef444976bbc38d00bcd19b8f733a..0e03f31eba088c551d6d8c6f4f5c7bfff6838316 100644 --- a/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/model.cpp +++ b/simulators/ovp/ovpworld.org/mmc/flakyMemory/1.0/model/model.cpp @@ -15,8 +15,8 @@ extern "C" { #include "flipBits.h" } -//#include "../core/SAL/ovp/OVPController.hpp" -#include "SAL/SALInst.hpp" +//#include "sal/ovp/OVPController.hpp" +#include "sal/SALInst.hpp" // Model prefix (used by vmiMessage interface) #define CPU_PREFIX "flakyMemory" diff --git a/ovp/setImperas.sh b/simulators/ovp/setImperas.sh similarity index 100% rename from ovp/setImperas.sh rename to simulators/ovp/setImperas.sh diff --git a/ovp/statusmsg/CMakeLists.txt b/simulators/ovp/statusmsg/CMakeLists.txt similarity index 100% rename from ovp/statusmsg/CMakeLists.txt rename to simulators/ovp/statusmsg/CMakeLists.txt diff --git a/ovp/statusmsg/OVPStatusMessage.proto b/simulators/ovp/statusmsg/OVPStatusMessage.proto similarity index 100% rename from ovp/statusmsg/OVPStatusMessage.proto rename to simulators/ovp/statusmsg/OVPStatusMessage.proto diff --git a/core/jobserver/messagedefs/protogen.sh b/simulators/ovp/statusmsg/protogen.sh similarity index 100% rename from core/jobserver/messagedefs/protogen.sh rename to simulators/ovp/statusmsg/protogen.sh diff --git a/ovp/test1/CMakeLists.txt b/simulators/ovp/test1/CMakeLists.txt similarity index 91% rename from ovp/test1/CMakeLists.txt rename to simulators/ovp/test1/CMakeLists.txt index 8b5448031ca661abdf0fc98caad2e8efeffd510a..2886eb3e6a09b27609994fedb04b5099dd927f15 100644 --- a/ovp/test1/CMakeLists.txt +++ b/simulators/ovp/test1/CMakeLists.txt @@ -7,7 +7,7 @@ set(SRCS platform/platform.cpp ) add_executable(ovp ${SRCS}) -add_dependencies(ovp protomessages) +add_dependencies(ovp msg) target_link_libraries(ovp ${SIM_LDFLAGS} ) ## OVP links all needed shared libraries via a runtimeloader set_target_properties(ovp PROPERTIES LINK_FLAGS " -m32 ") diff --git a/ovp/test1/application.elf b/simulators/ovp/test1/application.elf similarity index 100% rename from ovp/test1/application.elf rename to simulators/ovp/test1/application.elf diff --git a/ovp/test1/application/application.c b/simulators/ovp/test1/application/application.c similarity index 100% rename from ovp/test1/application/application.c rename to simulators/ovp/test1/application/application.c diff --git a/ovp/test1/platform/beforeInstruction.cpp b/simulators/ovp/test1/platform/beforeInstruction.cpp similarity index 100% rename from ovp/test1/platform/beforeInstruction.cpp rename to simulators/ovp/test1/platform/beforeInstruction.cpp diff --git a/ovp/test1/platform/beforeInstruction.hpp b/simulators/ovp/test1/platform/beforeInstruction.hpp similarity index 100% rename from ovp/test1/platform/beforeInstruction.hpp rename to simulators/ovp/test1/platform/beforeInstruction.hpp diff --git a/ovp/test1/platform/flakyMemory.cpp b/simulators/ovp/test1/platform/flakyMemory.cpp similarity index 100% rename from ovp/test1/platform/flakyMemory.cpp rename to simulators/ovp/test1/platform/flakyMemory.cpp diff --git a/ovp/test1/platform/flakyMemory.hpp b/simulators/ovp/test1/platform/flakyMemory.hpp similarity index 100% rename from ovp/test1/platform/flakyMemory.hpp rename to simulators/ovp/test1/platform/flakyMemory.hpp diff --git a/ovp/test1/platform/platform.cpp b/simulators/ovp/test1/platform/platform.cpp similarity index 100% rename from ovp/test1/platform/platform.cpp rename to simulators/ovp/test1/platform/platform.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..d5b7c565cc99fdfdddf3ef9574eb97a2bc016f64 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,39 @@ +### Setup search paths for headers ## +include_directories(${CMAKE_CURRENT_BINARY_DIR}/core) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/core) +# Note: CMAKE_CURRENT_BINARY_DIR is needed to find "FailConfig.hpp", which +# is generated by CMake from config/FailConfig.hpp.in and stored in +# your build-dir. (The same goes for "FailControlMessage.pb.h", etc.) +# This is done in the "src"-folder because experiments need to include +# Fail* headers as well (see hierarchy of CMakeLists.txt's). + +## Add CMakeLists from subdirectories ## +# The Fail* core source files (and it's subdirectories): +add_subdirectory(core) + +# Here we add all user-defined experiments (which fills the target list) +add_subdirectory(experiments/) +message(STATUS "[${PROJECT_NAME}] Chosen experiment targets:") +foreach(experiment_name ${EXPERIMENTS_ACTIVATED}) + message(STATUS "[${PROJECT_NAME}] -> ${experiment_name}") +endforeach(experiment_name) + +# Here we add activated plugins +add_subdirectory(plugins/) +message(STATUS "[${PROJECT_NAME}] Chosen plugin targets:") +foreach(plugin_name ${PLUGINS_ACTIVATED}) + message(STATUS "[${PROJECT_NAME}] -> ${plugin_name}") +endforeach(plugin_name) + +## Merge all resulting Fail* libs into a single libfail.a and copy it into the fail source directory +add_custom_target(fail + COMMAND ${CMAKE_SOURCE_DIR}/cmake/mergelib.sh ${LIBRARY_OUTPUT_PATH} && ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/libfail.a ${CMAKE_SOURCE_DIR}/src +) +# FIXME: "libfail.a" should not be located in the source-tree...?! + +## Setup build dependencies of the Fail* lib +## -> the Fail* targets and user defined experiment targets +add_dependencies(fail sal util cpn efw comm protomessages ${EXPERIMENTS_ACTIVATED} ${PLUGINS_ACTIVATED}) + +# Let make clean also delete libfail.a +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${LIBRARY_OUTPUT_PATH}/libfail.a) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8f5d5ea2efde4b630f3983df35a021147a737ee6 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,36 @@ +### Add Boost and Threads +find_package(Boost 1.42 COMPONENTS thread REQUIRED) +find_package(Threads) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) + +### Setup doxygen documentation +# TODO: put into helpers.cmake +find_package(Doxygen) +if(DOXYGEN_FOUND) +# Using a .in file means we can use CMake to insert project settings +# into the doxyfile. For example, CMake will replace @PROJECT_NAME@ in +# a configured file with the CMake PROJECT_NAME variable's value. +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY} +) + +## call make doc to generate documentation +add_custom_target(doc + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "[${PROJECT_NAME}] Generating Fail* documentation with Doxygen" VERBATIM +) +endif(DOXYGEN_FOUND) + +## Add CMakeLists from subdirectories ## +# The autogenerated header files +add_subdirectory(config) + +# Fail* targets +add_subdirectory(comm) +add_subdirectory(cpn) +add_subdirectory(efw) +add_subdirectory(sal) +add_subdirectory(util) diff --git a/core/Doxyfile.in b/src/core/Doxyfile.in similarity index 100% rename from core/Doxyfile.in rename to src/core/Doxyfile.in diff --git a/src/core/comm/CMakeLists.txt b/src/core/comm/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..279d3a095cc5c7fdea89ff2d718073aed0e1cea1 --- /dev/null +++ b/src/core/comm/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SRCS + SocketComm.cc +) + +add_subdirectory(msg) + +add_library(comm ${SRCS}) +add_dependencies(comm msg) diff --git a/core/controller/ExperimentData.hpp b/src/core/comm/ExperimentData.hpp similarity index 82% rename from core/controller/ExperimentData.hpp rename to src/core/comm/ExperimentData.hpp index dd90d96e856a117afa57862191b14229a1742085..a9bddfbd34a85f422d7fbd3002a38844d41b13d3 100644 --- a/core/controller/ExperimentData.hpp +++ b/src/core/comm/ExperimentData.hpp @@ -1,6 +1,6 @@ /** * \brief This is the base class for all user-defined data types for - * expirement parameter and results. + * expirement parameter and results. */ #ifndef __EXPERIMENT_DATA_HPP__ @@ -15,18 +15,17 @@ namespace fail { * \class ExperimentData * Container for experiment data with wrapper methods for serialization and deserialization. */ -class ExperimentData -{ +class ExperimentData { protected: google::protobuf::Message* msg; uint32_t m_workloadID; public: ExperimentData() : msg(0), m_workloadID(0) {}; - ExperimentData(google::protobuf::Message* m) : msg(m) , m_workloadID(0) {}; + ExperimentData(google::protobuf::Message* m) : msg(m) , m_workloadID(0) { } - google::protobuf::Message& getMessage() { return *msg; }; - uint32_t getWorkloadID() const { return m_workloadID;}; - void setWorkloadID(uint32_t id) { m_workloadID = id; }; + google::protobuf::Message& getMessage() { return *msg; } + uint32_t getWorkloadID() const { return m_workloadID; }; + void setWorkloadID(uint32_t id) { m_workloadID = id; } /** * Serializes the ExperimentData. * @param ped output the target-stream. diff --git a/core/jobserver/SocketComm.cc b/src/core/comm/SocketComm.cc similarity index 87% rename from core/jobserver/SocketComm.cc rename to src/core/comm/SocketComm.cc index 8ccb0835a43f1b07a8a99972b09ea12367a1934e..cb09d5357be9dbcb589dca08d13edd9503e4bd3a 100644 --- a/core/jobserver/SocketComm.cc +++ b/src/core/comm/SocketComm.cc @@ -4,7 +4,7 @@ namespace fail { -bool SocketComm::send_msg(int sockfd, google::protobuf::Message& msg) +bool SocketComm::sendMsg(int sockfd, google::protobuf::Message& msg) { #ifdef USE_SIZE_PREFIX int size = htonl(msg.ByteSize()); @@ -25,7 +25,7 @@ bool SocketComm::send_msg(int sockfd, google::protobuf::Message& msg) return true; } -bool SocketComm::rcv_msg(int sockfd, google::protobuf::Message& msg) +bool SocketComm::rcvMsg(int sockfd, google::protobuf::Message& msg) { #ifdef USE_SIZE_PREFIX int size; @@ -37,7 +37,7 @@ bool SocketComm::rcv_msg(int sockfd, google::protobuf::Message& msg) char *buf = new char[size]; // FIXME: read() may need to be called multiple times until all data was read if (read(sockfd, buf, size) != size) { - delete[] buf; + delete [] buf; return false; } std::string st(buf, size); diff --git a/core/jobserver/SocketComm.hpp b/src/core/comm/SocketComm.hpp similarity index 85% rename from core/jobserver/SocketComm.hpp rename to src/core/comm/SocketComm.hpp index b009dbb8f0d6ed7fb47da616d5035712df754899..097b023d6538818814480af3ee2939331c9352d6 100644 --- a/core/jobserver/SocketComm.hpp +++ b/src/core/comm/SocketComm.hpp @@ -19,21 +19,21 @@ namespace fail { class SocketComm { -public: +public: /** * Send Protobuf-generated message * @param sockfd open socket descriptor to write to * @param Msg Reference to Protobuf generated message type * \return false if message sending failed */ - static bool send_msg(int sockfd, google::protobuf::Message& msg); + static bool sendMsg(int sockfd, google::protobuf::Message& msg); /** * Receive Protobuf-generated message * @param sockfd open socket descriptor to read from * @param Msg Reference to Protobuf generated message type * \return false if message reception failed */ - static bool rcv_msg(int sockfd, google::protobuf::Message& msg); + static bool rcvMsg(int sockfd, google::protobuf::Message& msg); }; } // end-of-namespace: fail diff --git a/core/jobserver/messagedefs/CMakeLists.txt b/src/core/comm/msg/CMakeLists.txt similarity index 68% rename from core/jobserver/messagedefs/CMakeLists.txt rename to src/core/comm/msg/CMakeLists.txt index 7746f070d4813e36e7186cfcf7bce1e10c09748e..5bd41fad550d8b45f6f42f01d5bf0a48bf4f53ae 100644 --- a/core/jobserver/messagedefs/CMakeLists.txt +++ b/src/core/comm/msg/CMakeLists.txt @@ -8,8 +8,8 @@ find_package(Protobuf REQUIRED) include_directories(${PROTOBUF_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS} ) +PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS}) ## Build library -add_library(protomessages ${PROTO_SRCS} ${PROTO_HDRS} ) +add_library(msg ${PROTO_SRCS} ${PROTO_HDRS}) diff --git a/core/jobserver/messagedefs/FailControlMessage.proto b/src/core/comm/msg/FailControlMessage.proto similarity index 100% rename from core/jobserver/messagedefs/FailControlMessage.proto rename to src/core/comm/msg/FailControlMessage.proto diff --git a/ovp/statusmsg/protogen.sh b/src/core/comm/msg/protogen.sh similarity index 100% rename from ovp/statusmsg/protogen.sh rename to src/core/comm/msg/protogen.sh diff --git a/core/config/CMakeLists.txt b/src/core/config/CMakeLists.txt similarity index 93% rename from core/config/CMakeLists.txt rename to src/core/config/CMakeLists.txt index 0a5b17911238e7ed5da519fc97d281cd85281622..81bc32461884682351ef80c3b935503a4c0dc6ef 100644 --- a/core/config/CMakeLists.txt +++ b/src/core/config/CMakeLists.txt @@ -1,6 +1,6 @@ #### Configuration file emitting BUILD_OVP/BOCHS defines #### -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/variant_config.hpp.in - ${CMAKE_CURRENT_BINARY_DIR}/variant_config.hpp) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/VariantConfig.hpp.in + ${CMAKE_CURRENT_BINARY_DIR}/VariantConfig.hpp) OPTION(CONFIG_EVENT_BREAKPOINTS "Event source: Breakpoints" OFF) OPTION(CONFIG_EVENT_MEMREAD "Event source: Memory reads" OFF) diff --git a/core/config/FailConfig.hpp.in b/src/core/config/FailConfig.hpp.in similarity index 100% rename from core/config/FailConfig.hpp.in rename to src/core/config/FailConfig.hpp.in diff --git a/src/core/config/VariantConfig.hpp.in b/src/core/config/VariantConfig.hpp.in new file mode 100644 index 0000000000000000000000000000000000000000..6e591b3f43ecb6b618fbb3ff37083b76db97fcab --- /dev/null +++ b/src/core/config/VariantConfig.hpp.in @@ -0,0 +1,7 @@ +#ifndef __VARIANT_CONFIG_HPP__ + #define __VARIANT_CONFIG_HPP__ + +#cmakedefine BUILD_OVP +#cmakedefine BUILD_BOCHS + +#endif // __VARIANT_CONFIG_HPP__ diff --git a/src/core/cpn/CMakeLists.txt b/src/core/cpn/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..33576cecfc8c68e852d6182a07791a4e178c0589 --- /dev/null +++ b/src/core/cpn/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SRCS + CampaignManager.cc + JobServer.cc +) + +add_library(cpn ${SRCS}) + +add_dependencies(cpn comm) diff --git a/core/controller/Campaign.hpp b/src/core/cpn/Campaign.hpp similarity index 96% rename from core/controller/Campaign.hpp rename to src/core/cpn/Campaign.hpp index f11d29b54be6fcc98910e88271d9f9c2f13fa079..1fd155a319c0fd6efb295fc6f71215955e9d0966 100644 --- a/core/controller/Campaign.hpp +++ b/src/core/cpn/Campaign.hpp @@ -12,7 +12,7 @@ namespace fail { */ class Campaign { public: - Campaign() { }; + Campaign() { } /** * Defines the campaign. * @return \c true if the campaign was successful, \c false otherwise diff --git a/core/controller/CampaignManager.cc b/src/core/cpn/CampaignManager.cc similarity index 100% rename from core/controller/CampaignManager.cc rename to src/core/cpn/CampaignManager.cc diff --git a/core/controller/CampaignManager.hpp b/src/core/cpn/CampaignManager.hpp similarity index 94% rename from core/controller/CampaignManager.hpp rename to src/core/cpn/CampaignManager.hpp index 0c80cedf67f958bf9ea623894120bed9e6ec81a9..26b1ac99c2ebc0a6f9ed0c2857a973d8f55af032 100644 --- a/core/controller/CampaignManager.hpp +++ b/src/core/cpn/CampaignManager.hpp @@ -5,10 +5,10 @@ #ifndef __CAMPAIGN_MANAGER_HPP__ #define __CAMPAIGN_MANAGER_HPP__ -#include "SAL/SALInst.hpp" -#include "ExperimentData.hpp" -#include "jobserver/JobServer.hpp" -#include "controller/Campaign.hpp" +#include "sal/SALInst.hpp" +#include "comm/ExperimentData.hpp" +#include "JobServer.hpp" +#include "Campaign.hpp" namespace fail { @@ -60,14 +60,14 @@ public: * Signal, that there will not come any further parameter sets. */ void noMoreParameters() { m_jobserver.setNoMoreExperiments(); } - /** - * Wait actively, until all experiments expired. - */ -// void waitForCompletion(); /** * User campaign has finished. */ void done() { m_jobserver.done(); } + /** + * Wait actively, until all experiments expired. + */ +// void waitForCompletion(); }; extern CampaignManager campaignmanager; diff --git a/core/jobserver/JobServer.cc b/src/core/cpn/JobServer.cc similarity index 77% rename from core/jobserver/JobServer.cc rename to src/core/cpn/JobServer.cc index 126a45e72d62aed1b0be7779e50f7b63e8b5ba63..c61c909f3d400c2bf7b5be9fca3fc2d2042d9e7f 100644 --- a/core/jobserver/JobServer.cc +++ b/src/core/cpn/JobServer.cc @@ -9,10 +9,10 @@ #include <string.h> #include <arpa/inet.h> +#include "comm/msg/FailControlMessage.pb.h" +#include "comm/SocketComm.hpp" #include "JobServer.hpp" -#include "jobserver/messagedefs/FailControlMessage.pb.h" -#include "SocketComm.hpp" -#include "controller/Minion.hpp" +#include "Minion.hpp" #ifndef __puma #include <boost/thread.hpp> @@ -61,7 +61,7 @@ void JobServer::measure() // TODO: Log-level? cout << "\n[Server] Logging throughput in \"" << SERVER_PERF_LOG_PATH << "\"..." << endl; ofstream m_file(SERVER_PERF_LOG_PATH, std::ios::trunc); // overwrite existing perf-logs - if(!m_file.is_open()) { + if (!m_file.is_open()) { cerr << "[Server] Perf-logging has been enabled" << "but I was not able to write the log-file \"" << SERVER_PERF_LOG_PATH << "\"." << endl; @@ -71,7 +71,7 @@ void JobServer::measure() m_file << "time\tthroughput" << endl; unsigned diff = 0; - while(!m_finish) { + while (!m_finish) { // Format: 1st column (seconds)[TAB]2nd column (throughput) m_file << counter << "\t" << (m_DoneCount - diff) << endl; counter += SERVER_PERF_STEPPING_SEC; @@ -86,44 +86,47 @@ void JobServer::measure() #ifndef __puma /** - * This is a predicate class for the remove_if operator - * on the thread list. The operator waits for - * timeout milliseconds to join each thread in the list. - * If the join was successful, the exited thread is deallocated - * and removed from the list. + * This is a predicate class for the remove_if operator on the thread + * list. The operator waits for timeout milliseconds to join each + * thread in the list. If the join was successful, the exited thread + * is deallocated and removed from the list. */ struct timed_join_successful { - int timeout_ms; - timed_join_successful(int timeout) : timeout_ms(timeout){}; - - bool operator()( boost::thread * threadelement ){ - boost::posix_time::time_duration timeout = boost::posix_time::milliseconds(timeout_ms); - if(threadelement->timed_join(timeout)){ - delete threadelement; - return true; - }else{ - return false; + int timeout_ms; + timed_join_successful(int timeout) + : timeout_ms(timeout) { } + + bool operator()(boost::thread* threadelement) + { + boost::posix_time::time_duration timeout = boost::posix_time::milliseconds(timeout_ms); + if (threadelement->timed_join(timeout)) { + delete threadelement; + return true; + } else { + return false; + } } - -} }; #endif -void JobServer::run(){ +void JobServer::run() +{ struct sockaddr_in clientaddr; socklen_t clen = sizeof(clientaddr); // implementation of server-client communication int s; - if((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) { + if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) { perror("socket"); + // TODO: Log-level? return; } /* Enable address reuse */ int on = 1; - if(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) { + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) { perror("setsockopt"); + // TODO: Log-level? return; } @@ -134,37 +137,41 @@ void JobServer::run(){ saddr.sin_addr.s_addr = htons(INADDR_ANY); /* bind to port */ - if(bind(s, (struct sockaddr*) &saddr, sizeof(saddr)) == -1) { + if (bind(s, (struct sockaddr*) &saddr, sizeof(saddr)) == -1) { perror("bind"); + // TODO: Log-level? return; } /* Listen with a backlog of maxThreads */ - if(listen(s, m_maxThreads) == -1) { + if (listen(s, m_maxThreads) == -1) { perror("listen"); + // TODO: Log-level? return; } cout << "JobServer listening...." << endl; + // TODO: Log-level? #ifndef __puma boost::thread* th; while(!m_finish){ // Accept connection int cs = accept(s, (struct sockaddr*)&clientaddr, &clen); - if(cs == -1) { + if (cs == -1) { perror("accept"); + // TODO: Log-level? return; } // Spawn a thread for further communication, // and add this thread to a list threads // We can limit the generation of threads here. - if(m_threadlist.size() < m_maxThreads){ + if (m_threadlist.size() < m_maxThreads) { th = new boost::thread(CommThread(cs, *this)); m_threadlist.push_back(th); - }else{ + } else { // Run over list with a timed_join, // removing finished threads. do { - m_threadlist.remove_if( timed_join_successful(m_threadtimeout) ); + m_threadlist.remove_if(timed_join_successful(m_threadtimeout)); } while(m_threadlist.size() == m_maxThreads); // Start new thread th = new boost::thread(CommThread(cs, *this)); @@ -175,9 +182,8 @@ void JobServer::run(){ close(s); // when all undone Jobs are distributed -> call a timed_join on all spawned // TODO: interrupt threads that do not want to join.. - while(m_threadlist.size() > 0){ + while (m_threadlist.size() > 0) m_threadlist.remove_if( timed_join_successful(m_threadtimeout) ); - } #endif } @@ -189,7 +195,7 @@ void CommThread::operator()() FailControlMessage ctrlmsg; minion.setSocketDescriptor(m_sock); - if (!SocketComm::rcv_msg(minion.getSocketDescriptor(), ctrlmsg)) { + if (!SocketComm::rcvMsg(minion.getSocketDescriptor(), ctrlmsg)) { cout << "!![Server] failed to read complete message from client" << endl; close(m_sock); return; @@ -211,7 +217,7 @@ void CommThread::operator()() ctrlmsg.Clear(); ctrlmsg.set_command(FailControlMessage_Command_DIE); ctrlmsg.set_build_id(42); - SocketComm::send_msg(minion.getSocketDescriptor(), ctrlmsg); + SocketComm::sendMsg(minion.getSocketDescriptor(), ctrlmsg); } close(m_sock); @@ -226,26 +232,26 @@ void CommThread::sendPendingExperimentData(Minion& minion) FailControlMessage ctrlmsg; ctrlmsg.set_build_id(42); ExperimentData * exp = 0; - if(m_js.m_undoneJobs.Dequeue_nb(exp) == true) { + if (m_js.m_undoneJobs.Dequeue_nb(exp) == true) { // Got an element from queue, assign ID to workload and send to minion uint32_t workloadID = m_js.m_counter.increment(); // increment workload counter exp->setWorkloadID(workloadID); // store ID for identification when receiving result - if(!m_js.m_runningJobs.insert(workloadID, exp)) { + if (!m_js.m_runningJobs.insert(workloadID, exp)) { cout << "!![Server]could not insert workload id: [" << workloadID << "] double entry?" << endl; } ctrlmsg.set_command(FailControlMessage_Command_WORK_FOLLOWS); ctrlmsg.set_workloadid(workloadID); // set workload id //cout << ">>[Server] Sending workload [" << workloadID << "]" << endl; cout << ">>[" << workloadID << "] " << flush; - SocketComm::send_msg(minion.getSocketDescriptor(), ctrlmsg); - SocketComm::send_msg(minion.getSocketDescriptor(), exp->getMessage()); + SocketComm::sendMsg(minion.getSocketDescriptor(), ctrlmsg); + SocketComm::sendMsg(minion.getSocketDescriptor(), exp->getMessage()); return; } #ifndef __puma boost::unique_lock<boost::mutex> lock(m_CommMutex); #endif - if((exp = m_js.m_runningJobs.pickone()) != NULL) { // 2nd priority + if ((exp = m_js.m_runningJobs.pickone()) != NULL) { // 2nd priority // (This picks one running job.) // TODO: Improve selection of parameter set to be resent: // - currently: Linear complexity! @@ -263,19 +269,19 @@ void CommThread::sendPendingExperimentData(Minion& minion) ctrlmsg.set_workloadid(workloadID); // set workload id //cout << ">>[Server] Re-sending workload [" << workloadID << "]" << endl; cout << ">>R[" << workloadID << "] " << flush; - SocketComm::send_msg(minion.getSocketDescriptor(), ctrlmsg); - SocketComm::send_msg(minion.getSocketDescriptor(), exp->getMessage()); - } else if(m_js.noMoreExperiments() == false) { + SocketComm::sendMsg(minion.getSocketDescriptor(), ctrlmsg); + SocketComm::sendMsg(minion.getSocketDescriptor(), exp->getMessage()); + } else if (m_js.noMoreExperiments() == false) { // Currently we have no workload (even the running-job-queue is empty!), but // the campaign is not over yet. Minion can try again later. ctrlmsg.set_command(FailControlMessage_Command_COME_AGAIN); - SocketComm::send_msg(minion.getSocketDescriptor(), ctrlmsg); + SocketComm::sendMsg(minion.getSocketDescriptor(), ctrlmsg); cout << "--[Server] No workload, come again..." << endl; } else { // No more elements, and campaign is over. Minion can die. ctrlmsg.set_command(FailControlMessage_Command_DIE); cout << "--[Server] No workload, and no campaign, please die." << endl; - SocketComm::send_msg(minion.getSocketDescriptor(), ctrlmsg); + SocketComm::sendMsg(minion.getSocketDescriptor(), ctrlmsg); } } @@ -288,8 +294,8 @@ void CommThread::receiveExperimentResults(Minion& minion, uint32_t workloadID) ExperimentData * exp; // Get exp* from running jobs //cout << "<<[Server] Received result for workload id [" << workloadID << "]" << endl; cout << "<<[" << workloadID << "] " << flush; - if(m_js.m_runningJobs.remove(workloadID, exp)) { // ExperimentData* found - SocketComm::rcv_msg(minion.getSocketDescriptor(), exp->getMessage() ); // deserialize results. + if (m_js.m_runningJobs.remove(workloadID, exp)) { // ExperimentData* found + SocketComm::rcvMsg(minion.getSocketDescriptor(), exp->getMessage() ); // deserialize results. m_js.m_doneJobs.Enqueue(exp); // Put results in done queue.. #ifdef SERVER_PERFORMANCE_MEASURE ++JobServer::m_DoneCount; diff --git a/core/jobserver/JobServer.hpp b/src/core/cpn/JobServer.hpp similarity index 75% rename from core/jobserver/JobServer.hpp rename to src/core/cpn/JobServer.hpp index 431963002085da4b877e4d2c459679e8d61014df..66ecee3943f2f1d1fc812a1e83466068edcaedd6 100644 --- a/core/jobserver/JobServer.hpp +++ b/src/core/cpn/JobServer.hpp @@ -1,7 +1,7 @@ #ifndef __JOB_SERVER_H__ #define __JOB_SERVER_H__ -#include "controller/Minion.hpp" +#include "Minion.hpp" #include "util/SynchronizedQueue.hpp" #include "util/SynchronizedCounter.hpp" #include "util/SynchronizedMap.hpp" @@ -25,8 +25,8 @@ class CommThread; * experiment parameter sets, which the Jobserver will distribute to requesting * clients. The campaign controller can wait for all results, or a timeout. */ -class JobServer -{ +class JobServer { +private: //! The TCP Port number int m_port; //! TODO nice termination concept @@ -51,7 +51,6 @@ class JobServer boost::thread* m_measureThread; //! the performance measurement thread #endif #endif - //! Atomic counter for Workload IDs. SynchronizedCounter m_counter; //! Map of running jobs (referenced by Workload ID @@ -61,16 +60,28 @@ class JobServer //! List of finished experiment results. SynchronizedQueue<ExperimentData*> m_doneJobs; friend class CommThread; //!< CommThread is allowed access the job queues. + /** + * The actual startup of the Jobserver. + * Here we initalize the network socket + * and listen for connections. + */ + void run(); +#ifdef SERVER_PERFORMANCE_MEASURE + void measure(); +#endif + void sendWork(int sockfd); + public: JobServer(int port = 1111) : m_port(port), m_finish(false), m_noMoreExps(false), - m_maxThreads(128), m_threadtimeout(0) { + m_maxThreads(128), m_threadtimeout(0) + { #ifndef __puma - m_serverThread = new boost::thread(&JobServer::run, this); // run operator()() in a thread. + m_serverThread = new boost::thread(&JobServer::run, this); // run operator()() in a thread. #ifdef SERVER_PERFORMANCE_MEASURE - m_measureThread = new boost::thread(&JobServer::measure, this); + m_measureThread = new boost::thread(&JobServer::measure, this); #endif #endif - }; + } ~JobServer() { #ifndef __puma @@ -80,58 +91,37 @@ public: delete m_measureThread; #endif #endif // __puma - }; - - private: - - /** - * The actual startup of the Jobserver. - * Here we initalize the network socket - * and listen for connections. - */ - void run(); -#ifdef SERVER_PERFORMANCE_MEASURE - void measure(); -#endif - - void sendWork(int sockfd); - -public: - + } /** * Adds a new experiment data set to the job queue. * @param data Pointer to an expoeriment data object - */ + */ void addParam(ExperimentData* data); - /** - * Retrieve an experiment result. - * - * Blocks if we currently have no results. Returns NULL if no results - * are to be expected, because no parameter sets were enqueued - * beforehand. + * Retrieve an experiment result. Blocks if we currently have no results. + * Returns \c NULL if no results are to be expected, because no parameter + * sets were enqueued beforehand. + * @return pointer to experiment result data */ ExperimentData* getDone(); - /** - * The Campaign controller must signalize, that - * there will be no more parameter sets. - * We need this, as we allow concurrent parameter + * The Campaign controller must signalize, that there will be no + * more parameter sets. We need this, as we allow concurrent parameter * generation and distribution. */ - void setNoMoreExperiments(){ m_noMoreExps = true; }; - + void setNoMoreExperiments() { m_noMoreExps = true; } /** - * corresponding getter-method @see setNoMoreExperiments + * Checks whether there are no more experiment paremeter sets. + * @return \c true if no more parameter sets available, \c false otherwise + * @see setNoMoreExperiments */ - bool noMoreExperiments()const { return m_noMoreExps; }; + bool noMoreExperiments() const { return m_noMoreExps; } /** - * The Campaign Controller can signalize, that - * the jobserver can stop listening for client - * connections. + * The Campaign Controller can signalize, that the jobserver can + * stop listening for client connections. */ - void done() { m_finish = true; }; + void done() { m_finish = true; } }; /** @@ -141,19 +131,14 @@ public: * with the minions. */ class CommThread { +private: int m_sock; //! Socket descriptor of the connection JobServer& m_js; //! Calling jobserver #ifndef __puma static boost::mutex m_CommMutex; //! to synchronise the communication #endif // __puma -public: - CommThread(int sockfd, JobServer& p) : m_sock(sockfd), m_js(p) {}; - /** - * The thread's entry point. - */ - void operator() (); -private: - /// FIXME concerns are not really separated yet ;) + + // FIXME: Concerns are not really separated yet ;) /** * Called after minion calls for work. * Tries to deque a parameter set non blocking, and @@ -169,6 +154,13 @@ private: * @param workloadID The workload id of the result message */ void receiveExperimentResults(Minion& minion, uint32_t workloadID); +public: + CommThread(int sockfd, JobServer& p) + : m_sock(sockfd), m_js(p) { } + /** + * The thread's entry point. + */ + void operator()(); }; } // end-of-namespace: fail diff --git a/src/core/cpn/Minion.hpp b/src/core/cpn/Minion.hpp new file mode 100644 index 0000000000000000000000000000000000000000..dd6da7df9d73faf61044bc3bee8a798ff09eade8 --- /dev/null +++ b/src/core/cpn/Minion.hpp @@ -0,0 +1,71 @@ +/** + * \brief The representation of a minion. + */ + +#ifndef __MINION_HPP__ + #define __MINION_HPP__ + +#include <string> + +#include "comm/ExperimentData.hpp" + +namespace fail { + +/** + * \class Minion + * + * Contains all informations about a minion. + */ +class Minion { +private: + std::string hostname; + bool isWorking; + ExperimentData* currentExperimentData; + int sockfd; +public: + Minion() : isWorking(false), currentExperimentData(0), sockfd(-1) { } + /** + * Sets the socket descriptor. + * @param sock the new socket descriptor (used internal) + */ + void setSocketDescriptor(int sock) { sockfd = sock; } + /** + * Retrives the socket descriptor. + * @return the socket descriptor + */ + int getSocketDescriptor() const { return (sockfd); } + /** + * Returns the hostname of the minion. + * @return the hostname + */ + const std::string& getHostname() { return (hostname); } + /** + * Sets the hostname of the minion. + * @param host the hostname + */ + void setHostname(const std::string& host) { hostname = host; } + /** + * Returns the current ExperimentData which the minion is working with. + * @return a pointer of the current ExperimentData + */ + ExperimentData* getCurrentExperimentData() { return currentExperimentData; } + /** + * Sets the current ExperimentData which the minion is working with. + * @param exp the current ExperimentData + */ + void setCurrentExperimentData(ExperimentData* exp) { currentExperimentData = exp; } + /** + * Returns the current state of the minion. + * @return the current state + */ + bool isBusy() { return (isWorking); } + /** + * Sets the current state of the minion + * @param state the current state + */ + void setBusy(bool state) { isWorking = state; } +}; + +} // end-of-namespace: fail + +#endif // __MINION_HPP__ diff --git a/src/core/efw/CMakeLists.txt b/src/core/efw/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..cbe589d81a5409e761819072dbad03c9143983c5 --- /dev/null +++ b/src/core/efw/CMakeLists.txt @@ -0,0 +1,10 @@ +set(SRCS + CoroutineManager.cc + JobClient.cc +) + +# FIXME: Add dependency check for pcl-library here. + +add_library(efw ${SRCS}) + +add_dependencies(efw comm) diff --git a/core/controller/CoroutineManager.cc b/src/core/efw/CoroutineManager.cc similarity index 93% rename from core/controller/CoroutineManager.cc rename to src/core/efw/CoroutineManager.cc index 506ac64c791e0535be01c40bfdb5fd1b690b96f4..8254714952e5c40044e0ebc1d3f7e099e4295508 100644 --- a/core/controller/CoroutineManager.cc +++ b/src/core/efw/CoroutineManager.cc @@ -2,7 +2,7 @@ #include <cassert> #include "CoroutineManager.hpp" -#include "../controller/ExperimentFlow.hpp" +#include "ExperimentFlow.hpp" namespace fail { @@ -81,10 +81,11 @@ void CoroutineManager::resume() ExperimentFlow* CoroutineManager::getCurrent() { coroutine_t cr = co_current(); - for(std::map<ExperimentFlow*,corohandle_t>::iterator it = m_Flows.begin(); + for (std::map<ExperimentFlow*,corohandle_t>::iterator it = m_Flows.begin(); it != m_Flows.end(); it++) - if(it->second == cr) - return (it->first); + if (it->second == cr) + return it->first; + assert(false && "FATAL ERROR: The current flow could not be retrieved!"); return 0; } diff --git a/src/core/efw/CoroutineManager.hpp b/src/core/efw/CoroutineManager.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d7a40e6601e2df9d8fec87624c9f77d901d9375e --- /dev/null +++ b/src/core/efw/CoroutineManager.hpp @@ -0,0 +1,72 @@ +#ifndef __COROUTINE_MANAGER_HPP__ + #define __COROUTINE_MANAGER_HPP__ + +#include <map> +#include <stack> + +#include <pcl.h> // the underlying "portable coroutine library" + +namespace fail { + +class ExperimentFlow; + +/** + * \class CoroutineManager + * Manages the experiments flow encapsulated in coroutines. Each + * experiment (flow) has it's associated data structure which is + * represented by the ExperimentData-class. + */ +class CoroutineManager { +private: + //! the default stack size for coroutines (= experiment flows) + static const unsigned STACK_SIZE_DEFAULT = 4096*4096; + //! the abstraction for coroutine identification + typedef coroutine_t corohandle_t; + typedef std::map<ExperimentFlow*,corohandle_t> flowmap_t; + //! the mapping "flows <-> coro-handle" + flowmap_t m_Flows; + //! the simulator/backend coroutine handle + corohandle_t m_simCoro; + //! stack of coroutines that explicitly activated another one with toggle() + std::stack<corohandle_t> m_togglerstack; + //! manages the run-calls for each ExperimentFlow-object + static void m_invoke(void* pData); +public: + static const ExperimentFlow* SIM_FLOW; //!< the simulator coroutine flow + + CoroutineManager() : m_simCoro(co_current()) { } + ~CoroutineManager(); + /** + * Creates a new coroutine for the specified experiment flow. + * @param flow the flow to be executed in the newly created coroutine + */ + void create(ExperimentFlow* flow); + /** + * Destroys coroutine for the specified experiment flow. + * @param flow the flow to be removed + */ + void remove(ExperimentFlow* flow); + /** + * Switches the control flow to the experiment \a flow. If \a flow is + * equal to \c SIM_FLOW, the control will be handed back to the + * simulator. The current control flow is pushed onto an + * internal stack. + * @param flow the destination control flow or \c SIM_FLOW (= \c NULL ) + */ + void toggle(ExperimentFlow* flow); + /** + * Gives the control back to the coroutine that toggle()d the + * current one, by drawing from the internal stack built from + * calls to toggle(). + */ + void resume(); + /** + * Retrieves the current (active) coroutine (= flow). + * @return the current experiment flow. + */ + ExperimentFlow* getCurrent(); +}; + +} // end-of-namespace: fail + +#endif // __COROUTINE_MANAGER_HPP__ diff --git a/src/core/efw/ExperimentFlow.hpp b/src/core/efw/ExperimentFlow.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5825bfe5ba7acb653feb564c728bf237c13fa9eb --- /dev/null +++ b/src/core/efw/ExperimentFlow.hpp @@ -0,0 +1,37 @@ +#ifndef __EXPERIMENT_FLOW_HPP__ + #define __EXPERIMENT_FLOW_HPP__ + +#include "sal/SALInst.hpp" + +namespace fail { + +/** + * \class ExperimentFlow + * Basic interface for user-defined experiments. To create a new experiment, + * derive your own class from ExperimentFlow and define the run method. + */ +class ExperimentFlow { +public: + ExperimentFlow() { } + /** + * Defines the experiment flow. + * @return \c true if the experiment was successful, \c false otherwise + */ + virtual bool run() = 0; + /** + * The entry point for this experiment's coroutine. + * Should do some cleanup afterwards. + */ + void coroutine_entry() + { + run(); + simulator.clearEvents(this); // remove residual events + // FIXME: Consider removing this call (see EventList.cc, void remove(ExperimentFlow* flow)) + // a) with the advantage that we will potentially prevent serious segfaults but + // b) with the drawback that we cannot enforce any cleanups. + } +}; + +} // end-of-namespace: fail + +#endif // __EXPERIMENT_FLOW_HPP__ diff --git a/core/jobserver/JobClient.cc b/src/core/efw/JobClient.cc similarity index 51% rename from core/jobserver/JobClient.cc rename to src/core/efw/JobClient.cc index d616c0b4c82ba5f89df33f2ce41f97d3d8947545..b3770be52469f0c8f9b15fa3c6ee665bfff23089 100644 --- a/core/jobserver/JobClient.cc +++ b/src/core/efw/JobClient.cc @@ -4,7 +4,7 @@ using namespace std; namespace fail { -JobClient::JobClient(std::string server, int port) +JobClient::JobClient(const std::string& server, int port) { m_server_port = port; m_server = server; @@ -37,12 +37,12 @@ bool JobClient::connectToServer() memcpy(&serv_addr.sin_addr.s_addr, m_server_ent->h_addr, m_server_ent->h_length); serv_addr.sin_port = htons(m_server_port); - int retries = CLIENT_RETRY_COUNT; - while(true) { - if(connect(m_sockfd, (sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { + int retries = CLIENT_RETRY_COUNT; + while (true) { + if (connect(m_sockfd, (sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { perror("[Client@connect()]"); // TODO: Log-level? - if(retries > 0) { + if (retries > 0) { // Wait CLIENT_RAND_BACKOFF_TSTART to RAND_BACKOFF_TEND seconds: int delay = rand() % (CLIENT_RAND_BACKOFF_TEND-CLIENT_RAND_BACKOFF_TSTART) + CLIENT_RAND_BACKOFF_TSTART; cout << "[Client] Retrying to connect to server in ~" << delay << "s..." << endl; @@ -62,67 +62,72 @@ bool JobClient::connectToServer() cout << "[Client] Connection established!" << endl; // TODO: Log-level? - return true; + return true; } -bool JobClient::getParam(ExperimentData& exp){ - while(1) { // Here we try to acquire a parameter set - switch(tryToGetExperimentData(exp)){ - // Jobserver will sent workload, params are set in \c exp - case FailControlMessage_Command_WORK_FOLLOWS: return true; - // Nothing to do right now, but maybe later - case FailControlMessage_Command_COME_AGAIN: - sleep(1); - continue; - default: - return false; - } +bool JobClient::getParam(ExperimentData& exp) +{ + while (1) { // Here we try to acquire a parameter set + switch (tryToGetExperimentData(exp)) { + // Jobserver will sent workload, params are set in \c exp + case FailControlMessage_Command_WORK_FOLLOWS: return true; + // Nothing to do right now, but maybe later + case FailControlMessage_Command_COME_AGAIN: + sleep(1); + continue; + default: + return false; } + } } + FailControlMessage_Command JobClient::tryToGetExperimentData(ExperimentData& exp) { - // Connection failed, minion can die - if( !connectToServer() ) return FailControlMessage_Command_DIE; - - // Retrieve ExperimentData - FailControlMessage ctrlmsg; - ctrlmsg.set_command(FailControlMessage_Command_NEED_WORK); - ctrlmsg.set_build_id(42); + // Connection failed, minion can die + if (!connectToServer()) + return FailControlMessage_Command_DIE; - SocketComm::send_msg(m_sockfd, ctrlmsg); - ctrlmsg.Clear(); - SocketComm::rcv_msg(m_sockfd, ctrlmsg); + // Retrieve ExperimentData + FailControlMessage ctrlmsg; + ctrlmsg.set_command(FailControlMessage_Command_NEED_WORK); + ctrlmsg.set_build_id(42); - switch(ctrlmsg.command()){ - case FailControlMessage_Command_WORK_FOLLOWS: - SocketComm::rcv_msg(m_sockfd, exp.getMessage()); + SocketComm::sendMsg(m_sockfd, ctrlmsg); + ctrlmsg.Clear(); + SocketComm::rcvMsg(m_sockfd, ctrlmsg); + + switch (ctrlmsg.command()) { + case FailControlMessage_Command_WORK_FOLLOWS: + SocketComm::rcvMsg(m_sockfd, exp.getMessage()); exp.setWorkloadID(ctrlmsg.workloadid()); // Store workload id of experiment data break; - case FailControlMessage_Command_COME_AGAIN: + case FailControlMessage_Command_COME_AGAIN: break; - - default: + default: break; - } - close(m_sockfd); - return ctrlmsg.command(); + } + close(m_sockfd); + return ctrlmsg.command(); } bool JobClient::sendResult(ExperimentData& result) { - if (!connectToServer() ) return false; - // Send back results - FailControlMessage ctrlmsg; - ctrlmsg.set_command(FailControlMessage_Command_RESULT_FOLLOWS); - ctrlmsg.set_build_id(42); - ctrlmsg.set_workloadid(result.getWorkloadID()); - cout << "[Client] Sending back result [" << std::dec << result.getWorkloadID() << "]..." << endl; - // TODO: Log-level? - SocketComm::send_msg(m_sockfd, ctrlmsg); - SocketComm::send_msg(m_sockfd, result.getMessage()); - // close connection. - close(m_sockfd); - return true; + if (!connectToServer()) + return false; + + // Send back results + FailControlMessage ctrlmsg; + ctrlmsg.set_command(FailControlMessage_Command_RESULT_FOLLOWS); + ctrlmsg.set_build_id(42); + ctrlmsg.set_workloadid(result.getWorkloadID()); + cout << "[Client] Sending back result [" << std::dec << result.getWorkloadID() << "]..." << endl; + // TODO: Log-level? + SocketComm::sendMsg(m_sockfd, ctrlmsg); + SocketComm::sendMsg(m_sockfd, result.getMessage()); + + // Close connection. + close(m_sockfd); + return true; } } // end-of-namespace: fail diff --git a/core/jobserver/JobClient.hpp b/src/core/efw/JobClient.hpp similarity index 83% rename from core/jobserver/JobClient.hpp rename to src/core/efw/JobClient.hpp index faa1fd7e5458d8bc8eea33375f343efc32195e12..ec6757b742c4acb41901890ed15964d4f58a5119 100644 --- a/core/jobserver/JobClient.hpp +++ b/src/core/efw/JobClient.hpp @@ -7,9 +7,9 @@ #include <unistd.h> #include <iostream> -#include "SocketComm.hpp" -#include "controller/ExperimentData.hpp" -#include "jobserver/messagedefs/FailControlMessage.pb.h" +#include "comm/SocketComm.hpp" +#include "comm/ExperimentData.hpp" +#include "comm/msg/FailControlMessage.pb.h" #include "config/FailConfig.hpp" namespace fail { @@ -29,10 +29,9 @@ private: bool connectToServer(); - FailControlMessage_Command tryToGetExperimentData(ExperimentData& exp); + FailControlMessage_Command tryToGetExperimentData(ExperimentData& exp); public: - // FIXME: This should be a const reference to std::string... - JobClient(std::string server = "localhost", int port = 1111); + JobClient(const std::string& server = "localhost", int port = 1111); /** * Receive experiment data set from (remote) JobServer * The caller (experiment developer) is responsible for @@ -42,7 +41,6 @@ public: * @return \c true if parameter have been received and put into \c exp, \c false else. */ bool getParam(ExperimentData& exp); - /** * Send back experiment result to the (remote) JobServer * The caller (experiment developer) is responsible for diff --git a/core/controller/BufferCache.cc b/src/core/sal/BufferCache.cc similarity index 81% rename from core/controller/BufferCache.cc rename to src/core/sal/BufferCache.cc index 058c9407efe8e082ae2ab6505e28c84958239944..cc876f77847e12bcf6e9fe3e22a2d0288682c4d2 100644 --- a/core/controller/BufferCache.cc +++ b/src/core/sal/BufferCache.cc @@ -3,7 +3,8 @@ namespace fail { -template<class T> int BufferCache<T>::add(T val) +template<class T> +int BufferCache<T>::add(T val) { size_t new_size = getCount() + 1; size_t new_last_index = getCount(); @@ -16,7 +17,8 @@ template<class T> int BufferCache<T>::add(T val) return res; } -template<class T> int BufferCache<T>::remove(T val) +template<class T> +int BufferCache<T>::remove(T val) { bool do_remove = false; for (size_t i = 0; i < getCount(); i++) { @@ -39,14 +41,16 @@ template<class T> int BufferCache<T>::remove(T val) return res; } -template<class T> void BufferCache<T>::clear() +template<class T> +void BufferCache<T>::clear() { setCount(0); free(m_Buffer); m_Buffer = NULL; } -template<class T> int BufferCache<T>::erase(int idx) +template<class T> +int BufferCache<T>::erase(int idx) { for (size_t i = idx; i < getCount() - 1; i++) { set(i, get(i + 1)); @@ -58,7 +62,8 @@ template<class T> int BufferCache<T>::erase(int idx) return idx; } -template<class T> int BufferCache<T>::reallocate_buffer(size_t new_size) +template<class T> +int BufferCache<T>::reallocate_buffer(size_t new_size) { if (new_size == 0) { clear(); diff --git a/core/controller/BufferCache.hpp b/src/core/sal/BufferCache.hpp similarity index 90% rename from core/controller/BufferCache.hpp rename to src/core/sal/BufferCache.hpp index 7ae3355bfccb7c4b2154eeeed699e142742b1a95..c08c4efac8ca886a90f1005a256db08ad254d9b5 100644 --- a/core/controller/BufferCache.hpp +++ b/src/core/sal/BufferCache.hpp @@ -17,8 +17,32 @@ namespace fail { * untyped and therefore quite slow event handling mechanism of Fail*. * To keep the code easily readable, the buffer management methods * are less performant than the could be (remove() and erase() have linear complexity). + * + * FIXME: This desription sounds like a contradiction... + * (-> "quite slow event handling" vs. "are less performant than the could be") + * + * FIXME: Why not using std::vector? ("A simple dynamic array") */ -template<class T> class BufferCache { +template<class T> +class BufferCache { +private: + // TODO: comments ("//!<") needed! + T *m_Buffer; + size_t m_BufferCount; +protected: + /** + * Changes the current length of the array. Should be inlined. + * @param new_count the new array length + */ + inline void setCount(size_t new_count) { m_BufferCount = new_count; } + /** + * Reallocates the buffer. This implementation is extremely primitive, + * but since the amount of entries is small, + * this will not be significant, hopefully. Should be inlined. + * @param new_size the new number of elements in the array + * @return 0 if successful, an error code otherwise (ATM only 10 if malloc() fails) + */ + inline int reallocate_buffer(size_t new_size); public: BufferCache() : m_Buffer(NULL), m_BufferCount(0) {} @@ -62,24 +86,6 @@ public: * @return the array length */ inline size_t getCount() { return m_BufferCount; } -protected: - /** - * Changes the current length of the array. Should be inlined. - * @param new_count the new array length - */ - inline void setCount(size_t new_count) { m_BufferCount = new_count; } - /** - * Reallocates the buffer. This implementation is extremely primitive, - * but since the amount of entries is small, - * this will not be significant, hopefully. Should be inlined. - * @param new_size the new number of elements in the array - * @return 0 if successful, an error code otherwise (ATM only 10 if malloc() fails) - */ - inline int reallocate_buffer(size_t new_size); -private: - // TODO: comments needed! - T *m_Buffer; - size_t m_BufferCount; }; } // end-of-namespace: fail diff --git a/core/SAL/CMakeLists.txt b/src/core/sal/CMakeLists.txt similarity index 62% rename from core/SAL/CMakeLists.txt rename to src/core/sal/CMakeLists.txt index cf78e69fcac12c76df39f3f62412f4fda698a616..fc2a214776a7bc844fb7fd2c28f866c7e0b8b56f 100644 --- a/core/SAL/CMakeLists.txt +++ b/src/core/sal/CMakeLists.txt @@ -1,5 +1,8 @@ if(BUILD_BOCHS) set(SRCS + BufferCache.cc + Event.cc + EventList.cc Memory.cc Register.cc SimulatorController.cc @@ -7,6 +10,9 @@ if(BUILD_BOCHS) ) else() set(SRCS + BufferCache.cc + Event.cc + EventList.cc Memory.cc Register.cc SimulatorController.cc @@ -14,5 +20,6 @@ else() ) endif(BUILD_BOCHS) +add_library(sal ${SRCS}) -add_library(SAL ${SRCS}) +add_dependencies(sal efw) diff --git a/core/controller/Event.cc b/src/core/sal/Event.cc similarity index 98% rename from core/controller/Event.cc rename to src/core/sal/Event.cc index 24de8b9ff159310a62b473f2083bb8d92a8acc5e..c4e0e6d4599fdd12f1aa5da78e45d0f4ddd8e8f9 100644 --- a/core/controller/Event.cc +++ b/src/core/sal/Event.cc @@ -1,5 +1,5 @@ #include "Event.hpp" -#include "../SAL/SALInst.hpp" +#include "SALInst.hpp" namespace fail { diff --git a/core/controller/Event.hpp b/src/core/sal/Event.hpp similarity index 99% rename from core/controller/Event.hpp rename to src/core/sal/Event.hpp index 361a5115b7fdd6e83fb06ddd35b7ef682264a23a..053b0f2e132e76b06bede846d4e0a0c6c748fb6a 100644 --- a/core/controller/Event.hpp +++ b/src/core/sal/Event.hpp @@ -8,7 +8,7 @@ #include <utility> #include <iostream> -#include "../SAL/SALConfig.hpp" +#include "SALConfig.hpp" namespace fail { diff --git a/core/controller/EventList.cc b/src/core/sal/EventList.cc similarity index 99% rename from core/controller/EventList.cc rename to src/core/sal/EventList.cc index 483887d46379e97ef4a08f3578a9a20c2a671599..0d27f7da58dac330efd3113083bbeeb127470281 100644 --- a/core/controller/EventList.cc +++ b/src/core/sal/EventList.cc @@ -1,7 +1,7 @@ #include <set> #include "EventList.hpp" -#include "../SAL/SALInst.hpp" +#include "SALInst.hpp" namespace fail { diff --git a/core/controller/EventList.hpp b/src/core/sal/EventList.hpp similarity index 100% rename from core/controller/EventList.hpp rename to src/core/sal/EventList.hpp diff --git a/core/SAL/Memory.cc b/src/core/sal/Memory.cc similarity index 100% rename from core/SAL/Memory.cc rename to src/core/sal/Memory.cc diff --git a/core/SAL/Memory.hpp b/src/core/sal/Memory.hpp similarity index 100% rename from core/SAL/Memory.hpp rename to src/core/sal/Memory.hpp diff --git a/core/SAL/Register.cc b/src/core/sal/Register.cc similarity index 100% rename from core/SAL/Register.cc rename to src/core/sal/Register.cc diff --git a/core/SAL/Register.hpp b/src/core/sal/Register.hpp similarity index 100% rename from core/SAL/Register.hpp rename to src/core/sal/Register.hpp diff --git a/core/SAL/SALConfig.hpp b/src/core/sal/SALConfig.hpp similarity index 95% rename from core/SAL/SALConfig.hpp rename to src/core/sal/SALConfig.hpp index 0a6ea06ba7ce9097729116194e38aaed02efa46c..5aae2f59b35d4c30bb89fb45202e98f2628ee214 100644 --- a/core/SAL/SALConfig.hpp +++ b/src/core/sal/SALConfig.hpp @@ -2,7 +2,8 @@ #define __SAL_CONFIG_HPP__ #include <stdint.h> -#include "config/variant_config.hpp" + +#include "config/VariantConfig.hpp" // Type-config depends on the current selected simulator: #if defined BUILD_BOCHS diff --git a/core/SAL/SALInst.hpp b/src/core/sal/SALInst.hpp similarity index 94% rename from core/SAL/SALInst.hpp rename to src/core/sal/SALInst.hpp index 3195c396ea078c80be8b97ffaab87a8abe4388a9..ca814cfe6747437c9c237f5a255a2e1bef42d94b 100644 --- a/core/SAL/SALInst.hpp +++ b/src/core/sal/SALInst.hpp @@ -2,7 +2,7 @@ #define __SAL_INSTANCE_HPP__ #include "SALConfig.hpp" -#include "config/variant_config.hpp" +#include "config/VariantConfig.hpp" #ifdef BUILD_BOCHS diff --git a/core/SAL/SimulatorController.cc b/src/core/sal/SimulatorController.cc similarity index 83% rename from core/SAL/SimulatorController.cc rename to src/core/sal/SimulatorController.cc index facd0dabfdaa5a3411772bdc7c252dc4ee58e5f6..66755185b585c4a9a9ee0864fa12c423e9ebc7d6 100644 --- a/core/SAL/SimulatorController.cc +++ b/src/core/sal/SimulatorController.cc @@ -1,6 +1,5 @@ #include "SimulatorController.hpp" #include "SALInst.hpp" -#include "../controller/Event.hpp" namespace fail { @@ -9,7 +8,7 @@ ConcreteSimulatorController simulator; EventId SimulatorController::addEvent(BaseEvent* ev) { - assert(ev != NULL && "FATAL ERROR: ev pointer cannot be NULL!"); + assert(ev != NULL && "FATAL ERROR: Argument (ptr) cannot be NULL!"); EventId ret = m_EvList.add(ev, m_Flows.getCurrent()); // Call the common postprocessing function: if (!onEventAddition(ev)) { // If the return value signals "false"..., @@ -242,45 +241,6 @@ BaseEvent* SimulatorController::addEventAndWait(BaseEvent* ev) return (waitAny()); } -template <class T> -T* SimulatorController::getExperimentData() -{ - //BEGIN ONLY FOR TESTING------REMOVE--------REMOVE---------REMOVE--------REMOVE-------REMOVE------- - //Daten in Struktur schreiben und in Datei speichern - std::ofstream fileWrite; - fileWrite.open("test.txt"); - - T* faultCovExWrite = new T();; - faultCovExWrite->set_data_name("Testfall 42"); - - //Namen setzen - faultCovExWrite->set_data_name("Testfall 42"); - //Instruktionpointer 1 - faultCovExWrite->set_m_instrptr1(0x4711); - //Instruktionpointer 2 - faultCovExWrite->set_m_instrptr2(0x1122); - - //In ExperimentData verpacken - ExperimentData exDaWrite(faultCovExWrite); - //Serialisierung ueber Wrapper-Methode in ExperimentData - exDaWrite.serialize(&fileWrite); - - //cout << "Ausgabe: " << out << endl; - - fileWrite.close(); - - std::ifstream fileRead; - fileRead.open("test.txt"); - //END ONLY FOR TESTING------REMOVE--------REMOVE---------REMOVE--------REMOVE-------REMOVE------- - //TODO: implement server-client communication---------------------------------------------- - - T* concreteExpDat = new T(); - ExperimentData exDaRead(concreteExpDat); - exDaRead.unserialize(&fileRead); - - return (concreteExpDat); -} - void SimulatorController::terminate(int exCode) { // Attention: This could cause problems, e.g., because of non-closed sockets diff --git a/core/SAL/SimulatorController.hpp b/src/core/sal/SimulatorController.hpp similarity index 96% rename from core/SAL/SimulatorController.hpp rename to src/core/sal/SimulatorController.hpp index a2af79fc790661775257ef4b175ec0bdc353e5d0..bf7a2fa1e8da3a164f377c54a74833a3c10c9693 100644 --- a/core/SAL/SimulatorController.hpp +++ b/src/core/sal/SimulatorController.hpp @@ -6,15 +6,10 @@ #include <cassert> #include <vector> -//<BEGIN ONLY FOR TEST -#include <fstream> -//>END ONLY FOR TEST - -#include "../controller/Event.hpp" -#include "../controller/EventList.hpp" -#include "../controller/CoroutineManager.hpp" -#include "../controller/ExperimentData.hpp" +#include "efw/CoroutineManager.hpp" +#include "EventList.hpp" #include "SALConfig.hpp" +#include "Event.hpp" namespace fail { @@ -269,11 +264,6 @@ class SimulatorController * @return the actual number of events */ unsigned getEventCount() const { return m_EvList.getEventCount(); } - /** - * Fetches data for the experiments from the Job-Server. - * @return the Experiment-Data from the Job-Server. - */ - template <class T> T* getExperimentData(); }; } // end-of-namespace: fail diff --git a/core/SAL/bochs/BochsConfig.hpp b/src/core/sal/bochs/BochsConfig.hpp similarity index 77% rename from core/SAL/bochs/BochsConfig.hpp rename to src/core/sal/bochs/BochsConfig.hpp index 50f3c7e118371276dc9a5579dd3056365cc2b688..3b46a20c93a315cbe7a0a3133f723ef384673201 100644 --- a/core/SAL/bochs/BochsConfig.hpp +++ b/src/core/sal/bochs/BochsConfig.hpp @@ -1,12 +1,14 @@ +/** + * \brief Type definitions and configuration settings for + * the Bochs simulator. + */ + #ifndef __BOCHS_CONFIG_HPP__ #define __BOCHS_CONFIG_HPP__ -#include "../../../bochs/bochs.h" -#include "../../../bochs/config.h" +#include "bochs.h" +#include "config.h" -// Type definitions and configuration settings for -// the Bochs simulator. - namespace fail { typedef bx_address guest_address_t; //!< the guest memory address type diff --git a/core/SAL/bochs/BochsController.cc b/src/core/sal/bochs/BochsController.cc similarity index 94% rename from core/SAL/bochs/BochsController.cc rename to src/core/sal/bochs/BochsController.cc index dde848640e7c3ac7a65da76fcfd7d8c6c8583864..fa1f6b82850eb537eb598159b8b95143d8557442 100644 --- a/core/SAL/bochs/BochsController.cc +++ b/src/core/sal/bochs/BochsController.cc @@ -304,4 +304,19 @@ void BochsController::onEventTrigger(BaseEvent* pev) // Note: Maybe more stuff to do here for other event types. } +const std::string& BochsController::getMnemonic() const +{ + static std::string str; + bxICacheEntry_c* pEntry = BX_CPU(0)->getICacheEntry(); + assert(pEntry != NULL && "FATAL ERROR: Bochs internal function returned NULL (not expected)!"); + bxInstruction_c* pInstr = pEntry->i; + assert(pInstr != NULL && "FATAL ERROR: Bochs internal member was NULL (not expected)!"); + const char* pszName = get_bx_opcode_name(pInstr->getIaOpcode()); + if (pszName != NULL) + str = pszName; + else + str.clear(); + return str; +} + } // end-of-namespace: fail diff --git a/src/core/sal/bochs/BochsController.hpp b/src/core/sal/bochs/BochsController.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1512fd54b6277db136e7ebf94d5222407787cf73 --- /dev/null +++ b/src/core/sal/bochs/BochsController.hpp @@ -0,0 +1,181 @@ +#ifndef __BOCHS_CONTROLLER_HPP__ + #define __BOCHS_CONTROLLER_HPP__ + +#include <string> +#include <cassert> +#include <iostream> +#include <iomanip> +#include <string.h> + +#include "FailBochsGlobals.hpp" + +#include "../SimulatorController.hpp" +#include "../Event.hpp" + +#include "bochs.h" +#include "cpu/cpu.h" +#include "config.h" +#include "iodev/iodev.h" +#include "pc_system.h" + +namespace fail { + +class ExperimentFlow; + +/** + * \class BochsController + * Bochs-specific implementation of a SimulatorController. + */ +class BochsController : public SimulatorController { +private: + ExperimentFlow* m_CurrFlow; //!< Stores the current flow for save/restore-operations + #ifdef DEBUG + unsigned m_Regularity; //! regularity of instruction ptr output + unsigned m_Counter; //! current instr-ptr counter + std::ostream* m_pDest; //! debug output object (defaults to \c std::cout) + #endif + /** + * Static internal event handler for TimerEvents. This static function is + * called when a previously registered (Bochs) timer triggers. This function + * searches for the provided TimerEvent object within the EventList and + * fires such an event by calling \c fireActiveEvents(). + * @param thisPtr a pointer to the TimerEvent-object triggered + * + * FIXME: Due to Bochs internal timer and ips-configuration related stuff, + * the simulator sometimes panics with "keyboard error:21" (see line + * 1777 in bios/rombios.c, function keyboard_init()) if a TimerEvent + * is added *before* the bios has been loaded and initialized. To + * reproduce this error, try adding a TimerEvent as the initial step + * in your experiment code and wait for it (addEventAndWait()). + */ + static void m_onTimerTrigger(void *thisPtr); + /** + * Registers a timer in the Bochs simulator. This timer fires \a TimerEvents + * to inform the corresponding experiment-flow. Note that the number of timers + * (in Bochs) is limited to \c BX_MAX_TIMERS (defaults to 64 in v2.4.6). + * @param pev a pointer to the (experiment flow-) allocated TimerEvent object, + * providing all required information to start the time, e.g. the + * timeout value. + * @return \c The unique id of the timer recently created. This id is carried + * along with the TimerEvent, @see getId(). On error, -1 is returned + * (e.g. because a timer with the same id is already existing) + */ + timer_id_t m_registerTimer(TimerEvent* pev); + /** + * Deletes a timer. No further events will be triggered by the timer. + * @param pev a pointer to the TimerEvent-object to be removed + * @return \c true if the timer with \a pev->getId() has been removed + * successfully, \c false otherwise + */ + bool m_unregisterTimer(TimerEvent* pev); +public: + // Initialize the controller. + BochsController(); + ~BochsController(); + /* ******************************************************************** + * Standard Event Handler API: + * ********************************************************************/ + /** + * Instruction pointer modification handler. This method is called (from + * the Breakpoints aspect) every time when the Bochs-internal IP changes. + * @param instrPtr the new instruction pointer + * @param address_space the address space the CPU is currently in + */ + void onInstrPtrChanged(address_t instrPtr, address_t address_space); + /** + * I/O port communication handler. This method is called (from + * the IOPortCom aspect) every time when Bochs performs a port I/O operation. + * @param data the data transmitted + * @param port the port it was transmitted on + * @param out true if the I/O traffic has been outbound, false otherwise + */ + void onIOPortEvent(unsigned char data, unsigned port, bool out); + /** + * This method is called when an experiment flow adds a new event by + * calling \c simulator.addEvent(pev) or \c simulator.addEventAndWait(pev). + * More specifically, the event will be added to the event-list first + * (buffer-list, to be precise) and then this event handler is called. + * @param pev the event which has been added + * @return You should return \c true to continue and \c false to prevent + * the addition of the event \a pev. + */ + bool onEventAddition(BaseEvent* pev); + /** + * This method is called when an experiment flow removes an event from + * the event-management by calling \c removeEvent(prev), \c clearEvents() + * or by deleting a complete flow (\c removeFlow). More specifically, + * this event handler will be called *before* the event is actually deleted. + * @param pev the event to be deleted when returning from the event handler + */ + void onEventDeletion(BaseEvent* pev); + /** + * This method is called when an previously added event is about to be + * triggered by the simulator-backend. More specifically, this event handler + * will be called *before* the event is actually triggered, i.e. before the + * corresponding coroutine is toggled. + * @param pev the event to be triggered when returning from the event handler + */ + void onEventTrigger(BaseEvent* pev); + /* ******************************************************************** + * Simulator Controller & Access API: + * ********************************************************************/ + /** + * Save simulator state. + * @param path Location to store state information + */ + void save(const std::string& path); + /** + * Save finished: Callback from Simulator + */ + void saveDone(); + /** + * Restore simulator state. Clears all Events. + * @param path Location to previously saved state information + */ + void restore(const std::string& path); + /** + * Restore finished: Callback from Simulator + */ + void restoreDone(); + /** + * Reboot simulator. Clears all Events. + */ + void reboot(); + /** + * Reboot finished: Callback from Simulator + */ + void rebootDone(); + /** + * Fire an interrupt. + * @param irq Interrupt to be fired + */ + void fireInterrupt(unsigned irq); + /** + * Fire done: Callback from Simulator + */ + void fireInterruptDone(); + /* ******************************************************************** + * BochsController-specific (not implemented in SimulatorController!): + * ********************************************************************/ + #ifdef DEBUG + /** + * Enables instruction pointer debugging output. + * @param regularity the output regularity; 1 to display every + * instruction pointer, 0 to disable + * @param dest specifies the output destition; defaults to \c std::cout + */ + void dbgEnableInstrPtrOutput(unsigned regularity, std::ostream* dest = &std::cout); + #endif + /** + * Retrieves the textual description (mnemonic) for the current + * instruction. The format of the returned string is Bochs-specific. + * @return the mnemonic of the current instruction whose address + * is given by \c Register::getInstructionPointer(). On errors, + * the returned string is empty + */ + const std::string& getMnemonic() const; +}; + +} // end-of-namespace: fail + +#endif // __BOCHS_CONTROLLER_HPP__ diff --git a/core/SAL/bochs/BochsHelpers.hpp b/src/core/sal/bochs/BochsHelpers.hpp similarity index 85% rename from core/SAL/bochs/BochsHelpers.hpp rename to src/core/sal/bochs/BochsHelpers.hpp index 4fa9c3c8338f9f210d739d47692e2296e6834ed5..9138c9e92cf47458f0f2ea82556429391ba8ab82 100644 --- a/core/SAL/bochs/BochsHelpers.hpp +++ b/src/core/sal/bochs/BochsHelpers.hpp @@ -1,7 +1,7 @@ #ifndef __BOCHS_HELPERS_HPP__ #define __BOCHS_HELPERS_HPP__ -#include "../../../bochs/cpu/cpu.h" +#include "cpu/cpu.h" static inline BX_CPU_C *getCPU(BX_CPU_C *that) { diff --git a/src/core/sal/bochs/BochsMemory.hpp b/src/core/sal/bochs/BochsMemory.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1a9720e4682c57bdff1ea3b82b31af18bf6b905a --- /dev/null +++ b/src/core/sal/bochs/BochsMemory.hpp @@ -0,0 +1,110 @@ +#ifndef __BOCHS_MEMORY_HPP__ + #define __BOCHS_MEMORY_HPP__ + +#include "../Memory.hpp" + +namespace fail { + +/** + * \class BochsMemoryManager + * Represents a concrete implemenation of the abstract + * MemoryManager to provide access to Bochs' memory pool. + */ +class BochsMemoryManager : public MemoryManager { +public: + /** + * Constructs a new MemoryManager object and initializes + * it's attributes appropriately. + */ + BochsMemoryManager() : MemoryManager() { } + /** + * Retrieves the size of the available simulated memory. + * @return the size of the memory pool in bytes + */ + size_t getPoolSize() const { return static_cast<size_t>(BX_MEM(0)->get_memory_len()); } + /** + * Retrieves the starting address of the host memory. This is the + * first valid address in memory. + * @return the starting address + */ + host_address_t getStartAddr() const { return 0; } + /** + * Retrieves the byte at address \a addr in the memory. + * @param addr The guest address where the byte is located. + * The address is expected to be valid. + * @return the byte at \a addr + */ + byte_t getByte(guest_address_t addr) + { + host_address_t haddr = guestToHost(addr); + assert(haddr != (host_address_t)ADDR_INV && "FATAL ERROR: Invalid guest address provided!"); + return static_cast<byte_t>(*reinterpret_cast<Bit8u*>(haddr)); + } + /** + * Retrieves \a cnt bytes at address \a addr from the memory. + * @param addr The guest address where the bytes are located. + * The address is expected to be valid. + * @param cnt The number of bytes to be retrieved. \a addr + \a cnt + * is expected to not exceed the memory limit. + * @param dest Pointer to destination buffer to copy the data to. + */ + void getBytes(guest_address_t addr, size_t cnt, void *dest) + { + char *d = static_cast<char *>(dest); + for (size_t i = 0; i < cnt; ++i) + d[i] = getByte(addr + i); + } + /** + * Writes the byte \a data to memory. + * @param addr The guest address to write. + * The address is expected to be valid. + * @param data The new byte to write + */ + void setByte(guest_address_t addr, byte_t data) + { + host_address_t haddr = guestToHost(addr); + assert(haddr != (host_address_t)ADDR_INV && + "FATAL ERROR: Invalid guest address provided!"); + *reinterpret_cast<Bit8u*>(haddr) = data; + } + /** + * Copies data to memory. + * @param addr The guest address to write. + * The address is expected to be valid. + * @param cnt The number of bytes to be retrieved. \a addr + \a cnt + * is expected to not exceed the memory limit. + * @param src Pointer to data to be copied. + */ + void setBytes(guest_address_t addr, size_t cnt, void const *src) + { + char const *s = static_cast<char const *>(src); + for (size_t i = 0; i < cnt; ++i) + setByte(addr + i, s[i]); + } + /** + * Transforms the guest address \a addr to a host address. + * @param addr The (logical) guest address to be transformed + * @return the transformed (host) address or \c ADDR_INV on errors + */ + host_address_t guestToHost(guest_address_t addr) + { + const unsigned SEGMENT_SELECTOR_IDX = 2; // always the code segment + const bx_address logicalAddr = static_cast<bx_address>(addr); // offset within the segment + // Get the linear address: + Bit32u linearAddr = BX_CPU(0)->get_laddr32(SEGMENT_SELECTOR_IDX/*seg*/, logicalAddr/*offset*/); + // Map the linear address to the physical address: + bx_phy_address physicalAddr; + bx_bool fValid = BX_CPU(0)->dbg_xlate_linear2phy(linearAddr, (bx_phy_address*)&physicalAddr); + // Determine the *host* address of the physical address: + Bit8u* hostAddr = BX_MEM(0)->getHostMemAddr(BX_CPU(0), physicalAddr, BX_READ); + // Now, hostAddr contains the "final" address + if (!fValid) + return ((host_address_t)ADDR_INV); // error + else + return (reinterpret_cast<host_address_t>(hostAddr)); // okay + } +}; + +} // end-of-namespace: fail + +#endif // __BOCHS_MEMORY_HPP__ diff --git a/core/SAL/bochs/BochsNonVerbose.ah b/src/core/sal/bochs/BochsNonVerbose.ah similarity index 87% rename from core/SAL/bochs/BochsNonVerbose.ah rename to src/core/sal/bochs/BochsNonVerbose.ah index 975486551ea1d066023b2d86aed188c13fbecca1..fb08374d91f2bfc44b29017d72f70aa7e97a66c0 100644 --- a/core/SAL/bochs/BochsNonVerbose.ah +++ b/src/core/sal/bochs/BochsNonVerbose.ah @@ -7,18 +7,17 @@ #include "bochs.h" +/* // Doesn't work because AspectC++ doesn't deal properly with variadic parameter // lists: -/* aspect BochsNonVerbose { - // needed to suppress Bochs output *before* a state restore finished - // FIXME ac++ segfaults if we use call() instead of execution() + // Needed to suppress Bochs output *before* a state restore finished + // FIXME: ac++ segfaults if we use call() instead of execution(). advice execution("% logfunctions::debug(...)") || execution("% logfunctions::info(...)") || execution("% logfunctions::pass(...)") || execution("% logfunctions::error(...)") - : around () { - } + : around () { } }; */ diff --git a/src/core/sal/bochs/BochsRegister.hpp b/src/core/sal/bochs/BochsRegister.hpp new file mode 100644 index 0000000000000000000000000000000000000000..14ae69eda1ab283f452505b9d71263994b0091b7 --- /dev/null +++ b/src/core/sal/bochs/BochsRegister.hpp @@ -0,0 +1,238 @@ +#ifndef __BOCHS_REGISTER_HPP__ + #define __BOCHS_REGISTER_HPP__ + +#include "../Register.hpp" + +#include "bochs.h" + +#include <iostream> +#include <cassert> + +namespace fail { + +/** + * \class BochsRegister + * Bochs-specific implementation of x86 registers. + */ +class BochsRegister : public Register { +protected: + regdata_t* m_pData; +public: + /** + * Constructs a new register object. + * @param id the global unique id + * @param width width of the register (8, 16, 32 or 64 bit should + * suffice) + * @param link pointer to bochs interal register memory + * @param t type of the register + */ + BochsRegister(unsigned int id, regwidth_t width, regdata_t* link, RegisterType t) + : Register(id, t, width), m_pData(link) { } + /** + * Retrieves the data of the register. + * @return the current register data + */ + regdata_t getData() { return (*m_pData); } + /** + * Sets the content of the register. + * @param data the new register data to be written + */ + void setData(regdata_t data) { *m_pData = data; } +}; + +/** + * \class BxGPReg + * Bochs-specific implementation of x86 general purpose (GP) registers. + */ +class BxGPReg : public BochsRegister { +public: + /** + * Constructs a new general purpose register. + * @param id the global unique id + * @param width width of the register (8, 16, 32 or 64 bit should + * suffice) + * @param link pointer to bochs interal register memory + */ + BxGPReg(unsigned int id, regwidth_t width, regdata_t* link) + : BochsRegister(id, width, link, RT_GP) { } +}; + +/** + * \enum GPRegisterId + * Symbolic identifier to access Bochs' general purpose register + * (within the corresponding GP set), e.g. + * \code + * // Print %eax register data: + * BochsController bc(...); + * cout << bc.getRegisterManager().getSetOfType(RT_GP) + * .getRegister(RID_EAX)->getData(); + * \endcode + */ +enum GPRegisterId { + #if BX_SUPPORT_X86_64 // 64 bit register id's: + RID_RAX = 0, RID_RCX, RID_RDX, RID_RBX, RID_RSP, RID_RBP, RID_RSI, RID_RDI, + RID_R8, RID_R9, RID_R10, RID_R11, RID_R12, RID_R13, RID_R14, RID_R15, + #else // 32 bit register id's: + RID_EAX = 0, RID_ECX, RID_EDX, RID_EBX, RID_ESP, RID_EBP, RID_ESI, RID_EDI, + #endif + RID_CAX = 0, RID_CCX, RID_CDX, RID_CBX, RID_CSP, RID_CBP, RID_CSI, RID_CDI, + RID_LAST_GP_ID +}; + +/** + * \enum PCRegisterId + * Symbolic identifier to access Bochs' program counter register. + */ +enum PCRegisterId { RID_PC = RID_LAST_GP_ID, RID_LAST_PC_ID }; + +/** + * \enum FlagsRegisterId + * Symbolic identifier to access Bochs' flags register. + */ +enum FlagsRegisterId { RID_FLAGS = RID_LAST_PC_ID }; + +/** + * \class BxPCReg + * Bochs-specific implementation of the x86 program counter register. + */ +class BxPCReg : public BochsRegister { +public: + /** + * Constructs a new program counter register. + * @param id the global unique id + * @param width width of the register (8, 16, 32 or 64 bit should + * suffice) + * @param link pointer to bochs internal register memory + */ + BxPCReg(unsigned int id, regwidth_t width, regdata_t* link) + : BochsRegister(id, width, link, RT_PC) { } +}; + +/** + * \class BxFlagsReg + * Bochs-specific implementation of the FLAGS status register. + */ +class BxFlagsReg : public BochsRegister { +public: + /** + * Constructs a new FLAGS status register. The refenced FLAGS are + * allocated as follows: + * -------------------------------------------------- + * 31|30|29|28| 27|26|25|24| 23|22|21|20| 19|18|17|16 + * ==|==|=====| ==|==|==|==| ==|==|==|==| ==|==|==|== + * 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|ID|VP| VF|AC|VM|RF + * + * 15|14|13|12| 11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0 + * ==|==|=====| ==|==|==|==| ==|==|==|==| ==|==|==|== + * 0|NT| IOPL| OF|DF|IF|TF| SF|ZF| 0|AF| 0|PF| 1|CF + * -------------------------------------------------- + * @param id the global unique id + * @param link pointer to bochs internal register memory + */ + BxFlagsReg(unsigned int id, regdata_t* link) + : BochsRegister(id, 32, link, RT_ST) { } + + /** + * Returns \c true if the corresponding flag is set, or \c false + * otherwise. + */ + bool getCarryFlag() const { return (BX_CPU(0)->get_CF()); } + bool getParityFlag() const { return (BX_CPU(0)->get_PF()); } + bool getZeroFlag() const { return (BX_CPU(0)->get_ZF()); } + bool getSignFlag() const { return (BX_CPU(0)->get_SF()); } + bool getOverflowFlag() const { return (BX_CPU(0)->get_OF()); } + + bool getTrapFlag() const { return (BX_CPU(0)->get_TF()); } + bool getInterruptFlag() const { return (BX_CPU(0)->get_IF()); } + bool getDirectionFlag() const { return (BX_CPU(0)->get_DF()); } + unsigned getIOPrivilegeLevel() const { return (BX_CPU(0)->get_IOPL()); } + bool getNestedTaskFlag() const { return (BX_CPU(0)->get_NT()); } + bool getResumeFlag() const { return (BX_CPU(0)->get_RF()); } + bool getVMFlag() const { return (BX_CPU(0)->get_VM()); } + bool getAlignmentCheckFlag() const { return (BX_CPU(0)->get_AC()); } + bool getVInterruptFlag() const { return (BX_CPU(0)->get_VIF()); } + bool getVInterruptPendingFlag() const { return (BX_CPU(0)->get_VIP()); } + bool getIdentificationFlag() const { return (BX_CPU(0)->get_ID()); } + + /** + * Sets/resets various status FLAGS. + */ + void setCarryFlag(bool bit) { BX_CPU(0)->set_CF(bit); } + void setParityFlag(bool bit) { BX_CPU(0)->set_PF(bit); } + void setZeroFlag(bool bit) { BX_CPU(0)->set_ZF(bit); } + void setSignFlag(bool bit) { BX_CPU(0)->set_SF(bit); } + void setOverflowFlag(bool bit) { BX_CPU(0)->set_OF(bit); } + + void setTrapFlag(bool bit) { BX_CPU(0)->set_TF(bit); } + void setInterruptFlag(bool bit) { BX_CPU(0)->set_IF(bit); } + void setDirectionFlag(bool bit) { BX_CPU(0)->set_DF(bit); } + void setIOPrivilegeLevel(unsigned lvl) { BX_CPU(0)->set_IOPL(lvl); } + void setNestedTaskFlag(bool bit) { BX_CPU(0)->set_NT(bit); } + void setResumeFlag(bool bit) { BX_CPU(0)->set_RF(bit); } + void setVMFlag(bool bit) { BX_CPU(0)->set_VM(bit); } + void setAlignmentCheckFlag(bool bit) { BX_CPU(0)->set_AC(bit); } + void setVInterruptFlag(bool bit) { BX_CPU(0)->set_VIF(bit); } + void setVInterruptPendingFlag(bool bit) { BX_CPU(0)->set_VIP(bit); } + void setIdentificationFlag(bool bit) { BX_CPU(0)->set_ID(bit); } + + /** + * Sets the content of the status register. + * @param data the new register data to be written; note that only the + * 32 lower bits are used (bits 32-63 are ignored in 64 bit mode) + */ + void setData(regdata_t data) + { + #ifdef BX_SUPPORT_X86_64 + // We are in 64 bit mode: Just assign the lower 32 bits! + (*m_pData) = ((*m_pData) & 0xFFFFFFFF00000000ULL) | + (data & 0xFFFFFFFFULL); + #else + *m_pData = data; + #endif + } +}; + +/** + * \class BochsRegister + * Bochs-specific implementation of the RegisterManager. + */ +class BochsRegisterManager : public RegisterManager { +public: + /** + * Returns the current instruction pointer. + * @return the current eip + */ + address_t getInstructionPointer() + { + return (static_cast<address_t>(getSetOfType(RT_PC)->first()->getData())); + } + /** + * Retruns the top address of the stack. + * @return the starting address of the stack + */ + address_t getStackPointer() + { + #if BX_SUPPORT_X86_64 + return (static_cast<address_t>(getRegister(RID_RSP)->getData())); + #else + return (static_cast<address_t>(getRegister(RID_ESP)->getData())); + #endif + } + /** + * Retrieves the base ptr (holding the address of the + * current stack frame). + * @return the base pointer + */ + address_t getBasePointer() + { + #if BX_SUPPORT_X86_64 + return (static_cast<address_t>(getRegister(RID_RBP)->getData())); + #else + return (static_cast<address_t>(getRegister(RID_EBP)->getData())); + #endif + } +}; + +} // end-of-namespace: fail + +#endif // __BOCHS_REGISTER_HPP__ diff --git a/core/SAL/bochs/Breakpoints.ah b/src/core/sal/bochs/Breakpoints.ah similarity index 85% rename from core/SAL/bochs/Breakpoints.ah rename to src/core/sal/bochs/Breakpoints.ah index d128b91e0e05f90903eaa03649f9bdf2cf630f3f..42c004580152571d1f4b7a55e4462d42d190c561 100644 --- a/core/SAL/bochs/Breakpoints.ah +++ b/src/core/sal/bochs/Breakpoints.ah @@ -5,12 +5,12 @@ #ifdef CONFIG_EVENT_BREAKPOINTS -#include "../../../bochs/bochs.h" // for "BX_CPU_C" -#include "../../../bochs/cpu/cpu.h" // for "bxInstruction_c" +#include "bochs.h" +#include "cpu/cpu.h" + #include "../SALInst.hpp" -aspect Breakpoints -{ +aspect Breakpoints { pointcut cpuLoop() = "void defineCPULoopJoinPoint(...)"; advice execution (cpuLoop()) : after () // Event source: "instruction pointer" diff --git a/core/SAL/bochs/Credits.ah b/src/core/sal/bochs/Credits.ah similarity index 100% rename from core/SAL/bochs/Credits.ah rename to src/core/sal/bochs/Credits.ah diff --git a/core/SAL/bochs/DisableKeyboardInterrupt.ah b/src/core/sal/bochs/DisableKeyboardInterrupt.ah similarity index 77% rename from core/SAL/bochs/DisableKeyboardInterrupt.ah rename to src/core/sal/bochs/DisableKeyboardInterrupt.ah index 48d60f86ff0eef8f29ea29ead17a6174e66b2067..4dffe21213f5ecbbd7900c908442ea49f35cad40 100644 --- a/core/SAL/bochs/DisableKeyboardInterrupt.ah +++ b/src/core/sal/bochs/DisableKeyboardInterrupt.ah @@ -5,16 +5,16 @@ #ifdef CONFIG_DISABLE_KEYB_INTERRUPTS -#include "../../../bochs/iodev/iodev.h" -#include "../../../bochs/iodev/keyboard.h" +#include "iodev/iodev.h" +#include "iodev/keyboard.h" aspect DisableKeyboardInterrupt { pointcut heyboard_interrupt() = "void bx_keyb_c::timer_handler(...)"; - + advice execution (heyboard_interrupt()) : around () { - bx_keyb_c *class_ptr = (bx_keyb_c *)tjp->arg<0>(); + bx_keyb_c *class_ptr = (bx_keyb_c*)tjp->arg<0>(); unsigned retval; retval = class_ptr->periodic(1); diff --git a/core/SAL/bochs/DisableLogFunctions.ah b/src/core/sal/bochs/DisableLogFunctions.ah similarity index 100% rename from core/SAL/bochs/DisableLogFunctions.ah rename to src/core/sal/bochs/DisableLogFunctions.ah diff --git a/core/SAL/bochs/FailBochsGlobals.hpp b/src/core/sal/bochs/FailBochsGlobals.hpp similarity index 93% rename from core/SAL/bochs/FailBochsGlobals.hpp rename to src/core/sal/bochs/FailBochsGlobals.hpp index efe876bc71c68fe92d6e27887d29bed40f8db40d..0241fdcb29da05bb5240c67c343209a92fe701d4 100644 --- a/core/SAL/bochs/FailBochsGlobals.hpp +++ b/src/core/sal/bochs/FailBochsGlobals.hpp @@ -17,6 +17,6 @@ extern bx_bool reboot_bochs_request; extern bx_bool interrupt_injection_request; extern int interrupt_to_fire; -} +} // end-of-namespace: fail #endif // __FAIL_BOCHS_GLOBALS_HPP__ diff --git a/core/SAL/bochs/FailBochsInit.ah b/src/core/sal/bochs/FailBochsInit.ah similarity index 100% rename from core/SAL/bochs/FailBochsInit.ah rename to src/core/sal/bochs/FailBochsInit.ah diff --git a/core/SAL/bochs/FireInterrupt.ah b/src/core/sal/bochs/FireInterrupt.ah similarity index 82% rename from core/SAL/bochs/FireInterrupt.ah rename to src/core/sal/bochs/FireInterrupt.ah index a640270ba1b8b0714b9859898b1562afe0efbb49..8042b3b444f4f75e918f27b083af022379709108 100644 --- a/core/SAL/bochs/FireInterrupt.ah +++ b/src/core/sal/bochs/FireInterrupt.ah @@ -5,13 +5,13 @@ #ifdef CONFIG_FIRE_INTERRUPTS -#include "../../../bochs/bochs.h" -#include "../../../bochs/cpu/cpu.h" -#include "../../../bochs/iodev/iodev.h" +#include "bochs.h" +#include "cpu/cpu.h" +#include "iodev/iodev.h" #include "../SALInst.hpp" aspect FireInterrupt { - pointcut cpuLoop() = "void defineCPULoopJoinPoint(...)"; + pointcut cpuLoop() = "void defineCPULoopJoinPoint(...)"; advice execution (cpuLoop()) : before () { diff --git a/core/SAL/bochs/GuestSysCom.ah b/src/core/sal/bochs/GuestSysCom.ah similarity index 88% rename from core/SAL/bochs/GuestSysCom.ah rename to src/core/sal/bochs/GuestSysCom.ah index 2fc235530a567f5cb842cb862140dbdd2172d5a4..747c0ace634ce46ede72aaae3b437b968ddd8d9b 100644 --- a/core/SAL/bochs/GuestSysCom.ah +++ b/src/core/sal/bochs/GuestSysCom.ah @@ -5,14 +5,15 @@ #ifdef CONFIG_EVENT_GUESTSYS -#include "../../../bochs/bochs.h" -#include "../../../bochs/cpu/cpu.h" -#include "../SALInst.hpp" +#include "bochs.h" +#include "cpu/cpu.h" +#include "../SALInst.hpp" #include "BochsHelpers.hpp" // Fixed "port number" for "Guest system >> Bochs" communication #define BOCHS_COM_PORT 0x378 + // FIXME: This #define should be located in a config or passed within the event object... aspect GuestSysCom { @@ -22,9 +23,8 @@ aspect GuestSysCom { { unsigned rDX = getCPU(tjp->that())->gen_reg[2].word.rx; // port number unsigned rAL = getCPU(tjp->that())->gen_reg[0].word.byte.rl; // data - if (rDX == BOCHS_COM_PORT) { + if (rDX == BOCHS_COM_PORT) fail::simulator.onGuestSystemEvent((char)rAL, rDX); - } } }; diff --git a/core/SAL/bochs/IOPortCom.ah b/src/core/sal/bochs/IOPortCom.ah similarity index 93% rename from core/SAL/bochs/IOPortCom.ah rename to src/core/sal/bochs/IOPortCom.ah index 26453b68c278c1664827f43275bdea1d30b6a8c1..c107a0ddd0db5ffdb15c9601aa5f3b5fd0c2e634 100644 --- a/core/SAL/bochs/IOPortCom.ah +++ b/src/core/sal/bochs/IOPortCom.ah @@ -5,8 +5,9 @@ #ifdef CONFIG_EVENT_IOPORT -#include "../../../bochs/bochs.h" -#include "../../../bochs/cpu/cpu.h" +#include "bochs.h" +#include "cpu/cpu.h" + #include "../SALInst.hpp" #include "BochsHelpers.hpp" diff --git a/core/SAL/bochs/Interrupt.ah b/src/core/sal/bochs/Interrupt.ah similarity index 85% rename from core/SAL/bochs/Interrupt.ah rename to src/core/sal/bochs/Interrupt.ah index 40c5dca756935b83ccc0057cc7f18bc6db573fc9..e1246dc14580bddd4e14b31af0967bff974bba9c 100644 --- a/core/SAL/bochs/Interrupt.ah +++ b/src/core/sal/bochs/Interrupt.ah @@ -5,13 +5,13 @@ #ifdef CONFIG_EVENT_INTERRUPT -#include "../../../bochs/bochs.h" -#include "../../../bochs/cpu/cpu.h" +#include "bochs.h" +#include "cpu/cpu.h" + #include "../SALInst.hpp" aspect Interrupt { - // cpu/exception.cc - pointcut interrupt_method() = "void bx_cpu_c::interrupt(...)"; + pointcut interrupt_method() = "void bx_cpu_c::interrupt(...)"; // cpu/exception.cc advice execution (interrupt_method()) : before () { diff --git a/core/SAL/bochs/InterruptSuppression.ah b/src/core/sal/bochs/InterruptSuppression.ah similarity index 88% rename from core/SAL/bochs/InterruptSuppression.ah rename to src/core/sal/bochs/InterruptSuppression.ah index 0c8b098ca8536d6f92d187ba831930b1fe7cd80c..2d5771209e0aef34b7440bd59d4bd1e2fd9bf6b1 100644 --- a/core/SAL/bochs/InterruptSuppression.ah +++ b/src/core/sal/bochs/InterruptSuppression.ah @@ -5,8 +5,9 @@ #ifdef CONFIG_SUPPRESS_INTERRUPTS -#include "../../../bochs/bochs.h" -#include "../../../bochs/cpu/cpu.h" +#include "bochs.h" +#include "cpu/cpu.h" + #include "../SALInst.hpp" aspect InterruptSuppression { diff --git a/core/SAL/bochs/Jump.ah b/src/core/sal/bochs/Jump.ah similarity index 99% rename from core/SAL/bochs/Jump.ah rename to src/core/sal/bochs/Jump.ah index d4c37cbdc5bf74fb8ad388c6863180f6bebf0e65..57b2cf9729cfdb81ecbd16abf42806824cc14cb4 100644 --- a/core/SAL/bochs/Jump.ah +++ b/src/core/sal/bochs/Jump.ah @@ -10,7 +10,8 @@ #include <string> #include <ctime> -#include "../../../bochs/bochs.h" +#include "bochs.h" + #include "../SALInst.hpp" // FIXME: This seems (partial) deprecated/incomplete as well... diff --git a/core/SAL/bochs/MemAccess.ah b/src/core/sal/bochs/MemAccess.ah similarity index 94% rename from core/SAL/bochs/MemAccess.ah rename to src/core/sal/bochs/MemAccess.ah index 82437422e92369ee2b2b36ecfc3ce560430ac027..f8146c2080150cbad01624162d469c2869b2382f 100644 --- a/core/SAL/bochs/MemAccess.ah +++ b/src/core/sal/bochs/MemAccess.ah @@ -1,21 +1,23 @@ #ifndef __MEM_ACCESS_AH__ #define __MEM_ACCESS_AH__ -#include <iostream> #include "config/FailConfig.hpp" #if defined(CONFIG_EVENT_MEMREAD) || defined(CONFIG_EVENT_MEMWRITE) -#include "../../../bochs/bochs.h" -#include "../../../bochs/cpu/cpu.h" -#include "../SALInst.hpp" +#include <iostream> +#include "bochs.h" +#include "cpu/cpu.h" + +#include "../SALInst.hpp" #include "BochsHelpers.hpp" -// FIXME we currently assume a "flat" memory model and ignore the segment -// parameter of all memory accesses -// TODO instruction fetch? -// TODO warn on uncovered memory accesses +// FIXME: We currently assume a "flat" memory model and ignore the segment +// parameter of all memory accesses. +// TODO: Instruction fetch? +// TODO: Warn on uncovered memory accesses. + aspect MemAccess { fail::address_t rmw_address; diff --git a/core/SAL/bochs/Reboot.ah b/src/core/sal/bochs/Reboot.ah similarity index 100% rename from core/SAL/bochs/Reboot.ah rename to src/core/sal/bochs/Reboot.ah index 2fcc81591e8bbb10e828520339ac85ff724a8b60..a1705ad53bf0aec00692b558fd7808661b1f5ca3 100644 --- a/core/SAL/bochs/Reboot.ah +++ b/src/core/sal/bochs/Reboot.ah @@ -2,11 +2,11 @@ #define __REBOOT_AH__ #include "config/FailConfig.hpp" -#include "../SALInst.hpp" #ifdef CONFIG_SR_REBOOT #include "bochs.h" +#include "../SALInst.hpp" aspect Reboot { pointcut cpuLoop() = "void defineCPULoopJoinPoint(...)"; diff --git a/core/SAL/bochs/RestoreState.ah b/src/core/sal/bochs/RestoreState.ah similarity index 99% rename from core/SAL/bochs/RestoreState.ah rename to src/core/sal/bochs/RestoreState.ah index 430fab6d0b1c8c2af861134711bde7605f0e9043..6014e29fa315d410f0d9bff16d1ea7e35b165ff9 100644 --- a/core/SAL/bochs/RestoreState.ah +++ b/src/core/sal/bochs/RestoreState.ah @@ -1,15 +1,16 @@ #ifndef __RESTORE_STATE_AH__ #define __RESTORE_STATE_AH__ -#include <iostream> - #include "config/FailConfig.hpp" -#include "../SALInst.hpp" #ifdef CONFIG_SR_RESTORE +#include <iostream> + #include "bochs.h" +#include "../SALInst.hpp" + aspect RestoreState { pointcut restoreState() = "void bx_sr_after_restore_state()"; diff --git a/core/SAL/bochs/SaveState.ah b/src/core/sal/bochs/SaveState.ah similarity index 95% rename from core/SAL/bochs/SaveState.ah rename to src/core/sal/bochs/SaveState.ah index 7ca2a66b323d0c284461d11e4e46c5e3c3f2fe87..b7856d8024796e1e493dc92009cd9861a2c9f18f 100644 --- a/core/SAL/bochs/SaveState.ah +++ b/src/core/sal/bochs/SaveState.ah @@ -6,6 +6,7 @@ #ifdef CONFIG_SR_SAVE #include "bochs.h" + #include "../SALInst.hpp" aspect SaveState { @@ -17,9 +18,8 @@ aspect SaveState { advice execution (cpuLoop()) : order ("SaveState", "Breakpoints"); advice execution (cpuLoop()) : after () { - if (!fail::save_bochs_request) { + if (!fail::save_bochs_request) return; - } assert(fail::sr_path.size() > 0 && "FATAL ERROR: tried to save state without valid path"); SIM->save_state(fail::sr_path.c_str()); std::cout << "[FAIL] Save finished" << std::endl; diff --git a/core/SAL/bochs/Trap.ah b/src/core/sal/bochs/Trap.ah similarity index 87% rename from core/SAL/bochs/Trap.ah rename to src/core/sal/bochs/Trap.ah index 8d788191024442f126aba9ff636af3eed939af7b..dcfe489e44722d0535b673144eca60fd037eed5b 100644 --- a/core/SAL/bochs/Trap.ah +++ b/src/core/sal/bochs/Trap.ah @@ -5,8 +5,8 @@ #ifdef CONFIG_EVENT_TRAP -#include "../../../bochs/bochs.h" -#include "../../../bochs/cpu/cpu.h" +#include "bochs.h" +#include "cpu/cpu.h" #include "../SALInst.hpp" diff --git a/core/SAL/ovp/FailOVPInit.ah b/src/core/sal/ovp/FailOVPInit.ah similarity index 93% rename from core/SAL/ovp/FailOVPInit.ah rename to src/core/sal/ovp/FailOVPInit.ah index 92a9f26be2d3787816abf9528480921bb041b9f0..198fdf6cf43d3df042360bfd7d4620d75ec99fb5 100644 --- a/core/SAL/ovp/FailOVPInit.ah +++ b/src/core/sal/ovp/FailOVPInit.ah @@ -1,6 +1,8 @@ #ifndef __OVPINIT_AH__ #define __OVPINIT_AH__ +#include <iostream> + #include "../SALInst.hpp" aspect FailOVPInit { diff --git a/core/SAL/ovp/OVPConfig.hpp b/src/core/sal/ovp/OVPConfig.hpp similarity index 71% rename from core/SAL/ovp/OVPConfig.hpp rename to src/core/sal/ovp/OVPConfig.hpp index b6c7fe13bd060c380fd3a0bf24af4c5445a17659..f664af568e00cdfe610e71261e90db42c65dabb7 100644 --- a/core/SAL/ovp/OVPConfig.hpp +++ b/src/core/sal/ovp/OVPConfig.hpp @@ -1,8 +1,12 @@ +/** + * \brief Type definitions and configuration settings for + * the OVP simulator. + */ + #ifndef __OVP_CONFIG_HPP__ #define __OVP_CONFIG_HPP__ -// Type definitions and configuration settings for -// the OVP simulator. +#include <sys/types.h> namespace fail { @@ -11,6 +15,6 @@ typedef uint8_t* host_address_t; //!< the host memory address type typedef uint32_t register_data_t; //!< register data type (32 bit) typedef int timer_t; //!< type of timer IDs -} +} // end-of-namespace: fail #endif // __OVP_CONFIG_HPP__ diff --git a/core/SAL/ovp/OVPController.cc b/src/core/sal/ovp/OVPController.cc similarity index 63% rename from core/SAL/ovp/OVPController.cc rename to src/core/sal/ovp/OVPController.cc index 28b4de7ea78ca1dd1f7be39c3fe3962c713242f4..77688f65bfb02e7b1dc67c27e0c8064d7becc1ce 100644 --- a/core/SAL/ovp/OVPController.cc +++ b/src/core/sal/ovp/OVPController.cc @@ -3,32 +3,33 @@ #include "OVPController.hpp" #include "OVPMemory.hpp" #include "OVPRegister.hpp" -#include "../../../ovp/OVPStatusRegister.hpp" +#include "ovp/OVPStatusRegister.hpp" namespace fail { OVPController::OVPController() : SimulatorController(new OVPRegisterManager(), new OVPMemoryManager()) { - //FIXME: This should be obsolete now... - //set = new UniformRegisterSet(RT_GP); - //setStatus = new UniformRegisterSet(RT_ST); - //setPC= new UniformRegisterSet(RT_PC); + // FIXME: This should be obsolete now... +// set = new UniformRegisterSet(RT_GP); +// setStatus = new UniformRegisterSet(RT_ST); +// setPC = new UniformRegisterSet(RT_PC); } OVPController::~OVPController() { - //FIXME: This should be obsolete now... - //delete set; - //delete setStatus; - //delete setPC; + // FIXME: This should be obsolete now... +// delete set; +// delete setStatus; +// delete setPC; // Free memory of OVPRegister objects (actually allocated in make*Register): - for(RegisterManager::iterator it = m_Regs->begin(); it != m_Regs->end(); it++) + for (RegisterManager::iterator it = m_Regs->begin(); it != m_Regs->end(); it++) delete (*it); // free the memory, allocated in the constructor } -void OVPController::makeGPRegister(int width, void *link, const string& name) { +void OVPController::makeGPRegister(int width, void *link, const string& name) +{ // Add general purpose register OVPRegister *reg = new OVPRegister(m_currentRegId++, width, link, RT_GP); reg->setName(name); @@ -39,55 +40,58 @@ void OVPController::makeGPRegister(int width, void *link, const string& name) { } -void OVPController::makeSTRegister(Register *reg, const string& name) { +void OVPController::makeSTRegister(Register *reg, const string& name) +{ // Add status register reg->setName(name); cerr << "Add Status Register: " << reg << endl; m_Regs->add(reg); } -void OVPController::makePCRegister(int width, void *link, const string& name) { +void OVPController::makePCRegister(int width, void *link, const string& name) +{ // Add general purpose register OVPRegister *reg = new OVPRegister(m_currentRegId++, width, link, RT_PC); reg->setName(name); m_Regs->add(reg); } -//FIXME: This should be obsolete now... -//void OVPController::finishedRegisterCreation() { -// m_Regs->add(*set); -// m_Regs->add(*setStatus); -// m_Regs->add(*setPC); -//} +// FIXME: This should be obsolete now... +/* +void OVPController::finishedRegisterCreation() +{ + m_Regs->add(*set); + m_Regs->add(*setStatus); + m_Regs->add(*setPC); +} +*/ void OVPController::onInstrPtrChanged(address_t instrPtr) { // make some funny outputs unsigned int r0 = m_Regs->getSetOfType(RT_GP)->getRegister(0)->getData(); - OVPRegisterManager *ovp_Regs = (OVPRegisterManager *) m_Regs; + OVPRegisterManager *ovp_Regs = (OVPRegisterManager*) m_Regs; // FIXME: This cast seems to be invalid: RT_GP vs. OVPStatusRegister (= RT_ST)? - OVPStatusRegister *rid_st = (OVPStatusRegister *) m_Regs->getSetOfType(RT_GP)->first(); + OVPStatusRegister *rid_st = (OVPStatusRegister*) m_Regs->getSetOfType(RT_GP)->first(); // cerr << "Addr: " << rid_st << endl; unsigned int st = rid_st->getData(); - //save("/srv/scratch/sirozipp/test.txt"); +// save("/srv/scratch/sirozipp/test.txt"); - //ovpplatform.setPC(0x123); +// ovpplatform.setPC(0x123); - //restore("/srv/scratch/sirozipp/test.txt"); +// restore("/srv/scratch/sirozipp/test.txt"); // cerr << "instrPtr: 0x" << hex << instrPtr << " SP: 0x" << hex << m_Regs->getStackPointer() \ -// << " R0: 0x" << hex << r0 << " ST: 0x" << hex << st << endl; +// << " R0: 0x" << hex << r0 << " ST: 0x" << hex << st << endl; // Check for active breakpoint-events: EventList::iterator it = m_EvList.begin(); - while(it != m_EvList.end()) - { + while (it != m_EvList.end()) { // FIXME: Performance verbessern (dazu muss entsprechend auch die Speicherung // in EventList(.cc|.hpp) angepasst bzw. verbessert werden). BPSingleEvent* pEvBreakpt = dynamic_cast<BPSingleEvent*>(*it); - if(pEvBreakpt && (instrPtr == pEvBreakpt->getWatchInstructionPointer() || - pEvBreakpt->getWatchInstructionPointer() == ANY_ADDR)) - { + if (pEvBreakpt && (instrPtr == pEvBreakpt->getWatchInstructionPointer() || + pEvBreakpt->getWatchInstructionPointer() == ANY_ADDR)) { pEvBreakpt->setTriggerInstructionPointer(instrPtr); it = m_EvList.makeActive(it); // "it" has already been set to the next element (by calling @@ -95,8 +99,7 @@ void OVPController::onInstrPtrChanged(address_t instrPtr) continue; // -> skip iterator increment } BPRangeEvent* pEvRange = dynamic_cast<BPRangeEvent*>(*it); - if(pEvRange && pEvRange->isMatching(instrPtr)) - { + if (pEvRange && pEvRange->isMatching(instrPtr)) { pEvBreakpt->setTriggerInstructionPointer(instrPtr); it = m_EvList.makeActive(it); continue; // dito. @@ -108,27 +111,21 @@ void OVPController::onInstrPtrChanged(address_t instrPtr) void OVPController::save(const string& path) { - //TODO - //SIM->save_state(path.c_str()); - //bx_gui_c::power_handler(); + // TODO! ovpplatform.save(path); } void OVPController::restore(const string& path) { - //TODO - //bx_pc_system.restore_bochs_request = true; + //TODO! assert(path.length() > 0 && "FATAL ERROR: Tried to restore state without valid path!"); - //strncpy(bx_pc_system.sr_path, path.c_str(), 512 /*CI_PATH_LENGTH, @see gui/textconfig.cc*/); ovpplatform.restore(path); } void OVPController::reboot() { - //TODO - //bx_pc_system.Reset(BX_RESET_HARDWARE); - //bx_gui_c::reset_handler();//TODO: leider protected, so geht das also nicht... + // TODO! } -} +} // end-of-namespace: fail diff --git a/src/core/sal/ovp/OVPController.hpp b/src/core/sal/ovp/OVPController.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1f489c3967a22feddc568d3e197a18ecdb3cc60f --- /dev/null +++ b/src/core/sal/ovp/OVPController.hpp @@ -0,0 +1,72 @@ +#ifndef __OVP_CONTROLLER_HPP__ + #define __OVP_CONTROLLER_HPP__ + +#include <string> +#include <cassert> +#include <string.h> +#include <string> + +#include "../SimulatorController.hpp" +#include "../Event.hpp" +#include "../Register.hpp" +#include "ovp/OVPPlatform.hpp" + +namespace fail { + +extern OVPPlatform ovpplatform; + +/** + * \class OVPController + * OVP-specific implementation of a SimulatorController. + */ +class OVPController : public SimulatorController { +private: + // FIXME: This should be obsolete now... +// UniformRegisterSet *set; //(RT_GP); +// UniformRegisterSet *setStatus;//(RT_ST); +// UniformRegisterSet *setPC;//(RT_PC); + + // FIXME: Perhaps this should be declared as a static member: + unsigned int m_currentRegId; + // NOTE: Constants (such as GPRegisterId in sal/bochs/BochsRegister.hpp) + // are much easier to read... +public: + /** + * Initialize the controller. + */ + OVPController(); + virtual ~OVPController(); + virtual void onInstrPtrChanged(address_t instrPtr); + /** + * Save simulator state. + * @param path Location to store state information + */ + virtual void save(const std::string& path); + /** + * Restore simulator state. + * @param path Location to previously saved state information + */ + virtual void restore(const std::string& path); + /** + * Reboot simulator. + */ + virtual void reboot(); + /** + * Returns the current instruction pointer. + * @return the current eip + */ + void makeGPRegister(int, void*, const std::string&); + void makeSTRegister(Register *, const std::string&); + void makePCRegister(int, void*, const std::string&); + /** + * Due to empty RegisterSets are not allowed, OVP platform + * must tell OVPController when it is finished + * + * FIXME: This should be obsolete now... + */ +// void finishedRegisterCreation(); +}; + +} // end-of-namespace: fail + +#endif // __OVP_CONTROLLER_HPP__ diff --git a/src/core/sal/ovp/OVPMemory.hpp b/src/core/sal/ovp/OVPMemory.hpp new file mode 100644 index 0000000000000000000000000000000000000000..94c374011e048200935fa8ccf728beefe476b913 --- /dev/null +++ b/src/core/sal/ovp/OVPMemory.hpp @@ -0,0 +1,73 @@ +#ifndef __OVP_MEMORY_HPP__ + #define __OVP_MEMORY_HPP__ + +#include "../Memory.hpp" + +namespace fail { + +/** + * \class OVPMemoryManager + * Represents a concrete implemenation of the abstract + * MemoryManager to provide access to OVP's memory pool. + */ +class OVPMemoryManager : public MemoryManager { +public: + /** + * Constructs a new MemoryManager object and initializes + * it's attributes appropriately. + */ + OVPMemoryManager() : MemoryManager() { } + /** + * Retrieves the size of the available simulated memory. + * @return the size of the memory pool in bytes + */ + size_t getPoolSize() const { return 0; } + /** + * Retrieves the starting address of the host memory. This is the + * first valid address in memory. + * @return the starting address + */ + host_address_t getStartAddr() const { return 0; } + /** + * Retrieves the byte at address \a addr in the memory. + * @param addr The guest address where the byte is located. + * The address is expected to be valid. + * @return the byte at \a addr + */ + byte_t getByte(guest_address_t addr) { return 0; } + /** + * Retrieves \a cnt bytes at address \a addr in the memory. + * @param addr The guest address where the bytes are located. + * The address is expected to be valid. + * @param cnt the number of bytes to be retrieved. \a addr + \a cnt + * is expected to not exceed the memory limit. + * @param dest Pointer to destination buffer to copy the data to. + */ + void getBytes(guest_address_t addr, size_t cnt, void *dest) { } + /** + * Writes the byte \a data to memory. + * @param addr The guest address to write. + * The address is expected to be valid. + * @param data The new byte to write + */ + void setByte(guest_address_t addr, byte_t data) { } + /** + * Copies data to memory. + * @param addr The guest address to write. + * The address is expected to be valid. + * @param cnt The number of bytes to be retrieved. \a addr + \a cnt + * is expected to not exceed the memory limit. + * @param src Pointer to data to be copied. + */ + void setBytes(guest_address_t addr, size_t cnt, void const *src) { } + /** + * Transforms the guest address \a addr to a host address. + * @param addr The (logical) guest address to be transformed + * @return the transformed (host) address or \c ADDR_INV on errors + */ + host_address_t guestToHost(guest_address_t addr) { return 0; } +}; + +} // end-of-namespace: fail + +#endif // __OVP_MEMORY_HPP__ diff --git a/src/core/sal/ovp/OVPRegister.hpp b/src/core/sal/ovp/OVPRegister.hpp new file mode 100644 index 0000000000000000000000000000000000000000..dd6b3fe0c74b3eac3bb20643b1c00476e3747f9f --- /dev/null +++ b/src/core/sal/ovp/OVPRegister.hpp @@ -0,0 +1,76 @@ +#ifndef __OVP_REGISTER_HPP__ + #define __OVP_REGISTER_HPP__ + +#include "../Register.hpp" +#include "ovp/OVPPlatform.hpp" +//#include "ovp/OVPStatusRegister.hpp" + +extern OVPPlatform ovpplatform; + +namespace fail { + +/** + * \class OVPRegister + * OVP-specific implementation of x86 registers. + */ +class OVPRegister : public Register { +private: + void *reg; +public: + /** + * Constructs a new register object. + * @param id the unique id of this register (simulator specific) + * @param width width of the register (8, 16, 32 or 64 bit should suffice) + * @param link pointer to bochs internal register memory + * @param t type of the register + */ + OVPRegister(unsigned int id, regwidth_t width, void* link, RegisterType t) + : Register(id, t, width) { reg = link; } + /** + * Retrieves the data of the register. + * @return the current register data + */ + regdata_t getData() { return ovpplatform.getRegisterData(reg); } + /** + * Sets the content of the register. + * @param data the new register data to be written + */ + void setData(regdata_t data) { ovpplatform.setRegisterData(reg, data); } +}; + +/** + * \class OVPRegister + * OVP-specific implementation of the RegisterManager. + */ +class OVPRegisterManager : public RegisterManager { +public: + /** + * Returns the current instruction pointer. + * @return the current eip + */ + virtual address_t getInstructionPointer() + { + return ovpplatform.getPC(); + } + /** + * Retruns the top address of the stack. + * @return the starting address of the stack + */ + virtual address_t getStackPointer() + { + return ovpplatform.getSP(); + } + /** + * Retrieves the base ptr (holding the address of the + * current stack frame). + * @return the base pointer + */ + virtual address_t getBasePointer() + { + return 0; + } +}; + +} // end-of-namespace: fail + +#endif // __OVP_REGISTER_HPP__ diff --git a/core/util/CMakeLists.txt b/src/core/util/CMakeLists.txt similarity index 59% rename from core/util/CMakeLists.txt rename to src/core/util/CMakeLists.txt index f79d9732e95073f3ef99c16a31cd1c65fe21466c..ecc8270f80ae750b2bca1d592b4361e1b042bac5 100644 --- a/core/util/CMakeLists.txt +++ b/src/core/util/CMakeLists.txt @@ -6,3 +6,5 @@ set(SRCS ) add_library(util ${SRCS}) + +# FIXME: Add protobuf-dependency (required by ProtoStream.cc@line56) diff --git a/core/util/Logger.cc b/src/core/util/Logger.cc similarity index 100% rename from core/util/Logger.cc rename to src/core/util/Logger.cc diff --git a/src/core/util/Logger.hpp b/src/core/util/Logger.hpp new file mode 100644 index 0000000000000000000000000000000000000000..052886ff2247d449d87954b8d6467abb8d5f84fc --- /dev/null +++ b/src/core/util/Logger.hpp @@ -0,0 +1,53 @@ +#ifndef __LOGGER_HPP__ + #define __LOGGER_HPP__ + +#include <iostream> +#include <sstream> + +namespace fail { + +/** + * \class Logger + * Provides logging mechanisms. + */ +class Logger { +private: + std::ostream* m_pDest; + std::string m_description; + bool m_showTime; + void timestamp(); +public: + /** + * Constructor. + * @param description Description shown alongside each log entry in + * square brackets [ ]. Can be overridden in single add() calls. + * @param show_time Show a timestamp with each log entry. + * @param dest Stream to log into. + */ + Logger(const std::string& description = "Fail*", bool show_time = true, + std::ostream& dest = std::cout) + : m_pDest(&dest), m_description(description), m_showTime(show_time) { } + /** + * Change the default description which is shown alongside each log + * entry in square brackets [ ]. + * @param descr The description text. + */ + void setDescription(const std::string& descr) { m_description = descr; } + /** + * Change the default option of show_time which shows a timestamp + * each log entry. + * @param choice The choice for show_time + */ + void showTime(bool choice) { m_showTime = choice; } + /** + * Add a new log entry. + * @param v data to log + * @return a \c std::ostream reference to continue streaming a longer log entry + */ + template<class T> + inline std::ostream& operator <<(const T& v) { timestamp(); return (*m_pDest) << v; } +}; + +} // end-of-namespace: fail + +#endif // __LOGGER_HPP__ diff --git a/core/util/MemoryMap.hpp b/src/core/util/MemoryMap.hpp similarity index 94% rename from core/util/MemoryMap.hpp rename to src/core/util/MemoryMap.hpp index d284194f3ac667835bc43f511de1f4e4fef76734..15a6cbbef8f23e7cb648ab92948508df53c194b4 100644 --- a/core/util/MemoryMap.hpp +++ b/src/core/util/MemoryMap.hpp @@ -8,7 +8,7 @@ using namespace boost::icl; #include <set> -#include "SAL/SALConfig.hpp" +#include "sal/SALConfig.hpp" namespace fail { @@ -16,27 +16,26 @@ namespace fail { * \class MemoryMap * An efficient container for memory maps with holes. */ -class MemoryMap -{ +class MemoryMap { +private: #ifdef BOOST_1_46_OR_NEWER typedef interval<address_t>::type address_interval; typedef interval_set<address_t>::type address_set; address_set as; public: - MemoryMap() {} + MemoryMap() { } void clear() { as.clear(); } void add(address_t addr, int size) { as.add(address_interval(addr, addr+size-1)); } void isMatching(address_t addr, int size) { return intersects(as, address_interval(addr, addr+size-1)); } #endif std::set<address_t> as; public: - MemoryMap() {} + MemoryMap() { } /** * Clears the map. */ void clear() { as.clear(); } - /** * Adds one or a sequence of addresses to the map. */ @@ -46,7 +45,6 @@ public: as.insert(addr + i); } } - /** * Determines whether a given memory access at address \a addr with width * \a size hits the map. @@ -60,19 +58,16 @@ public: } return false; } - /** * The (STL-style) iterator of this class used to iterate over all * addresses in this map. */ typedef std::set<address_t>::iterator iterator; - /** * Returns an (STL-style) iterator to the beginning of the internal data * structure. */ iterator begin() { return as.begin(); } - /** * Returns an (STL-style) iterator to the end of the interal data * structure. diff --git a/core/util/ProtoStream.cc b/src/core/util/ProtoStream.cc similarity index 95% rename from core/util/ProtoStream.cc rename to src/core/util/ProtoStream.cc index d4315ff282714a80516ec5de0997b0c85bde4e0d..c9d4f1713cdec63aef549dccd2dcd6a554370ca7 100644 --- a/core/util/ProtoStream.cc +++ b/src/core/util/ProtoStream.cc @@ -5,6 +5,7 @@ namespace fail { ProtoOStream::ProtoOStream(std::ostream *outfile) : m_outfile(outfile) { m_log.setDescription("ProtoStream"); + // TODO: log-Level? m_log.showTime(false); } @@ -15,6 +16,7 @@ bool ProtoOStream::writeMessage(google::protobuf::Message* m) if (m_outfile->bad()) { m_log << "Could not write to file!" << std::endl; + // TODO: log-Level? return false; } @@ -26,6 +28,7 @@ bool ProtoOStream::writeMessage(google::protobuf::Message* m) ProtoIStream::ProtoIStream(std::istream *infile) : m_infile(infile) { m_log.setDescription("ProtoStream"); + // TODO: log-Level? m_log.showTime(false); } diff --git a/src/core/util/ProtoStream.hpp b/src/core/util/ProtoStream.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c465d7cc29bc8c1b7127c5d8379b2b32c3ca3e93 --- /dev/null +++ b/src/core/util/ProtoStream.hpp @@ -0,0 +1,81 @@ +/** + * \brief One way to manage large protobuf-messages + * + * Google protobuf is not designed for large messages. That leads to + * much memory which is consumed by processing large messages. To + * solve this problem the ProtoStream class stores the protobuf-messages + * in an other way. Instead of using the repeat-function the data is + * written sequentially in a file. Written in the format: + * + * \code + * | 4 bytes length-information of the first message | first message + * | 4 bytes length-information of the second message | second message + * | ... + * \endcode + */ + +#ifndef __PROTOSTREAM_HPP__ + #define __PROTOSTREAM_HPP__ + +#include <iostream> +#include <sys/types.h> +#include <netinet/in.h> +#include <google/protobuf/message.h> + +#include "Logger.hpp" + +namespace fail { + +/** + * \class ProtoOStream + * + * This class can be used to sequentially write a large number of + * protocol buffer messages to a \c std::ostream. + */ +class ProtoOStream { +private: + uint32_t m_size; // TODO: comments needed here + Logger m_log; + std::ostream* m_outfile; +public: + ProtoOStream(std::ostream *outfile); + virtual ~ProtoOStream() { } + /** + * Writes a message to a file. + * @param m The protobuf-message to be written + * @return Returns \c true on success, \c false otherwise + */ + bool writeMessage(google::protobuf::Message* m); +}; + +/** + * \class ProtoIStream + * + * This class can be used to read protocol buffer messages sequentially + * from a \c std::istream. + */ +class ProtoIStream { +private: + uint32_t m_size; // TODO: comments needed here + long m_sizeOfInfile; + Logger m_log; + std::istream *m_infile; +public: + ProtoIStream(std::istream *infile); + virtual ~ProtoIStream() { } + /** + * Resets the position of the get pointer. After that \c getNext() + * reads the first message again. + */ + void reset(); + /** + * Reads the next protobuf message from the input stream. + * @param m The output protobuf message + * @return Returns \c true on success, \c false otherwise + */ + bool getNext(google::protobuf::Message* m); +}; + +} // end-of-namespace: fail + +#endif // __PROTOSTREAM_HPP__ diff --git a/core/util/SynchronizedCounter.cc b/src/core/util/SynchronizedCounter.cc similarity index 69% rename from core/util/SynchronizedCounter.cc rename to src/core/util/SynchronizedCounter.cc index 232864eba424bd138a49063bbfd52af7dcbe372f..8bdc8323e713351c51e47bda300d34aec47cbde6 100644 --- a/core/util/SynchronizedCounter.cc +++ b/src/core/util/SynchronizedCounter.cc @@ -4,29 +4,26 @@ namespace fail { int SynchronizedCounter::increment() { - // Acquire lock on the queue #ifndef __puma boost::unique_lock<boost::mutex> lock(m_mutex); #endif return ++m_counter; -} // Lock is automatically released here +} int SynchronizedCounter::decrement() { -// Acquire lock on the queue #ifndef __puma boost::unique_lock<boost::mutex> lock(m_mutex); #endif return --m_counter; -} // Lock is automatically released here +} int SynchronizedCounter::getValue() { - // Acquire lock on the queue #ifndef __puma boost::unique_lock<boost::mutex> lock(m_mutex); #endif return m_counter; -} // Lock is automatically released here +} } // end-of-namespace: fail diff --git a/src/core/util/SynchronizedCounter.hpp b/src/core/util/SynchronizedCounter.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9ae8674105f81496c44fe7736884986122c0321b --- /dev/null +++ b/src/core/util/SynchronizedCounter.hpp @@ -0,0 +1,38 @@ +/** + * \brief Thread safe (synchronized) counter. + */ + +#ifndef __SYNCHRONIZED_COUNTER_HPP__ + #define __SYNCHRONIZED_COUNTER_HPP__ + +#ifndef __puma +#include <boost/thread.hpp> +#include <sys/types.h> +#endif + +namespace fail { + +/** + * \class ssd + * + * Provides a thread safe (synchronized) counter. When a method is called, + * the internal mutex is automatically locked. On return, the lock is + * automatically released ("scoped lock"). + */ +class SynchronizedCounter { +private: + int m_counter; +#ifndef __puma + boost::mutex m_mutex; //! The mutex to synchronise on +#endif +public: + SynchronizedCounter() : m_counter(0) { } + + int increment(); + int decrement(); + int getValue(); +}; + +} // end-of-namespace: fail + +#endif // __SYNCHRONIZED_COUNTER_HPP__ diff --git a/core/util/SynchronizedMap.hpp b/src/core/util/SynchronizedMap.hpp similarity index 83% rename from core/util/SynchronizedMap.hpp rename to src/core/util/SynchronizedMap.hpp index 876d7316c15cb623f5abe6fa2572a9ba2be308ac..5f6c934a25903e1b32af57d71e5b19682746868a 100644 --- a/core/util/SynchronizedMap.hpp +++ b/src/core/util/SynchronizedMap.hpp @@ -1,5 +1,6 @@ -// Map class that has thread synchronisation -// TODO We should consider to use Aspects for synchronisation primitives.. +/** + * \brief Map class that has thread synchronisation + */ #ifndef __SYNCHRONIZED_MAP_HPP__ #define __SYNCHRONIZED_MAP_HPP__ @@ -10,26 +11,28 @@ #include <boost/thread.hpp> #endif +// TODO: We should consider to use Aspects for synchronisation primitives. + namespace fail { template <typename Tkey, typename Tvalue> -class SynchronizedMap -{ +class SynchronizedMap { private: typedef std::map< Tkey, Tvalue > Tmap; typedef typename Tmap::iterator Tit; - Tmap m_map; // Use STL map to store data + Tmap m_map; //! Use STL map to store data #ifndef __puma - boost::mutex m_mutex; // The mutex to synchronise on + boost::mutex m_mutex; //! The mutex to synchronise on #endif int nextpick; enum { pick_window_size = 500 }; public: - SynchronizedMap() : nextpick(0) {} - int Size(){ + SynchronizedMap() : nextpick(0) { } + int Size() + { #ifndef __puma boost::unique_lock<boost::mutex> lock(m_mutex); #endif @@ -70,7 +73,7 @@ public: * @param value value according to key * @return false if key already present */ - bool insert(const Tkey& key, const Tvalue& value ) + bool insert(const Tkey& key, const Tvalue& value) { // Acquire lock on the queue #ifndef __puma @@ -98,11 +101,11 @@ public: boost::unique_lock<boost::mutex> lock(m_mutex); #endif Tit iterator; - if ( (iterator = m_map.find(key)) != m_map.end() ) { + if ((iterator = m_map.find(key)) != m_map.end()) { value = iterator->second; m_map.erase(iterator); return true; - }else{ + } else { return false; } } // Lock is automatically released here diff --git a/core/util/SynchronizedQueue.hpp b/src/core/util/SynchronizedQueue.hpp similarity index 76% rename from core/util/SynchronizedQueue.hpp rename to src/core/util/SynchronizedQueue.hpp index 49d06dcbb7e88fae832f2fba4cd62ced3e7a0900..03ae69290d9ebea4062890236ce06d4f59787c2e 100644 --- a/core/util/SynchronizedQueue.hpp +++ b/src/core/util/SynchronizedQueue.hpp @@ -1,5 +1,6 @@ -// Queue class that has thread synchronisation -// from: http://www.quantnet.com/cplusplus-multithreading-boost/ +/** + * \brief Queue class that has thread synchronisation. + */ #ifndef __SYNCHRONIZED_QUEUE_HPP__ #define __SYNCHRONIZED_QUEUE_HPP__ @@ -13,21 +14,21 @@ namespace fail { template <typename T> -class SynchronizedQueue -{ +class SynchronizedQueue { // Adapted from: http://www.quantnet.com/cplusplus-multithreading-boost/ private: - std::queue<T> m_queue; // Use STL queue to store data + std::queue<T> m_queue; //!< Use STL queue to store data #ifndef __puma - boost::mutex m_mutex; // The mutex to synchronise on - boost::condition_variable m_cond; // The condition to wait for + boost::mutex m_mutex; //!< The mutex to synchronise on + boost::condition_variable m_cond; //!< The condition to wait for #endif - public: - int Size(){ +public: + int Size() + { #ifndef __puma - boost::unique_lock<boost::mutex> lock(m_mutex); + boost::unique_lock<boost::mutex> lock(m_mutex); #endif - return m_queue.size(); - } + return m_queue.size(); + } // Add data to the queue and notify others void Enqueue(const T& data) { @@ -56,7 +57,8 @@ private: // Lock is automatically released in the wait and obtained // again after the wait #ifndef __puma - while (m_queue.size()==0) m_cond.wait(lock); + while (m_queue.size() == 0) + m_cond.wait(lock); #endif // Retrieve the data from the queue T result=m_queue.front(); m_queue.pop(); @@ -79,11 +81,11 @@ private: // When there is no data, return false. // Lock is automatically released in the wait and obtained // again after the wait - if (m_queue.size() > 0){ + if (m_queue.size() > 0) { // Retrieve the data from the queue d = m_queue.front(); m_queue.pop(); return true; - }else{ + } else { return false; } } // Lock is automatically released here diff --git a/core/experiments/CMakeLists.txt b/src/experiments/CMakeLists.txt similarity index 78% rename from core/experiments/CMakeLists.txt rename to src/experiments/CMakeLists.txt index 348f07d3014797509eaaa6772c1143a46813e2d5..931c52d9261be6f590976e18f631a22edd097559 100644 --- a/core/experiments/CMakeLists.txt +++ b/src/experiments/CMakeLists.txt @@ -1,5 +1,5 @@ # Note that we're allowing *multiple* experiments to be enabled at once. -set(EXPERIMENTS_ACTIVATED "" CACHE STRING "Activated experiments (a semicolon-separated list of fail/experiments/ subdirectories)") +set(EXPERIMENTS_ACTIVATED "" CACHE STRING "Activated experiments (a semicolon-separated list of fail/src/experiments/ subdirectories)") foreach(experiment_name ${EXPERIMENTS_ACTIVATED}) add_subdirectory(${experiment_name}) diff --git a/core/experiments/checksum-oostubs/CMakeLists.txt b/src/experiments/checksum-oostubs/CMakeLists.txt similarity index 95% rename from core/experiments/checksum-oostubs/CMakeLists.txt rename to src/experiments/checksum-oostubs/CMakeLists.txt index 0e8df5f51c249299bfa3ca87dc146b773e20c446..e3eb432b2dca9f3fd50019361829a81cd69509ae 100644 --- a/core/experiments/checksum-oostubs/CMakeLists.txt +++ b/src/experiments/checksum-oostubs/CMakeLists.txt @@ -25,6 +25,7 @@ PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS}) ## Build library add_library(${EXPERIMENT_NAME} ${PROTO_SRCS} ${PROTO_HDRS} ${MY_CAMPAIGN_SRCS}) +add_dependencies(${EXPERIMENT_NAME} tracing) ## This is the example's campaign server distributing experiment parameters add_executable(${EXPERIMENT_NAME}-server main.cc) diff --git a/core/experiments/checksum-oostubs/campaign.cc b/src/experiments/checksum-oostubs/campaign.cc similarity index 98% rename from core/experiments/checksum-oostubs/campaign.cc rename to src/experiments/checksum-oostubs/campaign.cc index cbf8348eda842949ed10ed4e07a18601d2868eb2..a280d3fbbf0a7c1a7399c1d931a12fba97685888 100644 --- a/core/experiments/checksum-oostubs/campaign.cc +++ b/src/experiments/checksum-oostubs/campaign.cc @@ -1,17 +1,18 @@ #include <iostream> +#include <fstream> #include <vector> #include <map> #include "campaign.hpp" #include "experimentInfo.hpp" -#include "controller/CampaignManager.hpp" +#include "cpn/CampaignManager.hpp" #include "util/Logger.hpp" #include "util/ProtoStream.hpp" #include "util/MemoryMap.hpp" #include "ecc_region.hpp" -#include "plugins/tracing/TracingPlugin.hpp" +#include "../plugins/tracing/TracingPlugin.hpp" char const * const trace_filename = "trace.pb"; using namespace std; diff --git a/core/experiments/checksum-oostubs/campaign.hpp b/src/experiments/checksum-oostubs/campaign.hpp similarity index 84% rename from core/experiments/checksum-oostubs/campaign.hpp rename to src/experiments/checksum-oostubs/campaign.hpp index c032778c30d36eff3531eb9997e963ab1705c803..332b168739217dbdf9d74844f8519f515376c85b 100644 --- a/core/experiments/checksum-oostubs/campaign.hpp +++ b/src/experiments/checksum-oostubs/campaign.hpp @@ -1,8 +1,8 @@ #ifndef __CHECKSUM_OOSTUBS_CAMPAIGN_HPP__ #define __CHECKSUM_OOSTUBS_CAMPAIGN_HPP__ -#include "controller/Campaign.hpp" -#include "controller/ExperimentData.hpp" +#include "cpn/Campaign.hpp" +#include "comm/ExperimentData.hpp" #include "checksum-oostubs.pb.h" class ChecksumOOStuBSExperimentData : public fail::ExperimentData { diff --git a/core/experiments/checksum-oostubs/checksum-oostubs.proto b/src/experiments/checksum-oostubs/checksum-oostubs.proto similarity index 100% rename from core/experiments/checksum-oostubs/checksum-oostubs.proto rename to src/experiments/checksum-oostubs/checksum-oostubs.proto diff --git a/core/experiments/checksum-oostubs/ecc_region.hpp b/src/experiments/checksum-oostubs/ecc_region.hpp similarity index 100% rename from core/experiments/checksum-oostubs/ecc_region.hpp rename to src/experiments/checksum-oostubs/ecc_region.hpp diff --git a/core/experiments/checksum-oostubs/experiment.cc b/src/experiments/checksum-oostubs/experiment.cc similarity index 96% rename from core/experiments/checksum-oostubs/experiment.cc rename to src/experiments/checksum-oostubs/experiment.cc index 1e815d4b6bd4d5e9e255500b5c3344a89c5cbba9..30a7205e9fc9cb571cfe5e46d12846be78863f7b 100644 --- a/core/experiments/checksum-oostubs/experiment.cc +++ b/src/experiments/checksum-oostubs/experiment.cc @@ -1,4 +1,5 @@ #include <iostream> +#include <fstream> // getpid #include <sys/types.h> @@ -8,14 +9,14 @@ #include "experiment.hpp" #include "experimentInfo.hpp" #include "campaign.hpp" -#include "SAL/SALConfig.hpp" -#include "SAL/SALInst.hpp" -#include "SAL/Memory.hpp" -#include "SAL/bochs/BochsRegister.hpp" -#include "controller/Event.hpp" +#include "sal/SALConfig.hpp" +#include "sal/SALInst.hpp" +#include "sal/Memory.hpp" +#include "sal/bochs/BochsRegister.hpp" +#include "sal/Event.hpp" -// you need to have the tracing plugin enabled for this -#include "plugins/tracing/TracingPlugin.hpp" +// You need to have the tracing plugin enabled for this +#include "../plugins/tracing/TracingPlugin.hpp" #include "ecc_region.hpp" @@ -30,7 +31,7 @@ using namespace fail; bool ChecksumOOStuBSExperiment::run() { - char const *statename = "checksum-oostubs.state"; +// char const *statename = "checksum-oostubs.state"; // FIXME: Variable is unused! Logger log("Checksum-OOStuBS", false); BPSingleEvent bp; diff --git a/core/experiments/checksum-oostubs/experiment.hpp b/src/experiments/checksum-oostubs/experiment.hpp similarity index 80% rename from core/experiments/checksum-oostubs/experiment.hpp rename to src/experiments/checksum-oostubs/experiment.hpp index af9cc5ac7e8795cf7bdf5ec1d74e9131a4e36fdd..a0ab7a9845f963211d3475c67a3c3a70a1d5bbf7 100644 --- a/core/experiments/checksum-oostubs/experiment.hpp +++ b/src/experiments/checksum-oostubs/experiment.hpp @@ -1,8 +1,8 @@ #ifndef __CHECKSUM_OOSTUBS_EXPERIMENT_HPP__ #define __CHECKSUM_OOSTUBS_EXPERIMENT_HPP__ -#include "controller/ExperimentFlow.hpp" -#include "jobserver/JobClient.hpp" +#include "efw/ExperimentFlow.hpp" +#include "efw/JobClient.hpp" class ChecksumOOStuBSExperiment : public fail::ExperimentFlow { fail::JobClient m_jc; diff --git a/core/experiments/checksum-oostubs/experimentInfo.hpp b/src/experiments/checksum-oostubs/experimentInfo.hpp similarity index 100% rename from core/experiments/checksum-oostubs/experimentInfo.hpp rename to src/experiments/checksum-oostubs/experimentInfo.hpp diff --git a/core/experiments/checksum-oostubs/main.cc b/src/experiments/checksum-oostubs/main.cc similarity index 66% rename from core/experiments/checksum-oostubs/main.cc rename to src/experiments/checksum-oostubs/main.cc index 9e1b2b7f7569bbcdb4a5b53eb64855920aa45cb9..16605ac5a18e80f1efad37fcdfeb9352b3fdc277 100644 --- a/core/experiments/checksum-oostubs/main.cc +++ b/src/experiments/checksum-oostubs/main.cc @@ -1,8 +1,8 @@ #include <iostream> #include <cstdlib> -#include "controller/CampaignManager.hpp" -#include "experiments/checksum-oostubs/campaign.hpp" +#include "cpn/CampaignManager.hpp" +#include "campaign.hpp" int main(int argc, char **argv) { diff --git a/core/experiments/coolchecksum/CMakeLists.txt b/src/experiments/cool-checksum/CMakeLists.txt similarity index 96% rename from core/experiments/coolchecksum/CMakeLists.txt rename to src/experiments/cool-checksum/CMakeLists.txt index 0c49e904f1c350a3678facdb9fe3222e0f37f0f1..585727881dd41e869422fbbcbcb1e9341114abeb 100644 --- a/core/experiments/coolchecksum/CMakeLists.txt +++ b/src/experiments/cool-checksum/CMakeLists.txt @@ -1,4 +1,4 @@ -set(EXPERIMENT_NAME coolchecksum) +set(EXPERIMENT_NAME cool-checksum) set(EXPERIMENT_TYPE CoolChecksumExperiment) configure_file(../instantiate-experiment.ah.in ${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY diff --git a/core/experiments/coolchecksum/campaign.cc b/src/experiments/cool-checksum/campaign.cc similarity index 98% rename from core/experiments/coolchecksum/campaign.cc rename to src/experiments/cool-checksum/campaign.cc index d01e53bb621e5d6e249cccc4b98fc37bc41808a1..31003ad531a3eaa5084edf2348951c3c762fdb25 100644 --- a/core/experiments/coolchecksum/campaign.cc +++ b/src/experiments/cool-checksum/campaign.cc @@ -1,14 +1,15 @@ #include <iostream> +#include <fstream> #include "campaign.hpp" #include "experimentInfo.hpp" -#include "controller/CampaignManager.hpp" +#include "cpn/CampaignManager.hpp" #include "util/Logger.hpp" #include "util/ProtoStream.hpp" -#include "SAL/SALConfig.hpp" +#include "sal/SALConfig.hpp" #if COOL_FAULTSPACE_PRUNING -#include "plugins/tracing/TracingPlugin.hpp" +#include "../plugins/tracing/TracingPlugin.hpp" char const * const trace_filename = "trace.pb"; #endif diff --git a/core/experiments/coolchecksum/campaign.hpp b/src/experiments/cool-checksum/campaign.hpp similarity index 83% rename from core/experiments/coolchecksum/campaign.hpp rename to src/experiments/cool-checksum/campaign.hpp index d30ac8e5386df34929cf221f768ecc5d624cefff..47c034d28f3bd947f44de22bbfdb13a74609e927 100644 --- a/core/experiments/coolchecksum/campaign.hpp +++ b/src/experiments/cool-checksum/campaign.hpp @@ -1,8 +1,8 @@ #ifndef __COOLCAMPAIGN_HPP__ #define __COOLCAMPAIGN_HPP__ -#include "controller/Campaign.hpp" -#include "controller/ExperimentData.hpp" +#include "cpn/Campaign.hpp" +#include "comm/ExperimentData.hpp" #include "coolchecksum.pb.h" class CoolChecksumExperimentData : public fail::ExperimentData { diff --git a/core/experiments/coolchecksum/coolchecksum.proto b/src/experiments/cool-checksum/coolchecksum.proto similarity index 100% rename from core/experiments/coolchecksum/coolchecksum.proto rename to src/experiments/cool-checksum/coolchecksum.proto diff --git a/core/experiments/coolchecksum/experiment.cc b/src/experiments/cool-checksum/experiment.cc similarity index 97% rename from core/experiments/coolchecksum/experiment.cc rename to src/experiments/cool-checksum/experiment.cc index ce72f76393183ea72220e8a8d59c7554276c6b8e..e1bb38aa03d89b19c4d4f1f36905f8bb2e8b5dd6 100644 --- a/core/experiments/coolchecksum/experiment.cc +++ b/src/experiments/cool-checksum/experiment.cc @@ -4,15 +4,15 @@ #include "experiment.hpp" #include "experimentInfo.hpp" #include "campaign.hpp" -#include "SAL/SALConfig.hpp" -#include "SAL/SALInst.hpp" -#include "SAL/Memory.hpp" -#include "SAL/bochs/BochsRegister.hpp" -#include "controller/Event.hpp" +#include "sal/SALConfig.hpp" +#include "sal/SALInst.hpp" +#include "sal/Memory.hpp" +#include "sal/bochs/BochsRegister.hpp" +#include "sal/Event.hpp" #include "config/FailConfig.hpp" #if COOL_FAULTSPACE_PRUNING -#include "plugins/tracing/TracingPlugin.hpp" +#include "../plugins/tracing/TracingPlugin.hpp" #endif #include "coolchecksum.pb.h" diff --git a/core/experiments/coolchecksum/experiment.hpp b/src/experiments/cool-checksum/experiment.hpp similarity index 78% rename from core/experiments/coolchecksum/experiment.hpp rename to src/experiments/cool-checksum/experiment.hpp index 319321a3e7e9c0c0dcaeb5ab09c34575b680ceba..36d121a23c6f81cb06e4cbfe72d905a02833076d 100644 --- a/core/experiments/coolchecksum/experiment.hpp +++ b/src/experiments/cool-checksum/experiment.hpp @@ -1,8 +1,8 @@ #ifndef __COOLEXPERIMENT_HPP__ #define __COOLEXPERIMENT_HPP__ -#include "controller/ExperimentFlow.hpp" -#include "jobserver/JobClient.hpp" +#include "efw/ExperimentFlow.hpp" +#include "efw/JobClient.hpp" class CoolChecksumExperiment : public fail::ExperimentFlow { fail::JobClient m_jc; diff --git a/core/experiments/coolchecksum/experimentInfo.hpp b/src/experiments/cool-checksum/experimentInfo.hpp similarity index 100% rename from core/experiments/coolchecksum/experimentInfo.hpp rename to src/experiments/cool-checksum/experimentInfo.hpp diff --git a/core/experiments/coolchecksum/main.cc b/src/experiments/cool-checksum/main.cc similarity index 67% rename from core/experiments/coolchecksum/main.cc rename to src/experiments/cool-checksum/main.cc index df6cf723af86e46004387205cef4a05064f0d7ab..b61acec0906ebc96c03e5c73644e6115c5cd325b 100644 --- a/core/experiments/coolchecksum/main.cc +++ b/src/experiments/cool-checksum/main.cc @@ -1,8 +1,8 @@ #include <iostream> #include <cstdlib> -#include "controller/CampaignManager.hpp" -#include "experiments/coolchecksum/campaign.hpp" +#include "cpn/CampaignManager.hpp" +#include "campaign.hpp" int main(int argc, char **argv) { diff --git a/core/experiments/FaultCoverageExperiment/CMakeLists.txt b/src/experiments/fault-coverage/CMakeLists.txt similarity index 90% rename from core/experiments/FaultCoverageExperiment/CMakeLists.txt rename to src/experiments/fault-coverage/CMakeLists.txt index 60ae68fcf5ffbaf6d061ad644fd1ba7b6c333af0..93c43971d87a9ef05cdbf643b24f25adaea7f1d5 100644 --- a/core/experiments/FaultCoverageExperiment/CMakeLists.txt +++ b/src/experiments/fault-coverage/CMakeLists.txt @@ -1,5 +1,5 @@ #FaultCoverage experiment -set(EXPERIMENT_NAME FaultCoverageExperiment) +set(EXPERIMENT_NAME fault-coverage) set(EXPERIMENT_TYPE FaultCoverageExperiment) configure_file(../instantiate-experiment.ah.in ${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY diff --git a/core/experiments/FaultCoverageExperiment/experiment.cc b/src/experiments/fault-coverage/experiment.cc similarity index 97% rename from core/experiments/FaultCoverageExperiment/experiment.cc rename to src/experiments/fault-coverage/experiment.cc index 49b8d40617cae792918595408adceed734d6d690..dcdccd953682b408fce0b68dddc381fdc516e811 100644 --- a/core/experiments/FaultCoverageExperiment/experiment.cc +++ b/src/experiments/fault-coverage/experiment.cc @@ -5,9 +5,9 @@ #include <time.h> #include "experiment.hpp" -#include "SAL/SALInst.hpp" -#include "SAL/bochs/BochsRegister.hpp" -#include "../../util/Logger.hpp" +#include "sal/SALInst.hpp" +#include "sal/bochs/BochsRegister.hpp" +#include "util/Logger.hpp" using namespace std; using namespace fail; diff --git a/core/experiments/FaultCoverageExperiment/experiment.hpp b/src/experiments/fault-coverage/experiment.hpp similarity index 94% rename from core/experiments/FaultCoverageExperiment/experiment.hpp rename to src/experiments/fault-coverage/experiment.hpp index 5c7af5de69390f342a5ff34fdbf010dd2c635e53..e0e109aa85b1e74220b1ab2b6cba5c746c1f8a1f 100644 --- a/core/experiments/FaultCoverageExperiment/experiment.hpp +++ b/src/experiments/fault-coverage/experiment.hpp @@ -5,7 +5,7 @@ #include <fstream> #include "config/FailConfig.hpp" -#include "controller/ExperimentFlow.hpp" +#include "efw/ExperimentFlow.hpp" #define INST_ADDR_FUNC_START 0x4ae6 #define INST_ADDR_FUNC_END 0x4be6 diff --git a/core/experiments/fireinterrupt/CMakeLists.txt b/src/experiments/fire-interrupt/CMakeLists.txt similarity index 81% rename from core/experiments/fireinterrupt/CMakeLists.txt rename to src/experiments/fire-interrupt/CMakeLists.txt index 50a65a8b456383bc130bf940e46f8fce2f21d117..36414e8de622567ce9738198028041f120ff6327 100644 --- a/core/experiments/fireinterrupt/CMakeLists.txt +++ b/src/experiments/fire-interrupt/CMakeLists.txt @@ -1,5 +1,5 @@ -set(EXPERIMENT_NAME fireinterrupt) -set(EXPERIMENT_TYPE fireinterruptExperiment) +set(EXPERIMENT_NAME fire-interrupt) +set(EXPERIMENT_TYPE FireInterruptExperiment) configure_file(../instantiate-experiment.ah.in ${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY ) diff --git a/core/experiments/fireinterrupt/bootdisk.img b/src/experiments/fire-interrupt/bootdisk.img similarity index 100% rename from core/experiments/fireinterrupt/bootdisk.img rename to src/experiments/fire-interrupt/bootdisk.img diff --git a/core/experiments/fireinterrupt/experiment.cc b/src/experiments/fire-interrupt/experiment.cc similarity index 93% rename from core/experiments/fireinterrupt/experiment.cc rename to src/experiments/fire-interrupt/experiment.cc index 8c04e8e50187b6fd9131f14b9c91b79652ed1c70..d0bac70c49b55c1a95e480a7fb30d99e8397f13c 100644 --- a/core/experiments/fireinterrupt/experiment.cc +++ b/src/experiments/fire-interrupt/experiment.cc @@ -11,8 +11,8 @@ #include <iostream> #include "experiment.hpp" -#include "SAL/SALInst.hpp" -#include "controller/Event.hpp" +#include "sal/SALInst.hpp" +#include "sal/Event.hpp" #include "util/Logger.hpp" #include "config/FailConfig.hpp" @@ -24,7 +24,7 @@ using namespace std; using namespace fail; -bool fireinterruptExperiment::run() +bool FireInterruptExperiment::run() { Logger log("FireInterrupt", false); log << "experiment start" << endl; diff --git a/src/experiments/fire-interrupt/experiment.hpp b/src/experiments/fire-interrupt/experiment.hpp new file mode 100644 index 0000000000000000000000000000000000000000..2785bd9711c5a2a67a900f6d32155e749c9978b3 --- /dev/null +++ b/src/experiments/fire-interrupt/experiment.hpp @@ -0,0 +1,12 @@ +#ifndef __FIREINTERRUPT_EXPERIMENT_HPP__ + #define __FIREINTERRUPT_EXPERIMENT_HPP__ + +#include "efw/ExperimentFlow.hpp" + +class FireInterruptExperiment : public fail::ExperimentFlow { +public: + FireInterruptExperiment() { } + bool run(); +}; + +#endif // __FIREINTERRUPT_EXPERIMENT_HPP__ diff --git a/core/experiments/hscsimple/CMakeLists.txt b/src/experiments/hsc-simple/CMakeLists.txt similarity index 83% rename from core/experiments/hscsimple/CMakeLists.txt rename to src/experiments/hsc-simple/CMakeLists.txt index 2b92c3cb0516f34c00798ed974cb3fd12781c5d9..57b4ffd0fd267b55c4688a5b33eb27668ceef52c 100644 --- a/core/experiments/hscsimple/CMakeLists.txt +++ b/src/experiments/hsc-simple/CMakeLists.txt @@ -1,5 +1,5 @@ -set(EXPERIMENT_NAME hscsimple) -set(EXPERIMENT_TYPE hscsimpleExperiment) +set(EXPERIMENT_NAME hsc-simple) +set(EXPERIMENT_TYPE HSCSimpleExperiment) configure_file(../instantiate-experiment.ah.in ${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY ) diff --git a/core/experiments/hscsimple/experiment.cc b/src/experiments/hsc-simple/experiment.cc similarity index 91% rename from core/experiments/hscsimple/experiment.cc rename to src/experiments/hsc-simple/experiment.cc index ca327272a5c9c15accd6917f61dbb4b32d1c25d2..b54728b031927c0e78dfda80f28e0142a7ada741 100644 --- a/core/experiments/hscsimple/experiment.cc +++ b/src/experiments/hsc-simple/experiment.cc @@ -1,11 +1,10 @@ #include <iostream> - #include <unistd.h> #include "experiment.hpp" -#include "SAL/SALInst.hpp" -#include "SAL/bochs/BochsRegister.hpp" -#include "controller/Event.hpp" +#include "sal/SALInst.hpp" +#include "sal/bochs/BochsRegister.hpp" +#include "sal/Event.hpp" #include "util/Logger.hpp" #include "config/FailConfig.hpp" @@ -17,7 +16,7 @@ using namespace std; using namespace fail; -bool hscsimpleExperiment::run() +bool HSCSimpleExperiment::run() { Logger log("HSC", false); log << "experiment start" << endl; diff --git a/src/experiments/hsc-simple/experiment.hpp b/src/experiments/hsc-simple/experiment.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4ee855851ea796cfac784daa0f3a3a849303ef40 --- /dev/null +++ b/src/experiments/hsc-simple/experiment.hpp @@ -0,0 +1,14 @@ +#ifndef __HSC_SIMPLE_EXPERIMENT_HPP__ + #define __HSC_SIMPLE_EXPERIMENT_HPP__ + +#include "efw/ExperimentFlow.hpp" + +class HSCSimpleExperiment : public fail::ExperimentFlow +{ + public: + HSCSimpleExperiment() { } + + bool run(); +}; + +#endif // __HSC_SIMPLE_EXPERIMENT_HPP__ diff --git a/core/experiments/instantiate-experiment.ah.in b/src/experiments/instantiate-experiment.ah.in similarity index 88% rename from core/experiments/instantiate-experiment.ah.in rename to src/experiments/instantiate-experiment.ah.in index 03f8116bd222c6d48f9d2e33998bb36a2056e140..765d7214544c56d1d6ba607c24ff19a4ef4114ba 100644 --- a/core/experiments/instantiate-experiment.ah.in +++ b/src/experiments/instantiate-experiment.ah.in @@ -6,8 +6,8 @@ // worked around by manually removing $BUILDDIR/core/experiments/*/*.ah . // Make sure your experiment declaration is in experiment.hpp: -#include "experiments/@EXPERIMENT_NAME@/experiment.hpp" -#include "SAL/SALInst.hpp" +#include "../experiments/@EXPERIMENT_NAME@/experiment.hpp" +#include "sal/SALInst.hpp" aspect @EXPERIMENT_TYPE@ExperimentHook { @EXPERIMENT_TYPE@ experiment; diff --git a/core/experiments/l4sys/CMakeLists.txt b/src/experiments/l4-sys/CMakeLists.txt similarity index 96% rename from core/experiments/l4sys/CMakeLists.txt rename to src/experiments/l4-sys/CMakeLists.txt index 0f51411f32aa8edef7295c96c487108316feec9f..8b0f1c1cdd667d19321d73bfebb3818dd4e3f7d9 100644 --- a/core/experiments/l4sys/CMakeLists.txt +++ b/src/experiments/l4-sys/CMakeLists.txt @@ -1,4 +1,4 @@ -set(EXPERIMENT_NAME l4sys) +set(EXPERIMENT_NAME l4-sys) set(EXPERIMENT_TYPE L4SysExperiment) configure_file(../instantiate-experiment.ah.in ${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY diff --git a/core/experiments/l4sys/campaign.cc b/src/experiments/l4-sys/campaign.cc similarity index 95% rename from core/experiments/l4sys/campaign.cc rename to src/experiments/l4-sys/campaign.cc index e52129379e629ec4ab74850a3214527d6695854d..61e50e8908cbef2a23b322c75d38a6fddd4bbc3e 100644 --- a/core/experiments/l4sys/campaign.cc +++ b/src/experiments/l4-sys/campaign.cc @@ -1,10 +1,11 @@ #include <iostream> +#include <fstream> #include "campaign.hpp" #include "experimentInfo.hpp" -#include "controller/CampaignManager.hpp" +#include "cpn/CampaignManager.hpp" #include "util/Logger.hpp" -#include "SAL/SALConfig.hpp" +#include "sal/SALConfig.hpp" using namespace std; using namespace fail; diff --git a/core/experiments/l4sys/campaign.hpp b/src/experiments/l4-sys/campaign.hpp similarity index 81% rename from core/experiments/l4sys/campaign.hpp rename to src/experiments/l4-sys/campaign.hpp index c624941f3378cf74dce7cff24a69d03ea754dd7c..cad4f060d916b92e64f91c5a1a900ab8dbb27b6c 100644 --- a/core/experiments/l4sys/campaign.hpp +++ b/src/experiments/l4-sys/campaign.hpp @@ -1,8 +1,8 @@ #ifndef __L4SYS_CAMPAIGN_HPP__ #define __L4SYS_CAMPAIGN_HPP__ -#include "controller/Campaign.hpp" -#include "controller/ExperimentData.hpp" +#include "cpn/Campaign.hpp" +#include "comm/ExperimentData.hpp" #include "l4sys.pb.h" class L4SysExperimentData : public fail::ExperimentData { diff --git a/core/experiments/l4sys/experiment.cc b/src/experiments/l4-sys/experiment.cc similarity index 98% rename from core/experiments/l4sys/experiment.cc rename to src/experiments/l4-sys/experiment.cc index 168cabf1c6bdca378c5be74edac27d4fbd8bf06f..a0c68713db7df391ba67638962f927d4e97b6580 100644 --- a/core/experiments/l4sys/experiment.cc +++ b/src/experiments/l4-sys/experiment.cc @@ -11,11 +11,11 @@ #include "experimentInfo.hpp" #include "campaign.hpp" -#include "SAL/SALConfig.hpp" -#include "SAL/SALInst.hpp" -#include "SAL/Memory.hpp" -#include "SAL/bochs/BochsRegister.hpp" -#include "controller/Event.hpp" +#include "sal/SALConfig.hpp" +#include "sal/SALInst.hpp" +#include "sal/Memory.hpp" +#include "sal/bochs/BochsRegister.hpp" +#include "sal/Event.hpp" #include "config/FailConfig.hpp" #include "l4sys.pb.h" @@ -213,7 +213,7 @@ bool L4SysExperiment::run() // inject RegisterManager& rm = simulator.getRegisterManager(); - Register *ebx = rm.getRegister(RID_EBX); + Register *ebx = rm.getRegister(RID_CBX); regdata_t data = ebx->getData(); regdata_t newdata = data ^ (1 << bit_offset); ebx->setData(newdata); diff --git a/core/experiments/l4sys/experiment.hpp b/src/experiments/l4-sys/experiment.hpp similarity index 88% rename from core/experiments/l4sys/experiment.hpp rename to src/experiments/l4-sys/experiment.hpp index f4afb88a715379bbe17178c52a471c7d56fb710d..8522827b294457f29fbd23a156ac7bdac202b8c4 100644 --- a/core/experiments/l4sys/experiment.hpp +++ b/src/experiments/l4-sys/experiment.hpp @@ -3,8 +3,8 @@ #include <string> -#include "controller/ExperimentFlow.hpp" -#include "jobserver/JobClient.hpp" +#include "efw/ExperimentFlow.hpp" +#include "efw/JobClient.hpp" class L4SysExperiment : public fail::ExperimentFlow { fail::JobClient m_jc; diff --git a/core/experiments/l4sys/experimentInfo.hpp b/src/experiments/l4-sys/experimentInfo.hpp similarity index 100% rename from core/experiments/l4sys/experimentInfo.hpp rename to src/experiments/l4-sys/experimentInfo.hpp diff --git a/core/experiments/l4sys/l4sys.proto b/src/experiments/l4-sys/l4sys.proto similarity index 100% rename from core/experiments/l4sys/l4sys.proto rename to src/experiments/l4-sys/l4sys.proto diff --git a/core/experiments/l4sys/main.cc b/src/experiments/l4-sys/main.cc similarity index 67% rename from core/experiments/l4sys/main.cc rename to src/experiments/l4-sys/main.cc index cf44477cd58287adee9f8d2a2f78b9d5c524ab42..3ef025027aaf774ff41d5cccff36871653fd5293 100644 --- a/core/experiments/l4sys/main.cc +++ b/src/experiments/l4-sys/main.cc @@ -1,8 +1,8 @@ #include <iostream> #include <cstdlib> -#include "controller/CampaignManager.hpp" -#include "experiments/l4sys/campaign.hpp" +#include "cpn/CampaignManager.hpp" +#include "campaign.hpp" int main(int argc, char **argv) { diff --git a/core/experiments/MHTestCampaign/CMakeLists.txt b/src/experiments/mh-test-campaign/CMakeLists.txt similarity index 95% rename from core/experiments/MHTestCampaign/CMakeLists.txt rename to src/experiments/mh-test-campaign/CMakeLists.txt index 9485934ffab566960900ad52497ea958a0dbc0d4..18ec47ac8495b2bb5626dbec1ad036add9bd4196 100644 --- a/core/experiments/MHTestCampaign/CMakeLists.txt +++ b/src/experiments/mh-test-campaign/CMakeLists.txt @@ -1,4 +1,4 @@ -set(EXPERIMENT_NAME MHTestCampaign) +set(EXPERIMENT_NAME mh-test-campaign) set(EXPERIMENT_TYPE MHTestExperiment) configure_file(../instantiate-experiment.ah.in ${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY diff --git a/core/experiments/MHTestCampaign/MHTest.proto b/src/experiments/mh-test-campaign/MHTest.proto similarity index 100% rename from core/experiments/MHTestCampaign/MHTest.proto rename to src/experiments/mh-test-campaign/MHTest.proto diff --git a/core/experiments/MHTestCampaign/MHTestCampaign.cc b/src/experiments/mh-test-campaign/MHTestCampaign.cc similarity index 96% rename from core/experiments/MHTestCampaign/MHTestCampaign.cc rename to src/experiments/mh-test-campaign/MHTestCampaign.cc index 3d0bea2893fc8bd89587555b8d7f8278202612f5..4f20cfc4d25ec6444814f1b8349a4164a500136c 100644 --- a/core/experiments/MHTestCampaign/MHTestCampaign.cc +++ b/src/experiments/mh-test-campaign/MHTestCampaign.cc @@ -1,7 +1,7 @@ #include <iostream> #include "MHTestCampaign.hpp" -#include <controller/CampaignManager.hpp> +#include <cpn/CampaignManager.hpp> using namespace std; using namespace fail; diff --git a/core/experiments/MHTestCampaign/MHTestCampaign.hpp b/src/experiments/mh-test-campaign/MHTestCampaign.hpp similarity index 76% rename from core/experiments/MHTestCampaign/MHTestCampaign.hpp rename to src/experiments/mh-test-campaign/MHTestCampaign.hpp index 5c2a34e239db7c7bb49d64c880b8507fc657a1e9..d5106f4835a871ab61e94df0a946e1f91254be20 100644 --- a/core/experiments/MHTestCampaign/MHTestCampaign.hpp +++ b/src/experiments/mh-test-campaign/MHTestCampaign.hpp @@ -1,9 +1,9 @@ #ifndef __MH_TEST_CAMPAIGN_HPP__ #define __MH_TEST_CAMPAIGN_HPP__ -#include <controller/Campaign.hpp> -#include "controller/ExperimentData.hpp" -#include <experiments/MHTestCampaign/MHTest.pb.h> +#include <cpn/Campaign.hpp> +#include "comm/ExperimentData.hpp" +#include "MHTest.pb.h" class MHExperimentData : public fail::ExperimentData { public: @@ -11,7 +11,6 @@ public: MHExperimentData() : fail::ExperimentData(&msg) { } }; - class MHTestCampaign : public fail::Campaign { private: int m_parameter_count; diff --git a/core/experiments/MHTestCampaign/experiment.cc b/src/experiments/mh-test-campaign/experiment.cc similarity index 92% rename from core/experiments/MHTestCampaign/experiment.cc rename to src/experiments/mh-test-campaign/experiment.cc index 324b847967634fa28b94a59f560d0fed90480c85..7b25200b48f67bcf20f21c1ce480ec01059a4ac7 100644 --- a/core/experiments/MHTestCampaign/experiment.cc +++ b/src/experiments/mh-test-campaign/experiment.cc @@ -2,9 +2,9 @@ #include "experiment.hpp" #include "MHTestCampaign.hpp" -#include "SAL/SALInst.hpp" -#include "SAL/Register.hpp" -#include "controller/Event.hpp" +#include "sal/SALInst.hpp" +#include "sal/Register.hpp" +#include "sal/Event.hpp" // FIXME: You should provide a dependency check here! diff --git a/core/experiments/MHTestCampaign/experiment.hpp b/src/experiments/mh-test-campaign/experiment.hpp similarity index 78% rename from core/experiments/MHTestCampaign/experiment.hpp rename to src/experiments/mh-test-campaign/experiment.hpp index 948f5159afbc6ec8083dc35283d4ccc60c4cc76e..c6d625930e363ecb7463b01cda96f0fd73e653db 100644 --- a/core/experiments/MHTestCampaign/experiment.hpp +++ b/src/experiments/mh-test-campaign/experiment.hpp @@ -1,8 +1,8 @@ #ifndef __MH_TEST_EXPERIMENT_HPP__ #define __MH_TEST_EXPERIMENT_HPP__ -#include "controller/ExperimentFlow.hpp" -#include "jobserver/JobClient.hpp" +#include "efw/ExperimentFlow.hpp" +#include "efw/JobClient.hpp" class MHTestExperiment : public fail::ExperimentFlow { private: diff --git a/core/experiments/MHTestCampaign/mhcampaign.cc b/src/experiments/mh-test-campaign/mhcampaign.cc similarity index 72% rename from core/experiments/MHTestCampaign/mhcampaign.cc rename to src/experiments/mh-test-campaign/mhcampaign.cc index 21bcb3bb900bd180427c405a2fca3f73d7677bd6..7b5b563e745396d95cafbb86a25405126fc1f501 100644 --- a/core/experiments/MHTestCampaign/mhcampaign.cc +++ b/src/experiments/mh-test-campaign/mhcampaign.cc @@ -1,8 +1,8 @@ #include <iostream> #include <cstdlib> -#include "controller/CampaignManager.hpp" -#include "experiments/MHTestCampaign/MHTestCampaign.hpp" +#include "cpn/CampaignManager.hpp" +#include "MHTestCampaign.hpp" using namespace std; @@ -16,7 +16,7 @@ int main(int argc, char**argv) cout << "Running MHTestCampaign [" << paramcount << " parameter sets]" << endl; MHTestCampaign mhc(paramcount); - campaignmanager.runCampaign(&mhc); + fail::campaignmanager.runCampaign(&mhc); cout << "Campaign complete." << endl; diff --git a/core/experiments/TracingTest/CMakeLists.txt b/src/experiments/tracing-test/CMakeLists.txt similarity index 82% rename from core/experiments/TracingTest/CMakeLists.txt rename to src/experiments/tracing-test/CMakeLists.txt index 5c5b3dcfc65c8fb46c40ec1a9e9a0b8e2cc75fec..5cd1ebb7c9a1c21258217747e6b3c93b5e4ffd21 100644 --- a/core/experiments/TracingTest/CMakeLists.txt +++ b/src/experiments/tracing-test/CMakeLists.txt @@ -1,4 +1,4 @@ -set(EXPERIMENT_NAME TracingTest) +set(EXPERIMENT_NAME tracing-test) set(EXPERIMENT_TYPE TracingTest) configure_file(../instantiate-experiment.ah.in ${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY @@ -13,3 +13,5 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) ## Build library add_library(${EXPERIMENT_NAME} ${PROTO_SRCS} ${PROTO_HDRS} ${MY_CAMPAIGN_SRCS}) + +add_dependencies(${EXPERIMENT_NAME} tracing) diff --git a/core/experiments/TracingTest/experiment.cc b/src/experiments/tracing-test/experiment.cc similarity index 93% rename from core/experiments/TracingTest/experiment.cc rename to src/experiments/tracing-test/experiment.cc index f3b0c736694788f77fc3d942f4c90e6b1aa9d0fc..e2ef10e1c44a0e0b6d9f475f626d52ef1e0956e6 100644 --- a/core/experiments/TracingTest/experiment.cc +++ b/src/experiments/tracing-test/experiment.cc @@ -1,9 +1,10 @@ #include <iostream> +#include <fstream> -#include "SAL/SALInst.hpp" -#include "SAL/Register.hpp" +#include "sal/SALInst.hpp" +#include "sal/Register.hpp" #include "experiment.hpp" -#include "plugins/tracing/TracingPlugin.hpp" +#include "../plugins/tracing/TracingPlugin.hpp" /* #include <google/protobuf/io/zero_copy_stream_impl.h> diff --git a/core/experiments/TracingTest/experiment.hpp b/src/experiments/tracing-test/experiment.hpp similarity index 56% rename from core/experiments/TracingTest/experiment.hpp rename to src/experiments/tracing-test/experiment.hpp index ae0133bfd2500e81940bce2630d7d55a2d01d229..102bc15c5bc154bb5fc79dc3fc746d5f4fca4237 100644 --- a/core/experiments/TracingTest/experiment.hpp +++ b/src/experiments/tracing-test/experiment.hpp @@ -1,10 +1,9 @@ #ifndef __TRACING_TEST_HPP__ #define __TRACING_TEST_HPP__ -#include "controller/ExperimentFlow.hpp" +#include "efw/ExperimentFlow.hpp" -class TracingTest : public fail::ExperimentFlow -{ +class TracingTest : public fail::ExperimentFlow { public: bool run(); }; diff --git a/core/experiments/weathermonitor/CMakeLists.txt b/src/experiments/weather-monitor/CMakeLists.txt similarity index 87% rename from core/experiments/weathermonitor/CMakeLists.txt rename to src/experiments/weather-monitor/CMakeLists.txt index cb92ba57c74dccf222d584a5b01e031ae815435a..6458e25b7c4609702435d43ce16dc9724f3e2fbc 100644 --- a/core/experiments/weathermonitor/CMakeLists.txt +++ b/src/experiments/weather-monitor/CMakeLists.txt @@ -1,5 +1,5 @@ -set(EXPERIMENT_NAME weathermonitor) -set(EXPERIMENT_TYPE WeathermonitorExperiment) +set(EXPERIMENT_NAME weather-monitor) +set(EXPERIMENT_TYPE WeatherMonitorExperiment) configure_file(../instantiate-experiment.ah.in ${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY ) @@ -27,6 +27,8 @@ PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS}) ## Build library add_library(${EXPERIMENT_NAME} ${PROTO_SRCS} ${PROTO_HDRS} ${MY_CAMPAIGN_SRCS}) +add_dependencies(${EXPERIMENT_NAME} tracing) + ## This is the example's campaign server distributing experiment parameters add_executable(${EXPERIMENT_NAME}-server main.cc) target_link_libraries(${EXPERIMENT_NAME}-server ${EXPERIMENT_NAME} fail ${PROTOBUF_LIBRARY} ${Boost_THREAD_LIBRARY}) diff --git a/core/experiments/weathermonitor/campaign.cc b/src/experiments/weather-monitor/campaign.cc similarity index 94% rename from core/experiments/weathermonitor/campaign.cc rename to src/experiments/weather-monitor/campaign.cc index 717ff894e5175d2c18347374b08dd787b16a4e88..0d3da831c3ac52baa80a96d56f4df13d95b07464 100644 --- a/core/experiments/weathermonitor/campaign.cc +++ b/src/experiments/weather-monitor/campaign.cc @@ -1,17 +1,18 @@ #include <iostream> +#include <fstream> #include <vector> #include <map> #include "campaign.hpp" #include "experimentInfo.hpp" -#include "controller/CampaignManager.hpp" +#include "cpn/CampaignManager.hpp" #include "util/Logger.hpp" #include "util/MemoryMap.hpp" #include "util/ProtoStream.hpp" #include "vptr_map.hpp" -#include "plugins/tracing/TracingPlugin.hpp" +#include "../plugins/tracing/TracingPlugin.hpp" using namespace std; using namespace fail; @@ -29,7 +30,7 @@ struct equivalence_class { address_t instr2_absolute; }; -bool WeathermonitorCampaign::run() +bool WeatherMonitorCampaign::run() { Logger log("Weathermonitor Campaign"); @@ -65,7 +66,7 @@ bool WeathermonitorCampaign::run() equivalence_class current_ec; // map for efficient access when results come in - map<WeathermonitorExperimentData *, unsigned> experiment_ecs; + map<WeatherMonitorExperimentData *, unsigned> experiment_ecs; // experiment count int count = 0; @@ -122,7 +123,7 @@ bool WeathermonitorCampaign::run() // instantly enqueue job: that way the job clients can already // start working in parallel - WeathermonitorExperimentData *d = new WeathermonitorExperimentData; + WeatherMonitorExperimentData *d = new WeatherMonitorExperimentData; // we pick the rightmost instruction in that interval d->msg.set_instr_offset(current_ec.instr2); d->msg.set_instr_address(current_ec.instr2_absolute); @@ -172,7 +173,7 @@ bool WeathermonitorCampaign::run() // FIXME copy/paste, encapsulate this: // instantly enqueue job: that way the job clients can already // start working in parallel - WeathermonitorExperimentData *d = new WeathermonitorExperimentData; + WeatherMonitorExperimentData *d = new WeatherMonitorExperimentData; // we pick the rightmost instruction in that interval d->msg.set_instr_offset(current_ec.instr2); //d->msg.set_instr_address(current_ec.instr2_absolute); // unknown! @@ -225,12 +226,12 @@ bool WeathermonitorCampaign::run() } // collect results - WeathermonitorExperimentData *res; + WeatherMonitorExperimentData *res; int rescount = 0; - while ((res = static_cast<WeathermonitorExperimentData *>(campaignmanager.getDone()))) { + while ((res = static_cast<WeatherMonitorExperimentData *>(campaignmanager.getDone()))) { rescount++; - map<WeathermonitorExperimentData *, unsigned>::iterator it = + map<WeatherMonitorExperimentData *, unsigned>::iterator it = experiment_ecs.find(res); if (it == experiment_ecs.end()) { results << "WTF, didn't find res!" << endl; diff --git a/src/experiments/weather-monitor/campaign.hpp b/src/experiments/weather-monitor/campaign.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c99df11fbcedf1645f9410330f593588a503b1ca --- /dev/null +++ b/src/experiments/weather-monitor/campaign.hpp @@ -0,0 +1,19 @@ +#ifndef __WEATHERMONITOR_CAMPAIGN_HPP__ + #define __WEATHERMONITOR_CAMPAIGN_HPP__ + +#include "cpn/Campaign.hpp" +#include "comm/ExperimentData.hpp" +#include "weathermonitor.pb.h" + +class WeatherMonitorExperimentData : public fail::ExperimentData { +public: + WeathermonitorProtoMsg msg; + WeatherMonitorExperimentData() : fail::ExperimentData(&msg) {} +}; + +class WeatherMonitorCampaign : public fail::Campaign { +public: + virtual bool run(); +}; + +#endif // __WEATHERMONITOR_CAMPAIGN_HPP__ diff --git a/core/experiments/weathermonitor/experiment.cc b/src/experiments/weather-monitor/experiment.cc similarity index 96% rename from core/experiments/weathermonitor/experiment.cc rename to src/experiments/weather-monitor/experiment.cc index 21a07c3426add4b35d78bb68e806611bb424f4b8..151d2d440493a777c29697e9ac0438d986315d04 100644 --- a/core/experiments/weathermonitor/experiment.cc +++ b/src/experiments/weather-monitor/experiment.cc @@ -10,14 +10,14 @@ #include "experimentInfo.hpp" #include "campaign.hpp" -#include "SAL/SALConfig.hpp" -#include "SAL/SALInst.hpp" -#include "SAL/Memory.hpp" -#include "SAL/bochs/BochsRegister.hpp" -#include "controller/Event.hpp" +#include "sal/SALConfig.hpp" +#include "sal/SALInst.hpp" +#include "sal/Memory.hpp" +#include "sal/bochs/BochsRegister.hpp" +#include "sal/Event.hpp" // you need to have the tracing plugin enabled for this -#include "plugins/tracing/TracingPlugin.hpp" +#include "../plugins/tracing/TracingPlugin.hpp" #include "vptr_map.hpp" @@ -32,9 +32,9 @@ using namespace fail; #error This experiment needs: breakpoints, traps, save, and restore. Enable these in the configuration. #endif -bool WeathermonitorExperiment::run() +bool WeatherMonitorExperiment::run() { - char const *statename = "bochs.state"; +// char const *statename = "bochs.state"; // FIXME: Variable is unused, accidental? Logger log("Weathermonitor", false); BPSingleEvent bp; @@ -134,7 +134,7 @@ bool WeathermonitorExperiment::run() // get an experiment parameter set log << "asking job server for experiment parameters" << endl; - WeathermonitorExperimentData param; + WeatherMonitorExperimentData param; #if !LOCAL if (!m_jc.getParam(param)) { log << "Dying." << endl; diff --git a/src/experiments/weather-monitor/experiment.hpp b/src/experiments/weather-monitor/experiment.hpp new file mode 100644 index 0000000000000000000000000000000000000000..13b88ad8a8874ecaf2d9990e6bb9eb39a889dc32 --- /dev/null +++ b/src/experiments/weather-monitor/experiment.hpp @@ -0,0 +1,14 @@ +#ifndef __WEATHERMONITOR_EXPERIMENT_HPP__ + #define __WEATHERMONITOR_EXPERIMENT_HPP__ + +#include "efw/ExperimentFlow.hpp" +#include "efw/JobClient.hpp" + +class WeatherMonitorExperiment : public fail::ExperimentFlow { + fail::JobClient m_jc; +public: + WeatherMonitorExperiment() : m_jc("ios.cs.tu-dortmund.de") {} + bool run(); +}; + +#endif // __WEATHERMONITOR_EXPERIMENT_HPP__ diff --git a/core/experiments/weathermonitor/experimentInfo.hpp b/src/experiments/weather-monitor/experimentInfo.hpp similarity index 100% rename from core/experiments/weathermonitor/experimentInfo.hpp rename to src/experiments/weather-monitor/experimentInfo.hpp diff --git a/core/experiments/weathermonitor/experimentInfo.hpp.sh b/src/experiments/weather-monitor/experimentInfo.hpp.sh similarity index 100% rename from core/experiments/weathermonitor/experimentInfo.hpp.sh rename to src/experiments/weather-monitor/experimentInfo.hpp.sh diff --git a/core/experiments/weathermonitor/main.cc b/src/experiments/weather-monitor/main.cc similarity index 51% rename from core/experiments/weathermonitor/main.cc rename to src/experiments/weather-monitor/main.cc index ca956423f2b56351972e0c0ae285d0ed8dc7b52b..0e77b098ed2f58e14ff0c09912b533ef1da5c407 100644 --- a/core/experiments/weathermonitor/main.cc +++ b/src/experiments/weather-monitor/main.cc @@ -1,11 +1,11 @@ #include <iostream> #include <cstdlib> -#include "controller/CampaignManager.hpp" -#include "experiments/weathermonitor/campaign.hpp" +#include "cpn/CampaignManager.hpp" +#include "campaign.hpp" int main(int argc, char **argv) { - WeathermonitorCampaign c; + WeatherMonitorCampaign c; return !fail::campaignmanager.runCampaign(&c); } diff --git a/core/experiments/weathermonitor/vptr_map.hpp b/src/experiments/weather-monitor/vptr_map.hpp similarity index 100% rename from core/experiments/weathermonitor/vptr_map.hpp rename to src/experiments/weather-monitor/vptr_map.hpp diff --git a/core/experiments/weathermonitor/weathermonitor.proto b/src/experiments/weather-monitor/weathermonitor.proto similarity index 100% rename from core/experiments/weathermonitor/weathermonitor.proto rename to src/experiments/weather-monitor/weathermonitor.proto diff --git a/core/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt similarity index 79% rename from core/plugins/CMakeLists.txt rename to src/plugins/CMakeLists.txt index 9a81d1591a104e6cb4ba75fc2c9f6cd82ac72bc0..a776417dec1b7a965de7f150871fb80f7b840385 100644 --- a/core/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,5 +1,5 @@ # Note that we're allowing *multiple* plugins to be enabled at once. -set(PLUGINS_ACTIVATED "" CACHE STRING "Activated plugins (a semicolon-separated list of fail/plugins/ subdirectories)") +set(PLUGINS_ACTIVATED "" CACHE STRING "Activated plugins (a semicolon-separated list of fail/src/plugins/ subdirectories)") foreach(plugin_name ${PLUGINS_ACTIVATED}) add_subdirectory(${plugin_name}) diff --git a/core/plugins/tracing/CMakeLists.txt b/src/plugins/tracing/CMakeLists.txt similarity index 100% rename from core/plugins/tracing/CMakeLists.txt rename to src/plugins/tracing/CMakeLists.txt diff --git a/core/plugins/tracing/README.txt b/src/plugins/tracing/README.txt similarity index 100% rename from core/plugins/tracing/README.txt rename to src/plugins/tracing/README.txt diff --git a/core/plugins/tracing/TracingPlugin.cc b/src/plugins/tracing/TracingPlugin.cc similarity index 96% rename from core/plugins/tracing/TracingPlugin.cc rename to src/plugins/tracing/TracingPlugin.cc index b28461887558bb3f07a99a2e2e49e58aec74bec4..b2eecb05c8c6a75ebd5146648ce57d2ed7d6c1fa 100644 --- a/core/plugins/tracing/TracingPlugin.cc +++ b/src/plugins/tracing/TracingPlugin.cc @@ -1,7 +1,7 @@ #include <iostream> -#include "SAL/SALInst.hpp" -#include "SAL/Register.hpp" +#include "sal/SALInst.hpp" +#include "sal/Register.hpp" #include "TracingPlugin.hpp" using namespace std; diff --git a/core/plugins/tracing/TracingPlugin.hpp b/src/plugins/tracing/TracingPlugin.hpp similarity index 97% rename from core/plugins/tracing/TracingPlugin.hpp rename to src/plugins/tracing/TracingPlugin.hpp index ed2f53cedc9ab4ca17d27db3be147a308b849707..64efe4dbe41dc09ce00b8d17778b6fc23f052f1f 100644 --- a/core/plugins/tracing/TracingPlugin.hpp +++ b/src/plugins/tracing/TracingPlugin.hpp @@ -3,12 +3,12 @@ #include <ostream> -#include "controller/ExperimentFlow.hpp" #include "util/MemoryMap.hpp" #include "util/ProtoStream.hpp" +#include "efw/ExperimentFlow.hpp" #include "config/FailConfig.hpp" -#include "plugins/tracing/trace.pb.h" +#include "../plugins/tracing/trace.pb.h" // Check if configuration dependencies are satisfied: #if !defined(CONFIG_EVENT_BREAKPOINTS) || !defined(CONFIG_EVENT_MEMREAD) || !defined(CONFIG_EVENT_MEMWRITE) diff --git a/core/plugins/tracing/dump-trace.py b/src/plugins/tracing/dump-trace.py similarity index 100% rename from core/plugins/tracing/dump-trace.py rename to src/plugins/tracing/dump-trace.py diff --git a/core/plugins/tracing/trace.proto b/src/plugins/tracing/trace.proto similarity index 100% rename from core/plugins/tracing/trace.proto rename to src/plugins/tracing/trace.proto