diff --git a/libs/libpcf/src/io/read_csv_io_pin_table.h b/libs/libpcf/src/io/read_csv_io_pin_table.h index 50f5e3d2a..e1b121bff 100644 --- a/libs/libpcf/src/io/read_csv_io_pin_table.h +++ b/libs/libpcf/src/io/read_csv_io_pin_table.h @@ -20,7 +20,10 @@ enum class e_pin_table_direction_convention { QUICKLOGIC, NUM_TYPES }; -constexpr std::array(e_pin_table_direction_convention::NUM_TYPES)> PIN_TABLE_DIRECTION_CONVENTION_STRING = {{"explicit", "quicklogic"}}; //String versions of side orientations +const std::map PIN_TABLE_DIRECTION_CONVENTION_STRING = { + {e_pin_table_direction_convention::EXPLICIT, "explicit"}, + {e_pin_table_direction_convention::QUICKLOGIC, "quicklogic"} +}; //String versions of side orientations IoPinTable read_csv_io_pin_table(const char* fname, const e_pin_table_direction_convention& pin_dir_convention); diff --git a/libs/libpcf/test/test_pcf2place.cpp b/libs/libpcf/test/test_pcf2place.cpp index b70e5339b..38e1c18c4 100644 --- a/libs/libpcf/test/test_pcf2place.cpp +++ b/libs/libpcf/test/test_pcf2place.cpp @@ -42,8 +42,8 @@ int main(int argc, const char** argv) { openfpga::read_xml_io_location_map(argv[3]); VTR_LOG("Read the I/O location map from an XML file: %s.\n", argv[3]); - openfpga::IoPinTable io_pin_table = openfpga::read_csv_io_pin_table(argv[4]); - VTR_LOG("Read the I/O pin table from a csv file: %s.\n", argv[4], openfpga::e_pin_table_direction_convention::QUICKLOGIC); + openfpga::IoPinTable io_pin_table = openfpga::read_csv_io_pin_table(argv[4], openfpga::e_pin_table_direction_convention::QUICKLOGIC); + VTR_LOG("Read the I/O pin table from a csv file: %s.\n", argv[4]); /* Convert */ openfpga::IoNetPlace io_net_place; diff --git a/openfpga/src/base/openfpga_pcf2place.cpp b/openfpga/src/base/openfpga_pcf2place.cpp index bcb069b8b..215d54b3b 100644 --- a/openfpga/src/base/openfpga_pcf2place.cpp +++ b/openfpga/src/base/openfpga_pcf2place.cpp @@ -49,13 +49,13 @@ int pcf2place_wrapper(const OpenfpgaContext& openfpga_context, e_pin_table_direction_convention pin_table_dir_convention = e_pin_table_direction_convention::EXPLICIT; if (cmd_context.option_enable(cmd, opt_pin_table_dir_convention)) { std::string pin_table_dir_convention_str = cmd_context.option_value(cmd, opt_pin_table_dir_convention); - if (pin_table_dir_convention_str == std::string(PIN_TABLE_DIRECTION_CONVENTION_STRING[e_pin_table_direction_convention::EXPLICIT])) { + if (pin_table_dir_convention_str == std::string(PIN_TABLE_DIRECTION_CONVENTION_STRING.at(e_pin_table_direction_convention::EXPLICIT))) { pin_table_dir_convention = e_pin_table_direction_convention::EXPLICIT; - } else if (pin_table_dir_convention_str == std::string(PIN_TABLE_DIRECTION_CONVENTION_STRING[e_pin_table_direction_convention::QUICKLOGIC])) { + } else if (pin_table_dir_convention_str == std::string(PIN_TABLE_DIRECTION_CONVENTION_STRING.at(e_pin_table_direction_convention::QUICKLOGIC))) { pin_table_dir_convention = e_pin_table_direction_convention::QUICKLOGIC; } else { VTR_LOG_ERROR("Invalid pin naming convention ('%s') to identify port direction for pin table! Expect ['%s'|'%s'].\n", - pin_table_dir_convention_str.c_str(), PIN_TABLE_DIRECTION_CONVENTION_STRING[e_pin_table_direction_convention::EXPLICIT], PIN_TABLE_DIRECTION_CONVENTION_STRING[e_pin_table_direction_convention::QUICKLOGIC]); + pin_table_dir_convention_str.c_str(), PIN_TABLE_DIRECTION_CONVENTION_STRING.at(e_pin_table_direction_convention::EXPLICIT), PIN_TABLE_DIRECTION_CONVENTION_STRING.at(e_pin_table_direction_convention::QUICKLOGIC)); } }