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

<<< Previous CBOLD Reference Home Next >>>

 

4.3. TBundle

TBundle acts like a complex TPort. It is used to provide connectivity between modules. Classes derived from TBundle and instances of such classes are referred to as bundles. TBundle's only user-coded member function is Register(). TBundle is essentially a container for creating sets of ports. Despite its name, a TBundle is not a bus, net, or group of nets. It is more like a complex connector. As an example, consider this DB13W3 connector:
DB13W3_Diagram_gif

This type of connector integrates three coax and ten individual connections. It was used for analog RGB video monitors. If, for example, your design had a Video subsystem and a FrontPanel subsystem in which a DB13W3 connector was instantiated, the interface between the two subsystems might be expressed as the following bundle:

class CB_Video_FrontPanel : public TBundle {   // Video-to-FrontPanel Interface
public:
  port R;
  port G;
  port B;
  port V_SYNC;
  port C_SYNC;
  port H_SYNC;
//port GND;          // omit ground -- by convention, ground connections are made via a dedicated GND port on each module
  port SENSE_GND;    // but this analog ground is a separate net from GND
  port SENSE;        // AR_BUS(2,0) three analog sense lines
  virtual void Register() {
    ...
  }
};
You would then add a CB_Video_FrontPanel member to each of the subsystems...
class CM_Video : public TModule {        // Video Subsystem
public:
  CB_Video_FrontPanel   FP;              // interface to FrontPanel subsystem
  ...                                    // e.g., interfaces to other subsystems
};
 
class CM_FrontPanel : public TModule {   // FrontPanel Subsystem
public:
  CB_Video_FrontPanel   VI;              // interface to Video subsystem
  ...                                    // e.g., interfaces to other subsystems
};
... and connect the two subsystems at the Root level:
class CM_Root : public TRootModule {     // Root of Hierarchy
  CM_Video       Video;                  // Video      Subsystem
  CM_FrontPanel  FrontPanel;             // FrontPanel Subsystem
  ...
  virtual void Connect() {
    ...
    "VI_" << Video.FP << FrontPanel.VI;  // connect the interfaces between Video and FrontPanel
    ...
  }
};

"VI_" is known as a net prefix. CBOLD uses the prefix to create net names based on the names of bundle members. The single connection statement above results in the creation of the following net names:

VI_R
VI_G
VI_B
VI_V_SYNC
VI_C_SYNC
VI_H_SYNC
VI_SENSE_GND
VI_SENSE0
VI_SENSE1
VI_SENSE2

A TBundle may have member TBundle's as well as member ports:

class CB_Color : public TBundle {
public:
  port R;
  port G;
  port B;
  virtual void Register() {
    ...
  }
};
 
class CB_Sync : public TBundle {
public:
  port V_SYNC;
  port C_SYNC;
  port H_SYNC;
  virtual void Register() {
    ...
  }
};
 
class CB_RGB_Video : public TBundle {
public:
  CB_Color  Color;
  CB_Sync   Sync;
  port      SENSE_GND;
  port      SENSE;        // AR_BUS(2,0) three analog sense lines
  virtual void Register() {
    ...
  }
};

For details on making connections to bundles or members of bundles, see Connections.

 

<<< Previous CBOLD Reference Home Next >>>

Legal Copyright © 2007 by Coolquest, Inc. Contact