SILICON
Loading...
Searching...
No Matches
wireUtils.hpp File Reference
#include <cstddef>
#include <vector>
#include <core/wire.hpp>
Include dependency graph for wireUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  SILICON
namespace  SILICON::wireUtils

Functions

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.