openfpga/src/fpga_sdc/sdc_writer_utils.cpp
/********************************************************************
 * Write a port in SDC format
 *******************************************************************/
Write a port in SDC format
Write a port in SDC format
std::string generate_sdc_port(const BasicPort& port) {
  std::string sdc_line;
  std::string size_str = "[" + std::to_string(port.get_lsb()) + ":" + std::to_string(port.get_msb()) + "]";
  if (1 == port.get_width()) {
    size_str = "[" + std::to_string(port.get_lsb()) + "]";
  }
  sdc_line = port.get_name() + size_str;
  return sdc_line;
}
std :: string generate_sdc_port ( const BasicPort & port ) { std :: string sdc_line ; std :: string size_str = " " + std :: to_string ( port . get_lsb ( ) ) + " " + std :: to_string ( port . get_msb ( ) ) + " " ; if ( 1 == port . get_width ( ) ) { size_str = " " + std :: to_string ( port . get_lsb ( ) ) + " " ; } sdc_line = port . get_name ( ) + size_str ; return sdc_line ; }
Write a port in SDC format
Write a port in SDC format
/* Only connection require a format of <port_name>[<lsb>:<msb>]
   * others require a format of <port_type> [<lsb>:<msb>] <port_name> 
   */ /* When LSB == MSB, we can use a simplified format 
   * If LSB != 0, we need to give explicit pin number
   *   <port_type>[<lsb>]
   * Otherwise, we can keep a compact format
   *   <port_type>
   */