vrq
cnet.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (C) 1997-2007, Mark Hummel
3  * This file is part of Vrq.
4  *
5  * Vrq is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * Vrq is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301 USA
19  *****************************************************************************
20  */
21 /******************************************************************************
22  *
23  *
24  * cnet.hpp
25  * - class definition of net
26  * definition nodes
27  *
28  ******************************************************************************
29  */
30 
31 #ifndef CNET_HPP
32 #define CNET_HPP
33 
34 #include <stdio.h>
35 #include "glue.h"
36 #include "cdecl.h"
37 #include "cnode.h"
38 #include "cportdir.h"
39 
40 
41 class CNode;
42 
46 class CNet: public CDecl
47 {
48 private:
49  CNode* delay;
50  CPortDir* portdir;
51  int scalared;
52  int vectored;
53  int undefined;
54  StrengthPair_t strength;
55 public:
64  CNet( CSymbol* symbol, Coord_t* aLoc, Wire_t wireType,
65  CDataType* dataType, int undefined );
71  virtual CDecl* Clone( CObstack* heap );
76  void PortDir( CPortDir* p ) { portdir = p; }
81  CPortDir* PortDir() { return portdir; }
86  void SetDelay( CNode* aExp ) { delay = aExp; }
91  CNode* GetDelay( void ) { return delay; }
96  int GetUndefined( void ) { return undefined; }
101  void SetUndefined( int value ) { undefined = value; }
106  StrengthPair_t GetStrength() { return strength; }
111  void SetStrength( StrengthPair_t s ) { strength = s; }
116  virtual void SetVectored( int v ) { vectored = v; }
121  virtual int GetVectored() { return vectored; }
126  virtual void SetScalared( int v ) { scalared = v; }
131  virtual int GetScalared() { return scalared; }
136  virtual void Dump( FILE* f );
140  virtual void PreVisit1( int (*func)(CNode*,void*), void* data );
141  virtual void PostVisit1( void (*func)(CNode*, void*), void* data );
142  virtual void PostSubVisit1( CNode* (*func)(CNode*, void*), void* data );
146 protected:
152  void Copy( CObstack* heap, const CNet& net );
153 private:
154  /*
155  * disable copy constructor
156  */
157  CNet( const CNet& net );
158 };
159 
160 
161 #endif // CNET_HPP
Declaration object for nets.
Definition: cnet.h:46
void Copy(CObstack *heap, const CNet &net)
Create a deep copy of given declaration.
StrengthPair_t GetStrength()
Get drive strength.
Definition: cnet.h:106
virtual void SetVectored(int v)
Set vectored attribute.
Definition: cnet.h:116
CNode * GetDelay(void)
Get net delay.
Definition: cnet.h:91
CNet(CSymbol *symbol, Coord_t *aLoc, Wire_t wireType, CDataType *dataType, int undefined)
Create a net declaration.
virtual void PreVisit1(int(*func)(CNode *, void *), void *data)
void PortDir(CPortDir *p)
Set portdir associated with net.
Definition: cnet.h:76
int GetUndefined(void)
Get undefined attribute.
Definition: cnet.h:96
CPortDir * PortDir()
Get portdir associated with net.
Definition: cnet.h:81
Base class for describing data types.
Definition: cdatatype.h:110
Pair of strengths.
Definition: cnode.h:108
Structure to hold file coordinates.
Definition: cdecl.h:47
Holder for character strings.
Definition: csymbol.h:44
Bulk object allocation object.
Definition: cobstack.h:46
virtual void Dump(FILE *f)
Dump net info to file descriptor.
void SetUndefined(int value)
Set undefined attribute.
Definition: cnet.h:101
Primary data structure representing parse tree nodes.
Definition: cnode.h:197
virtual void PostSubVisit1(CNode *(*func)(CNode *, void *), void *data)
virtual CDecl * Clone(CObstack *heap)
Create a clone of this declaration.
Base class for describing declaration objects.
Definition: cdecl.h:164
virtual int GetScalared()
Get scalared attribute.
Definition: cnet.h:131
virtual void PostVisit1(void(*func)(CNode *, void *), void *data)
void SetDelay(CNode *aExp)
Set net delay.
Definition: cnet.h:86
Declaration object for input/output/inout statements.
Definition: cportdir.h:45
Wire_t
Wire types.
Definition: cdecl.h:56
void SetStrength(StrengthPair_t s)
Set drive strength.
Definition: cnet.h:111
virtual int GetVectored()
Get vectored attribute.
Definition: cnet.h:121
virtual void SetScalared(int v)
Set scalared attribute.
Definition: cnet.h:126