SILICON
Loading...
Searching...
No Matches
wire.cpp File Reference
#include "wire.hpp"
#include <algorithm>
#include <ranges>
#include <stdexcept>
#include <utility>
#include <core/wireUtils.hpp>
#include <logging/logger.hpp>
#include <utils/num_formatting.hpp>
#include <utils/ranges_wrapper.hpp>
Include dependency graph for wire.cpp:

Go to the source code of this file.

Namespaces

namespace  SILICON
namespace  SILICON::core
namespace  SILICON::wireUtils

Functions

State operator&& (const State &a, const State &b)
State operator|| (const State &a, const State &b)
State operator! (const State &a)
State operator^ (const State &a, const State &b)
std::string to_str (State s)
bool busValueOverflowsWidth (const core::BusValue &value, std::size_t width)
 True when truncating to width would discard a non-low bit.
bool fitsUnsigned (const core::BusValue &value, std::size_t width)
 Tests whether an LSB-first value is representable as an unsigned value.
bool fitsSigned (const core::BusValue &value, std::size_t width)
 Tests whether an LSB-first two's-complement value fits a signed width.
BusValue normalizeBusValue (const core::BusValue &value, std::size_t width, core::State extension=core::State::LOW)
 Resize an LSB-first value to an exact bus width.
bool busWillChangeToValue (const core::Bus &bus, const core::BusValue &value)
 Checks whether assigning a binary value would change any driven bus wire.
bool isKnownBinary (core::State state)
 Tests whether a state is a concrete binary logic value.
bool mayBe (core::State actual, core::State expected)
 Tests whether an actual state could represent an expected binary state.
State normalizeBinaryOrUnknown (core::State state)
 Normalizes non-binary states for stored binary elements.
BusValue operator+ (const BusValue &a, const BusValue &b)
BusValue twosComplement (const BusValue &n)
std::partial_ordering compare (const BusValue &lhs, const BusValue &rhs, const Signedness signedness)
BusValue shift (const BusValue &v, const ptrdiff_t amount, const Signedness signedness)
BusValue multiply (const BusValue &a, const BusValue &b, const Signedness signedness)
std::pair< BusValue, BusValue > divide (const BusValue &a, const BusValue &b, Signedness signedness)