36 mTimeConstraint.mInitialValue=
"";
37 mTimeConstraint.mStartEvents.
Clear();
38 mTimeConstraint.mStopEvents.Clear();
39 mTimeConstraint.mResetEvents.Clear();
45 FD_DCG(
"AttributeCodeGeneratorEvent(" <<
this <<
"):DoAssign(): assignment from " << &rSrc);
56 (void) rLabel; (void) pContext;
57 FD_DCG(
"AttributeCodeGeneratorEvent::DoWrite()");
58 std::vector<InputTrigger>::const_iterator tit;
59 std::vector<OutputAction>::const_iterator ait;
64 rTw.WriteBegin(
"Input");
65 token.SetEmpty(
"Priority");
68 rTw.WriteBegin(
"Triggers");
70 rTw.WriteString(tit->mAddress);
71 if(tit->mPos && (!tit->mNeg))
72 rTw.WriteOption(
"PosEdge");
73 if((!tit->mPos) && tit->mNeg)
74 rTw.WriteOption(
"NegEdge");
75 if((tit->mPos) && tit->mNeg)
76 rTw.WriteOption(
"AnyEdge");
78 rTw.WriteOption(
"Static");
80 rTw.WriteOption(
"Value");
82 rTw.WriteEnd(
"Triggers");
83 rTw.WriteEnd(
"Input");
87 rTw.WriteBegin(
"Output");
88 token.SetEmpty(
"Priority");
91 rTw.WriteBegin(
"Actions");
93 rTw.WriteString(ait->mAddress);
94 if(ait->mSet) rTw.WriteOption(
"Set");
95 if(ait->mClr) rTw.WriteOption(
"Clr");
96 if(ait->mExe) rTw.WriteOption(
"Exe");
98 rTw.WriteEnd(
"Actions");
99 rTw.WriteEnd(
"Output");
103 rTw.WriteBegin(
"Internal");
104 token.SetEmpty(
"Priority");
105 token.InsAttributeFloat(
"val",
mPriority);
108 token.SetBegin(
"Timer");
114 rTw.WriteEnd(
"Timer");
116 rTw.WriteEnd(
"Internal");
127 (void) rLabel; (void) pContext;
130 FD_DCG(
"AttributeCodeGeneratorEvent::DoRead()");
137 if(token.Type()==Token::Begin)
138 if(token.StringValue()==
"Output") {
143 if(token.Type()==Token::Begin)
144 if(token.StringValue()==
"Input") {
149 if(token.Type()==Token::Begin)
150 if(token.StringValue()==
"Internal") {
155 if(label==
"")
return;
157 while(!rTr.Eos(label)) {
160 if(token.Type()==Token::Begin)
161 if(token.StringValue()==
"Priority") {
162 rTr.ReadBegin(
"Priority");
163 mPriority=(int) token.AttributeFloatValue(
"val");
164 rTr.ReadEnd(
"Priority");
169 if(token.Type()==Token::Begin)
170 if(token.StringValue()==
"Actions") {
171 rTr.ReadBegin(
"Actions");
172 while(!rTr.Eos(
"Actions")) {
181 std::string value=rTr.ReadOption();
184 }
else if(value ==
"Clr") {
186 }
else if(value ==
"Execute") {
196 rTr.ReadEnd(
"Actions");
201 if(token.Type()==Token::Begin)
202 if(token.StringValue()==
"Triggers") {
203 rTr.ReadBegin(
"Triggers");
204 while(!rTr.Eos(
"Triggers")) {
214 std::string value=rTr.ReadOption();
215 if (value ==
"PosEdge") {
217 }
else if (value ==
"NegEdge") {
219 }
else if (value ==
"AnyEdge") {
222 }
else if (value ==
"Value") {
232 if(token.StringValue()==
"Static") {
241 rTr.ReadEnd(
"Triggers");
245 if(
mType==ETInternal)
246 if(token.Type()==Token::Begin)
247 if(token.StringValue()==
"Timer") {
248 rTr.ReadBegin(
"Timer");
252 while(!rTr.Eos(
"Timer")) {
254 if(token.Type()==Token::Begin)
255 if(token.StringValue()==
"StartEvents") {
259 if(token.Type()==Token::Begin)
260 if(token.StringValue()==
"StopEvents") {
264 if(token.Type()==Token::Begin)
265 if(token.StringValue()==
"ResetEvents") {
273 rTr.ReadEnd(
"Timer");
282 std::stringstream errstr;
283 errstr <<
"invalid code generator event property" << rTr.FileLine();
284 throw Exception(
"AttributeCodeGeneratorEvent::Read", errstr.str(), 52);
289 AutoRegisterType<cgEventSet> gRtiRegisterCodeGeneratorAlphabet(
"CodeGeneratorAlphabet");
290 AutoRegisterXElementTag<cgEventSet> gRtiRegisterCodeGeneratorAlphabetElementTagAlphabet(
"CodeGeneratorAlphabet",
"Event");
EventSet mStartEvents
Events that start this timer.
std::string mAddress
Abstract address.
Event attributes for the purpose of code generation.
TimeConstraint mTimeConstraint
Timer definition (indicate timer event iff mInitialValue non-empty)
bool mExe
Literal expression i.e.
EventSet mResetEvents
Events that reset this timer.
std::string mAddress
Abstract address.
bool mNeg
Negative edge triggers event.
std::vector< InputTrigger > mTriggers
List of triggers (input events only)
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
bool mStatic
Fake an initial edge on initialisation to sense static levels.
virtual AttributeCodeGeneratorEvent & DoAssign(const AttributeCodeGeneratorEvent &rSrcAttr)
bool mExe
Evaluate literal expression to trigger event.
virtual void Clear(void)
Clear to default.
bool mPos
Positive edge triggers event.
std::vector< OutputAction > mActions
List of actions to perform (output events only)
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
Event attributes (execution semantics)
EventSet mStopEvents
Events that stop this timer.
Typedef for an individual trigger condition.
Typedef for an individual output action.
std::string mInitialValue
Initial value (literal to allow for advanced units, empty string for "not a timer") ...