Skip to content

Commit 0da3265

Browse files
looking at snapshotting, change roc idleframe
1 parent eeb054c commit 0da3265

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

app/tool/econ_snapshot.cxx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ uint32_t build_channel_mask(std::vector<int>& channels) {
1616
}
1717

1818
void econ_snapshot(Target* tgt, pflib::ECON& econ, std::vector<int>& channels) {
19-
uint32_t binary_channels =
20-
build_channel_mask(channels); // defined in align_phase_word.cxx
2119
std::cout << "Channels to be configured: ";
2220
for (int ch : channels) std::cout << ch << " ";
2321
std::cout << std::endl;
@@ -28,20 +26,15 @@ void econ_snapshot(Target* tgt, pflib::ECON& econ, std::vector<int>& channels) {
2826
// FAST CONTROL - ENABLE THE BCR (ORBIT SYNC)
2927
tgt->fc().standard_setup();
3028

31-
// ------- Scan when the ECON takes snapshot -----
32-
int snapshot_val = 3531; // near your orbit region of interest
33-
3429
// ---- SETTING ECON REGISTERS ---- //
3530
parameters["ALIGNER"]["GLOBAL_I2C_SNAPSHOT_EN"] = 0;
3631
parameters["ALIGNER"]["GLOBAL_SNAPSHOT_ARM"] = 0;
3732
parameters["ALIGNER"]["GLOBAL_SNAPSHOT_EN"] = 1;
38-
parameters["ALIGNER"]["GLOBAL_ORBSYN_CNT_SNAPSHOT"] = snapshot_val;
3933
auto econ_word_align_currentvals = econ.applyParameters(parameters);
4034

4135
// FAST CONTROL - LINK_RESET
4236
tgt->fc().linkreset_rocs();
4337

44-
std::cout << "Outputting snapshot at BX " << snapshot_val << std::endl;
4538
for (int channel : channels) {
4639
// print out snapshot
4740

@@ -66,7 +59,7 @@ void econ_snapshot(Target* tgt, pflib::ECON& econ, std::vector<int>& channels) {
6659
// shift by 1
6760
boost::multiprecision::uint256_t shifted1 = (snapshot >> 1);
6861

69-
std::cout << "Snapshot Printout: " << snapshot_val << std::endl
62+
std::cout << "Snapshot Printout: "
7063
<< " (channel " << channel << ") " << std::endl
7164
<< "snapshot_hex_shifted: 0x" << std::hex << std::uppercase
7265
<< shifted1 << std::dec << std::endl;

app/tool/tasks/align_phase_word.cxx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ ENABLE_LOGGING();
1111
bool debug_checks = false;
1212

1313
// ROC Idle Frame
14-
constexpr uint32_t ROC_IDLE_FRAME = 0x5555555;
14+
constexpr uint32_t ROC_IDLE_FRAME = 0x12c5c57;
15+
16+
constexpr uint64_t ECON_ROC_ALIGN_PATTERN = (
17+
(0x9ull << 60) | (static_cast<uint64_t>(ROC_IDLE_FRAME) << 32) |
18+
(0xaull << 28) | ROC_IDLE_FRAME
19+
);
1520

1621
// ECON PUSM State READY
1722
constexpr int ECON_EXPECTED_PUSM_STATE = 8;
@@ -79,6 +84,8 @@ void align_word(Target* tgt, pflib::ROC& roc, pflib::ECON& econ,
7984
// print ROC status
8085
if (debug_checks) {
8186
print_roc_status(roc);
87+
std::cout << "ROC_IDLE_FRAME: 0x" << std::hex << ROC_IDLE_FRAME << std::endl;
88+
std::cout << "ECON_ROC_ALIGN_PATTERN: 0x" << std::hex << ECON_ROC_ALIGN_PATTERN << std::endl;
8289
}
8390

8491
// ---- SETTING ECON REGISTERS ---- //
@@ -108,7 +115,7 @@ void align_word(Target* tgt, pflib::ROC& roc, pflib::ECON& econ,
108115
auto econ_word_align_currentvals_check = econ.applyParameters(parameters);
109116

110117
// Set GLOBAL_MATCH_PATTERN_VAL
111-
econ.setValue(0x0381, 0x95555555A5555555, 8);
118+
econ.setValue(0x0381, ECON_ROC_ALIGN_PATTERN, 8);
112119

113120
// Verify that channels are still locked
114121
for (int ch : channels) {
@@ -307,15 +314,13 @@ void align_phase_word(Target* tgt) {
307314
channels.push_back(mapping[iroc].first);
308315
channels.push_back(mapping[iroc].second);
309316

310-
uint32_t binary_channels = build_channel_mask(channels);
311317
std::cout << "Channels to be configured: ";
312318
for (int ch : channels) std::cout << ch << " ";
313319
std::cout << std::endl;
314320

315321
// Check PUSM state
316322
auto pusm_state = econ.readParameter("CLOCKSANDRESETS", "GLOBAL_PUSM_STATE");
317323
if (debug_checks) {
318-
std::cout << "Decimal value of channels: " << binary_channels << std::endl;
319324
std::cout << "PUSM_STATE = " << pusm_state << ", " << hex(pusm_state)
320325
<< std::endl;
321326
reset_stream();

0 commit comments

Comments
 (0)