@@ -393,12 +393,15 @@ def process_pmgfile(f, filename):
393
393
print (" typedef std::tuple<{}> index_{}_key_type;" .format (", " .join (index_types ), index ), file = f )
394
394
print (" typedef std::tuple<{}> index_{}_value_type;" .format (", " .join (value_types ), index ), file = f )
395
395
print (" dict<index_{}_key_type, vector<index_{}_value_type>> index_{};" .format (index , index , index ), file = f )
396
+
396
397
# BEGIN: Code added to original one in order to handle case of Jira-348 (Awais)
397
- if (prefix == "rs_dsp_macc" and block ["cell" ]== "mux" ):
398
- print (" dict<index_{}_key_type, vector<index_{}_value_type>> index_{}_mux;" .format (index , index , index ), file = f )
399
- elif ((prefix == "rs_dsp_macc" and block ["cell" ]== "add" )):
400
- print (" dict<index_{}_key_type, vector<index_{}_value_type>> index_{}_add;" .format (index , index , index ), file = f )
398
+ if (customize_file ):
399
+ if (prefix == "rs_dsp_macc" and block ["cell" ]== "mux" ):
400
+ print (" dict<index_{}_key_type, vector<index_{}_value_type>> index_{}_mux;" .format (index , index , index ), file = f )
401
+ elif ((prefix == "rs_dsp_macc" and block ["cell" ]== "add" )):
402
+ print (" dict<index_{}_key_type, vector<index_{}_value_type>> index_{}_add;" .format (index , index , index ), file = f )
401
403
# END: Code added to original one in order to handle case of Jira-348 (Awais)
404
+
402
405
print (" dict<SigBit, pool<Cell*>> sigusers;" , file = f )
403
406
print (" pool<Cell*> blacklist_cells;" , file = f )
404
407
print (" pool<Cell*> autoremove_cells;" , file = f )
@@ -545,12 +548,13 @@ def process_pmgfile(f, filename):
545
548
print (" index_{}_key_type key;" .format (index ), file = f )
546
549
for field , entry in enumerate (block ["index" ]):
547
550
# BEGIN: Code added to original one in order to handle case of Jira-348 (Awais)
548
- if (len (block ["if" ]) and prefix == "rs_dsp_macc" ):
549
- for expr in block ["if" ]:
550
- if ((entry [2 ].find ("neg" ) != - 1 ) and (entry [2 ].find ("mux_ba" ) == - 1 ) ):
551
- print (" index_{}_{}[key].push_back(value);" .format (index ,block ["cell" ]), file = f )
552
- elif ((entry [2 ].find ("neg" ) == - 1 ) and (entry [2 ].find ("mux_ba" ) != - 1 ) ):
553
- print (" index_{}_{}[key].push_back(value);" .format (index ,block ["cell" ]), file = f )
551
+ if (customize_file ):
552
+ if (len (block ["if" ]) and prefix == "rs_dsp_macc" ):
553
+ for expr in block ["if" ]:
554
+ if ((entry [2 ].find ("neg" ) != - 1 ) and (entry [2 ].find ("mux_ba" ) == - 1 ) ):
555
+ print (" index_{}_{}[key].push_back(value);" .format (index ,block ["cell" ]), file = f )
556
+ elif ((entry [2 ].find ("neg" ) == - 1 ) and (entry [2 ].find ("mux_ba" ) != - 1 ) ):
557
+ print (" index_{}_{}[key].push_back(value);" .format (index ,block ["cell" ]), file = f )
554
558
# END: Code added to original one in order to handle case of Jira-348 (Awais)
555
559
print (" std::get<{}>(key) = {};" .format (field , entry [1 ]), file = f )
556
560
@@ -728,9 +732,10 @@ def process_pmgfile(f, filename):
728
732
if len (block ["if" ]):
729
733
for expr in block ["if" ]:
730
734
# BEGIN: Code added to original one in order to handle case of Jira-348 (Awais)
731
- if ((expr .find ("neg" )!= - 1 ) and (expr .find ("nullptr" )!= - 1 ) and prefix == "rs_dsp_macc" ):
732
- if (block ["cell" ] == "mux" or block ["cell" ] == "add" ):
733
- print ("" , file = f )
735
+ if (customize_file ):
736
+ if ((expr .find ("neg" )!= - 1 ) and (expr .find ("nullptr" )!= - 1 ) and prefix == "rs_dsp_macc" ):
737
+ if (block ["cell" ] == "mux" or block ["cell" ] == "add" ):
738
+ print ("" , file = f )
734
739
else :
735
740
# END: Code added to original one in order to handle case of Jira-348 (Awais)
736
741
print ("" , file = f )
@@ -745,26 +750,29 @@ def process_pmgfile(f, filename):
745
750
print (" index_{}_key_type key;" .format (index ), file = f )
746
751
for field , entry in enumerate (block ["index" ]):
747
752
# BEGIN: Code added to original one in order to handle case of Jira-348 (Awais)
748
- if (len (block ["if" ]) and prefix == "rs_dsp_macc" ):
749
- for expr in block ["if" ]:
750
- if ((block ["cell" ] == "mux" and (entry [2 ].find ("neg" ) != - 1 ) and (entry [2 ].find ("mux_ba" ) == - 1 )) or (block ["cell" ] == "add" and (entry [2 ].find ("neg" ) == - 1 ) and (entry [2 ].find ("mux_ba" ) != - 1 ))):
751
- print ("" , file = f )
752
- if (block ["cell" ] == "mux" ):
753
- print (" if ({}) {{" .format (expr ), file = f )
753
+ if (customize_file ):
754
+ if (len (block ["if" ]) and prefix == "rs_dsp_macc" ):
755
+ for expr in block ["if" ]:
756
+ if ((block ["cell" ] == "mux" and (entry [2 ].find ("neg" ) != - 1 ) and (entry [2 ].find ("mux_ba" ) == - 1 )) or (block ["cell" ] == "add" and (entry [2 ].find ("neg" ) == - 1 ) and (entry [2 ].find ("mux_ba" ) != - 1 ))):
757
+ print ("" , file = f )
758
+ if (block ["cell" ] == "mux" ):
759
+ print (" if ({}) {{" .format (expr ), file = f )
760
+ else :
761
+ print (" if (!({}) and {} != nullptr) {{" .format (expr ,block ["cell" ]), file = f )
762
+ print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
763
+ print (" }" , file = f )
764
+ print ("" , file = f )
765
+ print (" else {" , file = f )
766
+ print (" index_{}.clear();" .format (index ), file = f )
767
+ print (" index_{} = index_{}_{};" .format (index ,index ,block ["cell" ]), file = f )
768
+ print (" }" , file = f )
754
769
else :
755
- print (" if (!({}) and {} != nullptr) {{" .format (expr ,block ["cell" ]), file = f )
756
- print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
757
- print (" }" , file = f )
758
- print ("" , file = f )
759
- print (" else {" , file = f )
760
- print (" index_{}.clear();" .format (index ), file = f )
761
- print (" index_{} = index_{}_{};" .format (index ,index ,block ["cell" ]), file = f )
762
- print (" }" , file = f )
763
- else :
764
- print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
770
+ print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
771
+ else :
772
+ print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
765
773
else :
766
- # END: Code added to original one in order to handle case of Jira-348 (Awais)
767
- print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
774
+ # END: Code added to original one in order to handle case of Jira-348 (Awais)
775
+ print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
768
776
print (" auto cells_ptr = index_{}.find(key);" .format (index ), file = f )
769
777
770
778
if block ["semioptional" ] or block ["genargs" ] is not None :
0 commit comments