From c75f9db315630fbbcf7e1a155312b6f8340b10b7 Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Sat, 7 Mar 2009 13:30:54 -0800 Subject: [PATCH] Add user interface to pin virtualization Flag is DISABLE_VIRTUAL_PINS. Try to give a helpful hint for how to work around any problems our regression testing might have missed. (cherry picked from commit 67381431ed2d1c5acf9ae7e674774476de4e998c) --- main.cc | 3 +++ netlist.cc | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/main.cc b/main.cc index 3ba8774f1..79a88e40c 100644 --- a/main.cc +++ b/main.cc @@ -714,6 +714,9 @@ int main(int argc, char*argv[]) cout << endl << "PARSING INPUT" << endl; } + const char *flag_dvp = flags["DISABLE_VIRTUAL_PINS"]; + if (flag_dvp) disable_virtual_pins = strcmp(flag_dvp,"true")==0; + /* Parse the input. Make the pform. */ int rc = pform_parse(argv[optind]); diff --git a/netlist.cc b/netlist.cc index df701a338..a3106e796 100644 --- a/netlist.cc +++ b/netlist.cc @@ -226,6 +226,11 @@ Link& NetPins::pin(unsigned idx) const Link& NetPins::pin(unsigned idx) const { + if (!pins_ && !disable_virtual_pins) { + cerr << get_fileline() << ": internal error: pin is unexpectedly" + " virtual, try again with -pDISABLE_VIRTUAL_PINS=true" << endl; + assert(NULL); + } assert(pins_); assert(idx < npins_); assert(idx == 0? pins_[0].pin_zero_ : pins_[idx].pin_==idx);