From c3f180372debbc34a6d0110211db7a28f27c64ff Mon Sep 17 00:00:00 2001 From: tangxifan Date: Mon, 17 Oct 2022 15:42:22 -0700 Subject: [PATCH] [engine] do not error out when ql-style is used in pin table --- libs/libpcf/src/io/read_csv_io_pin_table.cpp | 33 ++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/libs/libpcf/src/io/read_csv_io_pin_table.cpp b/libs/libpcf/src/io/read_csv_io_pin_table.cpp index a3f3f775a..9431ee579 100644 --- a/libs/libpcf/src/io/read_csv_io_pin_table.cpp +++ b/libs/libpcf/src/io/read_csv_io_pin_table.cpp @@ -80,24 +80,25 @@ IoPinTable read_csv_io_pin_table( "Invalid direction defintion! Expect [A2F|F2A] in the pin name\n"); exit(1); } + + /* Parse pin direction from a specific column, this has a higher priority + * than inferring from pin names */ + std::string port_dir_str = row_vec.at(ROW_INDEX_DIRECTION); + if (port_dir_str == std::string(DIRECTION_INPUT)) { + io_pin_table.set_pin_direction(pin_id, IoPinTable::INPUT); + } else if (port_dir_str == std::string(DIRECTION_OUTPUT)) { + io_pin_table.set_pin_direction(pin_id, IoPinTable::OUTPUT); + } else if (pin_dir_convention == + e_pin_table_direction_convention::EXPLICIT) { + /* Error out only when we need explicit port direction */ + VTR_LOG( + "Invalid direction defintion! Expect [%s|%s] in the GPIO direction\n", + DIRECTION_INPUT, DIRECTION_OUTPUT); + exit(1); + } } - /* Parse pin direction from a specific column, this has a higher priority - * than inferring from pin names */ - std::string port_dir_str = row_vec.at(ROW_INDEX_DIRECTION); - if (port_dir_str == std::string(DIRECTION_INPUT)) { - io_pin_table.set_pin_direction(pin_id, IoPinTable::INPUT); - } else if (port_dir_str == std::string(DIRECTION_OUTPUT)) { - io_pin_table.set_pin_direction(pin_id, IoPinTable::OUTPUT); - } else { - VTR_LOG( - "Invalid direction defintion! Expect [%s|%s] in the GPIO direction\n", - DIRECTION_INPUT, DIRECTION_OUTPUT); - exit(1); - } + return io_pin_table; } - return io_pin_table; -} - } /* End namespace openfpga*/