Skip to content

Commit

Permalink
Concise printing
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasily Galkin committed Sep 27, 2022
1 parent 9991534 commit 1cb3dac
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,16 @@ impl fmt::Display for IOBuf {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(
f,
" 0x0 0x1 0x2 0x3| 0x4 0x5 0x6 0x7| 0x8 0x9 0xA 0xB| 0xC 0xD 0xE 0xF"
"values range: 0x{:08X}..=0x{:08X} FFFFFFFF-like count:{} bit-level stats table:",
self.actual_max, self.actual_min, self.actual_ff
)?;
write!(f, "Err1BIdx{}", self.err_bit1_idx)?;
write!(f, "ErrBiCnt{}", self.err_bitcount)?;
write!(f, "MemBiCnt{}", self.mem_bitcount)?;
writeln!(f, "actual_ff: {} actual_max: 0x{:08X} actual_min: 0x{:08X} done_iter_or_err:{} iter:{} calc_param 0x{:08X}",
self.actual_ff, self.actual_max, self.actual_min, self.done_iter_or_err, self.iter, self.calc_param)?;
write!(
writeln!(
f,
"idxs:{}-{} first_elem: {}",
self.idx_min, self.idx_max, self.first_elem
" 0x0 0x1 0x2 0x3| 0x4 0x5 0x6 0x7| 0x8 0x9 0xA 0xB| 0xC 0xD 0xE 0xF"
)?;
write!(f, "SinglIdx{}", self.err_bit1_idx)?;
write!(f, "TogglCnt{}", self.err_bitcount)?;
write!(f, "1sInValu{}", self.mem_bitcount)?;
Ok(())
}
}
Expand Down Expand Up @@ -964,7 +962,11 @@ fn test_device<Writer: std::io::Write>(
total_errors as f64/test_elems as f64 * 100.0f64,
error_range,
)?;
writeln!(log_dupler, " deatils:\n{}", last_buffer_out)?;
writeln!(
log_dupler,
" iteration:{}\n{}",
last_buffer_out.iter, last_buffer_out
)?;
}
last_buffer_out.check_vec_first()?;
}
Expand Down

0 comments on commit 1cb3dac

Please sign in to comment.