Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
SCDDS
SCDDS-core
Commits
6d563728
Commit
6d563728
authored
5 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
LIUQE works now with RT data
parent
254a9c71
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/classes/SCDclass_expcode.m
+48
-39
48 additions, 39 deletions
code/classes/SCDclass_expcode.m
with
48 additions
and
39 deletions
code/classes/SCDclass_expcode.m
+
48
−
39
View file @
6d563728
...
...
@@ -176,8 +176,17 @@ classdef SCDclass_expcode
end
end
function
threadslx
=
getthreadslx
(
inode
,
icpu
)
threadslx
=
sprintf
(
'SCD_rtccode_%02d_%02d'
,
inode
,
icpu
);
function
myslx
=
getslx
(
inode
,
icpu
)
if
nargin
==
0
myslx
=
'tcv'
;
elseif
nargin
==
1
assert
(
isnumeric
(
inode
))
myslx
=
sprintf
(
'SCD_rtc_%02d'
,
inode
);
elseif
nargin
==
2
myslx
=
sprintf
(
'SCD_rtccode_%02d_%02d'
,
inode
,
icpu
);
else
error
(
'invalid number of arguments'
);
end
end
function
setcachefolder
(
obj
)
...
...
@@ -580,55 +589,55 @@ classdef SCDclass_expcode
fprintf
(
"}\n"
);
end
function
compile
(
obj
)
function
compile
(
~
,
varargin
)
myslx
=
SCDclass_expcode
.
getslx
(
varargin
{:});
fprintf
(
'Compiling %s.slx\n'
,
myslx
)
try
tcv
([],[],[],
'compile'
);
tcv
([],[],[],
'term'
);
eval
(
sprintf
(
'%s
([],[],[],
'
'
compile
'
'
)'
,
myslx
)
);
eval
(
sprintf
(
'%s
([],[],[],
'
'
term
'
'
)'
,
myslx
)
);
catch
ME
rethrow
(
ME
)
end
end
function
sim
(
obj
)
SCDconf_setCODEconf
(
'configurationSettingsCODEicc'
)
sim
(
'tcv'
)
function
sim
(
~
,
varargin
)
SCDconf_setSIMconf
myslx
=
SCDclass_expcode
.
getslx
(
varargin
{:});
fprintf
(
'Simulating %s.slx\n'
,
myslx
)
sim
(
myslx
)
end
function
open
(
~
,
node
,
cpu
)
if
nargin
==
1
openslx
=
'tcv'
;
elseif
nargin
==
2
assert
(
isnumeric
(
node
))
openslx
=
sprintf
(
'SCD_rtc_%02d'
,
node
);
elseif
nargin
==
3
openslx
=
SCDclass_expcode
.
getthreadslx
(
node
,
cpu
);
else
error
(
'invalid number of arguments'
);
end
function
open
(
~
,
varargin
)
openslx
=
SCDclass_expcode
.
getslx
(
varargin
{:});
fprintf
(
'Spening %s.slx\n'
,
openslx
)
open
(
openslx
);
end
function
build
(
obj
)
fprintf
(
'\n=== Building %s ===\n'
,
obj
.
name
);
function
build
(
obj
,
varargin
)
% make list of nodes to build
compileslx_list
=
cell
(
0
);
for
inode
=
1
:
8
nodeinfo
=
obj
.
(
sprintf
(
'node%02d'
,
inode
));
for
icpu
=
1
:
nodeinfo
.
ncpu
if
nodeinfo
.
cpuactive
(
icpu
)
compileslx_list
=
[
compileslx_list
,
...
SCDclass_expcode
.
getthreadslx
(
node
,
cpu
)];
%#ok<AGROW>
end
end
end
if
isempty
(
compileslx_list
)
fprintf
(
'No active nodes found, no .slx to compile. Done\n'
);
return
end
if
numel
(
varargin
)
==
0
fprintf
(
'\n=== Building all threads for %s ===\n'
,
obj
.
name
);
% make list of nodes to build
compileslx_list
=
cell
(
0
);
for
inode
=
1
:
8
nodeinfo
=
obj
.
(
sprintf
(
'node%02d'
,
inode
));
for
icpu
=
1
:
nodeinfo
.
ncpu
if
nodeinfo
.
cpuactive
(
icpu
)
compileslx_list
=
[
compileslx_list
,
...
SCDclass_expcode
.
getthreadslx
(
node
,
cpu
)];
%#ok<AGROW>
end
end
end
if
isempty
(
compileslx_list
)
fprintf
(
'No active nodes found, no .slx to compile. Done\n'
);
return
end
else
% user passed nodes,threads to compile
myslx
=
SCDclass_expcode
.
getslx
(
varargin
{:});
fprintf
(
'building %s.slx\n'
,
myslx
)
end
% set CodeGen folder for this expcode (allows fast rebuilding)
SCDclass_expcode
.
setcodegenfolder
(
obj
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment