gusucode.com > target工具箱matlab源码程序 > target/extensions/processor/shared/ti/utils/getDspBiosInstallation.m

    function pathValue = getDspBiosInstallation(modelName, proc)
%GETDSPBIOSINSTALLATION Get the DSP/BIOS location that this model should use.

%   Copyright 2010-2012 The MathWorks, Inc.

% This file is used by toolbox/target/extensions/processor/shared/ti/blks/mex/tlc_c/rtdx_util.tlc
% to add appropriate include paths for RTDX during build

% Determine what CCS version the model is configured for
blkTag = get_param(getTgtPrefBlock(modelName), 'tag');
isCCSv4 = strcmpi(blkTag, ticcsext.Utilities.getTICCSv4('tag'));
isCCSv5 = strcmpi(blkTag, ticcsext.Utilities.getTICCSv5('tag'));


if isCCSv4
    
    % If CCS v4, get the DSP/BIOS installation location from
    % xmakefilesetup.
    if nargin==2 && strcmpi(proc,'c2000')
        % Get DSP/BIOS preference for C2000 makefile configuration
        pathHdl = linkfoundation.xmakefile.XMakefilePreferences.getC2000RTDXInstallLocation();
        makefileConfig = 'ticcs_c2000_ccsv4';
    else
        % Get DSP/BIOS preference for C6000-DSP/BIOS makefile configuration
        pathHdl = linkfoundation.xmakefile.XMakefilePreferences.getDSPBIOSEclipseInstallLocation();
        makefileConfig = 'ticcs_c6000_dspbios_ccsv4';
    end
    pathValue = pathHdl.Path;
    
    % Validate the location
    if isempty(pathValue)
        DAStudio.error('TARGETSHARED:utils:EmptyDspBiosInXmakefilesetup', makefileConfig, makefileConfig);
    elseif ~pathHdl.exists()
        DAStudio.error('TARGETSHARED:utils:NonexistentDspBiosInXmakefilesetup', makefileConfig, makefileConfig);
    end

elseif isCCSv5
    % If CCS v5, get the DSP/BIOS installation location from
    % xmakefilesetup.
    if nargin==2 && strcmpi(proc,'c2000')
        % Get DSP/BIOS preference for C2000 makefile configuration
        pathHdl = linkfoundation.xmakefile.XMakefilePreferences.getCCEv5C2000RTDXInstallLocation();
        makefileConfig = 'ticcs_c2000_ccsv5';
    else
        % Get DSP/BIOS preference for C6000-DSP/BIOS makefile configuration
        pathHdl = linkfoundation.xmakefile.XMakefilePreferences.CCEv5DSPBIOSInstallDir();
        makefileConfig = 'ticcs_c6000_dspbios_ccsv5';
    end
    pathValue = pathHdl.Path;
    
    % Validate the location
    if isempty(pathValue)
        DAStudio.error('TARGETSHARED:utils:EmptyDspBiosInXmakefilesetup', makefileConfig, makefileConfig);
    elseif ~pathHdl.exists()
        DAStudio.error('TARGETSHARED:utils:NonexistentDspBiosInXmakefilesetup', makefileConfig, makefileConfig);
    end
    
else % CCSv3
    
    % If CCS v3, get the DSP/BIOS installation location from a known
    % environment variable
    pathValue = '$(BIOS_INSTALL_DIR)';
end