[engine] added command 'pcf2place' to openfpga

This commit is contained in:
tangxifan 2022-07-28 11:30:36 -07:00
parent 2a5bffa6b9
commit c1256ae818
3 changed files with 20 additions and 16 deletions

View File

@ -19,6 +19,8 @@
#include "io_net_place.h"
#include "pcf2place.h"
#include "openfpga_pcf2place.h"
/* begin namespace openfpga */
namespace openfpga {
@ -41,43 +43,45 @@ int pcf2place_wrapper(const OpenfpgaContext& openfpga_context,
std::string pcf_fname = cmd_context.option_value(cmd, opt_pcf);
std::string blif_fname = cmd_context.option_value(cmd, opt_blif);
std::string fpga_io_map_fname = cmd_context.option_value(cmd, opt_fpga_io_map);
std::string pin_table_fname = cmd_context.option_value(cmd, opt_pin_table);
std::string fpga_fix_pins_fname = cmd_context.option_value(cmd, opt_fpga_fix_pins);
/* Parse the input files */
openfpga::PcfData pcf_data;
openfpga::read_pcf(pcf_fname, pcf_data);
openfpga::read_pcf(pcf_fname.c_str(), pcf_data);
VTR_LOG("Read the design constraints from a pcf file: %s.\n",
pcf_fname.c_str());
blifparse::BlifHeadReader callback;
blifparse::blif_parse_filename(argv[2], callback);
blifparse::blif_parse_filename(blif_fname.c_str(), callback);
VTR_LOG("Read the blif from a file: %s.\n",
argv[2]);
blif_fname.c_str());
if (callback.had_error()) {
VTR_LOG("Read the blif ends with errors\n",
argv[2]);
return 1;
VTR_LOG_ERROR("Read the blif ends with errors\n");
return CMD_EXEC_FATAL_ERROR;
}
openfpga::IoLocationMap io_location_map = openfpga::read_xml_io_location_map(argv[3]);
IoLocationMap io_location_map = read_xml_io_location_map(fpga_io_map_fname.c_str());
VTR_LOG("Read the I/O location map from an XML file: %s.\n",
argv[3]);
fpga_io_map_fname.c_str());
openfpga::IoPinTable io_pin_table = openfpga::read_csv_io_pin_table(argv[4]);
IoPinTable io_pin_table = read_csv_io_pin_table(pin_table_fname.c_str());
VTR_LOG("Read the I/O pin table from a csv file: %s.\n",
argv[4]);
pin_table_fname.c_str());
/* Convert */
openfpga::IoNetPlace io_net_place;
IoNetPlace io_net_place;
int status = pcf2place(pcf_data, callback.input_pins(), callback.output_pins(), io_pin_table, io_location_map, io_net_place);
if (status) {
return status;
}
/* Output */
status = io_net_place.write_to_place_file(argv[5], true, true);
return CMD_EXEC_FATAL_ERROR;
status = io_net_place.write_to_place_file(fpga_fix_pins_fname.c_str(),
cmd_context.option_enable(cmd, opt_no_time_stamp),
cmd_context.option_enable(cmd, opt_verbose));
if (status) {
return status;
}
return CMD_EXEC_SUCCESS;

View File

@ -10,6 +10,7 @@
#include "check_netlist_naming_conflict.h"
#include "openfpga_build_fabric.h"
#include "openfpga_write_gsb.h"
#include "openfpga_pcf2place.h"
#include "openfpga_setup_command.h"
/* begin namespace openfpga */

View File

@ -17,7 +17,6 @@
#include "openfpga_bitstream_command.h"
#include "openfpga_spice_command.h"
#include "openfpga_sdc_command.h"
#include "openfpga_constrain_pin_location_command.h"
#include "basic_command.h"
#include "openfpga_title.h"