18
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
19
************************************************************************
20
20
************************************************************************/
28
28
#include "binop.hh"
29
29
#include <assert.h>
32
35
////////////////////////////////////////////////////////////////////////
35
* Les diff�rents constructeurs de signaux
38
* Les diff�rents constructeurs de signaux
37
40
///////////////////////////////////////////////////////////////////////
41
Tree sigReal(double n);
44
Tree sigReal(float n);
43
46
bool isSigInt(Tree t, int* i);
44
47
bool isSigReal(Tree t, float* r);
47
50
// les entr�es sorties
49
Tree sigOutput(int i, Tree t);
52
Tree sigOutput(int i, Tree t);
51
54
bool isSigInput(Tree t, int* i);
52
55
bool isSigOutput(Tree t, int* i, Tree& t0);
55
Tree sigDelay1(Tree t);
58
Tree sigDelay1(Tree t);
56
59
bool isSigDelay1(Tree t, Tree& t0);
58
Tree sigFixDelay(Tree t0, Tree t1);
59
bool isSigFixDelay(Tree t, Tree& t0, Tree& t1);
61
Tree sigPrefix(Tree t0, Tree t1);
62
bool isSigPrefix(Tree t, Tree& t0, Tree& t1);
64
Tree sigIota(Tree t0);
65
bool isSigIota(Tree t, Tree& t0);
61
Tree sigFixDelay(Tree t0, Tree t1);
62
bool isSigFixDelay(Tree t, Tree& t0, Tree& t1);
64
Tree sigPrefix(Tree t0, Tree t1);
65
bool isSigPrefix(Tree t, Tree& t0, Tree& t1);
67
Tree sigIota(Tree t0);
68
bool isSigIota(Tree t, Tree& t0);
67
70
// Int and Float casting
68
Tree sigIntCast(Tree t);
69
Tree sigFloatCast(Tree t);
71
Tree sigIntCast(Tree t);
72
Tree sigFloatCast(Tree t);
71
74
bool isSigIntCast(Tree t, Tree& x);
72
75
bool isSigFloatCast(Tree t, Tree& x);
76
Tree sigRDTbl (Tree t, Tree i);
79
Tree sigRDTbl (Tree t, Tree i);
77
80
Tree sigWRTbl (Tree id, Tree t, Tree i, Tree s);
78
Tree sigTable (Tree id, Tree n, Tree sig);
81
Tree sigTable (Tree id, Tree n, Tree sig);
79
82
Tree sigGen (Tree content);
81
84
bool isSigRDTbl (Tree s, Tree& t, Tree& i);
113
116
// Foreign Constants
115
Tree sigFConst (Tree type, Tree name, Tree file);
118
Tree sigFConst (Tree type, Tree name, Tree file);
116
119
bool isSigFConst (Tree s);
117
120
bool isSigFConst (Tree s, Tree& type, Tree& name, Tree& file);
119
122
// emulation des anciennes fonctions
120
inline Tree sigAdd(Tree x, Tree y) { return sigBinOp(kAdd, x, y); }
121
inline Tree sigSub(Tree x, Tree y) { return sigBinOp(kSub, x, y); }
122
inline Tree sigMul(Tree x, Tree y) { return sigBinOp(kMul, x, y); }
123
inline Tree sigDiv(Tree x, Tree y) { return sigBinOp(kDiv, x, y); }
124
inline Tree sigRem(Tree x, Tree y) { return sigBinOp(kRem, x, y); }
126
inline Tree sigAND(Tree x, Tree y) { return sigBinOp(kAND, x, y); }
127
inline Tree sigOR(Tree x, Tree y) { return sigBinOp(kOR, x, y); }
128
inline Tree sigXOR(Tree x, Tree y) { return sigBinOp(kXOR, x, y); }
130
inline Tree sigLeftShift(Tree x, Tree y) { return sigBinOp(kLsh, x, y); }
123
inline Tree sigAdd(Tree x, Tree y) { return sigBinOp(kAdd, x, y); }
124
inline Tree sigSub(Tree x, Tree y) { return sigBinOp(kSub, x, y); }
125
inline Tree sigMul(Tree x, Tree y) { return sigBinOp(kMul, x, y); }
126
inline Tree sigDiv(Tree x, Tree y) { return sigBinOp(kDiv, x, y); }
127
inline Tree sigRem(Tree x, Tree y) { return sigBinOp(kRem, x, y); }
129
inline Tree sigAND(Tree x, Tree y) { return sigBinOp(kAND, x, y); }
130
inline Tree sigOR(Tree x, Tree y) { return sigBinOp(kOR, x, y); }
131
inline Tree sigXOR(Tree x, Tree y) { return sigBinOp(kXOR, x, y); }
133
inline Tree sigLeftShift(Tree x, Tree y) { return sigBinOp(kLsh, x, y); }
131
134
inline Tree sigRightShift(Tree x, Tree y) { return sigBinOp(kRsh, x, y); }
133
inline Tree sigGT(Tree x, Tree y) { return sigBinOp(kGT, x, y); }
134
inline Tree sigLT(Tree x, Tree y) { return sigBinOp(kLT, x, y); }
135
inline Tree sigGE(Tree x, Tree y) { return sigBinOp(kGE, x, y); }
136
inline Tree sigLE(Tree x, Tree y) { return sigBinOp(kLE, x, y); }
137
inline Tree sigEQ(Tree x, Tree y) { return sigBinOp(kEQ, x, y); }
138
inline Tree sigNE(Tree x, Tree y) { return sigBinOp(kNE, x, y); }
136
inline Tree sigGT(Tree x, Tree y) { return sigBinOp(kGT, x, y); }
137
inline Tree sigLT(Tree x, Tree y) { return sigBinOp(kLT, x, y); }
138
inline Tree sigGE(Tree x, Tree y) { return sigBinOp(kGE, x, y); }
139
inline Tree sigLE(Tree x, Tree y) { return sigBinOp(kLE, x, y); }
140
inline Tree sigEQ(Tree x, Tree y) { return sigBinOp(kEQ, x, y); }
141
inline Tree sigNE(Tree x, Tree y) { return sigBinOp(kNE, x, y); }
140
143
// pattern matching pour les anciennes fonctions
141
144
bool isSigAdd (Tree a, Tree&x, Tree&y);