-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.h
44 lines (40 loc) · 1.06 KB
/
controller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "transaction.h"
#include <vector>
#include "thrift_client.h"
#include "simple_types.h"
#include "tm_harness_magic.h"
extern "C" {
#include "simics/api.h"
#include "tm_init.h"
}
class Controller {
public:
Controller(int num_cpus);
~Controller();
void BeginTransaction();
void BeginTransactionIdx(int cpu_num);
void CommitTransaction();
void CommitTransactionIdx(int cpu_num);
void AbortTransaction();
void AbortTransactionIdx(int cpu_num);
void DisableInterrupts();
void EnableInterrupts();
void EarlyRelease(int var);
int MemoryOperation(generic_transaction_t *mop);
int MemoryObserve(generic_transaction_t *mop);
void DumpStats(void);
bool InTransaction(int cpu);
bool InException(int cpu);
int handlingException(int cpu, int exception);
int clearingException(int cpu, int exception);
void ResumeTransaction();
private:
Thrift_Client* tc;
int cont_num_cpus;
int tid;
int* txs;
std::vector<Transaction *> trans_handler;
};
#endif