Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sdptr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
sdptr
Commits
b056d77d
Commit
b056d77d
authored
Feb 8, 2021
by
Kenneth Hiemstra
Browse files
Options
Downloads
Patches
Plain Diff
corrected for node 0,2
parent
510d2975
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/fpga.cpp
+1
-1
1 addition, 1 deletion
src/fpga.cpp
src/node.cpp
+10
-10
10 additions, 10 deletions
src/node.cpp
src/periph/fpga.cpp
+2
-0
2 additions, 0 deletions
src/periph/fpga.cpp
src/uniboard.conf
+1
-1
1 addition, 1 deletion
src/uniboard.conf
with
14 additions
and
12 deletions
src/fpga.cpp
+
1
−
1
View file @
b056d77d
...
@@ -239,7 +239,7 @@ bool Fpga::point(const uint clientId, TermOutput& termout, const char cmd, const
...
@@ -239,7 +239,7 @@ bool Fpga::point(const uint clientId, TermOutput& termout, const char cmd, const
case
REG_FORMAT_BOOLEAN
:
case
REG_FORMAT_BOOLEAN
:
case
REG_FORMAT_INTEGER
:
case
REG_FORMAT_INTEGER
:
for
(
unsigned
int
i
=
0
;
i
<
termresults
.
nof_vals
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
termresults
.
nof_vals
;
i
++
)
{
termout
.
valint
[
idx
*
nodes
.
size
()
+
i
]
=
termresults
.
valint
[
i
];
termout
.
valint
[
idx
*
termresults
.
nof_vals
+
i
]
=
termresults
.
valint
[
i
];
}
}
break
;
break
;
case
REG_FORMAT_FLOAT
:
case
REG_FORMAT_FLOAT
:
...
...
This diff is collapsed.
Click to expand it.
src/node.cpp
+
10
−
10
View file @
b056d77d
...
@@ -91,14 +91,14 @@ void Node::worker(const int clientId)
...
@@ -91,14 +91,14 @@ void Node::worker(const int clientId)
strerror
(
errno
),
clientId
,
UniboardNr
,
myIPaddr
.
c_str
(),
Type
.
c_str
(),
LocalNr
,
GlobalNr
);
strerror
(
errno
),
clientId
,
UniboardNr
,
myIPaddr
.
c_str
(),
Type
.
c_str
(),
LocalNr
,
GlobalNr
);
continue
;
continue
;
}
else
{
}
else
{
//
printf("Node::worker job (size=%d) for client[%d] Uniboard=%d node IP=%s type=%s localnr=%d globalnr=%d\n",
printf
(
"Node::worker job (size=%d) for client[%d] Uniboard=%d node IP=%s type=%s localnr=%d globalnr=%d
\n
"
,
//
(int)ret,clientId,UniboardNr, myIPaddr.c_str(), Type.c_str(), LocalNr, GlobalNr);
(
int
)
ret
,
clientId
,
UniboardNr
,
myIPaddr
.
c_str
(),
Type
.
c_str
(),
LocalNr
,
GlobalNr
);
}
}
//m.lock();
//m.lock();
pread_cmd_struct
*
p
=
(
pread_cmd_struct
*
)
buf
;
pread_cmd_struct
*
p
=
(
pread_cmd_struct
*
)
buf
;
/*
cout
<<
"clientId="
<<
p
->
clientId
;
cout
<<
"clientId="
<<
p
->
clientId
;
cout
<<
" p.relative_addr="
<<
p
->
relative_addr
;
cout
<<
" p.relative_addr="
<<
p
->
relative_addr
;
cout
<<
" p.type="
<<
p
->
type
<<
endl
;
cout
<<
" p.type="
<<
p
->
type
<<
endl
;
...
@@ -107,7 +107,7 @@ void Node::worker(const int clientId)
...
@@ -107,7 +107,7 @@ void Node::worker(const int clientId)
cout
<<
" p.nvalues="
<<
p
->
nvalues
;
cout
<<
" p.nvalues="
<<
p
->
nvalues
;
cout
<<
" p.format="
<<
p
->
format
;
cout
<<
" p.format="
<<
p
->
format
;
cout
<<
" p.cmd="
<<
p
->
cmdId
<<
endl
;
cout
<<
" p.cmd="
<<
p
->
cmdId
<<
endl
;
*/
termout
.
clear
();
termout
.
clear
();
memset
((
void
*
)
&
r
,
0
,
sizeof
(
r
));
memset
((
void
*
)
&
r
,
0
,
sizeof
(
r
));
...
@@ -150,16 +150,14 @@ void Node::worker(const int clientId)
...
@@ -150,16 +150,14 @@ void Node::worker(const int clientId)
for
(
unsigned
int
i
=
0
;
i
<
termout
.
nof_vals
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
termout
.
nof_vals
;
i
++
)
{
r
.
valfloat
[
i
]
=
termout
.
valfloat
[
i
];
r
.
valfloat
[
i
]
=
termout
.
valfloat
[
i
];
}
}
//printf("Node::worker job for client[%d] Uniboard=%d node IP=%s send back %d\n",
// clientId,UniboardNr, myIPaddr.c_str(),sizeof(r));
for
(
unsigned
int
i
=
0
;
i
<
termout
.
nof_vals
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
termout
.
nof_vals
;
i
++
)
{
r
.
valint
[
i
]
=
termout
.
valint
[
i
];
r
.
valint
[
i
]
=
termout
.
valint
[
i
];
}
}
memcpy
((
void
*
)
r
.
valstr
,
(
void
*
)
termout
.
valstr
,
sizeof
(
r
.
valstr
));
memcpy
((
void
*
)
r
.
valstr
,
(
void
*
)
termout
.
valstr
,
sizeof
(
r
.
valstr
));
r
.
datatype
=
termout
.
datatype
;
r
.
datatype
=
termout
.
datatype
;
//printf("Node::worker job for client[%d] Uniboard=%d New node IP=%s send back %d\n",
// clientId,UniboardNr, myIPaddr.c_str(),sizeof(r));
ret
=
write
(
reply_pipe
[
clientId
][
1
],
(
void
*
)
&
r
,
sizeof
(
r
));
ret
=
write
(
reply_pipe
[
clientId
][
1
],
(
void
*
)
&
r
,
sizeof
(
r
));
//printf("Node::worker job for client[%d] Uniboard=%d New node IP=%s sent done\n",
// clientId,UniboardNr, myIPaddr.c_str());
//m.unlock();
//m.unlock();
}
}
printf
(
"Node::worker job for client[%d] Uniboard=%d New node IP=%s leaving!!
\n
"
,
printf
(
"Node::worker job for client[%d] Uniboard=%d New node IP=%s leaving!!
\n
"
,
...
@@ -173,6 +171,7 @@ Node::Node(const string ipaddr, const uint unb, const uint localnr, const std::s
...
@@ -173,6 +171,7 @@ Node::Node(const string ipaddr, const uint unb, const uint localnr, const std::s
myIPaddr
=
ipaddr
;
myIPaddr
=
ipaddr
;
Nof_pipes
=
nof_pipes
;
Nof_pipes
=
nof_pipes
;
ucp_connection
=
new
UCP
*
[
nof_pipes
];
ucp_connection
=
new
UCP
*
[
nof_pipes
];
for
(
int
i
=
0
;
i
<
Nof_pipes
;
i
++
)
{
for
(
int
i
=
0
;
i
<
Nof_pipes
;
i
++
)
{
ucp_connection
[
i
]
=
new
UCP
(
ipaddr
);
ucp_connection
[
i
]
=
new
UCP
(
ipaddr
);
...
@@ -185,10 +184,11 @@ Node::Node(const string ipaddr, const uint unb, const uint localnr, const std::s
...
@@ -185,10 +184,11 @@ Node::Node(const string ipaddr, const uint unb, const uint localnr, const std::s
if
(
type
!=
"pn"
)
throw
runtime_error
(
"invalid node type:
\"
"
+
type
+
"
\"
"
);
if
(
type
!=
"pn"
)
throw
runtime_error
(
"invalid node type:
\"
"
+
type
+
"
\"
"
);
Type
=
type
;
Type
=
type
;
//syslog(LOG_INFO,"Uniboard=%d New node IP=%s type=%s localnr=%d globalnr=%d\n",
//syslog(LOG_INFO,"Uniboard=%d New node IP=%s type=%s localnr=%d globalnr=%d\n",
// UniboardNr, myIPaddr.c_str(), Type.c_str(), LocalNr, GlobalNr);
// UniboardNr, myIPaddr.c_str(), Type.c_str(), LocalNr, GlobalNr);
printf
(
"Uniboard=%d New node IP=%s type=%s localnr=%d globalnr=%d
\n
"
,
printf
(
"Uniboard=%d New node IP=%s type=%s localnr=%d globalnr=%d
enabled=%d
\n
"
,
UniboardNr
,
myIPaddr
.
c_str
(),
Type
.
c_str
(),
LocalNr
,
GlobalNr
);
UniboardNr
,
myIPaddr
.
c_str
(),
Type
.
c_str
(),
LocalNr
,
GlobalNr
,
enabled
);
reply_pipe
=
new
int
*
[
nof_pipes
];
reply_pipe
=
new
int
*
[
nof_pipes
];
cmd_pipe
=
new
int
*
[
nof_pipes
];
cmd_pipe
=
new
int
*
[
nof_pipes
];
...
...
This diff is collapsed.
Click to expand it.
src/periph/fpga.cpp
+
2
−
0
View file @
b056d77d
...
@@ -137,6 +137,7 @@ bool Periph_fpga::Read(UCP *ucp, const std::string addr_str, const uint32_t offs
...
@@ -137,6 +137,7 @@ bool Periph_fpga::Read(UCP *ucp, const std::string addr_str, const uint32_t offs
bool
isfifo
=
registerMap
->
type_isfifo
((
addr_str
));
bool
isfifo
=
registerMap
->
type_isfifo
((
addr_str
));
ret
=
ucp
->
readRegister
(
addr
,
nvalues
,
data_ptr
,
isfifo
);
ret
=
ucp
->
readRegister
(
addr
,
nvalues
,
data_ptr
,
isfifo
);
//usleep(300000);
if
(
ret
&&
(
shift
!=
0
||
mask
!=
0xffffffff
))
{
if
(
ret
&&
(
shift
!=
0
||
mask
!=
0xffffffff
))
{
for
(
uint32_t
i
=
0
;
i
<
nvalues
;
i
++
)
{
for
(
uint32_t
i
=
0
;
i
<
nvalues
;
i
++
)
{
data_ptr
[
i
]
&=
mask
;
data_ptr
[
i
]
&=
mask
;
...
@@ -165,6 +166,7 @@ bool Periph_fpga::Write(UCP *ucp, const std::string addr_str, const uint32_t off
...
@@ -165,6 +166,7 @@ bool Periph_fpga::Write(UCP *ucp, const std::string addr_str, const uint32_t off
data_ptr
[
i
]
&=
mask
;
data_ptr
[
i
]
&=
mask
;
}
}
}
}
//usleep(300000);
return
ucp
->
writeRegister
(
addr
,
nvalues
,
data_ptr
,
isfifo
);
return
ucp
->
writeRegister
(
addr
,
nvalues
,
data_ptr
,
isfifo
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/uniboard.conf
+
1
−
1
View file @
b056d77d
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
# UNB 0
# UNB 0
node
0
10
.
99
.
2
.
1
unb2b_minimal
2
1
node
0
10
.
99
.
2
.
1
unb2b_minimal
2
1
node
1
10
.
99
.
2
.
2
unb2b_minimal
2
0
node
1
10
.
99
.
2
.
2
unb2b_minimal
2
0
node
2
10
.
99
.
2
.
3
unb2b_minimal
2
0
node
2
10
.
99
.
2
.
3
unb2b_minimal
2
1
node
3
10
.
99
.
2
.
4
unb2b_minimal
2
0
node
3
10
.
99
.
2
.
4
unb2b_minimal
2
0
# UNB 1
# UNB 1
...
...
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