2022-07-27 00:54:27 -05:00
|
|
|
/********************************************************************
|
2022-10-06 19:08:50 -05:00
|
|
|
* Unit test functions to validate the correctness of
|
2022-07-27 00:54:27 -05:00
|
|
|
* 1. parser of data structures
|
|
|
|
* 2. writer of data structures
|
|
|
|
*******************************************************************/
|
|
|
|
/* Headers from vtrutils */
|
|
|
|
#include "vtr_assert.h"
|
|
|
|
#include "vtr_log.h"
|
|
|
|
|
|
|
|
/* Headers from fabric key */
|
|
|
|
#include "read_csv_io_pin_table.h"
|
|
|
|
#include "write_csv_io_pin_table.h"
|
|
|
|
|
|
|
|
int main(int argc, const char** argv) {
|
|
|
|
/* Ensure we have only one or two argument */
|
|
|
|
VTR_ASSERT((2 == argc) || (3 == argc));
|
|
|
|
|
|
|
|
/* Parse the fabric key from an XML file */
|
2022-10-17 16:08:21 -05:00
|
|
|
openfpga::IoPinTable io_pin_table = openfpga::read_csv_io_pin_table(argv[1], openfpga::e_pin_table_direction_convention::QUICKLOGIC);
|
2022-10-06 19:08:50 -05:00
|
|
|
VTR_LOG("Read the I/O pin table from a csv file: %s.\n", argv[1]);
|
2022-07-27 00:54:27 -05:00
|
|
|
|
|
|
|
/* Output to an XML file
|
|
|
|
* This is optional only used when there is a second argument
|
|
|
|
*/
|
2022-10-06 19:08:50 -05:00
|
|
|
if (3 <= argc) {
|
2022-07-27 01:04:14 -05:00
|
|
|
write_csv_io_pin_table(argv[2], io_pin_table);
|
2022-10-06 19:08:50 -05:00
|
|
|
VTR_LOG("Echo the I/O pin table to a csv file: %s.\n", argv[2]);
|
2022-07-27 00:54:27 -05:00
|
|
|
}
|
|
|
|
}
|