openfpga/src/fpga_spice/spice_essential_gates.cpp
/********************************************************************
 * Create supply voltage wrappers
 * The wrappers are used for constant inputs of routing multiplexers
 *
 *******************************************************************/
Create supply voltage wrappers
The wrappers are used for constant inputs of routing multiplexers
Create supply voltage wrappers The wrappers are used for constant inputs of routing multiplexers
int print_spice_supply_wrappers(NetlistManager& netlist_manager,
                                const ModuleManager& module_manager,
                                const std::string& submodule_dir) {
  int status = CMD_EXEC_SUCCESS;
  std::string spice_fname = submodule_dir + std::string(SUPPLY_WRAPPER_SPICE_FILE_NAME);
  std::fstream fp;
  fp.open(spice_fname, std::fstream::out | std::fstream::trunc);
  check_file_stream(spice_fname.c_str(), fp); 
  VTR_LOG("Generating SPICE netlist '%s' for voltage supply wrappers...",
          spice_fname.c_str());
  print_spice_file_header(fp, std::string("Voltage Supply Wrappers"));
  print_spice_supply_wrapper_subckt(module_manager, fp, 0);
  print_spice_supply_wrapper_subckt(module_manager, fp, 1);
  fp.close();
  NetlistId nlist_id = netlist_manager.add_netlist(spice_fname);
  VTR_ASSERT(NetlistId::INVALID() != nlist_id);
  netlist_manager.set_netlist_type(nlist_id, NetlistManager::SUBMODULE_NETLIST);
  VTR_LOG("Done\n");
  return status;
}
int print_spice_supply_wrappers ( NetlistManager & netlist_manager , const ModuleManager & module_manager , const std :: string & submodule_dir ) { int status = CMD_EXEC_SUCCESS ; std :: string spice_fname = submodule_dir + std :: string ( SUPPLY_WRAPPER_SPICE_FILE_NAME ) ; std :: fstream fp ; fp . open ( spice_fname , std :: fstream :: out | std :: fstream :: trunc ) ; check_file_stream ( spice_fname . c_str ( ) , fp ) ; VTR_LOG ( " " , spice_fname . c_str ( ) ) ; print_spice_file_header ( fp , std :: string ( " " ) ) ; print_spice_supply_wrapper_subckt ( module_manager , fp , 0 ) ; print_spice_supply_wrapper_subckt ( module_manager , fp , 1 ) ; fp . close ( ) ; NetlistId nlist_id = netlist_manager . add_netlist ( spice_fname ) ; VTR_ASSERT ( NetlistId :: INVALID ( ) != nlist_id ) ; netlist_manager . set_netlist_type ( nlist_id , NetlistManager :: SUBMODULE_NETLIST ) ; VTR_LOG ( " \n " ) ; return status ; }
Create supply voltage wrappers
 The wrappers are used for constant inputs of routing multiplexers
Create supply voltage wrappers The wrappers are used for constant inputs of routing multiplexers
/* Create file stream */ /* Create the file stream */ /* Check if the file stream if valid or not */ /* Create file */ /* VDD */ /* GND */ /* Close file handler*/ /* Add fname to the netlist name list */