Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 79 lines (65 sloc) 2.329 kb
91aad30 Parse UDP primitives all the way to pform.
steve authored
1 #ifndef __PUdp_H
2 #define __PUdp_H
3 /*
27af95d Use perm_strings for named langiage items.
steve authored
4 * Copyright (c) 1998-2004 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 */
21
e097c99 Elaborate UDP devices,
steve authored
22 # include <map>
27af95d Use perm_strings for named langiage items.
steve authored
23 # include "StringHeap.h"
d0afc9a Get rid of the STL vector template.
steve authored
24 # include "svector.h"
91aad30 Parse UDP primitives all the way to pform.
steve authored
25 # include "verinum.h"
26
e6c0629 Add language support for Verilog-2001 attribute
steve authored
27 class PExpr;
28
91aad30 Parse UDP primitives all the way to pform.
steve authored
29 /*
30 * This class represents a parsed UDP. This is a much simpler object
31 * then a module or macromodule.
32 *
cadf4cf Spelling fixes.
steve authored
33 * - all ports are scalar,
91aad30 Parse UDP primitives all the way to pform.
steve authored
34 * - pin 0 (the first port) is always output,
35 * and the remaining pins are input.
36 *
37 * Thus, the ports can be represented as an ordered list of pin names.
38 * If the output port is declared as a register in the Verilog source,
39 * then this is a sequential UDP and the sequential flag is set to true.
40 *
41 * STATE TABLE
42 * Each entry in the state table is given as a string with the same
43 * number of characters as inputs. If the UDP is sequential, a
44 * character is also included at the end of the string to represent
45 * the current output.
46 *
47 * If the UDP is sequential, the "initial" member is taken to be the
e941e7e Spelling fixes.
steve authored
48 * initial value assigned in the source, or 'x' if none is given.
91aad30 Parse UDP primitives all the way to pform.
steve authored
49 */
50 class PUdp {
51
52 public:
27af95d Use perm_strings for named langiage items.
steve authored
53 explicit PUdp(perm_string n, unsigned nports);
91aad30 Parse UDP primitives all the way to pform.
steve authored
54
d0afc9a Get rid of the STL vector template.
steve authored
55 svector<string>ports;
c6453a0 primitive ports can bind bi name.
steve authored
56 unsigned find_port(const char*name);
57
91aad30 Parse UDP primitives all the way to pform.
steve authored
58 bool sequential;
59
d0afc9a Get rid of the STL vector template.
steve authored
60 svector<string>tinput;
61 svector<char> tcurrent;
62 svector<char> toutput;
91aad30 Parse UDP primitives all the way to pform.
steve authored
63
64 verinum::V initial;
65
e6c0629 Add language support for Verilog-2001 attribute
steve authored
66 map<string,PExpr*> attributes;
e097c99 Elaborate UDP devices,
steve authored
67
91aad30 Parse UDP primitives all the way to pform.
steve authored
68 void dump(ostream&out) const;
69
27af95d Use perm_strings for named langiage items.
steve authored
70 perm_string name_;
66cf3ec More UDP consolidation from Stephan Boettcher.
steve authored
71 private:
91aad30 Parse UDP primitives all the way to pform.
steve authored
72
73 private: // Not implemented
74 PUdp(const PUdp&);
75 PUdp& operator= (const PUdp&);
76 };
77
78 #endif
Something went wrong with that request. Please try again.