Coolquest, Inc. Home Products Support About Contact
cbold_logo_gif C++BOLD Reference Manual cbold_logo_gif

<<< Previous CBOLD Reference Home Next >>>

 

7.3. Connecting Functions and Operators

7.3.1. << operator

This section is under construction. See the Practical Guide to Connecting for connection examples.

The << operator is the most commonly used CBOLD connecting operator. It creates a connection between its left operand and its right operand. The connection information is stored within the module as part of a subbus within the module's subbus list.

A runtime error results if there is a width mismatch between the two operands of the << operator.

Subbusses are discussed below in the Subbusses and Nets and Netlist Extraction sections.

The several forms of the << operator are shown in the table below:

Operator Declaration from cb_shorthand.h Example Use
TPortRange operator<<( TPortRange PortRangeA, TPortRange PortRangeB );
char*      operator<<( char*      CP,         TPortRange PortRange  );
char*      operator<<( TPortRange PortRange,  char*      CP         );
TBundle&   operator<<( TBundle&   BundleA,    TBundle&   BundleB    );
TBundle&   operator<<( char*      Prefix,     TBundle&   Bundle     );
FooPort   << BarPort;
"FOO"     << BarPort;
FooPort   << "BAR";
FooBundle << BarBundle;
"FOO_"    << BarBundle;

The CP operand refers to a named subbus. If the named subbus does not already exist within the module, it will be created, and its width will be the width of the other (PortRange) operand.

When connecting a port range to another port range, the CBOLD framework typically creates an automatically-named subbus, E.g., SB__017.

A runtime error results if BundleA and BundleB do not have the same type.

Prefix does not refer to a named subbus. The << operator uses Prefix to build a subbus name based on the names of Bundle's members.

In C++, the << operator is left-associative. I.e., a << b << c is the same as (a << b ) << c.

 

<<< Previous CBOLD Reference Home Next >>>

Legal Copyright © 2007 by Coolquest, Inc. Contact