Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of z_digit "?" and fix optimization of cmp with "z" #1377

Merged
merged 1 commit into from
Sep 15, 2019

Conversation

cliffordwolf
Copy link
Collaborator

See m-labs/nmigen#202 (comment) for details.

Signed-off-by: Clifford Wolf <clifford@clifford.at>
@@ -953,6 +953,10 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bool cons
}

if (b.is_fully_const()) {
if (b.is_fully_undef()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be is_fully_undef and not is_any_undef? My reading of the standard is that any x or z bits in any operand cause the result to be x.
Screenshot_20190913_114627

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is only for 1 bit expressions, so fully_undef and any_undef is the same.. However, answering the more general point, for example 2'b00 == 2'b1x is 1'b0. That's what's meant by "if [...] the relation is ambiguous".

@cliffordwolf cliffordwolf merged commit d9f9974 into master Sep 15, 2019
@eddiehung eddiehung deleted the clifford/fixzdigit branch September 30, 2019 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants