30 FD_DCG(
"CodePrimitives(" <<
this <<
")::CodePrimitives()");
35 FD_DCG(
"CodePrimitives(" <<
this <<
")::~CodePrimitives()");
41 FD_DCG(
"CodePrimitives(" <<
this <<
")::Clear()");
72 FD_DCG(
"CodePrimitives::DoReadTargetConfiguration()");
77 if(rTr.ExistsBegin(
"Prefix")) {
78 rTr.ReadBegin(
"Prefix",token);
79 mPrefix=token.AttributeStringValue(
"val");
83 rTr.ReadEnd(
"Prefix");
86 if(rTr.ExistsBegin(
"WordType")) {
87 rTr.ReadBegin(
"WordType",token);
88 mWordType=token.AttributeStringValue(
"val");
89 rTr.ReadEnd(
"WordType");
92 if(rTr.ExistsBegin(
"WordSize")) {
93 rTr.ReadBegin(
"WordSize",token);
94 mWordSize=token.AttributeIntegerValue(
"val");
95 rTr.ReadEnd(
"WordSize");
98 if(rTr.ExistsBegin(
"IntegerType")) {
99 rTr.ReadBegin(
"IntegerType",token);
101 rTr.ReadEnd(
"IntegerType");
104 if(rTr.ExistsBegin(
"IntegerSize")) {
105 rTr.ReadBegin(
"IntegerSize",token);
107 rTr.ReadEnd(
"IntegerSize");
110 if(rTr.ExistsBegin(
"ArrayForTransitions")) {
111 rTr.ReadBegin(
"ArrayForTransitions",token);
113 rTr.ReadEnd(
"ArrayForTransitions");
116 if(rTr.ExistsBegin(
"MaintainStateIndices")) {
117 rTr.ReadBegin(
"MaintainStateIndices",token);
119 rTr.ReadEnd(
"MaintainStateindices");
122 if(rTr.ExistsBegin(
"ArrayForBitmasks")) {
123 rTr.ReadBegin(
"ArrayForBitmasks",token);
125 rTr.ReadEnd(
"ArrayForBitmasks");
128 if(rTr.ExistsBegin(
"ArrayForBitarray")) {
129 rTr.ReadBegin(
"ArrayForBitarray",token);
131 rTr.ReadEnd(
"ArrayForBitarray");
134 if(rTr.ExistsBegin(
"BitAddressArithmetic")) {
135 rTr.ReadBegin(
"BitAddressArithmetic",token);
137 rTr.ReadEnd(
"BitAddressArithmetic");
140 if(rTr.ExistsBegin(
"BisectionForBitfind")) {
141 rTr.ReadBegin(
"BisectionForBitfind",token);
143 rTr.ReadEnd(
"BisectionForBitfind");
146 if(rTr.ExistsBegin(
"ArrayForState")) {
147 rTr.ReadBegin(
"ArrayForState",token);
149 rTr.ReadEnd(
"ArrayForState");
152 if(rTr.ExistsBegin(
"EventsetsForPerformance")) {
153 rTr.ReadBegin(
"EventsetsForPerformance",token);
155 rTr.ReadEnd(
"EventsetsForPerformance");
158 if(rTr.ExistsBegin(
"LoopPendingInputs")) {
159 rTr.ReadBegin(
"LoopPendingInputs",token);
161 rTr.ReadEnd(
"LoopPendingInputs");
164 if(rTr.ExistsBegin(
"LoopEnabledOutputs")) {
165 rTr.ReadBegin(
"LoopEnabledOutputs",token);
167 rTr.ReadEnd(
"LoopEnabledOutputs");
170 if(rTr.ExistsBegin(
"StrictEventSynchronisation")) {
171 rTr.ReadBegin(
"StrictEventSynchronisation",token);
173 rTr.ReadEnd(
"StrictEventSynchronisation");
176 if(rTr.ExistsBegin(
"EventNameLookup")) {
177 rTr.ReadBegin(
"EventNameLookup",token);
179 rTr.ReadEnd(
"EventNameLookup");
182 if(rTr.ExistsBegin(
"StateNameLookup")) {
183 rTr.ReadBegin(
"StateNameLookup",token);
185 rTr.ReadEnd(
"StateNameLookup");
188 if(rTr.ExistsBegin(
"EventExecutionHook")) {
189 rTr.ReadBegin(
"EventExecutionHook",token);
191 rTr.ReadEnd(
"EventExecutionHook");
194 if(rTr.ExistsBegin(
"StateUpdateHook")) {
195 rTr.ReadBegin(
"StateUpdateHook",token);
197 rTr.ReadEnd(
"StateUpdateHook");
200 if(rTr.ExistsBegin(
"IncludeBefore"))
203 if(rTr.ExistsBegin(
"IncludeAfter"))
205 FD_DCG(
"CodePrimitives::DoReadTargetConfiguration(): done");
217 token.SetEmpty(
"Prefix");
218 token.InsAttributeString(
"val",
mPrefix);
221 token.SetEmpty(
"WordType");
222 token.InsAttributeString(
"val",
mWordType);
225 token.SetEmpty(
"WordSize");
226 token.InsAttributeInteger(
"val",
mWordSize);
229 token.SetEmpty(
"IntegerType");
233 token.SetEmpty(
"IntegerSize");
237 token.SetEmpty(
"ArrayForTransitions");
241 token.SetEmpty(
"MaintainStateIndices");
245 token.SetEmpty(
"ArrayForBitmasks");
248 token.SetEmpty(
"ArrayForBitarray");
252 token.SetEmpty(
"BitAddressArithmetic");
256 token.SetEmpty(
"BisectionForBitfind");
260 token.SetEmpty(
"ArrayForState");
264 token.SetEmpty(
"EventsetsForPerformance");
268 token.SetEmpty(
"LoopPendingInputs");
272 token.SetEmpty(
"LoopEnabledOutputs");
276 token.SetEmpty(
"StrictEventSynchronisation");
280 token.SetEmpty(
"EventNameLookup");
284 token.SetEmpty(
"StateNameLookup");
287 token.SetEmpty(
"EventExecutionHook");
291 token.SetEmpty(
"StateUpdateHook");
305 FCG_VERB1(
"CodePrimitives::Compile(): cannot generate lookup tables for the specified platforms");
309 FCG_VERB1(
"CodePrimitives::Compile(): state name lookup implies to maintain state indices as provided");
313 FCG_VERB1(
"CodePrimitives::Compile(): state update hook implies to maintain state indices as provided");
317 for(
size_t git=0; git<
Size(); ++git) {
318 if(
At(git).MaxStateIndex()!=
At(git).States().Size()) {
320 FCG_VERB0(
"CodeGenerator::Generator(): generator [" <<
At(git).
Name() <<
"] " <<
321 "has non-consecutive state indicees --- this will introduce an inefficient sparse lookup table");
324 FCG_VERB0(
"CodeGenerator::Generator(): generator [" <<
At(git).
Name() <<
"] " <<
325 "has non-consecutive state indicees --- applying MinStateIndex()");
334 for(
size_t git=0; git<
Size(); ++git) {
337 for(
size_t vit=0; vit< transvect.size(); ++vit) {
338 int ev = transvect[vit];
340 int x2 = transvect[++vit];
341 transvect[vit]=faudesidx[x2];
346 FD_DCG(
"CodePrimitives(" <<
this <<
")::DoCompile()");
349 FCG_VERB1(
"CodePrimitives::Compile(): cannot generate compiled arrays for the specified target");
353 FCG_VERB1(
"CodePrimitives::Compile(): cannot generate compiled bit-masks for the specified target");
357 FCG_VERB1(
"CodePrimitives::Compile(): compiled bitmasks not recommended for word-size #" <<
mWordSize);
359 FCG_VERB1(
"CodePrimitives::Compile(): reject compiled bitmasks for word-size #" <<
mWordSize);
363 FCG_VERB1(
"CodePrimitives::Compile(): bit address-maths not available for the specified target");
367 FCG_VERB1(
"CodePrimitives::Compile(): reject option eventsets-for-performance for specified target");
376 FCG_VERB1(
"CodePrimitives::Compile(): option loop-enabled-outputs implies loop-enabled-inputs");
380 FCG_ERR(
"CodePrimitives::Compile(): option loop-enabled-outputs requires high priority for output events");
384 FCG_VERB1(
"CodePrimitives::Compile(): cannot generate lookup tables for the specified platform");
388 FCG_VERB1(
"CodePrimitives::Compile(): cannot implement state-update hook for the specified platform");
392 FCG_VERB1(
"CodePrimitives::Compile(): state-update hook implies array representation of overall state");
414 std::string::const_iterator sit=str.begin();
415 for(;sit!=str.end();++sit){
416 if(std::isalpha(*sit)) { res.push_back(*sit);
continue; };
417 if(std::isdigit(*sit) && res.size()>0) { res.push_back(*sit);
continue; }
418 if(res.size()>0) res.push_back(
'_');
462 Comment(
"************************************************");
463 Comment(
"* prepend code snippet from configuration *");
472 Comment(
"status (0x00 <> waiting, 0x01<>executing, 0x02<>err)");
473 WordDeclare(
AA(
"status"));
480 BooleanDeclare(
AA(
"reset"),
false);
486 Comment(
"recent event (0<>none)");
487 IntegerDeclare(
AA(
"recent_event"));
498 for(Idx gid=0; gid<
Size(); gid++)
499 IntegerDeclare(
AA(
"parallel_state").Sub(gid));
507 Comment(
"pending input events incl timer elapse");
508 EventSetDeclare(
AA(
"pending_events"));
510 Comment(
"events enabled by all generators");
511 EventSetDeclare(
AA(
"enabled_events"));
518 Comment(
"executed event (-1<>init, 0<>none)");
519 IntegerDeclare(
AA(
"exec_event"),-1);
522 Comment(
"scheduled event (0<>none)");
523 IntegerDeclare(
AA(
"sched_event"));
530 AA baddr =
AA(
"line_level").Sub(lit->second.mBitAddress);
531 BooleanDeclare(baddr);
538 BooleanDeclare(
AA(
"first_loop"));
549 TimerDeclare(
AA(tit->second.mAddress),tit->second.mInitialValue);
559 EventSetDeclare(
AA(
"aux_locenabled"));
560 IntegerDeclare(
AA(
"aux_parsetrans"));
561 IntegerDeclare(
AA(
"aux_parseevent"));
565 Comment(
"enabled events that can be executed");
566 EventSetDeclare(
AA(
"aux_executables"));
569 Comment(
"aux maths and stack variables ");
570 WordDeclare(
AA(
"aux_wordret"));
572 BooleanDeclare(
AA(
"aux_edge"));
575 IntegerDeclare(
AA(
"aux_wordaddr"));
576 IntegerDeclare(
AA(
"aux_bitaddr"));
579 WordDeclare(
AA(
"aux_bitmask"));
588 for(
size_t git=0; git<
Size(); ++git) {
591 CintarrayDeclare(
AA(
"generator_states").Sub(git),
mStateVector[git]);
614 std::vector<std::string> evlookup;\
616 faudes::EventSet::Iterator eit=
mUsedEvents.Begin();
619 if(((
int) evlookup.size())<tidx+1) evlookup.resize(tidx+1);
622 for(std::size_t i=0; i<evlookup.size(); ++i) {
623 if(evlookup[i]==
"") evlookup[i]=
"e0";
625 Comment(
"event name lookup table");
626 CstrarrayDeclare(
AA(
"event_lookup"),evlookup);
636 for(
size_t gid=0; gid<
Size(); ++gid) {
637 const faudes::Generator& gen=
At(gid);
638 std::vector<std::string> stlookup;\
639 faudes::StateSet::Iterator sit=gen.StatesBegin();
640 for(;sit!=gen.StatesEnd();++sit) {
642 if(((
int) stlookup.size())<tidx+1) stlookup.resize(tidx+1);
643 std::string name = gen.StateName(*sit);
651 for(std::size_t i=0; i<stlookup.size(); ++i)
652 if(stlookup[i]==
"") stlookup[i]=
"s" + ToStringInteger(i);
653 Comment(
"state name lookup for generator [" +
At(gid).
Name() +
"]");
654 CstrarrayDeclare(
AA(
"state_lookup").Sub(gid),stlookup);
658 FCG_VERB0(
"CodePrimitives::Compile(): no symbolic states found, no lookup-tables generated");
666 Comment(
"************************************************");
667 Comment(
"* reset internal state *");
669 Comment(
"set internal reset flag");
672 IntegerAssign(
AA(
"exec_event"),-1);
677 IfTrue(IntegerIsEq(
AA(
"exec_event"),-1));
679 IntegerAssign(
AA(
"status"),0);
681 for(Idx gid=0; gid<
Size(); gid++) {
686 statevar=
AA(
"parallel_state").Sub(gid);
689 Comment(
"clear scheduled event");
690 IntegerAssign(
AA(
"sched_event"),0);
692 IntegerAssign(
AA(
"recent_event"),0);
693 Comment(
"clear pending/enabled events");
694 EventSetClear(
AA(
"pending_events"));
695 EventSetClear(
AA(
"enabled_events"));
700 TimerStop(
AA(tit->second.mAddress));
701 TimerReset(
AA(tit->second.mAddress) ,tit->second.mInitialValue);
711 Comment(
"************************************************");
712 Comment(
"* bail out on external reset *");
729 Comment(
"************************************************");
730 Comment(
"* sense input events *");
733 EventSet::Iterator eit;
738 Comment(
"init: reset all line data and generate statics");
739 IfTrue(IntegerIsEq(
AA(
"exec_event"),-1));
742 AA baddr =
AA(
"line_level").Sub(lit->second.mBitAddress);
743 BooleanAssign(baddr,ReadInputLine(
AA(lit->second.mAddress)));
744 if(lit->second.mPosStatics.Empty() && lit->second.mNegStatics.Empty())
continue;
745 if(!lit->second.mPosStatics.Empty())
747 eit=lit->second.mPosStatics.Begin();
748 for(;eit!=lit->second.mPosStatics.End();++eit) {
750 EventSetInsert(
AA(
"pending_events"),*eit);
752 if(!lit->second.mPosStatics.Empty())
753 if(lit->second.mNegStatics.Empty())
755 if(!lit->second.mPosStatics.Empty())
756 if(!lit->second.mNegStatics.Empty())
758 if(lit->second.mPosStatics.Empty())
759 if(!lit->second.mNegStatics.Empty())
761 eit=lit->second.mNegStatics.Begin();
762 for(;eit!=lit->second.mNegStatics.End();++eit) {
764 EventSetInsert(
AA(
"pending_events"),*eit);
766 if(!lit->second.mNegStatics.Empty())
771 Comment(
"normal operation: read lines and detect edges");
772 IfTrue(IntegerIsNotEq(
AA(
"exec_event"),-1));
775 AA baddr =
AA(
"line_level").Sub(lit->second.mBitAddress);
776 Comment(
"read line [" + lit->second.mAddress +
"]");
777 BooleanAssign(
AA(
"aux_edge"),ReadInputLine(lit->second.mAddress));
778 IfTrue(BooleanIsNotEq(
AA(
"aux_edge"),baddr));
779 if(!lit->second.mPosEvents.Empty()) {
781 eit=lit->second.mPosEvents.Begin();
782 for(;eit!=lit->second.mPosEvents.End();++eit) {
784 EventSetInsert(
AA(
"pending_events"),*eit);
785 IntegerAssign(
AA(
"sched_event"),0);
789 if(!lit->second.mNegEvents.Empty()) {
791 eit=lit->second.mNegEvents.Begin();
792 for(;eit!=lit->second.mNegEvents.End();++eit) {
794 EventSetInsert(
AA(
"pending_events"),*eit);
795 IntegerAssign(
AA(
"sched_event"),0);
810 Comment(
"testing flag [" + fit->second.mAddress +
"]");
811 IfTrue(InputExpression(fit->second.mAddress));
812 eit=fit->second.mEvents.Begin();
813 for(;eit!=fit->second.mEvents.End();++eit) {
815 EventSetInsert(
AA(
"pending_events"),*eit);
816 IntegerAssign(
AA(
"sched_event"),0);
831 Comment(
"************************************************");
832 Comment(
"* sense timer elapse *");
837 IfTrue(TimerIsElapsed(
AA(tit->second.mAddress)));
838 TimerStop(
AA(tit->second.mAddress));
839 EventSetInsert(
AA(
"pending_events"),
EventIndex(tit->second.mElapseEvent));
840 IntegerAssign(
AA(
"sched_event"),0);
850 Comment(
"************************************************");
851 Comment(
"* event execution loop *");
853 Comment(
"clear status to waiting");
854 IntegerAssign(
AA(
"status"),0);
856 BooleanAssign(
AA(
"first_loop"),
true);
865 Comment(
"************************************************");
866 Comment(
"* update enabled events after execution *");
869 Comment(
"if event was executed (and on initialisation)");
870 IfTrue(IntegerIsNotEq(
AA(
"exec_event"),0));
872 EventSetFull(
AA(
"enabled_events"));
875 for(Idx gid=0; gid<
Size(); gid++) {
876 Comment(
"restricting enabled events by [" +
At(gid).
Name() +
"]");
881 statevar=
AA(
"parallel_state").Sub(gid);
882 SwitchBegin(statevar);
884 StateSet::Iterator sit;
885 for(sit=
At(gid).StatesBegin(); sit!=
At(gid).StatesEnd(); sit++) {
886 EventSet disset=
At(gid).Alphabet();
887 disset.EraseSet(
At(gid).ActiveEventSet(*sit));
888 if(disset.Empty())
continue;
889 SwitchCase(statevar,*sit);
890 EventSetErase(
AA(
"enabled_events"),disset);
897 IntegerAssign(
AA(
"exec_event"),0);
898 IntegerAssign(
AA(
"sched_event"),0);
907 FCG_ERR(
"CodePrimitives::UpdateEnabledByInterpreter(): vector representation not available");
908 Comment(
"************************************************");
909 Comment(
"* update enabled events after execution *");
912 Comment(
"if event was executed (and on init)");
913 IfTrue(IntegerIsNotEq(
AA(
"exec_event"),0));
923 statevar=
AA(
"parallel_state").Sub(0);
924 AA gentrans=
AA(
"generator_transitions").Sub(0);
925 AA genstates=
AA(
"generator_states").Sub(0);
926 EventSetAssign(
AA(
"enabled_events"),empty);
928 IntegerAssign(
AA(
"aux_parsetrans"),
TargetExpression(CintarrayAccess(genstates,statevar)));
933 IntegerAssign(
AA(
"aux_parseevent"),
TargetExpression(CintarrayAccess(gentrans,
AA(
"aux_parsetrans"))));
934 LoopBreak(IntegerIsEq(
AA(
"aux_parseevent"),0));
935 EventSetInsert(
AA(
"enabled_events"),
AA(
"aux_parseevent"),
At(0).
Alphabet());
936 IntegerIncrement(
AA(
"aux_parsetrans"),2);
946 for(Idx gid=0; gid<
Size(); gid++) {
952 statevar=
AA(
"parallel_state").Sub(gid);
953 AA gentrans=
AA(
"generator_transitions").Sub(gid);
954 AA genstates=
AA(
"generator_states").Sub(gid);
957 IntegerAssign(
AA(
"aux_parsetrans"),
TargetExpression(CintarrayAccess(genstates,statevar)));
962 IntegerAssign(
AA(
"aux_parseevent"),
TargetExpression(CintarrayAccess(gentrans,
AA(
"aux_parsetrans"))));
963 LoopBreak(IntegerIsEq(
AA(
"aux_parseevent"),0));
964 EventSetInsert(
AA(
"aux_locenabled"),
AA(
"aux_parseevent"),
At(gid).
Alphabet());
965 IntegerIncrement(
AA(
"aux_parsetrans"),2);
967 Comment(
"restrict enabled events");
968 EventSetRestrict(
AA(
"enabled_events"),
AA(
"aux_locenabled"));
973 IntegerAssign(
AA(
"exec_event"),0);
974 IntegerAssign(
AA(
"sched_event"),0);
990 Comment(
"************************************************");
991 Comment(
"* schedule next event to execute *");
993 IfTrue(IntegerIsEq(
AA(
"sched_event"),0));
995 Comment(
"setup candidate set to \"pending or internal\"");
997 Comment(
"restrict candidate set by \"enabled\"");
998 EventSetRestrict(
AA(
"aux_executables"),
AA(
"enabled_events"));
1000 Comment(
"find highest priority event (lowest bitaddress)");
1001 EventSetFindHighestPriority(
AA(
"aux_executables"),
AA(
"sched_event"));
1003 Comment(
"remove scheduled event from pending events");
1004 IfTrue(IntegerIsGreater(
AA(
"sched_event"),0));
1005 EventSetErase(
AA(
"pending_events"),
AA(
"sched_event"));
1009 IfTrue(IntegerIsEq(
AA(
"sched_event"),0));
1010 EventSetIsNotEmpty(
AA(
"pending_events"),
AA(
"aux_wordret"));
1011 IfTrue(WordIsNotEq(
AA(
"aux_wordret"),0));
1012 WordOr(
AA(
"status"),WordConstant(0x02));
1017 Comment(
"cancel pending events if no event could be scheduled ");
1018 IfTrue(IntegerIsEq(
AA(
"sched_event"),0));
1019 EventSetClear(
AA(
"pending_events"));
1031 Comment(
"************************************************");
1032 Comment(
"* break execution loop *");
1034 LoopBreak(IntegerIsEq(
AA(
"sched_event"),0));
1039 LoopBreak(IntegerIsGreater(
AA(
"sched_event"),max));
1042 BooleanAssign(
AA(
"first_loop"),
false);
1049 FCG_ERR(
"CodePrimitives::InsertExecHooks(): no hooks supported by target platform");
1055 Comment(
"************************************************");
1056 Comment(
"* execute scheduled event *");
1058 IfTrue(IntegerIsNotEq(
AA(
"sched_event"),0));
1061 IntegerAssign(
AA(
"sched_event"),0);
1062 WordOr(
AA(
"status"),WordConstant(0x01));
1064 for(Idx gid=0; gid<
Size(); gid++) {
1071 statevar=
AA(
"parallel_state").Sub(gid);
1072 SwitchBegin(statevar);
1073 StateSet::Iterator sit;
1074 for(sit=
At(gid).StatesBegin(); sit!=
At(gid).StatesEnd(); sit++) {
1076 SwitchCase(statevar,*sit);
1078 std::map< int , int > casedata;
1079 std::set< std::set< int > > casesets;
1080 TransSet::Iterator tit;
1081 for(tit=
At(gid).TransRelBegin(*sit); tit!=
At(gid).TransRelEnd(*sit); tit++)
1083 ConsolidateCaseSets<int>(casedata,casesets);
1085 SwitchBegin(
AA(
"exec_event"));
1086 std::set< std::set<int> >::iterator cit=casesets.begin();
1087 for(; cit!=casesets.end(); ++cit) {
1088 SwitchCases(
AA(
"exec_event"),*cit);
1089 IntegerAssign(statevar,casedata[*cit->begin()]);
1109 Comment(
"************************************************");
1110 Comment(
"* execute scheduled event *");
1113 FCG_ERR(
"CodePrimitives::ExecuteByInterpreter(): vector representation not available");
1116 IfTrue(IntegerIsNotEq(
AA(
"sched_event"),0));
1119 IntegerAssign(
AA(
"sched_event"),0);
1120 WordOr(
AA(
"status"),WordConstant(0x01));
1122 for(Idx gid=0; gid<
Size(); gid++) {
1129 statevar=
AA(
"parallel_state").Sub(gid);
1130 AA gentrans=
AA(
"generator_transitions").Sub(gid);
1131 AA genstates=
AA(
"generator_states").Sub(gid);
1133 IntegerAssign(
AA(
"aux_parsetrans"),
TargetExpression(CintarrayAccess(genstates,statevar)));
1138 IntegerAssign(
AA(
"aux_parseevent"),
TargetExpression(CintarrayAccess(gentrans,
AA(
"aux_parsetrans"))));
1140 LoopBreak(IntegerIsEq(
AA(
"aux_parseevent"),0));
1141 IntegerIncrement(
AA(
"aux_parsetrans"),2);
1143 IfTrue(IntegerIsGreater(
AA(
"aux_parseevent"),0));
1144 IntegerIncrement(
AA(
"aux_parsetrans"));
1145 IntegerAssign(statevar,
TargetExpression(CintarrayAccess(gentrans,
AA(
"aux_parsetrans"))));
1170 Comment(
"************************************************");
1171 Comment(
"* operate timers *");
1174 std::map< int , TimerAction> casedata;
1175 std::set< std::set< int > > casesets;
1182 casedata[tev]= eit->second;
1184 ConsolidateCaseSets<TimerAction>(casedata,casesets);
1186 IfTrue(IntegerIsGreater(
AA(
"exec_event"),0));
1188 SwitchBegin(
AA(
"exec_event"));
1190 std::set< std::set< int > >::iterator cit;
1191 for(cit=casesets.begin(); cit!=casesets.end(); ++cit) {
1192 SwitchCases(
AA(
"exec_event"),*cit);
1194 std::set< std::string >::iterator ait;
1197 TimerStop(
AA(*ait));
1203 FCG_ERR(
"CodePrimitives: internal error on timer records -- sorry");
1205 TimerReset(
AA(*ait),tit->second.mInitialValue);
1209 TimerStart(
AA(*ait));
1221 Comment(
"************************************************");
1222 Comment(
"* operate outputs *");
1228 SwitchBegin(
AA(
"exec_event"));
1230 const std::vector<AttributeCodeGeneratorEvent::OutputAction>& actions =
mAlphabet.Attribute(*eit).mActions;
1231 if(actions.size()==0)
continue;
1234 for(
size_t i=0; i<actions.size(); i++) {
1235 if(actions[i].mSet) RunActionSet(actions[i].mAddress);
1236 if(actions[i].mClr) RunActionClr(actions[i].mAddress);
1237 if(actions[i].mExe) RunActionExe(
AX(actions[i].mAddress));
1252 Comment(
"************************************************");
1253 Comment(
"* end execution loop *");
1264 Comment(
"************************************************");
1265 Comment(
"* append code snippet from configuration *");
1274 FD_DCG(
"CodePrimitives(" <<
this <<
")::DoGenerateDeclarations()");
1275 Comment(
"************************************************");
1276 Comment(
"* declaration of variables and constants *");
1294 FD_DCG(
"CodePrimitives(" <<
this <<
")::DoGenerateResetCode()");
1295 Comment(
"************************************************");
1296 Comment(
"* executor core cyclic code: reset/initialise *");
1297 Comment(
"************************************************");
1306 FD_DCG(
"CodePrimitives(" <<
this <<
")::DoGenerateCyclicCode()");
1307 Comment(
"************************************************");
1308 Comment(
"* executor core cyclic code: begin *");
1309 Comment(
"************************************************");
1322 Comment(
"************************************************");
1323 Comment(
"* executor core cyclic code: end *");
1324 Comment(
"************************************************");
1363 FCG_ERR(
"CodePrimitives::VariableDeclare(): not implemented");
1371 FCG_ERR(
"CodePrimitives::VariableDeclare(): not implemented");
1375 void CodePrimitives::IntegerDecrement(
const AA& address,
int val) {
1376 IntegerIncrement(address,-val);
1383 FCG_ERR(
"CodePrimitives::Integer(): maths not available");
1389 FCG_ERR(
"CodePrimitives::Integer(): maths not available");
1394 FCG_ERR(
"CodePrimitives::Integer(): maths not available");
1397 bool CodePrimitives::HasIntmaths(
void) {
1403 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1406 CodePrimitives::AX CodePrimitives::IntegerIsEq(
const AA& address,
const AX& expression) {
1409 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1415 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1418 CodePrimitives::AX CodePrimitives::IntegerIsNotEq(
const AA& address,
const AX& expression) {
1421 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1427 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1433 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1439 void CodePrimitives::WordDeclare(
const AA& address) {
1441 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1443 void CodePrimitives::WordDeclare(
const AA& address, word_t val) {
1446 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1448 void CodePrimitives::WordAssign(
const AA& address, word_t val) {
1451 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1453 void CodePrimitives::WordAssign(
const AA& address,
const AX& expression) {
1456 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1458 void CodePrimitives::WordOr(
const AA& address, word_t val) {
1461 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1463 void CodePrimitives::WordOr(
const AA& address,
const AX& expression) {
1466 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1468 void CodePrimitives::WordOr(
const AA& address,
const AA& op1,
const AA& op2) {
1472 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1474 void CodePrimitives::WordOr(
const AA& address,
const AA& op1, word_t op2) {
1478 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1480 void CodePrimitives::WordAnd(
const AA& address, word_t val) {
1483 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1485 void CodePrimitives::WordAnd(
const AA& address,
const AX& expression) {
1488 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1490 void CodePrimitives::WordAnd(
const AA& address,
const AA& op1,
const AA& op2) {
1494 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1496 void CodePrimitives::WordAnd(
const AA& address,
const AA& op1, word_t op2) {
1500 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1502 void CodePrimitives::WordNand(
const AA& address,
const AX& expression) {
1505 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1510 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1516 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1522 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1528 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1534 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
1539 FCG_ERR(
"CodePrimitives::Word(): word-of-bits type not available");
1545 void CodePrimitives::BooleanDeclare(
const AA& address) {
1546 IntegerDeclare(address);
1548 void CodePrimitives::BooleanDeclare(
const AA& address,
int val) {
1549 IntegerDeclare(address,val ? 1 : 0);
1551 void CodePrimitives::BooleanAssign(
const AA& address,
const AX& expression) {
1552 IntegerAssign(address,expression);
1554 void CodePrimitives::BooleanAssign(
const AA& address,
int val) {
1555 IntegerAssign(address, val ? 1 : 0);
1569 void CodePrimitives::CintarrayDeclare(
const AA& address,
const std::vector<int>& val) {
1572 FCG_ERR(
"CodePrimitives::Cintarray(): constant-int-arrays not defined");
1577 FCG_ERR(
"CodePrimitives::Cintarray(): constant-int-arrays not defined");
1580 CodePrimitives::AA CodePrimitives::CintarrayAccess(
const AA& address,
const AA& indexaddr){
1583 FCG_ERR(
"CodePrimitives::Cintarray(): constant-int-arrays not defined");
1586 bool CodePrimitives::HasCintarray(
void) {
1591 void CodePrimitives::CwordarrayDeclare(
const AA& address,
const std::vector<word_t>& val) {
1594 FCG_ERR(
"CodePrimitives::Cwordarray(): constant-word-arrays not defined");
1599 FCG_ERR(
"CodePrimitives::Cwordarray(): constant-word-arrays not defined");
1602 CodePrimitives::AA CodePrimitives::CwordarrayAccess(
const AA& address,
const AA& indexaddr){
1605 FCG_ERR(
"CodePrimitives::Cwordarray(): constant-word-arrays not defined");
1608 bool CodePrimitives::HasCwordarray(
void) {
1614 void CodePrimitives::WordarrayDeclare(
const AA& address,
int len) {
1617 FCG_ERR(
"CodePrimitives::Wordarray(): word-arrays not available");
1619 void CodePrimitives::WordarrayDeclare(
const AA& address,
const std::vector<word_t>& val) {
1622 FCG_ERR(
"CodePrimitives::Wordarray(): word-arrays not available");
1627 FCG_ERR(
"CodePrimitives::Wordarray(): word-arrays not available");
1630 CodePrimitives::AA CodePrimitives::WordarrayAccess(
const AA& address,
const AA& indexaddr){
1633 FCG_ERR(
"CodePrimitives::Wordarray(): word-arrays not available");
1636 bool CodePrimitives::HasWordarray(
void) {
1645 FCG_ERR(
"CodePrimitives::Intarray(): int-arrays not available");
1650 FCG_ERR(
"CodePrimitives::Intarray(): int-arrays not available");
1655 FCG_ERR(
"CodePrimitives::Intarray(): int-arrays not available");
1661 FCG_ERR(
"CodePrimitives::Intarray(): int-arrays not available");
1671 FCG_ERR(
"CodePrimitives::Cstrarray(): constant-str-arrays not defined");
1674 void CodePrimitives::CstrarrayDeclare(
const AA& address,
const std::vector<std::string>& val) {
1677 FCG_ERR(
"CodePrimitives::Cstrarray(): constant-str-arrays not defined");
1682 FCG_ERR(
"CodePrimitives::Cstrarray(): constant-str-arrays not defined");
1685 CodePrimitives::AA CodePrimitives::CstrarrayAccess(
const AA& address,
const AA& indexaddr){
1688 FCG_ERR(
"CodePrimitives::Cstrarray(): constant-str-arrays not defined");
1691 bool CodePrimitives::HasCstrarray(
void) {
1697 void CodePrimitives::BitarrayDeclare(
const AA& address,
int blen) {
1702 WordarrayDeclare(address, wlen);
1706 for(
int i=0; i<wlen; i++) {
1707 AA baddr= address.Sub(i);
1712 bitarray_rec newbitarray;
1713 newbitarray.blen= blen;
1718 void CodePrimitives::BitarrayDeclare(
const AA& address,
const std::vector<bool>& val) {
1720 int blen = (int) val.size();
1728 for(
int i=0; i<wlen; i++) {
1729 AA baddr = address.Sub(i);
1734 bitarray_rec newbitarray;
1735 newbitarray.blen= blen;
1736 newbitarray.value= val;
1741 void CodePrimitives::BitarrayAssign(
const AA& address,
const std::vector<bool>& val) {
1746 for(
int i=0; i<wlen; ++i) {
1749 else waddr = address.Sub(i);
1751 WordAssign(waddr,wval);
1756 void CodePrimitives::BitarrayAssign(
const AA& address,
const AA& otherarray) {
1762 FCG_ERR(
"CodePrimitives(): BitarrayAssign(): internal error");
1765 for(
int i=0; i<wlen; ++i) {
1768 else waddr = address.Sub(i);
1771 else oaddr = address.Sub(i);
1777 void CodePrimitives::BitarrayClear(
const AA& address){
1782 for(
int i=0; i<wlen; i++) {
1785 else waddr = address.Sub(i);
1786 WordAssign(waddr, 0x0UL);
1791 void CodePrimitives::BitarrayFull(
const AA& address){
1795 int bllen = blen - (wlen-1) *
mWordSize;
1797 for(
int i=0; i<wlen; i++) {
1800 else waddr = address.Sub(i);
1802 if(i==wlen-1) val= (1ULL<<bllen)-1;
1803 WordAssign(waddr, val);
1808 void CodePrimitives::BitarrayOrAllWords(
const AA& address,
const AA& result) {
1812 int bllen = blen - (wlen-1) *
mWordSize;
1817 else waddr = address.Sub(0);
1822 for(
int i=0; i<wlen; i++) {
1825 else waddr = address.Sub(i);
1826 if(i==wlen-1) WordAnd(waddr,WordConstant((1ULL<<bllen)-1));
1833 void CodePrimitives::BitarraySetBit(
const AA& address,
int index){
1840 else waddr = address.Sub(windex);
1841 WordOr(waddr,WordConstant( 1UL << bindex));
1845 void CodePrimitives::BitarraySetBit(
const AA& address,
const AA& indexaddr,
int offset,
const std::vector<bool>& hint){
1849 bool gotaddress=
false;
1853 IntegerDecrement(AA(
"aux_bitaddr"));
1854 IntegerAssign(AA(
"aux_wordaddr"),
TargetExpression(CintarrayAccess(AA(
"wordaddr_vector"),AA(
"aux_bitaddr"))));
1855 IntegerAssign(AA(
"aux_bitmask"),
TargetExpression(CwordarrayAccess(AA(
"bitmask_vector"),AA(
"aux_bitaddr"))));
1861 IntegerDecrement(AA(
"aux_bitaddr"),offset);
1864 IntegerAssign(AA(
"aux_bitmask"),IntegerBitmask(
TargetExpression(AA(
"aux_bitaddr"))));
1870 IntegerDecrement(AA(
"aux_bitaddr"),offset);
1871 IntegerAssign(AA(
"aux_bitmask"),
TargetExpression(CwordarrayAccess(AA(
"bitmask_vector"),AA(
"aux_bitaddr"))));
1877 IntegerDecrement(AA(
"aux_bitaddr"),offset);
1880 IntegerAssign(AA(
"aux_bitmask"),IntegerBitmask(
TargetExpression(AA(
"aux_bitaddr"))));
1885 WordOr(WordarrayAccess(address, AA(
"aux_wordaddr")),
TargetExpression(AA(
"aux_bitmask")));
1889 if(gotaddress && (wlen > 1)) {
1890 SwitchBegin(AA(
"aux_wordaddr"));
1891 for(
int i=0; i<wlen; i++) {
1894 SwitchCase(AA(
"aux_wordadd"),i);
1895 AA waddr = address.Sub(i);
1903 if(gotaddress && (wlen == 1)) {
1904 AA waddr = address.Sub(0);
1909 SwitchBegin(indexaddr);
1911 for(baddr=0;baddr<blen;baddr++) {
1915 SwitchCase(indexaddr,baddr+offset);
1916 BitarraySetBit(address,baddr);
1923 void CodePrimitives::BitarrayIsBitSet(
const AA& address,
const AA& indexaddr,
const AA& result,
int offset,
const std::vector<bool>& hint){
1927 bool gotaddress=
false;
1931 IntegerDecrement(AA(
"aux_bitaddr"),offset);
1932 IntegerAssign(AA(
"aux_wordaddr"),
TargetExpression(CintarrayAccess(AA(
"wordaddr_vector"),AA(
"aux_bitaddr"))));
1933 IntegerAssign(AA(
"aux_bitmask"),
TargetExpression(CwordarrayAccess(AA(
"bitmask_vector"),AA(
"aux_bitaddr"))));
1939 IntegerDecrement(AA(
"aux_bitaddr"),offset);
1942 IntegerAssign(AA(
"aux_bitmask"),IntegerBitmask(
TargetExpression(AA(
"aux_bitaddr"))));
1948 IntegerDecrement(AA(
"aux_bitaddr"),offset);
1949 IntegerAssign(AA(
"aux_bitmask"),
TargetExpression(CwordarrayAccess(AA(
"bitmask_vector"),AA(
"aux_bitaddr"))));
1955 IntegerDecrement(AA(
"aux_bitaddr"),offset);
1958 IntegerAssign(AA(
"aux_bitmask"),IntegerBitmask(
TargetExpression(AA(
"aux_bitaddr"))));
1963 WordAnd(result,WordarrayAccess(address, AA(
"aux_wordaddr")),AA(
"aux_bitmask"));
1966 if(gotaddress && (wlen > 1)) {
1967 SwitchBegin(AA(
"aux_wordaddr"));
1968 for(
int i=0; i<wlen; i++) {
1971 SwitchCase(AA(
"aux_wordadd"),i);
1972 AA waddr = address.Sub(i);
1973 WordAnd(result,waddr,AA(
"aux_bitmask"));
1980 if(gotaddress && (wlen == 1)) {
1981 AA waddr = address.Sub(0);
1982 WordAnd(result,waddr,AA(
"aux_bitmask"));
1986 FCG_ERR(
"CodePrimitives::Bitarray(): BitAddressArithmetic or ArrayForBitmasks required for test by variable");
1990 void CodePrimitives::BitarrayClrBit(
const AA& address,
int index){
1997 else waddr = address.Sub(windex);
1998 WordNand(waddr,WordConstant( 1UL << bindex));
2002 void CodePrimitives::BitarrayClrBit(
const AA& address,
const AA& indexaddr,
int offset,
const std::vector<bool>& hint){
2006 bool gotaddress=
false;
2010 IntegerDecrement(AA(
"aux_bitaddr"),offset);
2011 IntegerAssign(AA(
"aux_wordaddr"),
TargetExpression(CintarrayAccess(AA(
"wordaddr_vector"),AA(
"aux_bitaddr"))));
2012 IntegerAssign(AA(
"aux_bitmask"),
TargetExpression(CwordarrayAccess(AA(
"bitmask_vector"),AA(
"aux_bitaddr"))));
2018 IntegerDecrement(AA(
"aux_bitaddr"),offset);
2021 IntegerAssign(AA(
"aux_bitmask"),IntegerBitmask(
TargetExpression(AA(
"aux_bitaddr"))));
2027 IntegerDecrement(AA(
"aux_bitaddr"),offset);
2028 IntegerAssign(AA(
"aux_bitmask"),
TargetExpression(CwordarrayAccess(AA(
"bitmask_vector"),AA(
"aux_bitaddr"))));
2034 IntegerDecrement(AA(
"aux_bitaddr"),offset);
2037 IntegerAssign(AA(
"aux_bitmask"),IntegerBitmask(
TargetExpression(AA(
"aux_bitaddr"))));
2042 WordNand(WordarrayAccess(address, AA(
"aux_wordaddr")),
TargetExpression(AA(
"aux_bitmask")));
2046 if(gotaddress && (wlen > 1)) {
2047 SwitchBegin(AA(
"aux_wordaddr"));
2048 for(
int i=0; i<wlen; i++) {
2051 SwitchCase(AA(
"aux_wordadd"),i);
2052 AA waddr = address.Sub(i);
2060 if(gotaddress && (wlen == 1)) {
2061 AA waddr = address.Sub(0);
2066 SwitchBegin(indexaddr);
2068 for(baddr=0;baddr<blen;baddr++) {
2072 SwitchCase(indexaddr,baddr+offset);
2073 BitarrayClrBit(address,baddr);
2080 void CodePrimitives::BitarrayOr(
const AA& address,
const std::vector<bool>& val) {
2085 for(
int w=0; w<wlen; ++w) {
2087 if(wval==0)
continue;
2090 else waddr = address.Sub(w);
2097 void CodePrimitives::BitarrayOr(
const AA& address,
const AA &op1,
const std::vector<bool>& op2) {
2102 for(
int w=0; w<wlen; ++w) {
2107 else waddr = address.Sub(w);
2109 else wop1 = op1.Sub(w);
2111 WordOr(waddr,wop1,wval);
2118 void CodePrimitives::BitarrayAnd(
const AA& address,
const std::vector<bool>& val) {
2123 for(
int w=0; w<wlen; ++w) {
2125 if(wval== (1UL <<
mWordSize) - 1)
continue;
2128 else waddr = address.Sub(w);
2129 WordAnd(waddr,wval);
2134 void CodePrimitives::BitarrayAnd(
const AA& address,
const AA& otherarray) {
2139 for(
int w=0; w<wlen; ++w) {
2142 else waddr = address.Sub(w);
2145 else oaddr = otherarray.Sub(w);
2151 void CodePrimitives::BitarrayAnd(
const AA& address,
const AA &op1,
const std::vector<bool>& op2) {
2156 for(
int w=0; w<wlen; ++w) {
2161 else waddr = address.Sub(w);
2163 else wop1 = op1.Sub(w);
2165 WordAnd(waddr,wop1,wval);
2172 void CodePrimitives::BitarrayAnd(
const AA& address,
const AA& op1,
const AA& op2) {
2177 for(
int w=0; w<wlen; ++w) {
2180 else waddr = address.Sub(w);
2183 else op1addr = op1.Sub(w);
2186 else op2addr = op2.Sub(w);
2187 WordAnd(waddr,op1addr,op2addr);
2192 void CodePrimitives::BitarrayFindFirst(
const AA& address,
const AA& result,
int offset) {
2194 IntegerAssign(result,offset-1);
2201 else waddr = address.Sub(w);
2205 IfTrue(IntegerIsEq(result,offset-1));
2209 IfTrue(WordIsNotEq(waddr,0));
2213 IntegerAssign(result,w*
mWordSize+offset);
2214 for(;ifcnt>0;--ifcnt) IfEnd();
2220 int index=w*mWordSize + b;
2221 if(index>=blen)
break;
2223 IfTrue(WordIsBitSet(waddr,b));
2226 IfElseIfTrue(WordIsBitSet(waddr,b));
2228 IntegerAssign(result,index+offset);
2235 if(bleft>wsize) bleft=wsize;
2236 while(wsize/2>=bleft) wsize=wsize/2;
2240 while(size<=wsize) {
2242 if(!(pos<bleft))
break;
2246 while(pos+size/2>=bleft) size=size/2;
2251 if(hl && (size>2)) {
2252 word_t ltest= (1UL << size/2) -1;
2254 IfTrue(WordIsMaskSet(waddr,ltest));
2260 if(hl && (size==2)) {
2261 IfTrue(WordIsMaskSet(waddr,(1UL << pos)));
2262 IntegerAssign(result, w*mWordSize + pos + offset);
2264 IntegerAssign(result,w*mWordSize + pos + 1 + offset);
2271 if(hl && (size==1)) {
2272 IntegerAssign(result, w*mWordSize + pos + offset);
2278 if((!hl) && ((pos % size) == 0)) {
2282 if(pos<bleft) IfElse();
2286 if((!hl) && ((pos % size) != 0)) {
2295 for(;ifcnt>0;--ifcnt)
2302 void CodePrimitives::EventSetDeclare(
const AA& address) {
2307 void CodePrimitives::EventSetDeclare(
const AA& address,
const EventSet& evset) {
2309 BitarrayDeclare(address,evmask);
2313 void CodePrimitives::EventSetClear(
const AA& address) {
2314 BitarrayClear(address);
2318 void CodePrimitives::EventSetFull(
const AA& address) {
2319 BitarrayFull(address);
2323 void CodePrimitives::EventSetIsNotEmpty(
const AA& address,
const AA& result) {
2324 BitarrayOrAllWords(address,result);
2328 void CodePrimitives::EventSetAssign(
const AA& address,
const EventSet& evset) {
2330 BitarrayAssign(address,evmask);
2334 void CodePrimitives::EventSetInsert(
const AA& address,
const EventSet& evset) {
2336 BitarrayOr(address,evmask);
2340 void CodePrimitives::EventSetInsert(
const AA& address,
const AA& evaddrexpr) {
2341 BitarraySetBit(address,evaddrexpr,1);
2345 void CodePrimitives::EventSetInsert(
const AA& address,
const AA& evaddrexpr,
const EventSet& hint) {
2347 BitarraySetBit(address,evaddrexpr,1,evmask);
2351 void CodePrimitives::EventSetInsert(
const AA& address, Idx ev) {
2356 void CodePrimitives::EventSetErase(
const AA& address,
const EventSet& evset) {
2358 for(
size_t i=0; i<evmask.size(); i++) evmask[i]= ! evmask[i];
2359 BitarrayAnd(address,evmask);
2363 void CodePrimitives::EventSetErase(
const AA& address, Idx ev) {
2368 void CodePrimitives::EventSetErase(
const AA& address,
const AA& evaddr) {
2369 BitarrayClrBit(address,evaddr,1);
2373 void CodePrimitives::EventSetExists(
const AA& address,
const AA& evaddr,
const AA& result,
const EventSet& hint) {
2375 BitarrayIsBitSet(address,evaddr,result,1,evmask);
2379 void CodePrimitives::EventSetErase(
const AA& address,
const AA& evaddr,
const EventSet& hint) {
2381 BitarrayClrBit(address,evaddr,1,evmask);
2385 void CodePrimitives::EventSetRestrict(
const AA& address,
const AA& otherset) {
2386 BitarrayAnd(address,otherset);
2390 void CodePrimitives::EventSetUnion(
const AA& address,
const AA& op1,
const EventSet& op2) {
2392 BitarrayOr(address,op1,evmask);
2396 void CodePrimitives::EventSetIntersection(
const AA& address,
const AA& op1,
const EventSet& op2) {
2398 BitarrayAnd(address,op1,evmask);
2402 void CodePrimitives::EventSetFindHighestPriority(
const AA& address,
const AA& result) {
2403 BitarrayFindFirst(address,result,1);
2409 void CodePrimitives::IfTrue(
const AX& expression) {
2411 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
2414 void CodePrimitives::IfFalse(
const AX& expression) {
2416 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
2419 void CodePrimitives::IfWord(
const AX& expression) {
2421 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
2423 void CodePrimitives::IfElse(
void) {
2424 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
2427 void CodePrimitives::IfElseIfTrue(
const AX& expression) {
2429 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
2431 void CodePrimitives::IfEnd(
void) {
2432 FCG_ERR(
"CodePrimitives::Conditionals(): construct not available");
2434 void CodePrimitives::LoopBegin(
void) {
2435 FCG_ERR(
"CodePrimitives::Loops(): construct not available");
2437 void CodePrimitives::LoopBreak(
const AX& expression) {
2439 FCG_ERR(
"CodePrimitives::Loops(): construct not available");
2441 void CodePrimitives::LoopEnd(
void) {
2442 FCG_ERR(
"CodePrimitives::Loops(): construct not available");
2444 void CodePrimitives::FunctionReturn(
void) {
2445 FCG_ERR(
"CodePrimitives::FunctionReturn(): construct not available");
2449 void CodePrimitives::SwitchBegin(
const AA& address){
2451 FCG_ERR(
"CodePrimitives::Conditionals(): switch not available");
2453 void CodePrimitives::SwitchCase(
const AA& address,
int val){
2456 FCG_ERR(
"CodePrimitives::Conditionals(): switch not available");
2458 void CodePrimitives::SwitchCases(
const AA& address,
int from,
int to){
2462 FCG_ERR(
"CodePrimitives::Conditionals(): switch not available");
2464 void CodePrimitives::SwitchCases(
const AA& address,
const std::set< int > & vals){
2467 FCG_ERR(
"CodePrimitives::Conditionals(): switch not available");
2469 void CodePrimitives::SwitchBreak(
void){
2470 FCG_ERR(
"CodePrimitives::Conditionals(): switch not available");
2472 void CodePrimitives::SwitchEnd(
void){
2473 FCG_ERR(
"CodePrimitives::Conditionals(): switch not available");
2475 bool CodePrimitives::HasMultiCase(
void){
2481 void CodePrimitives::RunActionSet(
const std::string& address) {
2483 FCG_ERR(
"CodePrimitives::RunAction(): action not available");
2485 void CodePrimitives::RunActionClr(
const std::string& address) {
2487 FCG_ERR(
"CodePrimitives::RunAction(): action not available");
2489 void CodePrimitives::RunActionExe(
const AX& expression) {
2491 FCG_ERR(
"CodePrimitives::RunAction(): action not available");
2500 return AX(expression);
2505 void CodePrimitives::TimerDeclare(
const AA& address,
const std::string &litval) {
2508 FCG_ERR(
"CodePrimitives::Timer(): not available");
2510 void CodePrimitives::TimerStart(
const AA& address) {
2512 FCG_ERR(
"CodePrimitives::Timer(): not available");
2514 void CodePrimitives::TimerStop(
const AA& address) {
2516 FCG_ERR(
"CodePrimitives::Timer(): not available");
2518 void CodePrimitives::TimerReset(
const AA& address,
const std::string &litval) {
2521 FCG_ERR(
"CodePrimitives::Timer(): not available");
2525 FCG_ERR(
"CodePrimitives::Timer(): not available");