Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
scdaq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scouting-demonstrator
scdaq
Commits
c6412e43
Commit
c6412e43
authored
2 years ago
by
Dinyar Rabady
Browse files
Options
Downloads
Patches
Plain Diff
Replace VIO board reset with SCONE one
Still need to implement the actual reset. Belongs to
#14
.
parent
e5978d08
No related branches found
No related tags found
No related merge requests found
Pipeline
#4528884
failed
2 years ago
Stage: build
Stage: run
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/WZDmaInputFilter.cc
+6
-3
6 additions, 3 deletions
src/WZDmaInputFilter.cc
src/WZDmaInputFilter.h
+6
-1
6 additions, 1 deletion
src/WZDmaInputFilter.h
src/scdaq.cc
+1
-1
1 addition, 1 deletion
src/scdaq.cc
src/tools.h
+3
-0
3 additions, 0 deletions
src/tools.h
src/wz_dma.c
+0
-58
0 additions, 58 deletions
src/wz_dma.c
with
16 additions
and
63 deletions
src/WZDmaInputFilter.cc
+
6
−
3
View file @
c6412e43
...
@@ -12,8 +12,11 @@
...
@@ -12,8 +12,11 @@
#include
"tools.h"
#include
"tools.h"
WZDmaInputFilter
::
WZDmaInputFilter
(
size_t
packetBufferSize
,
WZDmaInputFilter
::
WZDmaInputFilter
(
size_t
packetBufferSize
,
size_t
nbPacketBuffers
,
ctrl
&
control
)
size_t
nbPacketBuffers
,
ctrl
&
control
,
:
InputFilter
(
packetBufferSize
,
nbPacketBuffers
,
control
)
{
config
&
conf
)
:
InputFilter
(
packetBufferSize
,
nbPacketBuffers
,
control
),
sconeHost_
{
conf
.
getSconeHost
()},
sconePort_
{
conf
.
getSconePort
()},
sconeBoard_
{
conf
.
getSconeBoard
()}
{
// Initialize the DMA subsystem
// Initialize the DMA subsystem
if
(
wz_init
(
&
dma_
)
<
0
)
{
if
(
wz_init
(
&
dma_
)
<
0
)
{
std
::
string
msg
=
"Cannot initialize WZ DMA device"
;
std
::
string
msg
=
"Cannot initialize WZ DMA device"
;
...
@@ -118,7 +121,7 @@ inline ssize_t WZDmaInputFilter::read_packet(char **buffer, size_t bufferSize) {
...
@@ -118,7 +121,7 @@ inline ssize_t WZDmaInputFilter::read_packet(char **buffer, size_t bufferSize) {
// Oversized packet is usually sign of link problem
// Oversized packet is usually sign of link problem
// Let's try to reset the board
// Let's try to reset the board
LOG
(
ERROR
)
<<
"Going to reset the board:"
;
LOG
(
ERROR
)
<<
"Going to reset the board:"
;
if
(
wz_
reset_board
()
<
0
)
{
if
(
reset_board
(
sconeHost_
,
sconePort_
,
sconeBoard_
)
<
0
)
{
LOG
(
ERROR
)
<<
"Reset failed"
;
LOG
(
ERROR
)
<<
"Reset failed"
;
}
else
{
}
else
{
LOG
(
ERROR
)
<<
"Reset finished"
;
LOG
(
ERROR
)
<<
"Reset finished"
;
...
...
This diff is collapsed.
Click to expand it.
src/WZDmaInputFilter.h
+
6
−
1
View file @
c6412e43
...
@@ -9,11 +9,12 @@
...
@@ -9,11 +9,12 @@
#include
"InputFilter.h"
#include
"InputFilter.h"
#include
"wz_dma.h"
#include
"wz_dma.h"
#include
"config.h"
class
WZDmaInputFilter
:
public
InputFilter
{
class
WZDmaInputFilter
:
public
InputFilter
{
public:
public:
WZDmaInputFilter
(
size_t
packetBufferSize
,
size_t
nbPacketBuffers
,
ctrl
&
control
);
WZDmaInputFilter
(
size_t
packetBufferSize
,
size_t
nbPacketBuffers
,
ctrl
&
control
,
config
&
conf
);
virtual
~
WZDmaInputFilter
();
virtual
~
WZDmaInputFilter
();
protected:
protected:
...
@@ -32,6 +33,10 @@ private:
...
@@ -32,6 +33,10 @@ private:
}
stats
;
}
stats
;
struct
wz_private
dma_
;
struct
wz_private
dma_
;
std
::
string
sconeHost_
;
short
sconePort_
;
std
::
string
sconeBoard_
;
};
};
typedef
std
::
shared_ptr
<
WZDmaInputFilter
>
WZDmaInputFilterPtr
;
typedef
std
::
shared_ptr
<
WZDmaInputFilter
>
WZDmaInputFilterPtr
;
...
...
This diff is collapsed.
Click to expand it.
src/scdaq.cc
+
1
−
1
View file @
c6412e43
...
@@ -58,7 +58,7 @@ int run_pipeline( int nbThreads, ctrl& control, config& conf )
...
@@ -58,7 +58,7 @@ int run_pipeline( int nbThreads, ctrl& control, config& conf )
}
else
if
(
input
==
config
::
InputType
::
WZDMA
)
{
}
else
if
(
input
==
config
::
InputType
::
WZDMA
)
{
// Create WZ DMA reader
// Create WZ DMA reader
input_filter
=
std
::
make_shared
<
WZDmaInputFilter
>
(
packetBufferSize
,
nbPacketBuffers
,
control
);
input_filter
=
std
::
make_shared
<
WZDmaInputFilter
>
(
packetBufferSize
,
nbPacketBuffers
,
control
,
conf
);
}
else
if
(
input
==
config
::
InputType
::
MICRONDMA
)
{
}
else
if
(
input
==
config
::
InputType
::
MICRONDMA
)
{
...
...
This diff is collapsed.
Click to expand it.
src/tools.h
+
3
−
0
View file @
c6412e43
...
@@ -44,6 +44,9 @@ inline const std::string strerror(const std::string& msg)
...
@@ -44,6 +44,9 @@ inline const std::string strerror(const std::string& msg)
return
msg
+
": "
+
tools
::
strerror
();
return
msg
+
": "
+
tools
::
strerror
();
}
}
int
reset_board
(
std
::
string
host
,
short
port
,
std
::
string
board
)
{
// TODO: Reset board with libcurl
}
/*
/*
* Various filesystem related utilities (will be removed once moved to C++17, or rewritten with boost)
* Various filesystem related utilities (will be removed once moved to C++17, or rewritten with boost)
...
...
This diff is collapsed.
Click to expand it.
src/wz_dma.c
+
0
−
58
View file @
c6412e43
...
@@ -152,61 +152,3 @@ inline void wz_stop_source(struct wz_private* wz)
...
@@ -152,61 +152,3 @@ inline void wz_stop_source(struct wz_private* wz)
wz
->
usr_regs
[
0x10000
/
4
]
=
0
;
wz
->
usr_regs
[
0x10000
/
4
]
=
0
;
asm
volatile
(
""
:
:
:
"memory"
);
asm
volatile
(
""
:
:
:
"memory"
);
}
}
#include
<stdio.h>
#include
<arpa/inet.h>
/*
* Normally, one should write to a register. But because we don't have a support for register for
* the moment, we use a server connected to Vivado to do a reset
*/
int
wz_reset_board
()
{
struct
sockaddr_in
saddr_in
;
int
sock
;
char
buf
[
12
];
int
bytes_read
;
// Fill the server address
inet_aton
(
"127.0.0.1"
,
&
(
saddr_in
.
sin_addr
));
saddr_in
.
sin_family
=
AF_INET
;
saddr_in
.
sin_port
=
htons
(
12345
);
//print out IP address
printf
(
"Server IP: %s
\n
"
,
inet_ntoa
(
saddr_in
.
sin_addr
));
if
((
sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
))
<
0
)
{
PERROR
(
"Socket"
);
return
-
1
;
}
// Connect socket to the server
if
(
connect
(
sock
,
(
struct
sockaddr
*
)
&
saddr_in
,
sizeof
(
struct
sockaddr_in
))
<
0
)
{
PERROR
(
"Connect"
);
goto
error
;
}
if
(
send
(
sock
,
"reset
\n
"
,
6
,
0
)
<
0
)
{
PERROR
(
"Send"
);
goto
error
;
}
if
((
bytes_read
=
recv
(
sock
,
buf
,
sizeof
(
buf
)
-
1
,
0
))
<
0
)
{
PERROR
(
"Recv"
);
goto
error
;
}
// Put null terminating character
buf
[
bytes_read
]
=
0
;
printf
(
"Received '%s'
\n
"
,
buf
);
close
(
sock
);
printf
(
"Finished
\n
"
);
return
0
;
error:
close
(
sock
);
return
-
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