- A Logic Circuit Simulation Library in C++





lcs::InOutBus< bits > Class Template Reference

#include <inoutbus.h>

Inheritance diagram for lcs::InOutBus< bits >:

lcs::Bus< bits > lcs::InputBus< bits > lcs::Array1D< T, len > List of all members.

Detailed Description

template<int bits = 1>
class lcs::InOutBus< bits >

A template class which encapsulates bus which can drive modules, as well as serve as their outputs.


Public Member Functions

 InOutBus (void)
 InOutBus (int val)
 InOutBus (const Bus< bits > &b)
 InOutBus (const InOutBus< bits > &b)
virtual ~InOutBus ()
InOutBus< 1 > operator[] (unsigned int i)
void operator= (int a)
void operator= (const LineState &l)
template<int w, ExprType Type, typename LExprType, typename RExprType>
void operator= (const Expression< w, Type, LExprType, RExprType > &expr)
template<int w, ExprType Type, typename LExprType, typename RExprType>
void operator= (const DelayExprPair< w, Type, LExprType, RExprType > &dep)
void operator= (const DelayStatePair &dsp)
template<int w>
const InOutBus< w+bits > operator, (const InOutBus< w > &bus) const
const InOutBus< bits+1 > operator, (const Line &line) const


Constructor & Destructor Documentation

template<int bits>
lcs::InOutBus< bits >::InOutBus ( void   ) 

Default construtor.

template<int bits>
lcs::InOutBus< bits >::InOutBus ( int  val  ) 

Initialised the bus lines two the binary bit equivalent of the integer argument.

template<int bits>
lcs::InOutBus< bits >::InOutBus ( const Bus< bits > &  b  ) 

Generates an InOutBus from a lcs::Bus object.

template<int bits>
lcs::InOutBus< bits >::InOutBus ( const InOutBus< bits > &  b  ) 

Copy constructor.

template<int bits>
lcs::InOutBus< bits >::~InOutBus (  )  [virtual]

Destructor.


Member Function Documentation

template<int bits = 1>
const InOutBus<bits+1> lcs::InOutBus< bits >::operator, ( const Line line  )  const [inline]

The overloaded operator to join a data line to a bus to form a new composite bus. The line to be joined will have to be the right operand. The joined line takes the MSB location in the resulting lcs::Bus object.

Parameters:
line The right operand lcs::Line object.

Reimplemented from lcs::Bus< bits >.

template<int bits = 1>
template<int w>
const InOutBus<w+bits> lcs::InOutBus< bits >::operator, ( const InOutBus< w > &  bus  )  const [inline]

The overloaded operator to join data lines from two busses and form a new composite bus. The right operand bus takes the MSB locations.

Parameters:
bits The width of the left-operand bus
w The width of the right operand bus
bus The right operand lcs::Bus object.

template<int bits = 1>
void lcs::InOutBus< bits >::operator= ( const DelayStatePair dsp  )  [inline]

Assignment operator for assignment with a delay-state pair. An example of usage of this overloaded assignment operator is as follows:

        lcs::Bus<3> b1;
        b1 = (5, lcs::HIGH);
        

In the second line of the above code snippet, an assignment is being made to the lcs::Bus object on the LHS with a delay-state pair in the RHS. The value of delay used here is 5 system time units. Note the use of the neccessary parentheses enclosing the delay-state pair.

Reimplemented from lcs::Bus< bits >.

template<int bits = 1>
template<int w, ExprType Type, typename LExprType, typename RExprType>
void lcs::InOutBus< bits >::operator= ( const DelayExprPair< w, Type, LExprType, RExprType > &  dep  )  [inline]

Assignment operator for assignment with a delay-expression pair. An example of usage of this overloaded assignment operator is as follows:

        lcs::Bus<3> b1(0), b2(5), b3(7);
        b1 = (5, b2 ^ b3);
        

In the second line of the above code snippet, an assignment is being made to the lcs::Bus object on the LHS with a delay-expression pair in the RHS. The value of delay used here is 5 system time units. Note the use of the neccessary parentheses enclosing the delay-expression pair.

Reimplemented from lcs::Bus< bits >.

template<int bits = 1>
template<int w, ExprType Type, typename LExprType, typename RExprType>
void lcs::InOutBus< bits >::operator= ( const Expression< w, Type, LExprType, RExprType > &  expr  )  [inline]

Assignment operator to facilitate assignment using an lcs::Expression object. ie., the operator facilitates assignment with an expression of bitwise operations on the right hand side of the assignment operator.

Reimplemented from lcs::Bus< bits >.

template<int bits = 1>
void lcs::InOutBus< bits >::operator= ( const LineState l  )  [inline]

Assigns a desired linestate to all the lines of the bus.

Reimplemented from lcs::Bus< bits >.

template<int bits = 1>
void lcs::InOutBus< bits >::operator= ( int  a  )  [inline]

Assigns the binary bit equivalent of an integer to the bus lines.

Reimplemented from lcs::Bus< bits >.

template<int bits = 1>
InOutBus<1> lcs::InOutBus< bits >::operator[] ( unsigned int  i  )  [inline]

Overloaded operator which returns a suitable expression object corresponding to the line at index i. This is done so that bit-selects can be used in expressions of bitwise operations. An OutOfRangeException is thrown if the index value i is beyond the bus width.

Reimplemented from lcs::Bus< bits >.


Copyright © 2006, 2007 Siva Chandra