diff options
| author | Julian Blake Kongslie | 2022-10-15 14:03:28 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-10-15 14:03:28 -0700 |
| commit | eaef9348431ea331ecf118aefc21246dbcf2c998 (patch) | |
| tree | d12a2f3c8d86b47a12ef2ef78a02be552cf59475 /memory/line.h | |
| parent | Initial commit (copied from biggolf) (diff) | |
| download | nanosim-eaef9348431ea331ecf118aefc21246dbcf2c998.tar.xz | |
Add memory implementation as well; reorg.
Diffstat (limited to 'memory/line.h')
| -rw-r--r-- | memory/line.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/memory/line.h b/memory/line.h new file mode 100644 index 0000000..3377ec8 --- /dev/null +++ b/memory/line.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <array> | ||
| 4 | #include <cstdint> | ||
| 5 | |||
| 6 | #include "infra/port.h" | ||
| 7 | #include "infra/sim.h" | ||
| 8 | |||
| 9 | namespace memory { | ||
| 10 | constexpr std::uint64_t LINE_BYTES_LOG2 = 4; | ||
| 11 | constexpr std::uint64_t LINE_BYTES = 1 << LINE_BYTES_LOG2; | ||
| 12 | constexpr std::uint64_t LINE_BYTE_OFFSET_MASK = LINE_BYTES - 1; | ||
| 13 | |||
| 14 | typedef std::array<std::uint8_t, LINE_BYTES> line; | ||
| 15 | } | ||
