@@ -882,9 +882,7 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
882
882
i = 1 ;
883
883
}
884
884
885
- annotation->num_value_prop_pairs = i;
886
- annotation->prop = new int [i]();
887
- annotation->value = new char *[i]();
885
+ annotation->pairs .resize (i);
888
886
annotation->line_num = loc_data.line (Parent);
889
887
/* Todo: This is slow, I should use a case lookup */
890
888
i = 0 ;
@@ -893,14 +891,14 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
893
891
annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
894
892
Prop = get_attribute (Parent, " max" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
895
893
if (Prop) {
896
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_DELAY_MAX;
897
- annotation->value [i] = vtr::strdup ( Prop) ;
894
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_DELAY_MAX;
895
+ annotation->pairs [i]. second = Prop;
898
896
i++;
899
897
}
900
898
Prop = get_attribute (Parent, " min" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
901
899
if (Prop) {
902
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_DELAY_MIN;
903
- annotation->value [i] = vtr::strdup ( Prop) ;
900
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_DELAY_MIN;
901
+ annotation->pairs [i]. second = Prop;
904
902
i++;
905
903
}
906
904
Prop = get_attribute (Parent, " in_port" , loc_data).value ();
@@ -913,13 +911,13 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
913
911
annotation->type = E_ANNOT_PIN_TO_PIN_DELAY;
914
912
annotation->format = E_ANNOT_PIN_TO_PIN_MATRIX;
915
913
Prop = get_attribute (Parent, " type" , loc_data).value ();
916
- annotation->value [i] = vtr::strdup ( Parent.child_value () );
914
+ annotation->pairs [i]. second = Parent.child_value ();
917
915
918
916
if (0 == strcmp (Prop, " max" )) {
919
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_DELAY_MAX;
917
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_DELAY_MAX;
920
918
} else {
921
919
VTR_ASSERT (0 == strcmp (Prop, " min" ));
922
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_DELAY_MIN;
920
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_DELAY_MIN;
923
921
}
924
922
925
923
i++;
@@ -933,8 +931,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
933
931
annotation->type = E_ANNOT_PIN_TO_PIN_CAPACITANCE;
934
932
annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
935
933
Prop = get_attribute (Parent, " C" , loc_data).value ();
936
- annotation->value [i] = vtr::strdup ( Prop) ;
937
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_CAPACITANCE_C;
934
+ annotation->pairs [i]. second = Prop;
935
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_CAPACITANCE_C;
938
936
i++;
939
937
940
938
Prop = get_attribute (Parent, " in_port" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
@@ -947,8 +945,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
947
945
} else if (0 == strcmp (Parent.name (), " C_matrix" )) {
948
946
annotation->type = E_ANNOT_PIN_TO_PIN_CAPACITANCE;
949
947
annotation->format = E_ANNOT_PIN_TO_PIN_MATRIX;
950
- annotation->value [i] = vtr::strdup ( Parent.child_value () );
951
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_CAPACITANCE_C;
948
+ annotation->pairs [i]. second = Parent.child_value ();
949
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_CAPACITANCE_C;
952
950
i++;
953
951
954
952
Prop = get_attribute (Parent, " in_port" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
@@ -962,8 +960,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
962
960
annotation->type = E_ANNOT_PIN_TO_PIN_DELAY;
963
961
annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
964
962
Prop = get_attribute (Parent, " value" , loc_data).value ();
965
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_DELAY_TSETUP;
966
- annotation->value [i] = vtr::strdup ( Prop) ;
963
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_DELAY_TSETUP;
964
+ annotation->pairs [i]. second = Prop;
967
965
968
966
i++;
969
967
Prop = get_attribute (Parent, " port" , loc_data).value ();
@@ -981,15 +979,15 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
981
979
982
980
bool found_min_max_attrib = false ;
983
981
if (Prop) {
984
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_DELAY_CLOCK_TO_Q_MAX;
985
- annotation->value [i] = vtr::strdup ( Prop) ;
982
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_DELAY_CLOCK_TO_Q_MAX;
983
+ annotation->pairs [i]. second = Prop;
986
984
i++;
987
985
found_min_max_attrib = true ;
988
986
}
989
987
Prop = get_attribute (Parent, " min" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
990
988
if (Prop) {
991
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_DELAY_CLOCK_TO_Q_MIN;
992
- annotation->value [i] = vtr::strdup ( Prop) ;
989
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_DELAY_CLOCK_TO_Q_MIN;
990
+ annotation->pairs [i]. second = Prop;
993
991
i++;
994
992
found_min_max_attrib = true ;
995
993
}
@@ -1012,8 +1010,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
1012
1010
annotation->type = E_ANNOT_PIN_TO_PIN_DELAY;
1013
1011
annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
1014
1012
Prop = get_attribute (Parent, " value" , loc_data).value ();
1015
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_DELAY_THOLD;
1016
- annotation->value [i] = vtr::strdup ( Prop) ;
1013
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_DELAY_THOLD;
1014
+ annotation->pairs [i]. second = Prop;
1017
1015
i++;
1018
1016
1019
1017
Prop = get_attribute (Parent, " port" , loc_data).value ();
@@ -1028,8 +1026,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
1028
1026
annotation->type = E_ANNOT_PIN_TO_PIN_PACK_PATTERN;
1029
1027
annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
1030
1028
Prop = get_attribute (Parent, " name" , loc_data).value ();
1031
- annotation->prop [i] = ( int ) E_ANNOT_PIN_TO_PIN_PACK_PATTERN_NAME;
1032
- annotation->value [i] = vtr::strdup ( Prop) ;
1029
+ annotation->pairs [i]. first = E_ANNOT_PIN_TO_PIN_PACK_PATTERN_NAME;
1030
+ annotation->pairs [i]. second = Prop;
1033
1031
i++;
1034
1032
1035
1033
Prop = get_attribute (Parent, " in_port" , loc_data).value ();
@@ -1043,7 +1041,7 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
1043
1041
" Unknown port type %s in %s in %s" , Parent.name (),
1044
1042
Parent.parent ().name (), Parent.parent ().parent ().name ());
1045
1043
}
1046
- VTR_ASSERT (i == annotation->num_value_prop_pairs );
1044
+ VTR_ASSERT (i == static_cast < int >( annotation->pairs . size ()) );
1047
1045
}
1048
1046
1049
1047
static void ProcessPb_TypePowerPinToggle (pugi::xml_node parent, t_pb_type* pb_type, const pugiutil::loc_data& loc_data) {
0 commit comments