T32: Code cleanup.
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@2104 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -1,6 +1 @@
|
||||
set(SRCS
|
||||
hlinknet.cc
|
||||
hremote.cc
|
||||
)
|
||||
|
||||
add_library(t32api ${SRCS})
|
||||
add_library(t32api hlinknet.cc hremote.cc)
|
||||
|
||||
@ -8,4 +8,4 @@ target_link_libraries(fail-client -Wl,-whole-archive t32api -Wl,-no-whole-archiv
|
||||
install(TARGETS fail-client RUNTIME DESTINATION bin)
|
||||
|
||||
add_executable(t32cli t32cli.cc)
|
||||
target_link_libraries(t32cli -Wl,-whole-archive t32api -Wl,-no-whole-archive)
|
||||
target_link_libraries(t32cli t32api)
|
||||
|
||||
@ -6,15 +6,12 @@
|
||||
#ifndef __T32_CONFIG_HPP__
|
||||
#define __T32_CONFIG_HPP__
|
||||
|
||||
struct T32Timer;
|
||||
|
||||
namespace fail {
|
||||
|
||||
typedef uint32_t guest_address_t; //!< the guest memory address type
|
||||
typedef unsigned char* host_address_t; //!< the host memory address type
|
||||
typedef uint32_t register_data_t; //!< register data type (64 bit)
|
||||
typedef int timer_t; //!< type of timer IDs
|
||||
//typedef T32Timer* timer_t; //!< type of timer IDs
|
||||
|
||||
} // end-of-namespace: fail
|
||||
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
/**
|
||||
* FailT32 -- Fault Injection on the Lauterbach Trace32 System
|
||||
*
|
||||
* 1. Invoke t32 executable with appropriate Lauterbach Skript
|
||||
* - Script has to load binary
|
||||
* - and let system run until entry point
|
||||
* -> Then we have a readily configured system
|
||||
*
|
||||
* @author Martin Hoffmann <hoffmann@cs.fau.de>
|
||||
* @date 15.02.2013
|
||||
*/
|
||||
|
||||
#include <t32.h>
|
||||
#include <iostream>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/* Default T32 error handler */
|
||||
void err(int ernum){
|
||||
if(err != 0){
|
||||
cerr << "Error: " << err << endl;
|
||||
//exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Here we go... */
|
||||
int main(int argc, char** argv){
|
||||
|
||||
// Evaluate arguments
|
||||
|
||||
// Setup connection to Lauterbach
|
||||
cout << "Lauterbach remote connection" << endl;
|
||||
int error;
|
||||
char hostname[] = "localhost";
|
||||
char packlen[] = "1024";
|
||||
char port[] = "20010";
|
||||
|
||||
cout << "[T32] Connecting to " << hostname << ":" << port << " Packlen: " << packlen << endl;
|
||||
T32_Config("NODE=", hostname);
|
||||
T32_Config("PACKLEN=", packlen);
|
||||
T32_Config("PORT=", port);
|
||||
|
||||
cout << "[T32] Init." << endl;
|
||||
err(T32_Init());
|
||||
|
||||
cout << "[T32] Attach." << endl;
|
||||
err(T32_Attach(T32_DEV_ICD));
|
||||
|
||||
|
||||
// Let simulatorcontroller do the work.
|
||||
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
#ifndef __T32_CONNECTOR_HPP__
|
||||
#define __T32_CONNECTOR_HPP__
|
||||
|
||||
#include <t32.h>
|
||||
|
||||
namespace fail {
|
||||
|
||||
/**
|
||||
* \class T32Connector
|
||||
*/
|
||||
class T32Connector {
|
||||
public:
|
||||
|
||||
|
||||
/**
|
||||
* Save simulator state. Quite hard on real hardware! Also safe all HW registers!
|
||||
* @param path Location to store state information
|
||||
* @return \c true if the state has been successfully saved, \c false otherwise
|
||||
*/
|
||||
};
|
||||
|
||||
} // end-of-namespace: fail
|
||||
|
||||
#endif // __T32_CONNECTOR_HPP__
|
||||
@ -1,9 +1,6 @@
|
||||
#include "T32Controller.hpp"
|
||||
#include "T32Connector.hpp"
|
||||
|
||||
#include "../Listener.hpp"
|
||||
|
||||
|
||||
namespace fail {
|
||||
|
||||
void T32Controller::startup(){
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "../SALInst.hpp"
|
||||
#include "../SALConfig.hpp"
|
||||
#include "config/FailConfig.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
void fail_init(struct CPUX86State *env)
|
||||
{
|
||||
std::cout << "FailT32" FAIL_VERSION << std::endl;
|
||||
fail::simulator.startup();
|
||||
}
|
||||
|
||||
void fail_watchpoint_hit(struct CPUX86State *env, uint64_t addr, int width, int is_write)
|
||||
{
|
||||
// FIXME: instruction pointer
|
||||
fail::simulator.onMemoryAccess(addr, width, is_write == 1, 0);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user