Parse more UDP input edge descriptions.

This commit is contained in:
steve 1998-12-18 05:16:25 +00:00
parent 4e2c0036aa
commit 2c1df3e6f7
4 changed files with 72 additions and 10 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #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 #endif
//# define YYSTYPE lexval //# define YYSTYPE lexval
@ -83,9 +83,16 @@ static verinum*make_sized_hex(const char*txt);
return STRING; } return STRING; }
<CSTRING>. { yymore(); } <CSTRING>. { yymore(); }
<UDPTABLE>\(\?0\) { return '_'; }
<UDPTABLE>\(\?1\) { return '+'; }
<UDPTABLE>\(\?x\) { return '%'; }
<UDPTABLE>\(\?\?\) { return '*'; } <UDPTABLE>\(\?\?\) { return '*'; }
<UDPTABLE>\(01\) { return 'r'; } <UDPTABLE>\(01\) { return 'r'; }
<UDPTABLE>\(0x\) { return 'P'; }
<UDPTABLE>\(10\) { return 'f'; } <UDPTABLE>\(10\) { return 'f'; }
<UDPTABLE>\(1x\) { return 'N'; }
<UDPTABLE>\(x0\) { return 'F'; }
<UDPTABLE>\(x1\) { return 'R'; }
<UDPTABLE>[bB] { return 'b'; } <UDPTABLE>[bB] { return 'b'; }
<UDPTABLE>[fF] { return 'f'; } <UDPTABLE>[fF] { return 'f'; }
<UDPTABLE>[rR] { return 'r'; } <UDPTABLE>[rR] { return 'r'; }

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #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 #endif
# include <cassert> # include <cassert>
@ -499,16 +499,25 @@ bool NetUDP::set_sequ_(const string&input, char output)
switch (to[edge]) { switch (to[edge]) {
case '0': case '0':
// Notice that I might have caught this edge already
if (sfrm->pins[edge].zer != sto) {
assert(sfrm->pins[edge].zer == 0); assert(sfrm->pins[edge].zer == 0);
sfrm->pins[edge].zer = sto; sfrm->pins[edge].zer = sto;
}
break; break;
case '1': case '1':
// Notice that I might have caught this edge already
if (sfrm->pins[edge].one != sto) {
assert(sfrm->pins[edge].one == 0); assert(sfrm->pins[edge].one == 0);
sfrm->pins[edge].one = sto; sfrm->pins[edge].one = sto;
}
break; break;
case 'x': case 'x':
// Notice that I might have caught this edge already
if (sfrm->pins[edge].xxx != sto) {
assert(sfrm->pins[edge].xxx == 0); assert(sfrm->pins[edge].xxx == 0);
sfrm->pins[edge].xxx = sto; sfrm->pins[edge].xxx = sto;
}
break; break;
} }
@ -539,6 +548,31 @@ bool NetUDP::sequ_glob_(string input, char output)
sequ_glob_(input, output); sequ_glob_(input, output);
return true; 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 case '*': // Iterate over all the edges
input[idx] = 'r'; input[idx] = 'r';
sequ_glob_(input, output); sequ_glob_(input, output);
@ -811,6 +845,9 @@ NetNet* Design::find_signal(bool (*func)(const NetNet*))
/* /*
* $Log: netlist.cc,v $ * $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 * Revision 1.13 1998/12/17 23:54:58 steve
* VVM support for small sequential UDP objects. * VVM support for small sequential UDP objects.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #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 #endif
/* /*
@ -352,6 +352,7 @@ class NetLogic : public NetNode {
* edge. * edge.
* *
* Set_table takes as input a string with one letter per pin. The * 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: * valid characters are:
* *
* 0, 1, x -- The levels * 0, 1, x -- The levels
@ -362,6 +363,17 @@ class NetLogic : public NetNode {
* P -- (0x) * P -- (0x)
* N -- (1x) * 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 * COMBINATIONAL
* The logic table is a map between the input levels and the * 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 * 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 $ * $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 * Revision 1.13 1998/12/17 23:54:58 steve
* VVM support for small sequential UDP objects. * VVM support for small sequential UDP objects.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #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 #endif
# include "parse_misc.h" # include "parse_misc.h"
@ -731,6 +731,9 @@ udp_input_sym
| '*' { $$ = '*'; } | '*' { $$ = '*'; }
| 'f' { $$ = 'f'; } | 'f' { $$ = 'f'; }
| 'r' { $$ = 'r'; } | 'r' { $$ = 'r'; }
| 'n' { $$ = 'n'; }
| 'p' { $$ = 'p'; }
| '_' { $$ = '_'; }
; ;
udp_output_sym udp_output_sym