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 doesn't detect multiple assignment #1184

veripoolbot opened this issue Jul 18, 2017 · 0 comments

Verilator doesn't detect multiple assignment #1184

veripoolbot opened this issue Jul 18, 2017 · 0 comments


Copy link

@veripoolbot veripoolbot commented Jul 18, 2017

Author Name: Dan Gisselquist
Original Redmine Issue: 1184 from

Consider the following code, first posted on the forum:

module tst(i_clk, i_val, o_a, o_b);
         input   wire    i_clk;
         input   wire    i_val;
         output  reg     o_a, o_b;

         always @(posedge i_clk)
                 if ((i_val)&&(!o_a))
                         o_b <= 1'b0;

         always @(posedge i_clk)
                 if ((i_val)&&(o_a))
                         o_b <= 1'b1;

         always @(posedge i_clk)
                 o_a <= i_val;


Notice how o_b is being set to contradictory values. I'd like to recommend that Verilator check for this.

I've searched through V3Delayed.cpp, seen the MULTIDRIVEN logic, thought to try to fix it but ... I'm still struggling to figure out what's going on. ;) I know, it can't be too hard ... I know what an AST is, I know what a parser is, etc., I just ... haven't figured it out yet. Oh, ok, here it is ... just found the defn of an ActiveAST ... I think I see the problem now, I just don't (yet) know how I might fix it.



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.