rohd icon indicating copy to clipboard operation
rohd copied to clipboard

An equality operator for `LogicValues` that supports "don't care"

Open mkorbel1 opened this issue 2 years ago • 1 comments

Motivation

There are cases where you want to compare two LogicValues values for some bits, but not all bits. It would be nice to support an equality check that enables a comparison of two LogicValues where any x is treated as a "don't care if this bit is equal". Some thought would need to be put into whether only one side of the comparison should consider x as don't care or both sides, or maybe that should be configurable. This feature is similar to a casez but for values instead of hardware.

Desired solution

Add a function for comparison with don't care to LogicValues.

Alternatives considered

Let users implement this functionality themselves as needed.

mkorbel1 avatar Mar 24 '22 20:03 mkorbel1

Comparison operator could also do things like compare a bus full of "x" to LogicValue.x with some sort of "fill" mechanism

mkorbel1 avatar Mar 28 '22 23:03 mkorbel1

I would like to take this one.

dmetis avatar Dec 21 '22 22:12 dmetis