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

tgt-vvp: Use signedness of expression instead of signal for index load #1166

Merged
merged 2 commits into from
Sep 7, 2024

Commits on Sep 2, 2024

  1. tgt-vvp: Use signedness of expression instead of signal for index load

    When loading a signal into into an index register currently the signedness
    of the signal is used when deciding whether sign-extension should be
    performed or not. But this can lead to incorrect results, instead the
    signedness of the expression must be used as that might be different from
    the signal. E.g.
    
    ```
    reg signed [1:0] = 2'b10;
    $display(1 << x[1:0]);
    ```
    
    gives the wrong result without this.
    
    Signed-off-by: Lars-Peter Clausen <[email protected]>
    larsclausen committed Sep 2, 2024
    Configuration menu
    Copy the full SHA
    50d9a32 View commit details
    Browse the repository at this point in the history
  2. ivtest: Add regression test to check that shift rhs is always unsigned

    Add a regression test to check that the right-hand side of a shift
    operation is always treated as unsigned, even if it is a signed registers
    or a variation thereof.
    
    Signed-off-by: Lars-Peter Clausen <[email protected]>
    larsclausen committed Sep 2, 2024
    Configuration menu
    Copy the full SHA
    841e5a9 View commit details
    Browse the repository at this point in the history