Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tamalero
Manage
Activity
Members
Labels
Plan
Issues
16
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
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
CMS ETL Electronics
tamalero
Merge requests
!73
Simple threshold scan work
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Simple threshold scan work
external_data
into
master
Overview
0
Commits
3
Pipelines
3
Changes
2
Merged
Daniel Spitzbart
requested to merge
external_data
into
master
1 year ago
Overview
0
Commits
3
Pipelines
3
Changes
2
Expand
Done:
fixing DATA_CNT for col>7
To Do:
adding Qinj
making
--scan simple
more flexible, e.g. for modules in different slot etc
👍
0
👎
0
Merge request reports
Compare
master
version 2
b648e566
1 year ago
version 1
2d7d55e3
1 year ago
master (base)
and
latest version
latest version
2f35a4d3
3 commits,
1 year ago
version 2
b648e566
2 commits,
1 year ago
version 1
2d7d55e3
1 commit,
1 year ago
2 files
+
52
−
34
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
tamalero/FIFO.py
+
38
−
31
Options
@@ -142,40 +142,47 @@ class FIFO:
else
:
return
self
.
rb
.
kcu
.
hw
.
getNode
(
"
DAQ_RB0
"
).
readBlock
(
block
)
except
uhal_exception
:
print
(
"
uhal UDP error in FIFO.read_block
"
)
#
raise
print
(
f
"
uhal UDP error in FIFO.read_block
, block size is
{
block
}
"
)
raise
def
read
(
self
,
dispatch
=
False
,
verbose
=
False
):
occupancy
=
self
.
get_occupancy
()
*
4
+
2
# FIXME don't know where factor of 4 comes from??
if
verbose
:
print
(
f
"
{
occupancy
=
}
"
)
num_blocks_to_read
=
occupancy
//
self
.
block
if
verbose
:
print
(
f
"
{
num_blocks_to_read
=
}
"
)
last_block
=
occupancy
%
self
.
block
if
verbose
:
print
(
f
"
{
last_block
=
}
"
)
#
occupancy = self.get_occupancy()*4 + 2 # FIXME don't know where factor of 4 comes from??
#
if verbose: print(f"{occupancy=}")
#
num_blocks_to_read = occupancy // self.block
#
if verbose: print(f"{num_blocks_to_read=}")
#
last_block = occupancy % self.block
#
if verbose: print(f"{last_block=}")
data
=
[]
if
(
num_blocks_to_read
or
last_block
):
if
dispatch
:
for
b
in
range
(
num_blocks_to_read
):
try
:
data
+=
self
.
read_block
(
self
.
block
,
dispatch
=
dispatch
).
value
()
except
uhal_exception
:
print
(
"
uhal UDP error in daq
"
)
return
data
try
:
data
+=
self
.
read_block
(
last_block
,
dispatch
=
dispatch
).
value
()
except
uhal_exception
:
print
(
"
uhal UDP error in daq
"
)
return
data
else
:
# FIXME the part below should be faster but is somehow broken now
reads
=
num_blocks_to_read
*
[
self
.
read_block
(
self
.
block
,
dispatch
=
dispatch
)]
+
[
self
.
read_block
(
last_block
,
dispatch
=
dispatch
)]
try
:
self
.
rb
.
kcu
.
hw
.
dispatch
()
except
:
print
(
"
uhal UDP error in daq
"
)
for
read
in
reads
:
data
+=
read
.
value
()
while
self
.
get_occupancy
()
>
0
:
# FIXME checking get_occupancy all the time is slow, but this is at least not broken.
data
+=
self
.
read_block
(
250
,
dispatch
=
dispatch
).
value
()
#if (num_blocks_to_read or last_block):
# if dispatch:
# #while self.get_occupancy()>0:
# # data += self.read_block(255, dispatch=dispatch).value()
# for b in range(num_blocks_to_read):
# #print(b)
# try:
# data += self.read_block(self.block, dispatch=dispatch).value()
# except uhal_exception:
# print("uhal UDP error in daq, full blocks")
# return data
# try:
# data += self.read_block(last_block, dispatch=dispatch).value()
# except uhal_exception:
# print("uhal UDP error in daq, last block")
# return data
# else:
# # FIXME the part below should be faster but is somehow broken now
# reads = num_blocks_to_read * [self.read_block(self.block, dispatch=dispatch)] + [self.read_block(last_block, dispatch=dispatch)]
# try:
# self.rb.kcu.hw.dispatch()
# except:
# print("uhal UDP error in daq")
# for read in reads:
# data += read.value()
return
data
Loading