From 2c1df3e6f7f70bfe9c2b4e84394dcbcdf7e4d17f Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 18 Dec 1998 05:16:25 +0000 Subject: [PATCH] Parse more UDP input edge descriptions. --- lexor.lex | 9 ++++++++- netlist.cc | 51 ++++++++++++++++++++++++++++++++++++++++++++------- netlist.h | 17 ++++++++++++++++- parse.y | 5 ++++- 4 files changed, 72 insertions(+), 10 deletions(-) diff --git a/lexor.lex b/lexor.lex index bdd4cb7b3..6291d78ae 100644 --- a/lexor.lex +++ b/lexor.lex @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: lexor.lex,v 1.6 1998/12/09 04:02:47 steve Exp $" +#ident "$Id: lexor.lex,v 1.7 1998/12/18 05:16:25 steve Exp $" #endif //# define YYSTYPE lexval @@ -83,9 +83,16 @@ static verinum*make_sized_hex(const char*txt); return STRING; } . { yymore(); } +\(\?0\) { return '_'; } +\(\?1\) { return '+'; } +\(\?x\) { return '%'; } \(\?\?\) { return '*'; } \(01\) { return 'r'; } +\(0x\) { return 'P'; } \(10\) { return 'f'; } +\(1x\) { return 'N'; } +\(x0\) { return 'F'; } +\(x1\) { return 'R'; } [bB] { return 'b'; } [fF] { return 'f'; } [rR] { return 'r'; } diff --git a/netlist.cc b/netlist.cc index 897e66265..1b273ee30 100644 --- a/netlist.cc +++ b/netlist.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: netlist.cc,v 1.13 1998/12/17 23:54:58 steve Exp $" +#ident "$Id: netlist.cc,v 1.14 1998/12/18 05:16:25 steve Exp $" #endif # include @@ -499,16 +499,25 @@ bool NetUDP::set_sequ_(const string&input, char output) switch (to[edge]) { case '0': - assert(sfrm->pins[edge].zer == 0); - sfrm->pins[edge].zer = sto; + // Notice that I might have caught this edge already + if (sfrm->pins[edge].zer != sto) { + assert(sfrm->pins[edge].zer == 0); + sfrm->pins[edge].zer = sto; + } break; case '1': - assert(sfrm->pins[edge].one == 0); - sfrm->pins[edge].one = sto; + // Notice that I might have caught this edge already + if (sfrm->pins[edge].one != sto) { + assert(sfrm->pins[edge].one == 0); + sfrm->pins[edge].one = sto; + } break; case 'x': - assert(sfrm->pins[edge].xxx == 0); - sfrm->pins[edge].xxx = sto; + // Notice that I might have caught this edge already + if (sfrm->pins[edge].xxx != sto) { + assert(sfrm->pins[edge].xxx == 0); + sfrm->pins[edge].xxx = sto; + } break; } @@ -539,6 +548,31 @@ bool NetUDP::sequ_glob_(string input, char output) sequ_glob_(input, output); return true; + case 'n': // Iterate over (n) edges + input[idx] = 'f'; + sequ_glob_(input, output); + input[idx] = 'F'; + sequ_glob_(input, output); + input[idx] = 'N'; + sequ_glob_(input, output); + return true; + + case 'p': // Iterate over (p) edges + input[idx] = 'r'; + sequ_glob_(input, output); + input[idx] = 'R'; + sequ_glob_(input, output); + input[idx] = 'P'; + sequ_glob_(input, output); + return true; + + case '_': // Iterate over (?0) edges + input[idx] = 'f'; + sequ_glob_(input, output); + input[idx] = 'F'; + sequ_glob_(input, output); + return true; + case '*': // Iterate over all the edges input[idx] = 'r'; sequ_glob_(input, output); @@ -811,6 +845,9 @@ NetNet* Design::find_signal(bool (*func)(const NetNet*)) /* * $Log: netlist.cc,v $ + * Revision 1.14 1998/12/18 05:16:25 steve + * Parse more UDP input edge descriptions. + * * Revision 1.13 1998/12/17 23:54:58 steve * VVM support for small sequential UDP objects. * diff --git a/netlist.h b/netlist.h index 8833e0081..462b38fc7 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: netlist.h,v 1.13 1998/12/17 23:54:58 steve Exp $" +#ident "$Id: netlist.h,v 1.14 1998/12/18 05:16:25 steve Exp $" #endif /* @@ -352,6 +352,7 @@ class NetLogic : public NetNode { * edge. * * Set_table takes as input a string with one letter per pin. The + * parser translates the written sequences to one of these. The * valid characters are: * * 0, 1, x -- The levels @@ -362,6 +363,17 @@ class NetLogic : public NetNode { * P -- (0x) * N -- (1x) * + * It also takes one of the following glob letters to represent more + * then one item. + * + * p -- 01, 0x or x1 + * n -- 10, 1x or x0 + * ? -- 0, 1, or x + * * -- any edge + * + -- 01 or x1 + * _ -- 10 or x0 (Note that this is not the output '-'.) + * % -- 0x or 1x + * * COMBINATIONAL * The logic table is a map between the input levels and the * output. Each input pin can have the value 0, 1 or x and the output @@ -894,6 +906,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.14 1998/12/18 05:16:25 steve + * Parse more UDP input edge descriptions. + * * Revision 1.13 1998/12/17 23:54:58 steve * VVM support for small sequential UDP objects. * diff --git a/parse.y b/parse.y index 5972e4bae..a06f53c4d 100644 --- a/parse.y +++ b/parse.y @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: parse.y,v 1.9 1998/12/14 02:01:35 steve Exp $" +#ident "$Id: parse.y,v 1.10 1998/12/18 05:16:25 steve Exp $" #endif # include "parse_misc.h" @@ -731,6 +731,9 @@ udp_input_sym | '*' { $$ = '*'; } | 'f' { $$ = 'f'; } | 'r' { $$ = 'r'; } + | 'n' { $$ = 'n'; } + | 'p' { $$ = 'p'; } + | '_' { $$ = '_'; } ; udp_output_sym