Commit 727983fd authored by minime's avatar minime
Browse files

Fix to fillDataContainer and moved in XML latency config

parent b31992cd
......@@ -976,7 +976,7 @@ void RD53FWInterface::Event::fillDataContainer(BoardDataContainer* boardContaine
for(const auto& cOpticalGroup: *boardContainer)
for(const auto& cHybrid: *cOpticalGroup)
for(const auto& cChip: *cHybrid)
if(RD53FWInterface::Event::isHittedChip(cHybrid->getId(), cChip->getId(), chipIndx) == true)
if((evtStatus == RD53FWEvtEncoder::GOOD) && (RD53FWInterface::Event::isHittedChip(cHybrid->getId(), cChip->getId(), chipIndx) == true))
{
if(vectorRequired == true)
{
......@@ -1164,7 +1164,7 @@ void RD53FWInterface::ConfigureFastCommands(const FastCommandsConfig* cfg)
RD53FWInterface::SendBoardCommand("user.ctrl_regs.fast_cmd_reg_1.load_config");
}
void RD53FWInterface::SetAndConfigureFastCommands(const BeBoard* pBoard, uint32_t nTRIGxEvent, size_t injType, uint32_t nClkDelays, bool enableAutozero)
void RD53FWInterface::SetAndConfigureFastCommands(const BeBoard* pBoard, const uint32_t nTRIGxEvent, const size_t injType, const uint32_t injLatency, const uint32_t nClkDelays, const bool enableAutozero)
// ############################
// # injType == 0 --> None #
// # injType == 1 --> Analog #
......@@ -1205,7 +1205,7 @@ void RD53FWInterface::SetAndConfigureFastCommands(const BeBoard* pBoard, uint32_
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_first_prime = (nClkDelays == 0 ? (uint32_t)INJdelay::Loop : nClkDelays);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_ecr = 0;
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_inject = INJdelay::AfterInjectCal;
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_inject = (injLatency == 0 ? (uint32_t)INJdelay::AfterInjectCal : injLatency);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_trigger = INJdelay::BeforePrimeCal;
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_prime = (nClkDelays == 0 ? (uint32_t)INJdelay::Loop : nClkDelays);
......@@ -1226,7 +1226,7 @@ void RD53FWInterface::SetAndConfigureFastCommands(const BeBoard* pBoard, uint32_
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_first_prime = (nClkDelays == 0 ? (uint32_t)INJdelay::Loop : nClkDelays);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_ecr = 0;
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_inject = INJdelay::AfterInjectCal;
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_inject = (injLatency == 0 ? (uint32_t)INJdelay::AfterInjectCal : injLatency);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_trigger = INJdelay::BeforePrimeCal;
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_prime = (nClkDelays == 0 ? (uint32_t)INJdelay::Loop : nClkDelays);
......@@ -1709,7 +1709,7 @@ float RD53FWInterface::ReadHybridVoltage(int hybridId)
usleep(DEEPSLEEP);
auto value = calcVoltage(senseVDD, senseGND);
LOG(INFO) << BOLDBLUE << "\t--> Hybrid voltage: " << BOLDYELLOW << std::setprecision(3) << value << BOLDBLUE << " V (corresponds to VOUT_dig_ShuLDO of the chip)" << std::setprecision(-1) << RESET;
LOG(INFO) << BOLDBLUE << "\t--> Hybrid voltage: " << BOLDYELLOW << std::setprecision(3) << value << BOLDBLUE << " V (corresponds to half VOUT_dig_ShuLDO of the chip)" << std::setprecision(-1) << RESET;
return value;
}
......
......@@ -211,7 +211,7 @@ class RD53FWInterface : public BeBoardFWInterface
};
void ConfigureFromXML(const Ph2_HwDescription::BeBoard* pBoard);
void SetAndConfigureFastCommands(const Ph2_HwDescription::BeBoard* pBoard, uint32_t nTRIGxEvent, size_t injType, uint32_t nClkDelays = 0, bool enableAutozero = false);
void SetAndConfigureFastCommands(const Ph2_HwDescription::BeBoard* pBoard, const uint32_t nTRIGxEvent, const size_t injType, const uint32_t injLatency = 0, const uint32_t nClkDelays = 0, const bool enableAutozero = false);
struct DIO5Config
{
......
......@@ -284,11 +284,12 @@ void SystemController::ConfigureHw(bool bIgnoreI2c)
// ###################
size_t nTRIGxEvent = SystemController::findValueInSettings("nTRIGxEvent");
size_t injType = SystemController::findValueInSettings("INJtype");
size_t injLatency = SystemController::findValueInSettings("InjLatency");
size_t nClkDelays = SystemController::findValueInSettings("nClkDelays");
size_t colStart = SystemController::findValueInSettings("COLstart");
bool resetMask = SystemController::findValueInSettings("ResetMask");
bool resetTDAC = SystemController::findValueInSettings("ResetTDAC");
static_cast<RD53FWInterface*>(this->fBeBoardFWMap[cBoard->getId()])->SetAndConfigureFastCommands(cBoard, nTRIGxEvent, injType, nClkDelays, colStart < RD53::LIN.colStart);
static_cast<RD53FWInterface*>(this->fBeBoardFWMap[cBoard->getId()])->SetAndConfigureFastCommands(cBoard, nTRIGxEvent, injType, injLatency, nClkDelays, colStart < RD53::LIN.colStart);
LOG(INFO) << GREEN << "Configured FSM fast command block" << RESET;
// ########################
......
......@@ -203,10 +203,12 @@
<!-- === Expert settings ===
SaveBinaryData = 0: do not save raw data in binary format; SaveBinaryData = 1: save raw data in binary format
nHITxCol: number of simultaneously injected pixels per column (it must be a divider of chip rows)
InjLatency: controls the latency of the injection in terms of 100ns period (up to 4095)
nClkDelays: controls the delay between two consecutive injections in terms of 100ns period (up to 4095)
-->
<Setting name="SaveBinaryData"> 0 </Setting>
<Setting name="nHITxCol"> 1 </Setting>
<Setting name="InjLatency"> 32 </Setting>
<Setting name="nClkDelays"> 280 </Setting>
</Settings>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment