-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrapLogic.h
88 lines (68 loc) · 1.8 KB
/
TrapLogic.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*******************************************************************
*
* DESCRIPTION: Atomic Model TrapLogic
*
* AUTHOR: Daniel Altman & Ezequiel Glinsky
*
* EMAIL: mailto://daltman@cwanet.com
* mailto://eglinsky@dc.uba.ar
*
* DATE: 10/10/1998
*
* FUNCIONALIDAD: indica qué interrupción debe atenderse según
* su prioridad
*
*
* MODIFICADO POR: Pablo L. Cremona
* Pablo S. Sor
*
* DATE: 28/01/1999
*
*
*******************************************************************/
#ifndef __TrapLogic_H
#define __TrapLogic_H
#include <atomic.h> // class Atomic
#include "bits.h"
class TrapLogic : public Atomic
{
public:
TrapLogic( const string &name = "TrapLogic" ); //Default constructor
~TrapLogic();
virtual string className() const ;
protected:
Model &initFunction();
Model &externalFunction( const ExternalMessage & );
Model &internalFunction( const InternalMessage & );
Model &outputFunction( const InternalMessage & );
private:
//Auxiliary functions
int getTrapIndexFromTrapName(const string &sTrapName) const;
int getTrapTypeFromTrapIndex(const int iIndex) const;
int getHighestPriorityTrapIndex();
int getNumberFromString( const string& sSource, const unsigned int iStartPos ) const;
Port &INST_ACC_EXCEP;
Port &ILLEG_INST;
Port &PRIV_INST;
Port &WIN_OVER;
Port &WIN_UNDER;
Port &ADDR_NOT_ALIGN;
Port &DATA_ACC_EXCEP;
Port &INST_ACC_ERR;
Port &DATA_ACC_ERR;
Port &DIV_ZERO;
Port &DATA_ST_ERR;
Port &TRAP_INST;
Port **TN, &TF, **TT;
bit tn[7], trap[12];
o_bit tf, tt[8];
//Output ports
Time preparationTime; //Stabilization time
}; // class TrapLogic
// ** inline ** //
inline
string TrapLogic::className() const
{
return "TrapLogic" ;
}
#endif //__TrapLogic_H