Clear Filters
Clear Filters

API를 사용하여 젠킨스에서 CLI를 구성하여 아래 f_PSGen.m을 실행하였습니다. 오류가 발생하여, 오류분석 부탁드립니다.

4 views (last 30 days)
정근
정근 on 17 May 2024
Moved: Angelo Yeo on 17 May 2024
■■■■■■■■■■■■■■■■■■■■■ 소스 코드 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
% f_PSGen
% Abstract: function for Polyspace for Simulink Model Only
%
%%% Syntax
% * [chrBFResult,chrCPResult]=f_SLPSGen(chrModelPath, chrProjectPath)
%
%%% Example
% [chrBFResult,chrCPResult]=f_SLPSGen(chrModelPath, chrProjectPath)
%
%%% Input
% * chrModelPath : Simulink Model Path
% * chrProjectPath : Simulink Project Path
%
%%% Output
% * chrBFResult : Bug Finder Result Path
% * chrCPResult : Code Prover Result Path
%
%%% Copyright
% -------------------------------------------------------------------------
% Copyright 2023 Consulting Services, The MathWorks, Inc.
% -------------------------------------------------------------------------
function [chrBFResult,chrCPResult]=f_PSGen(chrModelPath, chrProjectPath,chrLegacyCPath,chrTarget,chrCompiler)
arguments
chrModelPath (1,:) char {mustBeText}
chrProjectPath (1,:) char {mustBeText}
chrLegacyCPath (1,:) char {mustBeText}
chrTarget (1,:) char {mustBeText}
chrCompiler (1,:) char {mustBeText}
end
%Get Current Path for Code Verification
strCurrentPath = fileparts(mfilename('fullpath'));
fprintf('[PJK] Current path: %s\n', strCurrentPath);
%Incase Simulink model , then set up the code generation folder
if( exist(char(chrModelPath),'file') && exist(char(chrProjectPath),'file'))
%% Load Simulink Project to get Cach and CodeGen Folder
hdlSimulinkProject = openProject(char(chrProjectPath));
chrCodeGenFolder = hdlSimulinkProject.SimulinkCodeGenFolder;
chrCacheFolder = hdlSimulinkProject.SimulinkCacheFolder;
fprintf('[PJK] Simulink project loaded. CodeGenFolder: %s, CacheFolder: %s\n', chrCodeGenFolder, chrCacheFolder);
%%Set Reference Project for Simulink Model
hdlProject = openProject(strCurrentPath);
addReference(hdlProject,fileparts(char(chrProjectPath)),"relative");
hdlProject.SimulinkCacheFolder = chrCacheFolder;
hdlProject.SimulinkCodeGenFolder = chrCodeGenFolder;
reload(hdlProject);
fprintf('[PJK] Reference project set. SimulinkCacheFolder: %s, SimulinkCodeGenFolder: %s\n', hdlProject.SimulinkCacheFolder, hdlProject.SimulinkCodeGenFolder);
%Check CodeGen Folder Existing
if( ~exist(chrCodeGenFolder,'dir') )
chrModelPath = [];
end
else
chrModelPath = [];
end
%% Checking Legacy C Code Path Existing
if( ~exist(char(chrLegacyCPath),'dir') )
chrLegacyCPath = [];
end
%%Create Polyspace Project & Run
hPSProject = Polyspace.PSProject(chrModelPath,chrLegacyCPath,chrTarget,chrCompiler);
fprintf('[PJK] Polyspace project created. ModelPath: %s, LegacyCPath: %s, Target: %s, Compiler: %s\n', chrModelPath, chrLegacyCPath, chrTarget, chrCompiler);
%%Run Polyspace for Bug Finder
[chrBFResult,chrCPResult] = hPSProject.run(Polyspace.PSMode.AllMode);
fprintf('[PJK] Polyspace project run. BFResult: %s, CPResult: %s\n', chrBFResult, chrCPResult);
%delete handle
hPSProject.delete();
fprintf('[PJK] Polyspace project deleted.\n');
if( exist(char(chrModelPath),'file') && exist(char(chrProjectPath),'file'))
removeReference(hdlProject,fileparts(char(chrProjectPath)));
hdlProject.SimulinkCacheFolder = '';
hdlProject.SimulinkCodeGenFolder = '';
fprintf('[PJK] Reference removed. SimulinkCacheFolder: %s, SimulinkCodeGenFolder: %s\n', hdlProject.SimulinkCacheFolder, hdlProject.SimulinkCodeGenFolder);
end
end
■■■■■■■■■■■■■■■■■■■■■ Error Log ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Generating MATLAB script with content:
cd 'D:\t2-master-work-Model\work\Model';runAll;
#################### Starting command output ####################
[PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07] $ cmd.exe /C .matlab\YJKDTKes\run_matlab_command.bat "cd('D:\Jenkins\workspace\PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07/.matlab/YJKDTKes');command_lKfQMwWL"
---------This MATLAB R2021a Version Supported -------------
[PJK] Current path: D:\t2-master-work-Model\work\Model\Utilities\M08
[PJK] Polyspace project created. ModelPath: , LegacyCPath: D:\t2-master-work-Model\work\Model\LegacyCProject\SU2idL_FL-ICU-HMID-23-07, Target: powerpc, Compiler: greenhills
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
{���� ��� �� ������ ߻���: rmdir
���͸��� ���ŵ��� ʾҽ��ϴ.
���� ߻: Polyspace.PSProject/saveLegacy (45�� ����)
rmdir(chrFolderPath,'s');
���� ߻: Polyspace.PSProject/run (63�� ����)
obj.saveLegacy(true);
���� ߻: f_PSGen (68�� ����)
[chrBFResult,chrCPResult] = hPSProject.run(Polyspace.PSMode.AllMode);
���� ߻: PSGen (53�� ����)
f_PSGen(tblPSList.ModelPath{index},
tblPSList.ProjectPath{index},tblPSList.LegacyCPath{index},tblPSList.Target{index},tblPSList.Compiler{index}
);
���� ߻: runAll (8�� ����)
PSGen;
���� ߻: command_lKfQMwWL (2�� ����)
cd 'D:\t2-master-work-Model\work\Model';runAll;
}
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
ERROR: MATLAB error Exit Status: 0x00000001
Build step 'Run MATLAB Command' changed build result to FAILURE
[PolySpace_ICU_SU2idL_FL-ICU-HMID-23-07] $ cmd /c call C:\Users\ADMINI~1\AppData\Local\Temp\jenkins10177263456194605002.bat
  1 Comment
Walter Roberson
Walter Roberson on 17 May 2024
Approximate translation:
I configured the CLI in Jenkins using the API and ran f_PSGen.m below. An error occurred. Please analyze the error.

Sign in to comment.

Answers (1)

정근
정근 on 17 May 2024
Moved: Angelo Yeo on 17 May 2024
해결되었습니다.
감사합니다.

Categories

Find more on Test Model Components in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!