-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathairspy_decimate_codegenscript.m
60 lines (48 loc) · 1.93 KB
/
airspy_decimate_codegenscript.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
% AIRSPY_DECIMATE_CODEGEN_SCRIPT Generate executable airspy_decimate from
% airspy_decimate.
%
%
% See also CODER, CODER.CONFIG, CODER.TYPEOF, CODEGEN.
%% Create configuration object of class 'coder.EmbeddedCodeConfig'.
cfg = coder.config('exe','ecoder',true);
%cfg = coder.config('exe');
cfg.HardwareImplementation.ProdEqTarget = false;
cfg.TargetLang = 'C++';
cfg.GenCodeOnly = true;
cfg.GenerateExampleMain = 'DoNotGenerate';
% cfg.GenerateMakefile = false;
cfg.GenerateMakefile = true;%Needed so Don has example
cfg.GenerateReport = true;
cfg.MaxIdLength = 1024;
cfg.ReportPotentialDifferences = false;
cfg.TargetLangStandard = 'C++11 (ISO)';
cfg.RuntimeChecks = true;
%% Define argument types for entry-point 'airspy_channelize'.
% ARGS = cell(1,1);
% ARGS{1} = cell(1,1);
% ARGS{1}{1} = coder.typeof(int32(0),[1 Inf],[0 1]);
%% Invoke MATLAB Coder.
% codegen -config cfg airspy_decimate
cfg.CustomInclude = '/Users/mshafer/Library/CloudStorage/OneDrive-NorthernArizonaUniversity/CODE_PLAYGROUND/airspy_decimate/matlab-coder-utils/c-udp';
% cfg = coder.config('exe');
switch computer('arch')
case 'glnxa64'
cfg.CodeReplacementLibrary = 'DSP Intel AVX2-FMA (Linux)';
case 'win64'
cfg.CodeReplacementLibrary = 'DSP Intel AVX2-FMA (Windows)';
case 'maci64'
cfg.CodeReplacementLibrary = 'DSP Intel AVX2-FMA (Mac)';
case 'maca64'
cfg.CodeReplacementLibrary = 'DSP Intel AVX2-FMA (Mac)';
end
% cfg.GenerateExampleMain = 'GenerateCodeAndCompile'; % provides starter main.c
switch computer('arch')
case 'glnxa64'
codegen airspy_decimate -config cfg
case 'win64'
codegen airspy_decimate -config cfg
case 'maci64' %Include path to c headers for UDP
codegen airspy_decimate matlab-coder-utils/c-udp/udp.cpp matlab-coder-utils/c-udp/udp.h -config cfg -I /Users/mshafer/Library/CloudStorage/OneDrive-NorthernArizonaUniversity/CODE_PLAYGROUND/airspy_decimate/matlab-coder-utils/c-udp
case 'maca64'
codegen airspy_decimate -config cfg
end