- A Logic Circuit Simulation Library in C++





lcs::Register< bits, edgeType, delay > Class Template Reference

#include <register.h>

Inheritance diagram for lcs::Register< bits, edgeType, delay >:

lcs::Module List of all members.

Detailed Description

template<unsigned int bits = 1, PulseEdge edgeType = POS_EDGE, unsigned int delay = 0>
class lcs::Register< bits, edgeType, delay >

This class encapsulates a real hardware-like register element. It is a template class which takes three template parameters.

Parameters:
bits The number of bits in the register.
edgeType The edge type at which the data at the input of the register is transefered to the output.
delay The delay with which the input should be transferred after the triggering edge occurs at the clock input. This can considered as a propogation delay.


Public Member Functions

 Register (const Bus< bits > &out, const InputBus< bits > &in, const InputBus< 1 > &clk)
virtual ~Register ()
virtual void onPosEdge (int portId)
virtual void onNegEdge (int portId)
const LineState operator[] (const int &i)


Constructor & Destructor Documentation

template<unsigned int bits, PulseEdge edgeType, unsigned int delay>
lcs::Register< bits, edgeType, delay >::Register ( const Bus< bits > &  out,
const InputBus< bits > &  in,
const InputBus< 1 > &  clk 
)

Constructor. The only usefull constructor.

Parameters:
out The output bus, or the read bus, of the register.
in The input bus, or the write bus, of the register.

template<unsigned int bits, PulseEdge edgeType, unsigned int delay>
lcs::Register< bits, edgeType, delay >::~Register (  )  [virtual]

Destructor.


Member Function Documentation

template<unsigned int bits = 1, PulseEdge edgeType = POS_EDGE, unsigned int delay = 0>
virtual void lcs::Register< bits, edgeType, delay >::onNegEdge ( int  portId  )  [inline, virtual]

Internal function which will never be used by a user of libLCS.

Reimplemented from lcs::Module.

template<unsigned int bits = 1, PulseEdge edgeType = POS_EDGE, unsigned int delay = 0>
virtual void lcs::Register< bits, edgeType, delay >::onPosEdge ( int  portId  )  [inline, virtual]

Internal function which will never be used by a user of libLCS.

Reimplemented from lcs::Module.

template<unsigned int bits = 1, PulseEdge edgeType = POS_EDGE, unsigned int delay = 0>
const LineState lcs::Register< bits, edgeType, delay >::operator[] ( const int &  i  )  [inline]

An overloaded read only operator[] which can be used to read the line state of the i-th bit of the register.


Copyright © 2006, 2007 Siva Chandra