- A Logic Circuit Simulation Library in C++





lcs::Counter< bits, event > Class Template Reference

#include <counter.h>

Inheritance diagram for lcs::Counter< bits, event >:

lcs::Module List of all members.

Detailed Description

template<unsigned int bits, LineEvent event = LINE_POS_EDGE>
class lcs::Counter< bits, event >

A class which encapsulates a counter module. This counter module increments the count on its output bus when a line event occurs on its input bus. The line event can be of any type.

Parameters:
bits The bit-width of the counter
event The event on the input bus which triggers the counter


Public Member Functions

 Counter (const Bus< bits > &output, const InputBus< 1 > &clk)
virtual ~Counter ()
virtual void onPosEdge (int portId)
virtual void onNegEdge (int portId)
virtual void onStateChange (int portId)


Constructor & Destructor Documentation

template<unsigned int bits, LineEvent event>
lcs::Counter< bits, event >::Counter ( const Bus< bits > &  output,
const InputBus< 1 > &  clk 
)

Constructor

Parameters:
output The output bus of the counter
clk The input bus of the counter.

template<unsigned int bits, LineEvent event>
lcs::Counter< bits, event >::~Counter (  )  [virtual]

Destructor


Member Function Documentation

template<unsigned int bits, LineEvent event = LINE_POS_EDGE>
virtual void lcs::Counter< bits, event >::onNegEdge ( int  portId  )  [inline, virtual]

A subclass of the class Module should override this function so that it can be notified of a negetive edge on its input busses. If a lcs::LINE_NEG_EDGE event occurs on an input bus, the bus will call this function on the corresponding module object as a notification of the occurance of the event.

Reimplemented from lcs::Module.

template<unsigned int bits, LineEvent event = LINE_POS_EDGE>
virtual void lcs::Counter< bits, event >::onPosEdge ( int  portId  )  [inline, virtual]

A subclass of the class Module should override this function so that it can be notified of a positive edge on its input busses. If a lcs::LINE_POS_EDGE event occurs on an input bus, the bus will call this function on the corresponding module object as a notification of the occurance of the event.

Reimplemented from lcs::Module.

template<unsigned int bits, LineEvent event = LINE_POS_EDGE>
virtual void lcs::Counter< bits, event >::onStateChange ( int  portId  )  [inline, virtual]

A subclass of the class Module should override this function so that it can be notified of a state change on its input busses. If a lcs::LINE_STATE_CHANGE event occurs on an input bus, the bus will call this function on the corresponding module object as a notification of the occurance of the event.

Reimplemented from lcs::Module.


Copyright © 2006, 2007 Siva Chandra