diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-10-29 23:05:04 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-10-29 23:05:04 +0100 |
commit | b0b6a7d7f4de63fba2ba91a98cecec1bd57d03f1 (patch) | |
tree | 7dd61f93298d56a6234435b72b30bf00cacd242b /src/utils | |
parent | b716fdae5ef9b76920fdd2bcd8aab97d9cde90a0 (diff) | |
download | sysc-playground-b0b6a7d7f4de63fba2ba91a98cecec1bd57d03f1.tar.gz sysc-playground-b0b6a7d7f4de63fba2ba91a98cecec1bd57d03f1.zip |
test: add first lt_bus tests
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/range.h | 6 | ||||
-rw-r--r-- | src/utils/types.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/utils/range.h b/src/utils/range.h index ce25298..e4ef12f 100644 --- a/src/utils/range.h +++ b/src/utils/range.h @@ -7,7 +7,7 @@ struct range { constexpr explicit range(u64 start, u64 end) : start{start}, end{end} { - assert(start < end); + assert(start <= end); } constexpr bool overlaps(range rhs) const { @@ -18,6 +18,10 @@ struct range { return start <= rhs.start && rhs.end <= end; } + constexpr bool operator==(range rhs) const { + return start == rhs.start && end == rhs.end; + } + u64 start; u64 end; }; diff --git a/src/utils/types.h b/src/utils/types.h index a13b8ef..4f824f6 100644 --- a/src/utils/types.h +++ b/src/utils/types.h @@ -3,6 +3,7 @@ #include <cstdint> +using u8 = std::uint8_t; using u32 = std::uint32_t; using u64 = std::uint64_t; |