Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Irene Mateos Dominguez
Ph2_ACF
Commits
142d2c75
Commit
142d2c75
authored
Feb 17, 2022
by
Sarah Seif El Nasr
Browse files
Re-checked S-curves on PS-FEHs with SSA1+SSA2; trig src 12
parent
4546ce1f
Pipeline
#3590806
failed with stages
in 70 minutes and 28 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
HWInterface/D19cI2CInterface.cc
View file @
142d2c75
...
...
@@ -212,7 +212,7 @@ bool D19cI2CInterface::MultiWriteRead(Chip* pChip, std::vector<ChipRegItem>& pWr
{
if
(
MultiWrite
(
pChip
,
pWriteRegs
))
{
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
microseconds
(
3
0000
));
// need this pause for SSA I2C to work .. why?
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
microseconds
(
10
0000
));
// need this pause for SSA I2C to work .. why?
if
(
MultiRead
(
pChip
,
cReadbackRegs
))
{
// check read against write
...
...
@@ -222,7 +222,10 @@ bool D19cI2CInterface::MultiWriteRead(Chip* pChip, std::vector<ChipRegItem>& pWr
if
(
cIterator
!=
pWriteRegs
.
end
()){
if
(
cReadBackReg
.
fValue
!=
cIterator
->
fValue
)
LOG
(
INFO
)
<<
BOLDRED
<<
"D19cI2CInterface::MultiWriteRead"
<<
" mismatch in readback register "
<<
std
::
hex
<<
+
cIterator
->
fAddress
<<
" NO MATCH!"
<<
std
::
dec
<<
RESET
;
<<
" mismatch in readback register "
<<
std
::
hex
<<
+
cIterator
->
fAddress
<<
" NO MATCH!"
<<
" expected "
<<
cIterator
->
fValue
<<
" read back "
<<
cReadBackReg
.
fValue
<<
std
::
dec
<<
RESET
;
else
LOG
(
DEBUG
)
<<
BOLDGREEN
<<
"D19cI2CInterface::MultiWriteRead"
<<
" match in readback register "
<<
std
::
hex
<<
+
cIterator
->
fAddress
<<
" MATCH!"
<<
std
::
dec
<<
RESET
;
...
...
HWInterface/D19cPSCounterFWInterface.cc
View file @
142d2c75
...
...
@@ -328,7 +328,7 @@ void D19cPSCounterFWInterface::FillData()
}
bool
D19cPSCounterFWInterface
::
WaitForNTriggers
()
{
fTriggerInterface
->
ResetTriggerFSM
();
//
fTriggerInterface->ResetTriggerFSM();
// make sure counters have been cleared and reset
// not sure its needed but.. to be safe
PS_Close_shutter
();
...
...
@@ -366,8 +366,8 @@ bool D19cPSCounterFWInterface::ReadEvents(const BeBoard* pBoard)
// clear data vector
fData
.
clear
();
// make sure handshake is configured
WriteReg
(
"fc7_daq_cnfg.readout_block.global.data_handshake_enable"
,
fHandshake
);
fTriggerInterface
->
SetNTriggersToAccept
(
fNEvents
);
WriteReg
(
"fc7_daq_cnfg.readout_block.global.data_handshake_enable"
,
fHandshake
);
if
(
WaitForNTriggers
())
{
LOG
(
DEBUG
)
<<
BOLDYELLOW
<<
"D19cPSCounterFWInterface::ReadEvents triggers succesfully sent"
<<
RESET
;
...
...
HWInterface/D19cTriggerInterface.cc
View file @
142d2c75
...
...
@@ -67,9 +67,12 @@ void D19cTriggerInterface::TriggerConfiguration()
}
else
{
LOG
(
DEBUG
)
<<
BOLDGREEN
<<
"Trigger source is : "
<<
+
cSource
<<
" matches configured source "
<<
fTriggerConfiguration
.
fTriggerSource
<<
RESET
;
fTriggerConfiguration
.
fTriggerRate
=
ReadReg
(
"fc7_daq_cnfg.fast_command_block.user_trigger_frequency"
);
fTriggerConfiguration
.
fNtriggersToAccept
=
ReadReg
(
"fc7_daq_cnfg.fast_command_block.triggers_to_accept"
);
LOG
(
DEBUG
)
<<
BOLDGREEN
<<
"Trigger source is : "
<<
+
cSource
<<
" matches configured source "
<<
+
fTriggerConfiguration
.
fTriggerSource
<<
" number of triggers to accept is "
<<
+
fTriggerConfiguration
.
fNtriggersToAccept
<<
RESET
;
}
}
...
...
@@ -148,7 +151,7 @@ bool D19cTriggerInterface::Start()
LOG
(
DEBUG
)
<<
BOLDYELLOW
<<
"D19cTriggerInterface::Start - trigger state is "
<<
cTriggerState
<<
RESET
;
// this stops triggers + resets
this
->
ResetTriggerFSM
();
// here open the shutter for the stub counter block (for some reason self clear doesn't work, that why we have to
// clear the register manually)
WriteReg
(
"fc7_daq_ctrl.stub_counter_block.general.shutter_open"
,
0x1
);
...
...
@@ -291,7 +294,7 @@ bool D19cTriggerInterface::RunTriggerFSM()
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
microseconds
(
fWait_us
));
auto
cNtriggers
=
ReadReg
(
"fc7_daq_stat.fast_command_block.trigger_in_counter"
);
if
(
cIterations
%
1000
==
0
&&
cIterations
>
0
){
LOG
(
INFO
)
<<
"Trigger FSM State: "
<<
BOLDGREEN
<<
"Running.. : "
<<
cNtriggers
<<
RESET
;
LOG
(
DEBUG
)
<<
"Trigger FSM State: "
<<
BOLDGREEN
<<
"Running.. : "
<<
cNtriggers
<<
" triggers received."
<<
RESET
;
}
cEndTime
=
std
::
chrono
::
high_resolution_clock
::
now
();
cDuration
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
cEndTime
-
cStartTime
).
count
();
...
...
@@ -299,8 +302,9 @@ bool D19cTriggerInterface::RunTriggerFSM()
}
while
(
this
->
ReadReg
(
"fc7_daq_stat.fast_command_block.general.fsm_state"
)
&&
cDuration
<
fTimeout_us
);
bool
cFailed
=
(
this
->
ReadReg
(
"fc7_daq_stat.fast_command_block.general.fsm_state"
));
auto
cNtriggers
=
ReadReg
(
"fc7_daq_stat.fast_command_block.trigger_in_counter"
);
LOG
(
DEBUG
)
<<
BOLDYELLOW
<<
"D19cTriggerInterface::RunTriggerFSM "
<<
cNtriggers
<<
"
received."
<<
RESET
;
LOG
(
DEBUG
)
<<
BOLDYELLOW
<<
"D19cTriggerInterface::RunTriggerFSM "
<<
cNtriggers
<<
"
triggers received. "
<<
cFailed
<<
RESET
;
this
->
Stop
();
// return true;
return
!
cFailed
;
}
...
...
HWInterface/SSA2Interface.cc
View file @
142d2c75
...
...
@@ -47,7 +47,7 @@ bool SSA2Interface::ConfigureChip(Chip* pSSA2, bool pVerifLoop, uint32_t pBlockS
LOG
(
INFO
)
<<
BOLDBLUE
<<
cOutput
.
str
()
<<
"...Configuring chip with Id["
<<
+
pSSA2
->
getId
()
<<
"] oh Hybrid"
<<
+
pSSA2
->
getHybridId
()
<<
RESET
;
// write mask registers
std
::
vector
<
std
::
string
>
cMaskRegs
{
"strip"
,
"peri_A"
,
"peri_D"
};
std
::
vector
<
std
::
string
>
cMaskRegs
{
"peri_A"
,
"peri_D"
,
"strip"
};
std
::
vector
<
ChipRegItem
>
cRegItems
;
cRegItems
.
clear
();
for
(
auto
cName
:
cMaskRegs
)
...
...
@@ -56,12 +56,12 @@ bool SSA2Interface::ConfigureChip(Chip* pSSA2, bool pVerifLoop, uint32_t pBlockS
cItem
.
fValue
=
0xFF
;
cRegItems
.
push_back
(
cItem
);
}
fBoardFW
->
MultiRegisterWrite
(
pSSA2
,
cRegItems
,
tru
e
);
fBoardFW
->
MultiRegisterWrite
(
pSSA2
,
cRegItems
,
fals
e
);
// configure W/R registers
// do not overwrite these registers..
std
::
vector
<
std
::
string
>
cRegsToSkip
{
"mask_strip"
,
"mask_peri_A"
,
"mask_peri_D"
};
std
::
vector
<
std
::
string
>
cReadOnlyRegs
{
"SEUcnt"
,
"Ring_oscillator"
,
"ADC_out"
,
"bist_output"
,
"AC_ReadCounter"
};
std
::
vector
<
std
::
string
>
cReadOnlyRegs
{
"SEUcnt"
,
"Ring_oscillator"
,
"ADC_out"
,
"bist_output"
,
"AC_ReadCounter"
,
"status_reg"
};
cRegItems
.
clear
();
// need to split between control and enable registers
...
...
@@ -299,7 +299,7 @@ bool SSA2Interface::WriteChipRegBits(Chip* pSSA2, const std::string& pRegNode, u
cRegItems
.
push_back
(
cItem
);
}
LOG
(
DEBUG
)
<<
BOLDYELLOW
<<
"SSA2Interface::WriteChipRegBits Writing mask ... writing 0x"
<<
std
::
hex
<<
+
mask
<<
" to "
<<
pMaskReg
<<
std
::
dec
<<
RESET
;
if
(
fBoardFW
->
MultiRegisterWrite
(
pSSA2
,
cRegItems
,
tru
e
))
if
(
fBoardFW
->
MultiRegisterWrite
(
pSSA2
,
cRegItems
,
fals
e
))
{
LOG
(
DEBUG
)
<<
BOLDYELLOW
<<
"
\t
..SSA2Interface::WriteChipRegBits Writing 0x"
<<
std
::
hex
<<
+
pValue
<<
" to "
<<
pRegNode
<<
std
::
dec
<<
RESET
;
auto
cRegItem
=
cRegMap
[
pRegNode
];
...
...
@@ -316,7 +316,7 @@ bool SSA2Interface::WriteChipRegBits(Chip* pSSA2, const std::string& pRegNode, u
cRegItems
.
push_back
(
cItem
);
}
LOG
(
DEBUG
)
<<
BOLDYELLOW
<<
"SSA2Interface::WriteChipRegBits Resetting mask ... writing 0x"
<<
std
::
hex
<<
+
mask
<<
" to "
<<
pMaskReg
<<
std
::
dec
<<
RESET
;
return
cSuccess
&&
fBoardFW
->
MultiRegisterWrite
(
pSSA2
,
cRegItems
,
tru
e
);
return
cSuccess
&&
fBoardFW
->
MultiRegisterWrite
(
pSSA2
,
cRegItems
,
fals
e
);
// this->WriteChipSingleReg(pSSA2, pMaskReg, mask, pVerifLoop);
// bool cReadoutMode = WriteChipSingleReg(pSSA2, pRegNode, pValue, pVerifLoop);
...
...
HWInterface/TriggerInterface.h
View file @
142d2c75
...
...
@@ -79,7 +79,7 @@ class TriggerInterface : public RegManager
protected:
uint32_t
fWait_us
{
10
};
TriggerConfiguration
fTriggerConfiguration
;
uint32_t
fTimeout_us
{
10
000000
};
// time-out after 5s
uint32_t
fTimeout_us
{
5
000000
};
// time-out after 5s
};
}
// namespace Ph2_HwInterface
#endif
\ No newline at end of file
tools/BackEndAlignment.cc
View file @
142d2c75
...
...
@@ -72,7 +72,8 @@ bool BackEndAlignment::PSAlignment(BeBoard* pBoard)
// D19cDebugFWInterface* cDebugInterface = cInterface->getDebugInterface();
uint8_t
cPhaseAlignmentPattern
=
0xAA
;
uint8_t
cWordAlignmentPattern
=
0xEA
;
auto
cFeTypes
=
pBoard
->
connectedFrontEndTypes
();
for
(
auto
cOpticalReadout
:
*
pBoard
)
{
for
(
auto
cHybrid
:
*
cOpticalReadout
)
...
...
@@ -91,6 +92,7 @@ bool BackEndAlignment::PSAlignment(BeBoard* pBoard)
}
}
// configure PA pattern on all SLVS lines
uint8_t
cFirstLine
=
(
std
::
find
(
cFeTypes
.
begin
(),
cFeTypes
.
end
(),
FrontEndType
::
SSA
)
!=
cFeTypes
.
end
()
)
?
1
:
0
;
for
(
auto
cOpticalReadout
:
*
pBoard
)
{
for
(
auto
cHybrid
:
*
cOpticalReadout
)
...
...
@@ -102,7 +104,7 @@ bool BackEndAlignment::PSAlignment(BeBoard* pBoard)
LOG
(
INFO
)
<<
BOLDYELLOW
<<
"Skipping Phase tuning on Chip#"
<<
+
cChip
->
getId
()
<<
RESET
;
continue
;
}
for
(
uint8_t
cLineId
=
0
;
cLineId
<=
8
;
cLineId
++
)
// stub lines - 1 to 8
for
(
uint8_t
cLineId
=
cFirstLine
;
cLineId
<=
8
;
cLineId
++
)
// stub lines - 1 to 8
{
PhaseTuneLine
(
cChip
,
cLineId
);
}
}
}
...
...
@@ -137,7 +139,7 @@ bool BackEndAlignment::PSAlignment(BeBoard* pBoard)
LOG
(
INFO
)
<<
BOLDYELLOW
<<
"Skipping word alignment on Chip#"
<<
+
cChip
->
getId
()
<<
RESET
;
continue
;
}
for
(
uint8_t
cLineId
=
0
;
cLineId
<=
8
;
cLineId
++
)
// stub lines - 1 to 8
for
(
uint8_t
cLineId
=
cFirstLine
;
cLineId
<=
8
;
cLineId
++
)
// stub lines - 1 to 8
{
WordAlignLine
(
cChip
,
cLineId
,
cWordAlignmentPattern
,
8
);
}
}
}
...
...
tools/Tool.cc
View file @
142d2c75
...
...
@@ -737,8 +737,8 @@ void Tool::setFWTestPulse()
}
else
{
LOG
(
INFO
)
<<
BOLDBLUE
<<
"Since I'm in ASYNC mode .. set trigger source to 1
0
"
<<
RESET
;
cRegVec
.
push_back
({
"fc7_daq_cnfg.fast_command_block.trigger_source"
,
1
0
});
LOG
(
INFO
)
<<
BOLDBLUE
<<
"Since I'm in ASYNC mode .. set trigger source to 1
2
"
<<
RESET
;
cRegVec
.
push_back
({
"fc7_daq_cnfg.fast_command_block.trigger_source"
,
1
2
});
cRegVec
.
push_back
({
"fc7_daq_ctrl.fast_command_block.control.load_config"
,
0x1
});
}
break
;
...
...
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