59 unique_ptr<coral::IQuery> query0(
m_session.nominalSchema().newQuery());
60 query0->addToTableList(
"SUPER_MASTER_TABLE",
"SM");
61 query0->addToTableList(
"TOPO_MASTER_TABLE",
"TMT");
62 query0->addToTableList(
"TOPO_TRIGGER_MENU",
"TTM");
63 query0->addToTableList(
"TTM_TO_TA",
"TTM2TA");
64 query0->addToTableList(
"TOPO_ALGO",
"TA");
65 query0->setRowCacheSize(1000);
68 coral::AttributeList bindList0;
69 bindList0.extend<
unsigned int>(
"tmtId");
70 std::string cond =
"TMT_ID = :tmtId";
71 bindList0[0].data<
unsigned int>() = tcaTarget.
getSMK();
73 string theCondition0 =
"";
74 theCondition0 += string(
" SM.SMT_ID = :tmtId");
75 theCondition0 += string(
" AND TMT.TMT_ID = SM.SMT_TOPO_MASTER_TABLE_ID ");
76 theCondition0 += string(
" AND TTM.TTM_ID = TMT.TMT_TRIGGER_MENU_ID ");
77 theCondition0 += string(
" AND TTM2TA.TTM2TA_MENU_ID = TTM.TTM_ID ");
78 theCondition0 += string(
" AND TA.TA_ID = TTM2TA.TTM2TA_ALGO_ID ");
79 query0->setCondition( theCondition0, bindList0 );
81 coral::AttributeList attList0;
86 attList0.extend<
string>(
"TTM.TTM_NAME" );
88 attList0.extend<
int>(
"TTM.TTM_CTPLINK_ID" );
89 attList0.extend<
int>(
"TA.TA_ID" );
90 attList0.extend<
string>(
"TA.TA_NAME" );
91 attList0.extend<
string>(
"TA.TA_OUTPUT" );
92 attList0.extend<
string>(
"TA.TA_TYPE" );
93 attList0.extend<
int>(
"TA.TA_BITS" );
94 attList0.extend<
string>(
"TA.TA_SORT_DECI" );
95 attList0.extend<
int>(
"TA.TA_ALGO_ID" );
96 query0->defineOutput(attList0);
99 coral::ICursor& cursor0 = query0->execute();
103 std::map<uint, TXC::L1TopoConfigAlg> idToAlgMap;
105 while(cursor0.next()){
106 const coral::AttributeList& row0 = cursor0.currentRow();
107 int ta_id = row0[
"TA.TA_ID"].data<
int>();
108 string ta_name = row0[
"TA.TA_NAME"].data<
string>();
109 string ta_output = row0[
"TA.TA_OUTPUT"].data<
string>();
110 string ta_type = row0[
"TA.TA_TYPE"].data<
string>();
112 string ta_sort_deci = row0[
"TA.TA_SORT_DECI"].data<
string>();
113 int ta_algo_id = row0[
"TA.TA_ALGO_ID"].data<
int>();
114 ctplinkid = row0[
"TTM.TTM_CTPLINK_ID"].data<
int>();
123 alg.setAlgOutput(ta_output);
124 alg.setAlgoID(ta_algo_id);
129 idToAlgMap.emplace(ta_id,std::move(alg));
138 for(
auto & e : idToAlgMap ) {
144 }
catch(
const std::exception& e ) {
145 TRG_MSG_ERROR(
"loadTopoAlgos >> Standard C++ exception: " << e.what());
158 for(
auto & e : idToAlgMap ) {
159 algIds.insert(e.first);
162 string algIdsConc =
"(";
164 for(
int id : algIds ) {
165 if(first) { first =
false; }
else { algIdsConc +=
","; }
176 unique_ptr<coral::IQuery> query0(
m_session.nominalSchema().newQuery());
177 query0->addToTableList(
"TA_TO_TI",
"TA2TI");
178 query0->addToTableList(
"TOPO_ALGO_INPUT",
"TAI");
179 coral::AttributeList bindList0;
181 string theCondition0 =
"";
182 theCondition0 +=
" TA2TI.TA2TI_ALGO_ID IN " + algIdsConc;
183 theCondition0 += string(
" AND TA2TI.TA2TI_INPUT_ID = TAI.TAI_ID");
184 query0->setCondition( theCondition0, bindList0 );
186 coral::AttributeList attList0;
187 attList0.extend<
int>(
"TA2TI.TA2TI_ALGO_ID" );
188 attList0.extend<
string>(
"TAI.TAI_NAME" );
189 attList0.extend<
string>(
"TAI.TAI_VALUE" );
190 attList0.extend<
int>(
"TAI.TAI_POSITION" );
191 query0->defineOutput(attList0);
194 coral::ICursor& cursor0 = query0->execute();
197 while(cursor0.next()){
200 const coral::AttributeList& row0 = cursor0.currentRow();
203 string tai_name = row0[
"TAI.TAI_NAME"].data<
string>();
204 string tai_value = row0[
"TAI.TAI_VALUE"].data<
string>();
205 int tai_pos = row0[
"TAI.TAI_POSITION"].data<
int>();
206 if(tai_pos<0) tai_pos=0;
209 int algoId = row0[
"TA2TI.TA2TI_ALGO_ID"].data<
int>();
210 auto match = idToAlgMap.find(algoId);
211 if (
match == idToAlgMap.end())
continue;
213 alg.addInput(tai_name,tai_value,tai_pos);
218 }
catch (
const exception& e){
219 TRG_MSG_ERROR(
"loadAlgInput >> Standard C++ exception: " << e.what());
231 for(
auto & e : idToAlgMap ) {
232 algIds.insert(e.first);
235 string algIdsConc =
"(";
237 for(
int id : algIds ) {
238 if(first) { first =
false; }
else { algIdsConc +=
","; }
245 unique_ptr<coral::IQuery> query0(
m_session.nominalSchema().newQuery());
246 query0->addToTableList(
"TOPO_ALGO",
"TA");
247 query0->addToTableList(
"TA_TO_TO",
"TA2TO");
248 query0->addToTableList(
"TOPO_ALGO_OUTPUT",
"TAO");
250 coral::AttributeList bindList0;
254 string theCondition0 =
"";
255 theCondition0 +=
" TA.TA_ID IN " + algIdsConc;
256 theCondition0 +=
" AND TA.TA_ID = TA2TO.TA2TO_ALGO_ID";
257 theCondition0 +=
" AND TA2TO.TA2TO_OUTPUT_ID = TAO.TAO_ID";
258 query0->setCondition( theCondition0, bindList0 );
260 coral::AttributeList attList0;
261 attList0.extend<
int>(
"TA2TO.TA2TO_ALGO_ID" );
262 attList0.extend<
string>(
"TAO.TAO_NAME" );
263 attList0.extend<
string>(
"TAO.TAO_VALUE" );
264 attList0.extend<
string>(
"TAO.TAO_BITNAME" );
265 attList0.extend<
int>(
"TAO.TAO_SELECTION" );
266 attList0.extend<
int>(
"TA.TA_BITS" );
267 query0->defineOutput(attList0);
270 coral::ICursor& cursor0 = query0->execute();
273 uint outputCount = 0;
274 while(cursor0.next()){
277 const coral::AttributeList& row0 = cursor0.currentRow();
279 string tao_name = row0[
"TAO.TAO_NAME"].data<
string>();
280 string tao_value = row0[
"TAO.TAO_VALUE"].data<
string>();
281 string tao_bitname = row0[
"TAO.TAO_BITNAME"].data<
string>();
282 int tao_sel = row0[
"TAO.TAO_SELECTION"].data<
int>();
283 int ta_bits = row0[
"TA.TA_BITS"].data<
int>();
286 int algoId = row0[
"TA2TO.TA2TO_ALGO_ID"].data<
int>();
287 auto match = idToAlgMap.find(algoId);
288 if (
match == idToAlgMap.end())
continue;
290 alg.addOutput(tao_name,tao_value,ta_bits,tao_bitname, tao_sel);
295 }
catch (
const exception& e){
296 TRG_MSG_ERROR(
"loadAlgOutput >> Standard C++ exception: " << e.what());
310 for(
auto & e : idToAlgMap ) {
311 algIds.insert(e.first);
314 string algIdsConc =
"(";
316 for(
int id : algIds ) {
317 if(first) { first =
false; }
else { algIdsConc +=
","; }
325 unique_ptr<coral::IQuery> query0(
m_session.nominalSchema().newQuery());
326 query0->addToTableList(
"TA_TO_TP",
"TA2TP");
327 query0->addToTableList(
"TOPO_PARAMETER",
"TP");
329 coral::AttributeList bindList0;
333 string theCondition0 =
"";
334 theCondition0 +=
" TA2TP.TA2TP_ALGO_ID IN " + algIdsConc;
335 theCondition0 +=
" AND TA2TP.TA2TP_PARAM_ID = TP.TP_ID";
336 query0->setCondition( theCondition0, bindList0 );
338 coral::AttributeList attList0;
339 attList0.extend<
int>(
"TA2TP.TA2TP_ALGO_ID" );
340 attList0.extend<
string>(
"TP.TP_NAME" );
341 attList0.extend<
long>(
"TP.TP_VALUE" );
342 attList0.extend<
int>(
"TP.TP_POSITION" );
343 attList0.extend<
int>(
"TP.TP_SELECTION" );
344 query0->defineOutput(attList0);
347 coral::ICursor& cursor0 = query0->execute();
349 uint registerCount(0);
350 while(cursor0.next()){
352 const coral::AttributeList& row0 = cursor0.currentRow();
354 string tp_name = row0[
"TP.TP_NAME"].data<
string>();
355 long tp_value = row0[
"TP.TP_VALUE"].data<
long>();
356 int tp_pos = row0[
"TP.TP_POSITION"].data<
int>();
357 int tp_sel = row0[
"TP.TP_SELECTION"].data<
int>();
358 if(tp_pos<0) tp_pos=0;
359 if(tp_sel<0) tp_sel=0;
363 int algoId = row0[
"TA2TP.TA2TP_ALGO_ID"].data<
int>();
364 auto match = idToAlgMap.find(algoId);
365 if (
match == idToAlgMap.end())
continue;
367 alg.addParameter(tp_name,
to_string(tp_value),tp_pos, tp_sel);
372 }
catch (
const exception& e){
373 TRG_MSG_ERROR(
"loadAlgRegister >> Standard C++ exception: " << e.what());
387 for(
auto & e : idToAlgMap ) {
388 algIds.insert(e.first);
391 string algIdsConc =
"(";
393 for(
int id : algIds ) {
394 if(first) { first =
false; }
else { algIdsConc +=
","; }
402 unique_ptr<coral::IQuery> query0(
m_session.nominalSchema().newQuery());
403 query0->addToTableList(
"TA_TO_TG",
"TA2TG");
404 query0->addToTableList(
"TOPO_GENERIC",
"TG");
406 coral::AttributeList bindList0;
410 string theCondition0 =
"";
411 theCondition0 += string(
" TA2TG.TA2TG_ALGO_ID IN " + algIdsConc);
412 theCondition0 += string(
" AND TA2TG.TA2TG_GENERIC_ID = TG.TG_ID");
413 query0->setCondition( theCondition0, bindList0 );
415 query0->addToOrderList(
"TG.TG_NAME");
417 coral::AttributeList attList0;
418 attList0.extend<
int>(
"TA2TG.TA2TG_ALGO_ID" );
419 attList0.extend<
string>(
"TG.TG_NAME" );
420 attList0.extend<
string>(
"TG.TG_VALUE" );
421 query0->defineOutput(attList0);
424 coral::ICursor& cursor0 = query0->execute();
427 while(cursor0.next()){
429 const coral::AttributeList& row0 = cursor0.currentRow();
431 string tg_name = row0[
"TG.TG_NAME"].data<
string>();
432 string tg_value = row0[
"TG.TG_VALUE"].data<
string>();
435 int algoId = row0[
"TA2TG.TA2TG_ALGO_ID"].data<
int>();
436 auto match = idToAlgMap.find(algoId);
437 if (
match == idToAlgMap.end())
continue;
439 alg.addFixedParameter(tg_name,tg_value);
444 }
catch (
const exception& e){
445 TRG_MSG_ERROR(
"loadAlgFixed >> Standard C++ exception: " << e.what());
630 unique_ptr<coral::IQuery> query0(
m_session.nominalSchema().newQuery());
631 query0->addToTableList(
"TOPO_OUTPUT_LIST",
"TOL");
632 query0->addToTableList(
"TOPO_OUTPUT_LINK",
"TOLK");
633 query0->addToTableList(
"TOPO_OUTPUT_LINE",
"TOLINE");
635 coral::AttributeList bindList0;
636 bindList0.extend<
int>(
"ctpLId");
637 bindList0[0].data<
int>() = ctplinkid;
639 string theCondition0 =
"";
640 theCondition0 += string(
" TOL.OL_ID = :ctpLId" );
641 theCondition0 += string(
" AND TOLK.TL_LINK_ID = TOL.OL_ID");
642 theCondition0 += string(
" AND TOLK.TL_OUTPUT_ID = TOLINE.TOL_ID");
643 query0->setCondition( theCondition0, bindList0 );
645 coral::AttributeList attList0;
646 attList0.extend<
int>(
"TOLINE.TOL_ID" );
647 attList0.extend<
string>(
"TOLINE.TOL_ALGO_NAME" );
648 attList0.extend<
string>(
"TOLINE.TOL_TRIGGERLINE" );
649 attList0.extend<
unsigned int>(
"TOLINE.TOL_ALGO_ID" );
650 attList0.extend<
unsigned int>(
"TOLINE.TOL_MODULE" );
651 attList0.extend<
unsigned int>(
"TOLINE.TOL_FPGA" );
652 attList0.extend<
unsigned int>(
"TOLINE.TOL_FIRST_BIT" );
653 attList0.extend<
unsigned int>(
"TOLINE.TOL_CLOCK" );
654 query0->defineOutput(attList0);
657 coral::ICursor& cursor0 = query0->execute();
658 while(cursor0.next()){
659 const coral::AttributeList& row0 = cursor0.currentRow();
661 string tol_name = row0[
"TOLINE.TOL_ALGO_NAME"].data<
string>();
662 unsigned int tol_algoId = row0[
"TOLINE.TOL_ALGO_ID"].data<
unsigned int>();
663 unsigned int tol_module = row0[
"TOLINE.TOL_MODULE"].data<
unsigned int>();
664 unsigned int tol_fpga = row0[
"TOLINE.TOL_FPGA"].data<
unsigned int>();
665 unsigned int tol_clock = row0[
"TOLINE.TOL_CLOCK"].data<
unsigned int>();
666 unsigned int tol_firstbit = row0[
"TOLINE.TOL_FIRST_BIT"].data<
unsigned int>();
670 }
catch (
const exception& e){
671 TRG_MSG_ERROR(
"loadOutputList >> Standard C++ exception: " << e.what());
683 unique_ptr<coral::IQuery> query0(
m_session.nominalSchema().newQuery());
684 query0->addToTableList(
"SUPER_MASTER_TABLE",
"SM");
685 query0->addToTableList(
"TOPO_MASTER_TABLE",
"TMT");
686 query0->addToTableList(
"TOPO_TRIGGER_MENU",
"TTM");
687 query0->addToTableList(
"TTM_TO_TC",
"TTM2TC");
688 query0->addToTableList(
"TOPO_CONFIG",
"TC");
689 query0->setRowCacheSize(5);
692 coral::AttributeList bindList0;
693 bindList0.extend<
unsigned int>(
"tmtId");
694 std::string cond =
"TMT_ID = :tmtId";
695 bindList0[0].data<
unsigned int>() = tcaTarget.
getSMK();
697 string theCondition0 =
"";
698 theCondition0 += string(
" SM.SMT_ID = :tmtId");
699 theCondition0 += string(
" AND TMT.TMT_ID = SM.SMT_TOPO_MASTER_TABLE_ID ");
700 theCondition0 += string(
" AND TTM.TTM_ID = TMT.TMT_TRIGGER_MENU_ID ");
701 theCondition0 += string(
" AND TTM2TC.TTM2TC_ID = TTM.TTM_ID ");
702 theCondition0 += string(
" AND TC.TC_ID = TTM2TC.TTM2TC_CONFIG_ID ");
703 query0->setCondition( theCondition0, bindList0 );
705 coral::AttributeList attList0;
706 attList0.extend<
string>(
"TC.TC_NAME" );
707 attList0.extend<
string>(
"TC.TC_VALUE" );
708 query0->defineOutput(attList0);
710 coral::ICursor& cursor0 = query0->execute();
712 while(cursor0.next()){
713 const coral::AttributeList& row0 = cursor0.currentRow();
715 string tc_name = row0[
"TC.TC_NAME"].data<
string>();
716 string tc_value = row0[
"TC.TC_VALUE"].data<
string>();
721 }
catch(
const std::exception& e ) {
722 TRG_MSG_ERROR(
"loadTopoConfig >> Standard C++ exception: " << e.what());