@@ -393,12 +393,12 @@ 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
- if ( customize_file ): # Awais: emulate "out = subtr?acc-mul:acc+mul" for RS DSP MACC against EDA -348
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 )
401
-
396
+ # 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 )
401
+ # END: Code added to original one in order to handle case of Jira-348 (Awais)
402
402
print (" dict<SigBit, pool<Cell*>> sigusers;" , file = f )
403
403
print (" pool<Cell*> blacklist_cells;" , file = f )
404
404
print (" pool<Cell*> autoremove_cells;" , file = f )
@@ -544,13 +544,14 @@ def process_pmgfile(f, filename):
544
544
valueidx += 1
545
545
print (" index_{}_key_type key;" .format (index ), file = f )
546
546
for field , entry in enumerate (block ["index" ]):
547
- if (customize_file ):
548
- if (len (block ["if" ]) and prefix == "rs_dsp_macc" ): # Awais: emulate "out = subtr?acc-mul:acc+mul" for RS DSP MACC against EDA-348
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 ) #
547
+ # 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 )
554
+ # END: Code added to original one in order to handle case of Jira-348 (Awais)
554
555
print (" std::get<{}>(key) = {};" .format (field , entry [1 ]), file = f )
555
556
556
557
print (" index_{}[key].push_back(value);" .format (index ), file = f )
@@ -726,11 +727,12 @@ def process_pmgfile(f, filename):
726
727
727
728
if len (block ["if" ]):
728
729
for expr in block ["if" ]:
729
- if (customize_file ): # Awais: emulate "out = subtr?acc-mul:acc+mul" for RS DSP MACC against EDA-348
730
- if ((expr .find ("neg" )!= - 1 ) and (expr .find ("nullptr" )!= - 1 ) and prefix == "rs_dsp_macc" ):
731
- if (block ["cell" ] == "mux" or block ["cell" ] == "add" ):
732
- print ("" , file = f )
733
- else : #
730
+ # 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 )
734
+ else :
735
+ # END: Code added to original one in order to handle case of Jira-348 (Awais)
734
736
print ("" , file = f )
735
737
print (" if (!({})) {{" .format (expr ), file = f )
736
738
print (" {} = nullptr;" .format (block ["cell" ]), file = f )
@@ -742,26 +744,27 @@ def process_pmgfile(f, filename):
742
744
print ("" , file = f )
743
745
print (" index_{}_key_type key;" .format (index ), file = f )
744
746
for field , entry in enumerate (block ["index" ]):
745
- if (customize_file ):
746
- if (len (block ["if" ]) and prefix == "rs_dsp_macc" ): # Awais: emulate "out = subtr?acc-mul:acc+mul" for RS DSP MACC against EDA-348
747
- for expr in block ["if" ]:
748
- 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 ))):
749
- print ("" , file = f )
750
- if (block ["cell" ] == "mux" ):
751
- print (" if ({}) {{" .format (expr ), file = f )
752
- else :
753
- print (" if (!({}) and {} != nullptr) {{" .format (expr ,block ["cell" ]), file = f )
754
- print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
755
- print (" }" , file = f )
756
- print ("" , file = f )
757
- print (" else {" , file = f )
758
- print (" index_{}.clear();" .format (index ), file = f )
759
- print (" index_{} = index_{}_{};" .format (index ,index ,block ["cell" ]), file = f )
760
- print (" }" , file = f )
747
+ # 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 )
761
754
else :
762
- print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
763
- else :
764
- print (" std::get<{}>(key) = {};" .format (field , entry [2 ]), file = f )
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 )
765
+ 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 )
765
768
print (" auto cells_ptr = index_{}.find(key);" .format (index ), file = f )
766
769
767
770
if block ["semioptional" ] or block ["genargs" ] is not None :
0 commit comments