Commit f7257377 authored by Mark Pesaresi's avatar Mark Pesaresi
Browse files

Updates for daqpath fw branch with modified address table

parent 0a948600
......@@ -9,7 +9,7 @@ namespace Ph2_HwInterface
void DtcFWInterface::InitialiseLocalTCDS(unsigned pChanId){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe.chan_sel", pChanId);
// initialise with config file settings eventually
LocalResetPatternGen(pChanId);
LocalSourceSelect(pChanId, 1); // 0=global, 1=local
......@@ -68,7 +68,7 @@ namespace Ph2_HwInterface
void DtcFWInterface::SendLocalCustomFastCommands(unsigned pChanId, std::vector<FastCommand> &pFastCmd, bool repeat){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe.chan_sel", pChanId);
LocalResetPatternGen(pChanId);
std::vector<unsigned> patterns;
......@@ -96,11 +96,11 @@ namespace Ph2_HwInterface
void DtcFWInterface::PrintLocalCounters(unsigned pChanId){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
uint32_t n_fast_reset = ReadReg("payload.fe_chan.fast_cmd_status.fast_resets");
uint32_t n_l1a_trig = ReadReg("payload.fe_chan.fast_cmd_status.l1a_trigs");
uint32_t n_cal_pulse = ReadReg("payload.fe_chan.fast_cmd_status.cal_pulses");
uint32_t n_counter_reset = ReadReg("payload.fe_chan.fast_cmd_status.counter_resets");
WriteReg("payload.fe.chan_sel", pChanId);
uint32_t n_fast_reset = ReadReg("payload.fe_chan.fast_cmd.status.fast_resets");
uint32_t n_l1a_trig = ReadReg("payload.fe_chan.fast_cmd.status.l1a_trigs");
uint32_t n_cal_pulse = ReadReg("payload.fe_chan.fast_cmd.status.cal_pulses");
uint32_t n_counter_reset = ReadReg("payload.fe_chan.fast_cmd.status.counter_resets");
LOG(INFO) << BOLDBLUE << "Fast commands sent from local TCDS on channel " << pChanId
<< " :: FastReset " << n_fast_reset << " :: L1A " << n_l1a_trig
......@@ -109,73 +109,73 @@ namespace Ph2_HwInterface
void DtcFWInterface::LocalSourceSelect(unsigned pChanId, unsigned pSource){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe.chan_sel", pChanId);
if (pSource > 1) {
LOG(ERROR) << BOLDRED << "Invalid Fast Command local source select option" << RESET;
} else {
WriteReg("payload.fe_chan.fast_cmd_ctrl.source", pSource);
WriteReg("payload.fe_chan.fast_cmd.ctrl.source", pSource);
}
}
void DtcFWInterface::LocalDelayFastCommand(unsigned pChanId, unsigned pDelay){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe.chan_sel", pChanId);
if (pDelay > 7) {
pDelay = 7;
LOG(WARNING) << BOLDRED << "Cannot delay local fast commands by more than 7 BX : Setting to 7 BX" << RESET;
}
WriteReg("payload.fe_chan.fast_cmd_ctrl.delay", pDelay);
WriteReg("payload.fe_chan.fast_cmd.ctrl.delay", pDelay);
}
void DtcFWInterface::LocalRepeatFastCommand(unsigned pChanId, unsigned pRepeat){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe.chan_sel", pChanId);
if (pRepeat > 1023) {
pRepeat = 1023;
LOG(WARNING) << BOLDRED << "Cannot repeat fast command pattern more than 1023 times : Setting to 1023" << RESET;
}
WriteReg("payload.fe_chan.fast_cmd_ctrl.repeat", pRepeat);
WriteReg("payload.fe_chan.fast_cmd.ctrl.repeat", pRepeat);
}
void DtcFWInterface::LocalInternalBC0sEnable(unsigned pChanId){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe_chan.fast_cmd_ctrl.bc0", 0x0);
WriteReg("payload.fe.chan_sel", pChanId);
WriteReg("payload.fe_chan.fast_cmd.ctrl.bc0", 0x0);
}
void DtcFWInterface::LocalInternalBC0sDisable(unsigned pChanId){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe_chan.fast_cmd_ctrl.bc0", 0x1);
WriteReg("payload.fe.chan_sel", pChanId);
WriteReg("payload.fe_chan.fast_cmd.ctrl.bc0", 0x1);
}
void DtcFWInterface::LocalStartPatternGen(unsigned pChanId){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe_chan.fast_cmd_ctrl.run", 0x1);
WriteReg("payload.fe.chan_sel", pChanId);
WriteReg("payload.fe_chan.fast_cmd.ctrl.run", 0x1);
}
void DtcFWInterface::LocalResetPatternGen(unsigned pChanId){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe_chan.fast_cmd_ctrl.run", 0x0);
WriteReg("payload.fe.chan_sel", pChanId);
WriteReg("payload.fe_chan.fast_cmd.ctrl.run", 0x0);
}
void DtcFWInterface::LocalLoadPatternGen(unsigned pChanId, std::vector<unsigned> &pPatterns){
WriteReg("payload.fe_ctrl.chan_sel", pChanId);
WriteReg("payload.fe.chan_sel", pChanId);
int i = 0;
for (auto pattern : pPatterns) {
i++;
std::string reg_name = "payload.fe_chan.fast_cmd_buf_" + std::to_string(i);
std::string reg_name = "payload.fe_chan.fast_cmd.pgen_buf_" + std::to_string(i);
if (i <= 6) WriteReg(reg_name, pattern);
}
......
<?xml version="1.0" encoding="utf-8"?>
<HwDescription>
<BeBoard Id="0" boardType="SERENITY" eventType="VR">
<connection file="file:///home/cmx/.emp/packages/mprocessor/emp-test-81ac9fb0/package/connections.xml" id="x1"/>
<connection file="file:///home/cmx/.emp/packages/dtc/2S5G_vu13p-so2v1_mini_feature/daqpath-c859472d/package/connections.xml" id="x0"/>
<OpticalGroup Id="0" FMCId="0">
<lpGBT LinkId="8" Address="0x70" phaseTap="12" configfile="./settings/lpGBTFiles/CMSOT_lpGBT_skeleton.txt"/>
<lpGBT LinkId="32" Address="0x70" phaseTap="12" configfile="./settings/lpGBTFiles/CMSOT_lpGBT_skeleton.txt"/>
<Hybrid Id="0" Status="1" I2CMaster="2">
<Clock Id="1" freq="4" driveStr="4" invert="1" preEmphWidth="0" preEmphMode="1" preEmphStr="4" />
......@@ -14,7 +14,7 @@
<ClusterStub clusterwidth="4" ptwidth="14" layerswap="1" off1="0" off2="0" off3="0" off4="0"/>
<Misc analogmux="0b00000" pipelogic="3" stublogic="3" or254="1" tpgclock="1" testclock="0" dll="0"/>
<ChannelMask disable=""/>
<CIC2 enableBend="1" enableLastLine="0" enableSparsification="0" clockFrequency="320"/>
<CIC enableBend="1" enableLastLine="0" enableSparsification="0" clockFrequency="320"/>
</Global>
<CBC_Files path="/home/cmx/module_files/m4_031121_1000/KITBR_300V" />
<CBC Id="0" configfile="BE0_OG0_FE0_Chip0.txt" resetPort="8"/>
......@@ -25,10 +25,13 @@
<CBC Id="5" configfile="BE0_OG0_FE0_Chip5.txt" resetPort="8"/>
<CBC Id="6" configfile="BE0_OG0_FE0_Chip6.txt" resetPort="8"/>
<CBC Id="7" configfile="BE0_OG0_FE0_Chip7.txt" resetPort="8"/>
<CIC_Files path="/home/cmx/module_files/m4_031121_1000/KITBR_300V" />
<CIC2 Id="8" configfile="BE0_OG0_FE0.txt" resetPort="6" ClockId="-1"/>
<CIC_Files path="./settings/CicFiles/" />
<CIC Id="8" configfile="CIC_default.txt" />
<!-- <CIC_Files path="/home/cmx/module_files/m4_031121_1000/KITBR_300V" />
<CIC2 Id="8" configfile="BE0_OG0_FE0.txt" resetPort="6" ClockId="-1"/>-->
</Hybrid>
<!--
<Hybrid Id="1" Status="1" I2CMaster="0">
<Clock Id="11" freq="4" driveStr="4" invert="0" preEmphWidth="0" preEmphMode="1" preEmphStr="4" />
<Global>
......@@ -48,9 +51,12 @@
<CBC Id="5" configfile="BE0_OG0_FE1_Chip5.txt" resetPort="3"/>
<CBC Id="6" configfile="BE0_OG0_FE1_Chip6.txt" resetPort="3"/>
<CBC Id="7" configfile="BE0_OG0_FE1_Chip7.txt" resetPort="3"/>
<CIC_Files path="/home/cmx/module_files/m4_031121_1000/KITBR_300V" />
<CIC2 Id="8" configfile="BE0_OG0_FE1.txt" resetPort="0" ClockId="-1"/>
</Hybrid>-->
<CIC_Files path="./settings/CicFiles/" />
<CIC Id="8" configfile="CIC_default.txt" />
<!-- <CIC_Files path="/home/cmx/module_files/m4_031121_1000/KITBR_300V" />
<CIC2 Id="8" configfile="BE0_OG0_FE1.txt" resetPort="0" ClockId="-1"/>-->
</Hybrid>
</OpticalGroup>
<!--
<OpticalGroup Id="1" FMCId="0">
......@@ -105,7 +111,7 @@
-->
<OpticalGroup Id="2" FMCId="0">
<lpGBT LinkId="10" Address="0x70" phaseTap="12" configfile="./settings/lpGBTFiles/CMSOT_lpGBT_perugia.txt"/>
<lpGBT LinkId="34" Address="0x70" phaseTap="12" configfile="./settings/lpGBTFiles/CMSOT_lpGBT_perugia.txt"/>
<Hybrid Id="0" Status="1" I2CMaster="2">
<Clock Id="1" freq="4" driveStr="4" invert="1" preEmphWidth="0" preEmphMode="3" preEmphStr="7" />
......
......@@ -225,8 +225,7 @@ int main(int argc, char* argv[]) {
// cFWInterface->PrintLocalCounters(cOpticalGroup->getId());
unsigned localcThreshold = 600;
if ((cOpticalGroup->getId()==10)) localcThreshold = 550;
else localcThreshold = cThreshold;
localcThreshold = cThreshold;
for (auto cHybrid : *cOpticalGroup) {
......@@ -246,7 +245,16 @@ int main(int argc, char* argv[]) {
}
if (cDisableC7 != (unsigned)-1) {
for (auto cBoard : *cTool.fDetectorContainer) {
cBeBoardInterface->setBoard(cBoard->getId());
DtcFWInterface *cFWInterface = static_cast<DtcFWInterface*>(cBeBoardInterface->getFirmwareInterface());
cFWInterface->SendLocalRepetitiveL1As(2,10);
}
if (cDisableC7) {
for (auto cBoard : *cTool.fDetectorContainer) {
......
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