Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 107 lines (94 sloc) 3.19 kb
91aad30 Parse UDP primitives all the way to pform.
steve authored
1 #ifndef __PUdp_H
2 #define __PUdp_H
3 /*
b734ecf Macintosh compilers do not support ident.
steve authored
4 * Copyright (c) 1998-2000 Stephen Williams (steve@picturel.com)
91aad30 Parse UDP primitives all the way to pform.
steve authored
5 *
6 * This source code is free software; you can redistribute it
7 * and/or modify it in source code form under the terms of the GNU
8 * General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */
b734ecf Macintosh compilers do not support ident.
steve authored
21 #if !defined(WINNT) && !defined(macintosh)
66cf3ec More UDP consolidation from Stephan Boettcher.
steve authored
22 #ident "$Id: PUdp.h,v 1.5 2001/04/22 23:09:45 steve Exp $"
91aad30 Parse UDP primitives all the way to pform.
steve authored
23 #endif
24
e097c99 Elaborate UDP devices,
steve authored
25 # include <map>
d0afc9a Get rid of the STL vector template.
steve authored
26 # include "svector.h"
e097c99 Elaborate UDP devices,
steve authored
27 # include <string>
91aad30 Parse UDP primitives all the way to pform.
steve authored
28 # include "verinum.h"
29
d0afc9a Get rid of the STL vector template.
steve authored
30 svector<string>::svector<string>(unsigned size)
31 : nitems_(size), items_(new string[size])
32 {
33 }
34
91aad30 Parse UDP primitives all the way to pform.
steve authored
35 /*
36 * This class represents a parsed UDP. This is a much simpler object
37 * then a module or macromodule.
38 *
39 * - all ports are scaler,
40 * - pin 0 (the first port) is always output,
41 * and the remaining pins are input.
42 *
43 * Thus, the ports can be represented as an ordered list of pin names.
44 * If the output port is declared as a register in the Verilog source,
45 * then this is a sequential UDP and the sequential flag is set to true.
46 *
47 * STATE TABLE
48 * Each entry in the state table is given as a string with the same
49 * number of characters as inputs. If the UDP is sequential, a
50 * character is also included at the end of the string to represent
51 * the current output.
52 *
53 * If the UDP is sequential, the "initial" member is taken to be the
54 * intial value assigned in the source, or 'x' if none is given.
55 */
56 class PUdp {
57
58 public:
59 explicit PUdp(const string&n, unsigned nports)
60 : ports(nports), sequential(false), initial(verinum::Vx), name_(n) { }
61
d0afc9a Get rid of the STL vector template.
steve authored
62 svector<string>ports;
91aad30 Parse UDP primitives all the way to pform.
steve authored
63 bool sequential;
64
d0afc9a Get rid of the STL vector template.
steve authored
65 svector<string>tinput;
66 svector<char> tcurrent;
67 svector<char> toutput;
91aad30 Parse UDP primitives all the way to pform.
steve authored
68
69 verinum::V initial;
70
e097c99 Elaborate UDP devices,
steve authored
71 map<string,string> attributes;
72
91aad30 Parse UDP primitives all the way to pform.
steve authored
73 void dump(ostream&out) const;
74
75 const string name_;
66cf3ec More UDP consolidation from Stephan Boettcher.
steve authored
76 private:
91aad30 Parse UDP primitives all the way to pform.
steve authored
77
78 private: // Not implemented
79 PUdp(const PUdp&);
80 PUdp& operator= (const PUdp&);
81 };
82
83 /*
84 * $Log: PUdp.h,v $
66cf3ec More UDP consolidation from Stephan Boettcher.
steve authored
85 * Revision 1.5 2001/04/22 23:09:45 steve
86 * More UDP consolidation from Stephan Boettcher.
87 *
b734ecf Macintosh compilers do not support ident.
steve authored
88 * Revision 1.4 2000/02/23 02:56:53 steve
89 * Macintosh compilers do not support ident.
90 *
d0afc9a Get rid of the STL vector template.
steve authored
91 * Revision 1.3 1999/06/15 03:44:53 steve
92 * Get rid of the STL vector template.
93 *
e097c99 Elaborate UDP devices,
steve authored
94 * Revision 1.2 1998/12/01 00:42:13 steve
95 * Elaborate UDP devices,
96 * Support UDP type attributes, and
97 * pass those attributes to nodes that
98 * are instantiated by elaboration,
99 * Put modules into a map instead of
100 * a simple list.
101 *
91aad30 Parse UDP primitives all the way to pform.
steve authored
102 * Revision 1.1 1998/11/25 02:35:53 steve
103 * Parse UDP primitives all the way to pform.
104 *
105 */
106 #endif
Something went wrong with that request. Please try again.