Highlights from
Embedded Coder Support Package for Green Hills MULTI IDE (R2012b)

image thumbnail

Embedded Coder Support Package for Green Hills MULTI IDE (R2012b)

by

 

Embedded Coder integration for creating models that run directly in Green Hills MULTI IDE

ghsmulti(varargin)
function h = ghsmulti(varargin)
%Support for Green Hills(R) MULTI(R) IDE will be removed in a future release.
%GHSMULTI Create an IDE Link object for use with Green Hills MULTI.
%   H = GHSMULTI('PropertyName',PropertyValue,...) returns an object H
%   that IDE Link software uses to communicate with Green Hills MULTI IDE.  
%   This object can also be used to access memory and control the execution
%   of the processor connected to the MULTI IDE. This command creates a
%   service in the host machine.
%   
%   Before running the GHSMULTI command for the first time, use GHSMULTICONFIG
%   to configure IDE Link to identify the location of your MULTI
%   software, your processor configuration, your debug server and the host
%   name and port number of the service to be created. 
%
%   All parameters passed to GHSMULTI are interpreted as object property
%   definitions. Each property definition consists of a property name
%   followed by the desired property value. After the object is
%   created, these values can be retrieved or modified depending on the
%   property attributes. 
%
%   Property Names: 
%   'hostname' - The host name of the machine where the IDE Link
%                Service for Green Hills MULTI will run. Specifying HOSTNAME
%                overrides the host name specified through GHSMULTICONFIG.
%   'portnum'  - The port number of the IDE Link Service for 
%                Green Hills MULTI. Specifying PORTNUM overrides the port
%                number specified through GHSMULTICONFIG. 
%   'timeout'  - The maximum period (in seconds) that a GHSMULTI method waits
%                for a processor operation to complete (e.g. load).
%                If this time is exceeded, a time-out error is thrown.
%                The default time-out value is 10 seconds.
%
%   Examples: 
%   h = ghsmulti             % creates or connects to a service at the 
%                            % default host name and port number 
%
%   h = ghsmulti('hostname','localhost','portnum',4444); % creates or connects to a 
%                                                        % service running on the specified 
%                                                        % host name and port number 
%   h = ghsmulti('timeout',20);
%
%
%   The GHSMULTI object provides methods you can use for communicating with
%   MULTI and the processor. For more information on a given GHSMULTI
%   method, use the following syntax:   
%
%     help ghsmulti/(method)
%
%   -------------------------------
%   Methods for GHSMULTI Object
%   -------------------------------
%
%   add         - Place a file in the current MULTI project.
%   activate    - Cause the specified file to become active in MULTI.
%   address     - Return the address value of specified target symbol.
%   build       - Build a MULTI project.
%   cd          - Change current working directory.
%   dir         - List MULTI working directory.
%   disp        - Display properties of MULTI object.
%   display     - Display a MULTI object.
%   halt        - Immediately terminate execution of target processor.
%   info        - Return information about the target processor. 
%   insert      - Add a debug point into MULTI.
%   isrunning   - Check if the target processor is executing.
%   list        - Return information on a variable, function, data type or project.
%   load        - Transfer a program file to the target processor.
%   new         - Create an empty file in MULTI.
%   open        - Load a file into the MULTI IDE.
%   profile     - Obtain statistics on current program execution.
%   read        - Retrieve a block of data from the target processor's memory.
%   regread     - Return the value in the specified processor register.	 
%   regwrite    - Place passed value into the specified processor register.
%   reload      - Repeat load of the most recently loaded program file.
%   remove      - Remove a file from the current MULTI Project.
%   reset       - Initiate software reset of board.
%   restart     - Restore the target processor to the program entry point.
%   run         - Initiate execution of target processor.
%   setbuildopt - Set the build option for the project.
%   symbol      - Read the target processor's entire symbol table.
%   write       - Write a block of data into the target processor's memory.
%
%   See also GHSMULTICONFIG.

% Copyright 2006-2011 The MathWorks, Inc.

%% Check if Embedded Coder license is available
linkfoundation.autointerface.baselink.checkOutLicense({'ishostonly', 0});

%% Check if this platform is supported
linkfoundation.autointerface.baselink.checkPlatformSupport(mfilename, ...
    ghsmultiext.Utilities.getPlatformsSupported());

%% Create MULTI handle(s)
try
    CheckPrefs();
    
    % Get and check properties, if specified by user
    args = CheckInputs(varargin);
    specifiedProps = {args{1:2:end}};
    if ~iscellstr(specifiedProps)
        error(message('ERRORHANDLER:utils:InvalidPropertyName'))
        %else
        %for now we don't need to look at specifiedProps.
        %    specifiedProps = lower(specifiedProps);
    end
    

     h = ghsmultiext.autointerface.ghsmulti(args{:});

catch consException
    %should we be doing any parsing here!
    rethrow(consException);
end


%% ------------------------------------------------------------------------
function args = CheckInputs(args)
nargs = length(args);
if(mod(nargs,2)~=0)
    error(message('ERRORHANDLER:utils:ConstructorInputsNotInPairs', 'GHSMULTI'));
end

%% ------------------------------------------------------------------------
function CheckPrefs()
CheckPrefEntry('multidir');
CheckPrefEntry('config');
CheckPrefEntry('debugconnection');
CheckPrefAndSetDefault('startmulti',true);
CheckPrefAndSetDefault('hostname','localhost');
CheckPrefAndSetDefault('portnum',4444);

%% ------------------------------------------------------------------------
function CheckPrefEntry(theEntry)
ghsmultiext.Utilities.checkPrefEntry(theEntry);

%% ------------------------------------------------------------------------
function CheckPrefAndSetDefault(theEntry,defaultval)
EntryVal = ghsmultiext.Utilities.multilinkpref('getpref',theEntry);
if (isempty(EntryVal))
    ghsmultiext.Utilities.multilinkpref('setpref',theEntry,defaultval);
end
% [EOF] GHSMULTI.m

Contact us