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

<<< Previous CBOLD Reference Home Next >>>

 

7.2.7. The wireall() Function

The CBOLD framework provides wire() and wireall() to automate common connecting tasks. The functions are named after the verb wire, not the noun.

Of the two functions, wireall() is the most commonly used:

wireall(  "GND" );                  // connect all GND ports to the named connection "GND"
wireall(   GND  );                  // connect all GND ports to this module's GND port
wireall(  VCC5, "VPOS5" );          // connect all VPOS5 ports to this module's VCC5 port
wireall( "/NC", "NC"    );          // connect all NC ports to the global no-connect net

The wireall() function searches through all member modules and parts (but not bundles) looking for ports with the specified name. It connects such ports to the specified port of this module or the specified named connection.

N.B.: The first example above connects the GND ports of all members to the named connection "GND". If this module has a GND port, it is not connected to "GND". The second example above does connect this module's GND port, but the connection is not named. The first example is typically found in the Root module, whereas the second example is typical of all other modules:

class CM_Root : public TRootModule {
  ...                       // root modules have no ports
  virtual void Connect() {
    wireall( "GND" );       // create a connection named GND, connect the GND ports of all member modules and parts to it
    ...
  }
};
class CM_MyModule : public TModule {
  ...
  port  GND;                // typical non-root modules have a GND port
  ...
  virtual void Connect() {
    wireall( GND );         // connect the GND ports of all member modules and parts to this module's GND port
    ...
  }
};

The wireall() function ignores bundles, though it is legal for the first argument of the call to be a member port of a bundle that is a member of this module:

wireall( Jtag.TMS );  // connect all TMS ports to the TMS port of this module's Jtag bundle

In this example, Jtag is a member bundle of this module. It has a member port named TMS.

 

<<< Previous CBOLD Reference Home Next >>>

Legal Copyright © 2007 by Coolquest, Inc. Contact