Skip to content

Commit 5fab69a

Browse files
github-actions[bot]tvami
authored andcommitted
Apply clang-format --style=Google
1 parent 8690b07 commit 5fab69a

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

src/pflib/ECON.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,14 @@ void ECON::setRegisters(
236236
std::map<int, std::map<int, uint8_t>> ECON::getRegisters(
237237
const std::map<int, std::map<int, uint8_t>>& selected) {
238238
constexpr int MAX_BATCH_SIZE = 128;
239-
239+
240240
std::map<int, std::map<int, uint8_t>> chip_reg;
241241
const int page_id = 0;
242242
std::map<int, uint8_t> all_regs;
243243

244244
// Build sorted list of registers to read
245245
std::vector<std::pair<int, int>> reads_to_perform; // (address, nbytes)
246-
246+
247247
if (selected.empty()) {
248248
for (const auto& [reg_addr, nbytes] : econ_reg_nbytes_lut_) {
249249
reads_to_perform.emplace_back(reg_addr, nbytes);
@@ -264,12 +264,12 @@ std::map<int, std::map<int, uint8_t>> ECON::getRegisters(
264264
if (!reads_to_perform.empty()) {
265265
int start_addr = reads_to_perform[0].first;
266266
int current_end = start_addr + reads_to_perform[0].second;
267-
267+
268268
for (size_t i = 1; i < reads_to_perform.size(); ++i) {
269269
int next_addr = reads_to_perform[i].first;
270270
int next_nbytes = reads_to_perform[i].second;
271271
int potential_size = next_addr + next_nbytes - start_addr;
272-
272+
273273
// Check if contiguous AND under size limit
274274
if (next_addr == current_end && potential_size <= MAX_BATCH_SIZE) {
275275
// Extend the batch
@@ -278,17 +278,17 @@ std::map<int, std::map<int, uint8_t>> ECON::getRegisters(
278278
// Non-contiguous or too large - perform the batch
279279
int batch_size = current_end - start_addr;
280280
std::vector<uint8_t> batch_data = getValues(start_addr, batch_size);
281-
281+
282282
for (int j = 0; j < batch_size; ++j) {
283283
all_regs[start_addr + j] = batch_data[j];
284284
}
285-
285+
286286
// Start new batch
287287
start_addr = next_addr;
288288
current_end = next_addr + next_nbytes;
289289
}
290290
}
291-
291+
292292
// Perform the final batch
293293
int batch_size = current_end - start_addr;
294294
std::vector<uint8_t> batch_data = getValues(start_addr, batch_size);

test/compile.cxx

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -312,60 +312,65 @@ BOOST_AUTO_TEST_CASE(full_lut_econd) {
312312
"The generated register LUT does not match the expected LUT");
313313
}
314314

315-
316315
BOOST_AUTO_TEST_CASE(read_three_aligner_params) {
317316
pflib::Compiler c = pflib::Compiler::get("econd");
318-
317+
319318
std::map<int, std::map<int, uint8_t>> registers;
320-
319+
321320
// First, set all registers to zero to avoid warnings
322321
auto reg_lut = c.build_register_byte_lut();
323322
for (const auto& [reg_addr, nbytes] : reg_lut) {
324323
for (size_t i = 0; i < nbytes; i++) {
325324
registers[0][reg_addr + i] = 0;
326325
}
327326
}
328-
327+
329328
// Now overwrite with our three parameters of interest
330-
c.compile("ALIGNER", "GLOBAL_MATCH_PATTERN_VAL", 10760600711006082389ULL, registers);
329+
c.compile("ALIGNER", "GLOBAL_MATCH_PATTERN_VAL", 10760600711006082389ULL,
330+
registers);
331331
c.compile("ALIGNER", "GLOBAL_IDLE_HDR_VAL", 12, registers);
332332
c.compile("ALIGNER", "GLOBAL_ORBSYN_CNT_LOAD_VAL", 3514, registers);
333-
333+
334334
// Decompile
335335
auto chip_params = c.decompile(registers, true, true);
336336
auto aligner_it = chip_params.find("ALIGNER");
337337
if (aligner_it != chip_params.end()) {
338338
const auto& params = aligner_it->second;
339-
339+
340340
auto check_param = [&](const std::string& param_name, uint64_t expected) {
341341
auto it = params.find(param_name);
342342
if (it != params.end()) {
343343
bool match = (it->second == expected);
344344
std::cout << param_name << ":" << std::endl;
345-
std::cout << " Found: " << std::dec << it->second
346-
<< " (0x" << std::hex << std::uppercase << it->second << ")" << std::endl;
347-
std::cout << " Expected: " << std::dec << expected
348-
<< " (0x" << std::hex << std::uppercase << expected << ")" << std::endl;
349-
std::cout << " Status: " << (match ? "PASS ✓" : "FAIL ✗") << std::endl << std::endl;
345+
std::cout << " Found: " << std::dec << it->second << " (0x"
346+
<< std::hex << std::uppercase << it->second << ")"
347+
<< std::endl;
348+
std::cout << " Expected: " << std::dec << expected << " (0x"
349+
<< std::hex << std::uppercase << expected << ")" << std::endl;
350+
std::cout << " Status: " << (match ? "PASS ✓" : "FAIL ✗")
351+
<< std::endl
352+
<< std::endl;
350353
BOOST_CHECK_EQUAL(it->second, expected);
351354
} else {
352355
std::cout << param_name << ":" << std::endl;
353356
std::cout << " Status: NOT FOUND ✗" << std::endl;
354-
std::cout << " Expected: " << std::dec << expected
355-
<< " (0x" << std::hex << std::uppercase << expected << ")" << std::endl << std::endl;
357+
std::cout << " Expected: " << std::dec << expected << " (0x"
358+
<< std::hex << std::uppercase << expected << ")" << std::endl
359+
<< std::endl;
356360
BOOST_FAIL("Parameter not found: " + param_name);
357361
}
358362
};
359-
363+
360364
check_param("GLOBAL_MATCH_PATTERN_VAL", 10760600711006082389ULL);
361365
check_param("GLOBAL_IDLE_HDR_VAL", 12);
362366
check_param("GLOBAL_ORBSYN_CNT_LOAD_VAL", 3514);
363367
} else {
364-
std::cout << "ERROR: ALIGNER page not found in decompiled output!" << std::endl;
368+
std::cout << "ERROR: ALIGNER page not found in decompiled output!"
369+
<< std::endl;
365370
BOOST_FAIL("ALIGNER page not found");
366371
}
367-
372+
368373
std::cout << "=== End of Test ===" << std::endl;
369-
} // end of BOOST_AUTO_TEST_CASE(read_three_aligner_params)
374+
} // end of BOOST_AUTO_TEST_CASE(read_three_aligner_params)
370375

371376
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)