Skip to content

Commit ba2fb02

Browse files
committed
Testing for v3.0.0 [WIP]
1 parent 0c6be65 commit ba2fb02

File tree

6 files changed

+221
-113
lines changed

6 files changed

+221
-113
lines changed

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class ProgramStatus: public Program
8080
std::cout << clock << " clock" << std::endl;
8181
std::cout << "------------" << std::endl;
8282

83+
// TODO: Sort according to linkID
8384
for (const auto& link : reportInfo.linkList) {
8485
int globalId = link.id + link.bank*6;
8586
std::string gbtTxMode = (link.gbtTxMode == Cru::GBT_MODE_WB ? "WB" : "GBT");

src/Cru/Common.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void rxcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress)
126126

127127
//b. Validate that user has control
128128
uint32_t bit = waitForBit(pdaBar, baseAddress + 4 * 0x280, 2, 0);
129-
if (bit != 0) {
129+
if (bit != 0 && false) {
130130
std::cout << "rxcal0 0" << std::endl;
131131
BOOST_THROW_EXCEPTION(Exception() << ErrorInfo::Message("rxcal0: User does not have control"));
132132
}
@@ -145,7 +145,7 @@ void rxcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress)
145145

146146
//g. Wait..
147147
bit = waitForBit(pdaBar, baseAddress + 4 * 0x281, 1, 0);
148-
if (bit != 0) {
148+
if (bit != 0 && false) {
149149
std::cout << "rxcal0 1" << std::endl;
150150
BOOST_THROW_EXCEPTION(Exception() << ErrorInfo::Message("rxcal0: User does not have control"));
151151
}

src/Cru/Constants.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static constexpr Register GBT_BANK_LINK_OFFSET(0x00002000);
205205
static constexpr Register GBT_LINK_REGS_OFFSET(0x00000000);
206206

207207
/// Register for selecting the GBT link source (i.e. Internal Data Generator)
208-
static constexpr Register GBT_LINK_SOURCE_SELECT(0x00000038);
208+
static constexpr Register GBT_LINK_SOURCE_SELECT(0x00000030);
209209

210210
/// Register for selecting the the GBT Multiplexer
211211
static constexpr Register GBT_MUX_SELECT(0x0000001c);
@@ -222,8 +222,8 @@ static constexpr Register GBT_WRAPPER_ATX_PLL(0x000e0000);
222222
static constexpr Register GBT_BANK_FPLL(0x0000e000);
223223

224224
/// Registers to set TX and RX GBT modes
225-
static constexpr Register GBT_LINK_TX_CONTROL_OFFSET(0x00000034);
226-
static constexpr Register GBT_LINK_RX_CONTROL_OFFSET(0x00000040);
225+
static constexpr Register GBT_LINK_TX_CONTROL_OFFSET(0x0000002c);
226+
static constexpr Register GBT_LINK_RX_CONTROL_OFFSET(0x0000003c);
227227
/*static constexpr uint32_t GBT_MODE_GBT(0x0);
228228
static constexpr uint32_t GBT_MODE_WB(0x1);*/
229229

@@ -246,7 +246,7 @@ static constexpr Register DWRAPPER_MUX_CONTROL(0x00000004);
246246

247247
/// Datapath Wrapper configuration registers
248248
static constexpr Register DATAPATHLINK_OFFSET(0x00040000);
249-
static constexpr Register DATALINK_OFFSET(0x00001000);
249+
static constexpr Register DATALINK_OFFSET(0x00002000);
250250
static constexpr Register DATALINK_CONTROL(0x00000000);
251251
/*static constexpr uint32_t GBT_PACKET(0x1);
252252
static constexpr uint32_t GBT_CONTINUOUS(0x0);*/

src/Cru/CruBar.cxx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,24 @@ std::vector<Link> CruBar::initializeLinkList()
563563
}
564564
}
565565
}
566-
return links;
566+
567+
std::vector<Link> newLinks(sizeof(links));
568+
for(int i=0; i<links.size(); i++) {
569+
Link link = links.at(i);
570+
int newpos = (i-link.bank*6) * 2 + 12*(link.bank/2) + (link.bank %2);
571+
newLinks[newpos] = link;
572+
}
573+
574+
for(auto link: links) {
575+
std::cout << link.id << std::endl;
576+
}
577+
std::cout << "====" << std::endl;
578+
for (auto link: newLinks) {
579+
std::cout << link.id << std::endl;
580+
std::cout << std::hex << link.baseAddress << std::endl;
581+
}
582+
return newLinks;
583+
//return links;
567584
}
568585

569586
/// Initializes and Populates the linkList with the GBT configuration parameters

src/Cru/Ttc.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void Ttc::configurePlls(uint32_t clock)
5858
setRefGen(0);
5959
setRefGen(1);
6060
registerMap1 = getTtcClockPll1RegisterMap();
61-
registerMap2 = getTtcClockPll1RegisterMap();
61+
registerMap2 = getTtcClockPll2RegisterMap();
6262
}
6363

6464
I2c p1 = I2c(Cru::Registers::SI5345_1.address, chipAddress, mPdaBar, registerMap1);

0 commit comments

Comments
 (0)