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

Verilator truncates statement incorrectly for pattern assignments #1037

Closed
veripoolbot opened this issue Feb 19, 2016 · 3 comments
Closed

Verilator truncates statement incorrectly for pattern assignments #1037

veripoolbot opened this issue Feb 19, 2016 · 3 comments
Assignees
Labels
area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Johan Bjork
Original Redmine Issue: 1037 from https://www.veripool.org
Original Date: 2016-02-19
Original Assignee: Wilson Snyder (@wsnyder)


// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2014 by Wilson Snyder.

module t (clk);
    input clk;
    typedef struct packed {
       logic [2:0] _foo;
       logic [2:0] _bar;
    } struct_t;

    logic [2:0] meh;
    struct_t param;
    localparam integer twentyone = 21;

    assign param = '{
       _foo: twentyone % 8 + 1,
       _bar: (twentyone / 8) + 1
    };
    assign meh = twentyone % 8 + 1;
    initial begin
       $display("param: %d, %d, %b, %d", param._foo, param._bar, param, meh);
       $write("*-* All Finished *-*\n");
       $finish;
    end

endmodule

yields param: 0, 0, 000000, 6
expected results:
param: 6, 3, 110011, 6

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-02-22T04:01:24Z


Fixed in git towards 3.881.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Johan Bjork
Original Date: 2016-02-22T13:46:46Z


thanks!

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-03-02T00:16:41Z


In 3.882.

@veripoolbot veripoolbot added area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants