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

<<< Previous CBOLD Reference Home Next >>>

 

7.2.3. Connections to Bundles

Entire bundles can be connected with the << operator.

When both operands of the << operator are bundles, the operator connects the corresponding members of each bundle together. Both bundles must have the same type. If they do not, the CBOLD framework will report a runtime error.

When the left operand of the << operator is a string literal, the operator uses the string literal as a prefix for connection names. The operator creates connection names by combining the prefix with the name of the bundle's members.

It is illegal for the right operand of the << operator to be a string literal if the left operand is a bundle.

Some bundle connection example statements:

Jtag        << MyFPGA.Jtag;  // connect MyFPGA's Jtag bundle to this module's JTag bundle
"JF_"       << MyFPGA.Jtag;  // connect the members of MyFPGA's Jtag bundles to named connections prefixed with JF_
MyFPGA.Jtag << "JF_";        // illegal -- the prefix string must be to the left of <<

If Jtag and MyFPGA.Jtag are both instances of this class...

class CB_JTAG : public TBundle {  // JTAG bundle
public:
  port TMS;
  port TDI;
  port TDO;
  port TCK;
  ...
};

...then the first example statement above is equivalent to...

Jtag.TMS  << MyFPGA.Jtag.TMS;
Jtag.TDI  << MyFPGA.Jtag.TDI;
Jtag.TDO  << MyFPGA.Jtag.TDO;
Jtag.TCK  << MyFPGA.Jtag.TCK;

...and the second example statement above is equivalent to:

"JF_TMS"  << MyFPGA.Jtag.TMS;
"JF_TDI"  << MyFPGA.Jtag.TDI;
"JF_TDO"  << MyFPGA.Jtag.TDO;
"JF_TCK"  << MyFPGA.Jtag.TCK;

 

<<< Previous CBOLD Reference Home Next >>>

Legal Copyright © 2007 by Coolquest, Inc. Contact