Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLASfpga
VILLASfpga
Commits
28891cd2
Commit
28891cd2
authored
Jun 04, 2018
by
Daniel Krebs
Browse files
ips/switch: add more sanity checks for making connections
parent
ae908407
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/ips/switch.cpp
View file @
28891cd2
...
...
@@ -73,9 +73,26 @@ bool
AxiStreamSwitch
::
connectInternal
(
const
std
::
string
&
portSlave
,
const
std
::
string
&
portMaster
)
{
// check if slave port exists
try
{
getSlavePort
(
portSlave
);
}
catch
(
const
std
::
out_of_range
&
)
{
logger
->
error
(
"Switch doesn't have a slave port named '{}'"
,
portSlave
);
return
false
;
}
// check if master port exists
try
{
getMasterPort
(
portMaster
);
}
catch
(
const
std
::
out_of_range
&
)
{
logger
->
error
(
"Switch doesn't have a master port named '{}'"
,
portMaster
);
return
false
;
}
if
(
portSlave
.
substr
(
0
,
1
)
!=
"S"
or
portMaster
.
substr
(
0
,
1
)
!=
"M"
)
{
logger
->
error
(
"sanity check failed"
);
logger
->
error
(
"sanity check failed: master {} slave {}"
,
portMaster
,
portSlave
);
return
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment