3#include "slang/numeric/ConstantValue.h"
4#include "slang/util/Util.h"
15 using ConstantRange::ConstantRange;
17 auto toPair() const -> std::pair<int32_t, int32_t> {
18 return {lower(), upper()};
24 return upper() + 1 >= other.lower() && other.upper() + 1 >= lower();
31 return {std::min(lower(), other.lower()), std::max(upper(), other.upper())};
37 -> std::optional<DriverBitRange> {
38 if (!overlaps(other)) {
42 std::min(upper(), other.upper())};
46static inline auto toString(DriverBitRange
const &range) -> std::string {
47 if (range.lower() == range.upper()) {
48 return fmt::format(
"[{}]", range.lower());
50 return fmt::format(
"[{}:{}]", range.upper(), range.lower());
53static inline auto toString(std::pair<int32_t, int32_t> bounds) -> std::string {
Definition Utilities.hpp:16
A range over which a symbol is driven.
Definition DriverBitRange.hpp:14
auto toPair() const -> std::pair< int32_t, int32_t >
Definition DriverBitRange.hpp:17
auto intersection(DriverBitRange other) const -> std::optional< DriverBitRange >
Definition DriverBitRange.hpp:36
auto unionWith(DriverBitRange other) const -> DriverBitRange
Definition DriverBitRange.hpp:29
auto isContiguousWith(DriverBitRange other) const -> bool
Definition DriverBitRange.hpp:23