openfpga/src/base/openfpga_read_arch.cpp
/********************************************************************
 * Top-level function to read an OpenFPGA architecture file
 * we use the APIs from the libarchopenfpga library 
 *
 * The command will accept an option '--file' which is the architecture
 * file provided by users  
 *******************************************************************/
Top-level function to read an OpenFPGA architecture file
we use the APIs from the libarchopenfpga library

The command will accept an option '--file' which is the architecture
file provided by users
Top - level function to read an OpenFPGA architecture file we use the APIs from the libarchopenfpga library The command will accept an option ' -- file ' which is the architecture file provided by users
int read_arch(OpenfpgaContext& openfpga_context,
              const Command& cmd, const CommandContext& cmd_context) {
  CommandOptionId opt_file = cmd.option("file");
  VTR_ASSERT(true == cmd_context.option_enable(cmd, opt_file));
  VTR_ASSERT(false == cmd_context.option_value(cmd, opt_file).empty());
  std::string arch_file_name = cmd_context.option_value(cmd, opt_file);
  VTR_LOG("Reading XML architecture '%s'...\n",
          arch_file_name.c_str());
  openfpga_context.mutable_arch() = read_xml_openfpga_arch(arch_file_name.c_str());
  if (false == check_circuit_library(openfpga_context.arch().circuit_lib)) {
    return CMD_EXEC_FATAL_ERROR;
  }
  if (false == check_configurable_memory_circuit_model(openfpga_context.arch().config_protocol.type(),
                                                       openfpga_context.arch().circuit_lib,
                                                       openfpga_context.arch().config_protocol.memory_model())) {
    return CMD_EXEC_FATAL_ERROR;
  }
  if (false == check_tile_annotation(openfpga_context.arch().tile_annotations,
                                     openfpga_context.arch().circuit_lib,
                                     g_vpr_ctx.device().physical_tile_types)) {
    return CMD_EXEC_FATAL_ERROR;
  }
  return CMD_EXEC_SUCCESS;
}
int read_arch ( OpenfpgaContext & openfpga_context , const Command & cmd , const CommandContext & cmd_context ) { CommandOptionId opt_file = cmd . option ( " " ) ; VTR_ASSERT ( true == cmd_context . option_enable ( cmd , opt_file ) ) ; VTR_ASSERT ( false == cmd_context . option_value ( cmd , opt_file ) . empty ( ) ) ; std :: string arch_file_name = cmd_context . option_value ( cmd , opt_file ) ; VTR_LOG ( " \n " , arch_file_name . c_str ( ) ) ; openfpga_context . mutable_arch ( ) = read_xml_openfpga_arch ( arch_file_name . c_str ( ) ) ; if ( false == check_circuit_library ( openfpga_context . arch ( ) . circuit_lib ) ) { return CMD_EXEC_FATAL_ERROR ; } if ( false == check_configurable_memory_circuit_model ( openfpga_context . arch ( ) . config_protocol . type ( ) , openfpga_context . arch ( ) . circuit_lib , openfpga_context . arch ( ) . config_protocol . memory_model ( ) ) ) { return CMD_EXEC_FATAL_ERROR ; } if ( false == check_tile_annotation ( openfpga_context . arch ( ) . tile_annotations , openfpga_context . arch ( ) . circuit_lib , g_vpr_ctx . device ( ) . physical_tile_types ) ) { return CMD_EXEC_FATAL_ERROR ; } return CMD_EXEC_SUCCESS ; }
Top-level function to read an OpenFPGA architecture file
 we use the APIs from the libarchopenfpga library
Top - level function to read an OpenFPGA architecture file we use the APIs from the libarchopenfpga library
/* Check the option '--file' is enabled or not 
   * Actually, it must be enabled as the shell interface will check 
   * before reaching this fuction
   */ /* Check the architecture:
   * 1. Circuit library
   * 2. Tile annotation
   * 3. Technology library (TODO)
   * 4. Simulation settings (TODO)
   */