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
ac893d2f
Commit
ac893d2f
authored
3 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Generate SCDnode*parameters in setup and put in main sldd
parent
a7d04ece
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
code/classes/SCDclass_expcode.m
+25
-2
25 additions, 2 deletions
code/classes/SCDclass_expcode.m
code/classes/SCDclass_node.m
+5
-10
5 additions, 10 deletions
code/classes/SCDclass_node.m
with
30 additions
and
12 deletions
code/classes/SCDclass_expcode.m
+
25
−
2
View file @
ac893d2f
...
...
@@ -144,7 +144,6 @@ classdef SCDclass_expcode
obj
.
setupnodedd
;
obj
.
setupmaindd
;
fprintf
(
'Setting up expcode %d,
''
%s
''
, configuring default tunable parameters ...\n'
,
obj
.
maincode
,
obj
.
name
);
obj
.
updatedefaulttp
;
fprintf
(
'Setting up expcode %d,
''
%s
''
, configuring global data ...\n'
,
obj
.
maincode
,
obj
.
name
);
...
...
@@ -186,6 +185,9 @@ classdef SCDclass_expcode
fprintf
(
'Setting up variant model configuration'
)
obj
.
setupvaralgo
;
fprintf
(
'Setting up node parameters configuration\n'
)
obj
.
setupnodeparams
;
dd
.
saveChanges
;
end
...
...
@@ -777,7 +779,7 @@ classdef SCDclass_expcode
end
function
obj
=
setupvaralgo
(
obj
)
function
setupvaralgo
(
obj
)
% Sets up varalgo structure in main tcv data dictionary
% according to varalgo info of the nodes
...
...
@@ -806,6 +808,27 @@ classdef SCDclass_expcode
end
end
function
setupnodeparams
(
obj
)
% set node parameter structure in main data dictionary
for
ii
=
obj
.
definednodes
node
=
obj
.
nodes
{
ii
};
for
field
=
{
'name'
,
'timing'
}
nodeparams
.
(
field
{:})
=
node
.
(
field
{:});
end
varname
=
sprintf
(
'SCDnode%02dparams'
,
node
.
nodenr
);
% setup node parameters
d
=
Simulink
.
data
.
dictionary
.
open
(
obj
.
ddname
);
dd
=
getSection
(
d
,
'Design Data'
);
fprintf
(
'setting Node parameters %s in %s\n'
,
varname
,
obj
.
ddname
);
if
dd
.
exist
(
varname
)
ee
=
dd
.
getEntry
(
varname
);
ee
.
setValue
(
nodeparams
);
else
dd
.
addEntry
(
varname
,
nodeparams
);
end
end
end
function
obj
=
buildworkspacesimstructnode
(
obj
,
inode
,
dd
)
% build simulation data structure
node
=
obj
.
nodes
{
inode
};
...
...
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_node.m
+
5
−
10
View file @
ac893d2f
...
...
@@ -11,8 +11,7 @@ classdef SCDclass_node < SCDclass_component
hasethercat
ncpu
% number of CPUs
cputype
timing
=
struct
(
't_start'
,
-
4.5
,
't_stop'
,
3
,
'dt'
,
1e-4
);
thperiod
timing
buildcfg
initscdbeforecomp
cpuactive
...
...
@@ -64,6 +63,7 @@ classdef SCDclass_node < SCDclass_component
function
node
=
defaultnodeconfig
(
node
,
nodenr
)
% Default configuration for nodes
node
.
name
=
sprintf
(
'CRPPRT%02d'
,
nodenr
);
switch
nodenr
case
1
node
.
ncpu
=
1
;
...
...
@@ -71,7 +71,6 @@ classdef SCDclass_node < SCDclass_component
node
.
timing
.
t_start
=
-
4.5
;
node
.
timing
.
t_stop
=
3
;
node
.
timing
.
dt
=
1e-4
;
node
.
thperiod
=
1.0000e-03
;
node
.
buildcfg
.
conffile
{
1
}
=
'standard'
;
node
.
buildcfg
.
initscdbeforecomp
=
false
;
node
.
haswavegen
=
true
;
...
...
@@ -83,7 +82,6 @@ classdef SCDclass_node < SCDclass_component
node
.
timing
.
t_start
=
-
4.5
;
node
.
timing
.
t_stop
=
3
;
node
.
timing
.
dt
=
1e-4
;
node
.
thperiod
=
[
1.0000e-03
1.0000e-03
1.0000e-03
1.0000e-03
1.0e-3
1.0e-3
];
node
.
buildcfg
.
conffile
=
cell
(
node
.
ncpu
,
1
);
node
.
buildcfg
.
conffile
{
1
}
=
'standard'
;
node
.
buildcfg
.
conffile
{
2
}
=
'standard'
;
...
...
@@ -101,7 +99,6 @@ classdef SCDclass_node < SCDclass_component
node
.
timing
.
t_start
=
-
2.0
;
node
.
timing
.
t_stop
=
2.75
;
node
.
timing
.
dt
=
1e-3
;
node
.
thperiod
=
[
1.0000e-03
1.0000e-03
1.0000e-03
1.0000e-03
];
node
.
buildcfg
.
conffile
=
cell
(
node
.
ncpu
,
1
);
node
.
buildcfg
.
conffile
{
1
}
=
'standard'
;
node
.
buildcfg
.
conffile
{
2
}
=
'standard'
;
...
...
@@ -117,7 +114,6 @@ classdef SCDclass_node < SCDclass_component
node
.
timing
.
t_start
=
-
4.5
;
node
.
timing
.
t_stop
=
3
;
node
.
timing
.
dt
=
1e-4
;
node
.
thperiod
=
1.0000e-04
;
node
.
buildcfg
.
conffile
{
1
}
=
'standard'
;
node
.
buildcfg
.
initscdbeforecomp
=
false
;
node
.
haswavegen
=
true
;
...
...
@@ -129,7 +125,6 @@ classdef SCDclass_node < SCDclass_component
node
.
timing
.
t_start
=
-
4.5
;
node
.
timing
.
t_stop
=
3
;
node
.
timing
.
dt
=
1e-4
;
node
.
thperiod
=
1.0000e-04
;
node
.
buildcfg
.
conffile
{
1
}
=
'standard'
;
node
.
buildcfg
.
initscdbeforecomp
=
false
;
node
.
haswavegen
=
true
;
...
...
@@ -141,7 +136,6 @@ classdef SCDclass_node < SCDclass_component
node
.
timing
.
t_start
=
0.0
;
node
.
timing
.
t_stop
=
2.75
;
node
.
timing
.
dt
=
1e-3
;
node
.
thperiod
=
[
1.0000e-03
1.0000e-03
1.0000e-03
1.0000e-03
];
node
.
buildcfg
.
conffile
=
cell
(
node
.
ncpu
,
1
);
node
.
buildcfg
.
conffile
{
1
}
=
'standard'
;
node
.
buildcfg
.
conffile
{
2
}
=
'standard'
;
...
...
@@ -157,7 +151,6 @@ classdef SCDclass_node < SCDclass_component
node
.
timing
.
t_start
=
-
0.5
;
node
.
timing
.
t_stop
=
2.5
;
node
.
timing
.
dt
=
1e-3
;
node
.
thperiod
=
[
1.0000e-03
1.0000e-03
1.0000e-03
1.0000e-03
];
node
.
buildcfg
.
conffile
=
cell
(
node
.
ncpu
,
1
);
node
.
buildcfg
.
conffile
{
1
}
=
'standard'
;
node
.
buildcfg
.
conffile
{
2
}
=
'standard'
;
...
...
@@ -173,7 +166,6 @@ classdef SCDclass_node < SCDclass_component
node
.
timing
.
t_start
=
-
0.5
;
node
.
timing
.
t_stop
=
2.5
;
node
.
timing
.
dt
=
1e-3
;
node
.
thperiod
=
[
1.0000e-03
1.0000e-03
1.0000e-03
1.0000e-03
];
node
.
buildcfg
.
conffile
=
cell
(
node
.
ncpu
,
1
);
node
.
buildcfg
.
conffile
{
1
}
=
'standard'
;
node
.
buildcfg
.
conffile
{
2
}
=
'standard'
;
...
...
@@ -186,6 +178,9 @@ classdef SCDclass_node < SCDclass_component
end
node
.
cpuactive
=
zeros
(
1
,
node
.
ncpu
);
% thread timing
node
.
timing
.
thperiod
=
1e-3
*
ones
(
1
,
node
.
ncpu
);
% add template node wrappers
for
icpu
=
1
:
node
.
ncpu
wrappername
=
sprintf
(
'SCDwrap_template%02d%02d'
,
nodenr
,
icpu
);
...
...
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