summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-11 12:00:09 -0400
committerbd <bdunahu@operationnull.com>2025-03-11 12:00:09 -0400
commit97173af3651138db50cc42df25b474af2b6ece43 (patch)
tree6acbf3d9e589afe31b735dab2dca4c7fac54a4ba
parent7c226db9f04de7061596b98763dc408d601d74e1 (diff)
Pad memory address output with trailing zeros
-rw-r--r--src/storage/dram.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/storage/dram.cc b/src/storage/dram.cc
index d239cb1..8513147 100644
--- a/src/storage/dram.cc
+++ b/src/storage/dram.cc
@@ -82,11 +82,11 @@ std::ostream &operator<<(std::ostream &os, const Dram &d)
std::vector<std::array<signed int, LINE_SIZE>> data = d.view(0, MEM_LINES);
- os << " " << std::setfill(' ') << std::setw(MEM_LINE_SPEC + 2) << "INDEX"
+ os << " " << std::setfill(' ') << std::setw(MEM_LINE_SPEC + 2 + LINE_SPEC) << "ADDRESS"
<< " | " << std::setfill(' ') << std::setw((8 + 3) * 4 - 1) << "DATA"
<< std::endl;
for (int i = 0; i < MEM_LINES; ++i) {
- os << " 0b" << std::setw(MEM_LINE_SPEC) << std::bitset<MEM_LINE_SPEC>(i) << " | ";
+ os << " 0b" << std::setw(MEM_LINE_SPEC+LINE_SPEC) << left << std::bitset<MEM_LINE_SPEC>(i) << " | ";
for (int j = 0; j < LINE_SIZE; ++j) {
os << "0x" << std::setfill('0') << std::setw(8) << std::hex
<< data.at(i).at(j) << ' ';