| 1396 | } |
| 1397 | |
| 1398 | uint8_t *LogicSnapshot::get_block_buf(int block_index, int sig_index, bool &sample) |
| 1399 | { |
| 1400 | assert(block_index < get_block_num()); |
| 1401 | |
| 1402 | int order = get_ch_order(sig_index); |
| 1403 | if (order == -1) { |
| 1404 | sample = 0; |
| 1405 | return NULL; |
| 1406 | } |
| 1407 | |
| 1408 | int block_index0 = block_index; |
| 1409 | block_index += _loop_offset / LeafBlockSamples; |
| 1410 | |
| 1411 | uint64_t index = block_index / RootScale; |
| 1412 | uint8_t pos = block_index % RootScale; |
| 1413 | uint8_t *lbp = (uint8_t*)_ch_data[order][index].lbp[pos]; |
| 1414 | |
| 1415 | if (lbp == NULL) |
| 1416 | sample = (_ch_data[order][index].first & 1ULL << pos) != 0; |
| 1417 | |
| 1418 | if (lbp != NULL && _loop_offset > 0 && block_index0 == 0) |
| 1419 | { |
| 1420 | lbp += (_loop_offset % LeafBlockSamples) / 8; |
| 1421 | } |
| 1422 | |
| 1423 | return lbp; |
| 1424 | } |
| 1425 | |
| 1426 | int LogicSnapshot::get_ch_order(int sig_index) |
| 1427 | { |
no outgoing calls
no test coverage detected