-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfault_object.h
51 lines (41 loc) · 1.19 KB
/
fault_object.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
45
46
47
48
49
50
51
#include "systemc.h"
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
#ifndef __FAULT_OBJECT_H__
#define __FAULT_OBJECT_H__
enum Faults { SA0, SA1, BitFlip, NoFault };
class fault_portfolio{
private:
SC_MODULE_FAULTABLE* faultable_module;
int base_id;
public:
fault_portfolio(SC_MODULE_FAULTABLE* faultable_module, int base_id): base_id(base_id){
// register all ports
}
void register_obj(SC_MODULE_FAULTABLE* faultable_module, int base_id){
for(){
}
}
};
///////////////////////////////////// future project /////////////////////////////////////
template <class T, sc_write_policy WRITER_POLICY = SC_ONE_WRITER>
class sc_flt_signal : public sc_core::sc_signal<T, WRITER_POLICY>{
private:
Faults fault;
public:
sc_flt_signal(Faults fault):fault(fault){
}
void activate_fault(Faults fault_type, Faults fault_value) {
if (fault_type == SA){
if (fault_value == '0'){
this->write(SC_LOGIC_0);// THIS IS SIGNAL AND DOES NOT CHANGE VALUE UNLESS SCHEDULE BY KERNEL
}
}
}
};
//////////////////////////////////////////////////////////////////////////
#endif