Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

vhdl_const Class Reference

Base class for VHDL constants. More...

#include <const.h>

Inheritance diagram for vhdl_const:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 vhdl_const (void)
void * operator new (unsigned int num_bytes)
 Disallow the default new operator.

void * operator new (unsigned int num_bytes, pool *mem_pool)
 Overloaded new.

virtual const uint get_cn_kind (void)
 shared virtual functions

virtual void set_val (int i)
 const_range_signed

virtual const int get_val (void)
virtual void set_uval (uint u)
 const_range_unsigned

virtual const uint get_uval (void)
virtual void set_real (float f)
 const_real

virtual const float get_real (void)
virtual void set_agg_ty (pType ty)
virtual const pType get_agg_ty (void)
virtual void set_tree (NODE *tree)
virtual const NODEget_tree (void)

Detailed Description

Base class for VHDL constants.

Like types in VHDL, constants come in two flavors: named and anonymous.

Named constants are created by:

The value of a declared constant may be deferred until the design is elaborated. However, after elaboration the values of all named constants must be known.

The classes in this file define anonymous constants. If the object is a named constant, an anonymous constant will be allocated and it will be used to initialize a sym_const object.

There are five kinds of constant:

Note that an enumeration value is a named constant. So it will have a symbol and an associated const_range object giving the enumeration value.

Ranges are limited to bounds that can be represented in 32-bits. Note that "x" and "z" are not scalar values. In VHDL "x" and "z" are enumeration values defined as part of packages like std_logic.

Array and record constants are aggragates, whose type is defined by their context. Depending on where they are used (e.g., in a process or in a function) an aggragate will be implemented by static initialized data or via generated code. The choice also depends on the aggragate itself. Even in cases where an aggragate could be created in static initialized data, it may be more efficient to generate code for it.

The choice of what to do with an aggragate is made after the QT trees have been constructed. So initially all aggragate constants have a pointer to a QT tree that represents the aggragate. This also allows aggragates to be composed of sub-aggragates. Later these can all be "flattened".

Definition at line 105 of file const.h.


Constructor & Destructor Documentation

vhdl_const::vhdl_const void   )  [inline]
 

Definition at line 107 of file const.h.

00107 { }


Member Function Documentation

virtual const pType vhdl_const::get_agg_ty void   )  [inline, virtual]
 

Reimplemented in const_agg.

Definition at line 169 of file const.h.

References NULL.

00170     {
00171         return NULL;
00172     }

virtual const uint vhdl_const::get_cn_kind void   )  [inline, virtual]
 

shared virtual functions

Reimplemented in const_range_signed, const_range_unsigned, const_real, and const_agg.

Definition at line 125 of file const.h.

References bad_constant, and uint.

00125 { return bad_constant; }

virtual const float vhdl_const::get_real void   )  [inline, virtual]
 

Reimplemented in const_real.

Definition at line 157 of file const.h.

References FALSE.

00158     {
00159         assert( FALSE );
00160         return (float)0.0;
00161     }

virtual const NODE* vhdl_const::get_tree void   )  [inline, virtual]
 

Reimplemented in const_agg.

Definition at line 180 of file const.h.

References NULL.

00181     {
00182         return NULL;
00183     }

virtual const uint vhdl_const::get_uval void   )  [inline, virtual]
 

Reimplemented in const_range_unsigned.

Definition at line 146 of file const.h.

References FALSE, and uint.

00147     {
00148         assert( FALSE );
00149         return 0;
00150     }

virtual const int vhdl_const::get_val void   )  [inline, virtual]
 

Reimplemented in const_range_signed.

Definition at line 135 of file const.h.

References FALSE.

00136     {
00137         assert( FALSE );
00138         return 0;
00139     }

void* vhdl_const::operator new unsigned int  num_bytes,
pool mem_pool
[inline]
 

Overloaded new.

Definition at line 119 of file const.h.

References pool::GetMem().

00120   {
00121     return mem_pool->GetMem( num_bytes );
00122   }

void* vhdl_const::operator new unsigned int  num_bytes  )  [inline]
 

Disallow the default new operator.

Definition at line 110 of file const.h.

References FALSE, and NULL.

00111   {
00112     assert( FALSE );
00113     return NULL;
00114   }

virtual void vhdl_const::set_agg_ty pType  ty  )  [inline, virtual]
 

Reimplemented in const_agg.

Definition at line 165 of file const.h.

References FALSE.

00166     {
00167         assert( FALSE );
00168     }    

virtual void vhdl_const::set_real float  f  )  [inline, virtual]
 

const_real

Reimplemented in const_real.

Definition at line 153 of file const.h.

References FALSE.

00154     {
00155         assert( FALSE );
00156     }

virtual void vhdl_const::set_tree NODE tree  )  [inline, virtual]
 

Reimplemented in const_agg.

Definition at line 176 of file const.h.

References FALSE.

00177     {
00178         assert( FALSE );
00179     }

virtual void vhdl_const::set_uval uint  u  )  [inline, virtual]
 

const_range_unsigned

Reimplemented in const_range_unsigned.

Definition at line 142 of file const.h.

References FALSE.

00143     {
00144         assert( FALSE );
00145     }

virtual void vhdl_const::set_val int  i  )  [inline, virtual]
 

const_range_signed

Reimplemented in const_range_signed.

Definition at line 131 of file const.h.

References FALSE.

00132     {
00133         assert( FALSE );
00134     }


The documentation for this class was generated from the following file:
Generated on Wed Mar 31 21:16:14 2004 for Data Structures for a VHDL Compiler by doxygen 1.3.3