Bugfix: Multiple Verilog plugins

45 views
Skip to first unread message

fnp

unread,
Nov 9, 2023, 7:30:13 PM11/9/23
to xyce-users
The code in N_CIR_Xyce.C, line 867 processing the -plugin statement only works for 1 or 2 plugins but breaks for 3 or more (iirc). Below is a fixed version that I provide under the same license as the current Xyce license, so it can hopefully be included into the Xyce repo without problems.

Best regards
Thomas


Current non functional code:
  if (commandLine_.argExists(std::string("-plugin")))
  {
    const std::string plugin = commandLine_.getArgumentValue("-plugin");
   
    for (std::string::size_type i = 0, j = plugin.find_first_of(", "); i != std::string::npos; i = (j == std::string::npos ? j : j + 1), j = plugin.find_first_of(", ", i))
    {
      Device::registerPlugin(plugin.substr(i, j).c_str());
    }
  }

Fixed code:
  if (commandLine_.argExists(std::string("-plugin")))
  {
    const std::string plugin = commandLine_.getArgumentValue("-plugin");

std::string::size_type beg = 0;
    for (
std::string::size_type end = 0;
(end=plugin.find_first_of(",", end)) != std::string::npos;
++end
)
    {
std::string regi=plugin.substr(beg, end-beg);
Device::registerPlugin(plugin.substr(beg, end-beg).c_str());
beg = end + 1;
    }
    Device::registerPlugin(plugin.substr(beg).c_str());

  }


xyce-users

unread,
Nov 12, 2023, 6:54:18 PM11/12/23
to xyce-users

Thanks for sending this.  We'll check it, and if it holds up we'll add it to Xyce.

thanks,
Eric
Reply all
Reply to author
Forward
0 new messages