module ti.sdo.utils.MultiProc

Processor Id Module Manager

Many IPC modules require the ability to uniquely specify and identify processors in a multi-processor environment. The MultiProc module centeralizes processor id management into one module. Since this configuration is almost always universally required, most IPC applications require supplying configuration of this module. [ more ... ]
XDCspec summary sourced in ti/sdo/utils/MultiProc.xdc
module MultiProc {  ...
// inherits xdc.runtime.IModule
C synopsis target-domain
XDCscript usage meta-domain
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
module-wide constants & types
 
    var obj = new MultiProc.ModuleView// ;
        obj.id = UInt16  ...
        obj.numProcessors = UInt16  ...
        obj.nameList = String[]  ...
module-wide config parameters
        msg: "A_invalidMultiProcId: Invalid MultiProc id"
    };
 
module-wide functions
    MultiProc.getIdMeta// Meta version of getId( String name ) returns UInt16
    MultiProc.setConfig// Configure the MultiProc module( String name, String[] nameList ) returns Void
 
XDCspec declarations sourced in ti/sdo/utils/MultiProc.xdc
package ti.sdo.utils;
 
module MultiProc {
module-wide constants & types
    const UInt16 INVALIDID// Invalid processor id constant = 0xFFFF;
 
    metaonly struct ModuleView//  {
        UInt16 id;
        UInt16 numProcessors;
        String nameList[];
    };
module-wide config parameters
        msg: "A_invalidMultiProcId: Invalid MultiProc id"
    };
 
    metaonly config ViewInfo.Instance rovViewInfo//  = ViewInfo.create;
module-wide functions
    metaonly UInt16 getIdMeta// Meta version of getId( String name );
    metaonly Void setConfig// Configure the MultiProc module( String name, String nameList[] );
}
DETAILS
Many IPC modules require the ability to uniquely specify and identify processors in a multi-processor environment. The MultiProc module centeralizes processor id management into one module. Since this configuration is almost always universally required, most IPC applications require supplying configuration of this module.
Each processor in the MultiProc module may be uniquely identified by either a name string or an integer ranging from 0 to MAXPROCESSORS - 1. Configuration is supplied using the setConfig meta function.
The setConfig function tells the MultiProc module:
  • The specific processor for which the application is being built
  • Which processors out of a set of possible processors on a device are being used by the multi-processor application
Using the information supplied using the setConfig meta function, The numProcessors module configuration and the processor IDs are internally set. Please refer to the documentation for setConfig for more details.
At runtime, the getId call returns the MultiProc id for any processor. At config-time, the getIdMeta call returns the the same value. At both run time and static time, the numProcessors module config is equal to the length of the procNames array supplied in setConfig.
 
const MultiProc.INVALIDID

Invalid processor id constant

XDCscript usage meta-domain
const MultiProc.INVALIDID = 0xFFFF;
C synopsis target-domain
#define MultiProc_INVALIDID (UInt16)0xFFFF
 
DETAILS
This constant denotes that the processor id is not valid.
 
metaonly struct MultiProc.ModuleView
XDCscript usage meta-domain
var obj = new MultiProc.ModuleView;
 
    obj.id = UInt16  ...
    obj.numProcessors = UInt16  ...
    obj.nameList = String[]  ...
 
 
config MultiProc.A_invalidMultiProcId  // module-wide

Assert raised when an invalid processor id is used

XDCscript usage meta-domain
MultiProc.A_invalidMultiProcId = Assert.Desc {
    msg: "A_invalidMultiProcId: Invalid MultiProc id"
};
C synopsis target-domain
extern const Assert_Id MultiProc_A_invalidMultiProcId;
 
 
config MultiProc.numProcessors  // module-wide

Number of processors in the system

XDCscript usage meta-domain
MultiProc.numProcessors = UInt16 1;
C synopsis target-domain
extern const UInt16 MultiProc_numProcessors;
 
DETAILS
This configuration should only be read from and should never be set: numProcessors is internally set by the setConfig meta function. setConfig statically sets the value of this configuration to the length of the supplied nameList array. After setConfig has been called, it is possible to retrive the maximum # of processors by reading this module config either at run-time or at config time.
 
metaonly config MultiProc.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
MultiProc.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
 
metaonly config MultiProc.rovViewInfo  // module-wide
XDCscript usage meta-domain
MultiProc.rovViewInfo = ViewInfo.Instance ViewInfo.create;
 
 
metaonly MultiProc.getIdMeta( )  // module-wide

Meta version of getId

XDCscript usage meta-domain
MultiProc.getIdMeta( String name ) returns UInt16
 
DETAILS
Statically returns the internally set ID based on configuration supplied via setConfig.
 
metaonly MultiProc.setConfig( )  // module-wide

Configure the MultiProc module

XDCscript usage meta-domain
MultiProc.setConfig( String name, String[] nameList ) returns Void
 
DETAILS
Configuration of the MultiProc module is primarily accomplished using the setConfig API at config time. The setConfig API allows the MultiProc module to identify:
  • Which is the local processor
  • Which processors are being used
The second of these two pieces of information is supplied via the nameList argument. The nameList is a non-empty set of distinct processors valid for the particular device. For a list of valid processor names for a given device, please refer to the : Table of Valid Names for Each Device.
The local processor is identified by using a single name from nameList. A MultiProc id is internally set to the index of 'name' in the supplied 'nameList'. If the local processor is not known at static time, it is possible to supply a null name. MultiProc will set the local id to INVALIDID until it is set at runtime using setLocalId.
 
module-wide built-ins

C synopsis target-domain
Types_ModuleId MultiProc_Module_id( );
// Get this module's unique id
 
Bool MultiProc_Module_startupDone( );
// Test if this module has completed startup
 
IHeap_Handle MultiProc_Module_heap( );
// The heap from which this module allocates memory
 
Bool MultiProc_Module_hasMask( );
// Test whether this module has a diagnostics mask
 
Bits16 MultiProc_Module_getMask( );
// Returns the diagnostics mask for this module
 
Void MultiProc_Module_setMask( Bits16 mask );
// Set the diagnostics mask for this module
generated on Fri, 09 Apr 2010 01:41:16 GMT