-
Notifications
You must be signed in to change notification settings - Fork 86
/
startup.m
66 lines (60 loc) · 2.43 KB
/
startup.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
warning off Simulink:SL_SaveWithParameterizedLinks_Warning
warning off Simulink:SL_LoadMdlParameterizedLink
warning off Simulink:Engine:SaveWithParameterizedLinks_Warning
warning off Simulink:Engine:SaveWithDisabledLinks_Warning
warning off Simulink:Commands:LoadMdlParameterizedLink
jasper_backend = getenv('JASPER_BACKEND');
%if vivado is to be used
if strcmp(jasper_backend, 'vivado') || strcmp(jasper_backend, 'vitis') || isempty(jasper_backend)
disp('Starting Model Composer')
addpath([getenv('MLIB_DEVEL_PATH'), '/casper_library']);
addpath([getenv('MLIB_DEVEL_PATH'), '/xps_library']);
addpath([getenv('MLIB_DEVEL_PATH'), '/jasper_library']);
%addpath(getenv('HDL_DSP_DEVEL'));
if ~isempty(getenv('DSP_HDL_SL_PATH'))
addpath(getenv('DSP_HDL_SL_PATH'));
end
%if ISE is to be used
elseif strcmp(jasper_backend, 'ise')
disp('Starting ISE Sysgen')
addpath([getenv('XILINX_PATH'), '/ISE/sysgen/util/']);
addpath([getenv('XILINX_PATH'), '/ISE/sysgen/bin/lin64']);
addpath([getenv('MLIB_DEVEL_PATH'), '/casper_library']);
addpath([getenv('MLIB_DEVEL_PATH'), '/xps_library']);
addpath([getenv('MLIB_DEVEL_PATH'), '/jasper_library']);
%addpath(getenv('HDL_DSP_DEVEL'));
if ~isempty(getenv('DSP_HDL_SL_PATH'))
addpath(getenv('DSP_HDL_SL_PATH'));
end
xlAddSysgen([getenv('XILINX_PATH'), '/ISE'])
sysgen_startup
else
fprintf('Unknown JASPER_BACKEND ''%s''\n', jasper_backend);
% Hopefully helpful in this case
addpath([getenv('MLIB_DEVEL_PATH'), '/casper_library']);
addpath([getenv('MLIB_DEVEL_PATH'), '/xps_library']);
addpath([getenv('MLIB_DEVEL_PATH'), '/jasper_library']);
%addpath(getenv('HDL_DSP_DEVEL'));
if ~isempty(getenv('DSP_HDL_SL_PATH'))
addpath(getenv('DSP_HDL_SL_PATH'));
end
end
% The load_system function causes a segfault when run with the Matlab 2021a and Vivado 2021.1
% but the libraries are still accessable even without loading them.
load_system('casper_library');
load_system('xps_library');
if ~isempty(getenv('DSP_HDL_SL_PATH'))
load_system('hdl_library');
end
casper_startup_dir = getenv('CASPER_STARTUP_DIR');
if ~isempty(casper_startup_dir)
cd(casper_startup_dir);
% If a 'casper_startup.m' file exists, run it!
if exist('casper_startup.m', 'file')
run('./casper_startup.m');
end
end
% Add the local python directory to MATLAB's python environment
insert(py.sys.path, int32(0), [getenv('MLIB_DEVEL_PATH'), '/casper_library/python'])
clear casper_startup_dir;
clear jasper_backend;