Skip to content

Triple equals === in ROHD #353

Closed Answered by mkorbel1
quekyj asked this question in Q&A
Discussion options

You must be logged in to vote

ROHD takes a different approach to how signals, values, and equality checks work than SystemVerilog.

Comparing the values of two Logic signals in a synthesizable way is done using Logic.eq. This will always represent a synthesizable comparison. In simulation, if either value is not valid, the resulting equality check will also be invalid.

Comparing whether two Logic objects are exactly the same is done using Logic.==. This is a pure-software object reference comparison.

Comparing whether two LogicValues have the same value is done using LogicValue.==. This checks that every bit of the value is identical, including invalid bits like x and z. Note that LogicValue is sort of like an arbitrar…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by quekyj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants