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

cxxrtl: Prevent wires with input or output ports from being aliased #4406

Merged
merged 1 commit into from
May 24, 2024

Conversation

noeamiot
Copy link
Contributor

As explained in #4405, having outputs or inputs aliased causes a loss of information in debug_info.

To prevent this behavior, we stop assigning debug information at the beginning of the debug_alias option corresponding logic if the wire is an input and/or an output.

One implementation choice here was to choose, for an input that is tied to a constant, whether we should generate:

items->add(path, "a0", "src\000sand_ti.v:1.18-1.20\000", p_a0, 0, debug_item::INPUT|debug_item::DRIVEN_COMB);

or

static const value<1> const_p_a0 = value<1>{0u};
items->add(path, "a0", "src\000sand_ti.v:1.18-1.20\000", const_p_a0);

This patch is an implementation for the first one, because we can still query the constant later in the first whereas we would loose the INPUT and DRIVEN_COMB flags in the second one.

@noeamiot noeamiot requested a review from whitequark as a code owner May 21, 2024 19:53
@noeamiot noeamiot force-pushed the unaliasable_in_and_outs branch from edc6236 to 5d61ec5 Compare May 22, 2024 07:15
@noeamiot noeamiot requested a review from whitequark May 22, 2024 07:44
Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@whitequark whitequark merged commit c7580eb into YosysHQ:main May 24, 2024
21 checks passed
@noeamiot noeamiot deleted the unaliasable_in_and_outs branch May 24, 2024 22:34
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.

2 participants