-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetupPaths.m
More file actions
148 lines (112 loc) · 4.29 KB
/
Copy pathSetupPaths.m
File metadata and controls
148 lines (112 loc) · 4.29 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
function SetupPaths()
%% ==========================================
%% SETUP PATHS FOR ADC-POLYPHASE SYSTEM INTEGRATION
%% ==========================================
%% ==========================================
%% SYSTEM INTEGRATION ROOT
%% ==========================================
IntegrationRoot = fileparts(mfilename("fullpath"));
% Make the integration-owned files (for example EndToEndTestConfig.m)
% available regardless of the caller's current working directory.
addpath(IntegrationRoot);
%% ==========================================
%% DEMONSTRATION STAGES
%% ==========================================
DemoStages = fullfile(IntegrationRoot, "Demo Stages");
if isfolder(DemoStages)
addpath(DemoStages);
end
%% ==========================================
%% DSP DOWNSTREAM ROOT
%% ==========================================
DSPDownstreamRoot = fileparts(IntegrationRoot);
%% ==========================================
%% LOCAL DEVELOPMENT PATHS
%% ==========================================
LocalADCDesign = fullfile( ...
DSPDownstreamRoot, ...
"ADC Signal Chain", ...
"Design");
LocalPolyphaseDesign = fullfile( ...
DSPDownstreamRoot, ...
"Polyphase Decimator DSP", ...
"Design");
%% ==========================================
%% GITHUB ACTIONS DEPENDENCY PATHS
%% ==========================================
CIADCDesign = fullfile( ...
IntegrationRoot, ...
"dependencies", ...
"adc", ...
"Design");
CIPolyphaseDesign = fullfile( ...
IntegrationRoot, ...
"dependencies", ...
"polyphase", ...
"Design");
%% ==========================================
%% SELECT AVAILABLE ENVIRONMENT
%% ==========================================
if isfolder(LocalADCDesign) && ...
isfolder(LocalPolyphaseDesign)
ADCDesign = LocalADCDesign;
PolyphaseDesign = LocalPolyphaseDesign;
fprintf( ...
"Using local ADC Signal Chain and " + ...
"Polyphase Decimator DSP repositories.\n");
elseif isfolder(CIADCDesign) && ...
isfolder(CIPolyphaseDesign)
ADCDesign = CIADCDesign;
PolyphaseDesign = CIPolyphaseDesign;
fprintf( ...
"Using GitHub Actions dependency repositories.\n");
else
error( ...
'ADCPolyphaseSystemIntegration:DependenciesNotFound', ...
['Could not locate the ADC Signal Chain and ', ...
'Polyphase Decimator DSP Design folders.']);
end
%% ==========================================
%% VERIFY REQUIRED DEPENDENCY ENTRY POINTS
%% ==========================================
RequiredADCFile = fullfile(ADCDesign, "ADCParameters.m");
RequiredDSPFile = fullfile(PolyphaseDesign, "DSPParameters.m");
if ~isfile(RequiredADCFile)
error( ...
'ADCPolyphaseSystemIntegration:ADCDependencyInvalid', ...
'ADCParameters.m was not found in the ADC Design folder.');
end
if ~isfile(RequiredDSPFile)
error( ...
'ADCPolyphaseSystemIntegration:DSPDependencyInvalid', ...
'DSPParameters.m was not found in the Polyphase Design folder.');
end
%% ==========================================
%% ADD DEPENDENCY DESIGN PATHS
%% ==========================================
addpath(genpath(ADCDesign));
addpath(genpath(PolyphaseDesign));
%% ==========================================
%% ADD SYSTEM ANALYSIS PATHS
%% ==========================================
AnalysisFolders = [ ...
"ADC Analysis", ...
"AGC Analysis", ...
"Decimator Analysis", ...
"Filter Analysis", ...
"Spectrum Analysis"];
for k = 1:numel(AnalysisFolders)
AnalysisPath = fullfile( ...
IntegrationRoot, AnalysisFolders(k));
if isfolder(AnalysisPath)
addpath(AnalysisPath);
end
end
%% ==========================================
%% OPTIONAL INTEGRATION DESIGN FOLDER
%% ==========================================
IntegrationDesign = fullfile(IntegrationRoot, "Design");
if isfolder(IntegrationDesign)
addpath(genpath(IntegrationDesign));
end
end