Fix for assertion error when expanding macro.
[iverilog.git] / PDelays.h
blob644c4bd02e06ff0a6b31e09eecd409f631d19957
1 #ifndef __PDelays_H
2 #define __PDelays_H
3 /*
4 * Copyright (c) 1999-2002 Stephen Williams (steve@icarus.com)
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.
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.
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
21 #ifdef HAVE_CVS_IDENT
22 #ident "$Id: PDelays.h,v 1.9 2006/01/03 05:22:14 steve Exp $"
23 #endif
25 # include "svector.h"
26 # include <string>
27 # include <iostream>
29 #ifdef __GNUC__
30 #if __GNUC__ > 2
31 using namespace std;
32 #endif
33 #endif
35 class Design;
36 class NetScope;
37 class NetExpr;
38 class PExpr;
41 * Various PForm objects can carry delays. These delays include rise,
42 * fall and decay times. This class arranges to carry the triplet.
44 class PDelays {
46 public:
47 PDelays();
48 ~PDelays();
50 /* Set the delay expressions. If the delete_flag is true, then
51 this object takes ownership of the expressions, and will
52 delete it in the destructor. */
53 void set_delay(PExpr*);
54 void set_delays(const svector<PExpr*>*del, bool delete_flag=true);
56 void eval_delays(Design*des, NetScope*scope,
57 NetExpr*&rise_time,
58 NetExpr*&fall_time,
59 NetExpr*&decay_time,
60 bool as_nets_flag =false) const;
62 void dump_delays(ostream&out) const;
64 private:
65 PExpr* delay_[3];
66 bool delete_flag_;
68 private: // not implemented
69 PDelays(const PDelays&);
70 PDelays& operator= (const PDelays&);
73 ostream& operator << (ostream&o, const PDelays&);
76 * $Log: PDelays.h,v $
77 * Revision 1.9 2006/01/03 05:22:14 steve
78 * Handle complex net node delays.
80 * Revision 1.8 2006/01/02 05:33:19 steve
81 * Node delays can be more general expressions in structural contexts.
83 * Revision 1.7 2002/08/12 01:34:58 steve
84 * conditional ident string using autoconfig.
86 * Revision 1.6 2002/06/14 03:25:51 steve
87 * Compiler portability.
89 * Revision 1.5 2001/12/29 20:19:31 steve
90 * Do not delete delay expressions of UDP instances.
92 * Revision 1.4 2001/11/22 06:20:59 steve
93 * Use NetScope instead of string for scope path.
95 * Revision 1.3 2001/01/16 02:44:17 steve
96 * Use the iosfwd header if available.
98 * Revision 1.2 2000/02/23 02:56:53 steve
99 * Macintosh compilers do not support ident.
101 * Revision 1.1 1999/09/04 19:11:46 steve
102 * Add support for delayed non-blocking assignments.
105 #endif