[engine] syntax

This commit is contained in:
tangxifan 2022-10-17 14:54:18 -07:00
parent 811438c20e
commit 63d8b00630
3 changed files with 9 additions and 6 deletions

View File

@ -20,7 +20,10 @@ enum class e_pin_table_direction_convention {
QUICKLOGIC, QUICKLOGIC,
NUM_TYPES NUM_TYPES
}; };
constexpr std::array<const char*, static_cast<size_t>(e_pin_table_direction_convention::NUM_TYPES)> PIN_TABLE_DIRECTION_CONVENTION_STRING = {{"explicit", "quicklogic"}}; //String versions of side orientations const std::map<e_pin_table_direction_convention, const char*> 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); IoPinTable read_csv_io_pin_table(const char* fname, const e_pin_table_direction_convention& pin_dir_convention);

View File

@ -42,8 +42,8 @@ int main(int argc, const char** argv) {
openfpga::read_xml_io_location_map(argv[3]); openfpga::read_xml_io_location_map(argv[3]);
VTR_LOG("Read the I/O location map from an XML file: %s.\n", 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]); 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], openfpga::e_pin_table_direction_convention::QUICKLOGIC); VTR_LOG("Read the I/O pin table from a csv file: %s.\n", argv[4]);
/* Convert */ /* Convert */
openfpga::IoNetPlace io_net_place; openfpga::IoNetPlace io_net_place;

View File

@ -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; 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)) { 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); 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; 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; pin_table_dir_convention = e_pin_table_direction_convention::QUICKLOGIC;
} else { } else {
VTR_LOG_ERROR("Invalid pin naming convention ('%s') to identify port direction for pin table! Expect ['%s'|'%s'].\n", 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));
} }
} }