@@ -882,9 +882,7 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
882882 i = 1 ;
883883 }
884884
885- annotation->num_value_prop_pairs = i;
886- annotation->prop = new int [i]();
887- annotation->value = new char *[i]();
885+ annotation->pairs .resize (i);
888886 annotation->line_num = loc_data.line (Parent);
889887 /* Todo: This is slow, I should use a case lookup */
890888 i = 0 ;
@@ -893,14 +891,14 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
893891 annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
894892 Prop = get_attribute (Parent, " max" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
895893 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;
898896 i++;
899897 }
900898 Prop = get_attribute (Parent, " min" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
901899 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;
904902 i++;
905903 }
906904 Prop = get_attribute (Parent, " in_port" , loc_data).value ();
@@ -913,13 +911,13 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
913911 annotation->type = E_ANNOT_PIN_TO_PIN_DELAY;
914912 annotation->format = E_ANNOT_PIN_TO_PIN_MATRIX;
915913 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 ();
917915
918916 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;
920918 } else {
921919 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;
923921 }
924922
925923 i++;
@@ -933,8 +931,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
933931 annotation->type = E_ANNOT_PIN_TO_PIN_CAPACITANCE;
934932 annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
935933 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;
938936 i++;
939937
940938 Prop = get_attribute (Parent, " in_port" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
@@ -947,8 +945,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
947945 } else if (0 == strcmp (Parent.name (), " C_matrix" )) {
948946 annotation->type = E_ANNOT_PIN_TO_PIN_CAPACITANCE;
949947 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;
952950 i++;
953951
954952 Prop = get_attribute (Parent, " in_port" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
@@ -962,8 +960,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
962960 annotation->type = E_ANNOT_PIN_TO_PIN_DELAY;
963961 annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
964962 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;
967965
968966 i++;
969967 Prop = get_attribute (Parent, " port" , loc_data).value ();
@@ -981,15 +979,15 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
981979
982980 bool found_min_max_attrib = false ;
983981 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;
986984 i++;
987985 found_min_max_attrib = true ;
988986 }
989987 Prop = get_attribute (Parent, " min" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
990988 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;
993991 i++;
994992 found_min_max_attrib = true ;
995993 }
@@ -1012,8 +1010,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
10121010 annotation->type = E_ANNOT_PIN_TO_PIN_DELAY;
10131011 annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
10141012 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;
10171015 i++;
10181016
10191017 Prop = get_attribute (Parent, " port" , loc_data).value ();
@@ -1028,8 +1026,8 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
10281026 annotation->type = E_ANNOT_PIN_TO_PIN_PACK_PATTERN;
10291027 annotation->format = E_ANNOT_PIN_TO_PIN_CONSTANT;
10301028 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;
10331031 i++;
10341032
10351033 Prop = get_attribute (Parent, " in_port" , loc_data).value ();
@@ -1043,7 +1041,7 @@ static void ProcessPinToPinAnnotations(pugi::xml_node Parent,
10431041 " Unknown port type %s in %s in %s" , Parent.name (),
10441042 Parent.parent ().name (), Parent.parent ().parent ().name ());
10451043 }
1046- VTR_ASSERT (i == annotation->num_value_prop_pairs );
1044+ VTR_ASSERT (i == static_cast < int >( annotation->pairs . size ()) );
10471045}
10481046
10491047static void ProcessPb_TypePowerPinToggle (pugi::xml_node parent, t_pb_type* pb_type, const pugiutil::loc_data& loc_data) {
0 commit comments