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

Internal Error: ...: ../V3Slice.cpp:277: ArraySel dtyping failed when resolving slice #795

Closed
veripoolbot opened this issue Jun 27, 2014 · 5 comments
Labels
area: lint Issue involves SystemVerilog lint checking resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Alex Solomatnikov
Original Redmine Issue: 795 from https://www.veripool.org


Incorrect RTL:

    way_cnt_t completed_cnt   [32-1:0][2-1:0];
    way_cnt_t completed_cnt_dp        [2-1:0];

  always_ff @(posedge clk) begin
     completed_cnt[id] <= `CLK2Q completed_cnt_dp + 1;
  end

causes internal error:

%Error: Internal Error: ...: ../V3Slice.cpp:277: ArraySel dtyping failed when resolving slice

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-06-27T02:11:32Z


Could you attach a self-contained failing example? Thanks.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2014-06-27T20:46:10Z


Test case is the same RTL wrapped in a module:

typedef logic [$clog2(32)-1:0]   id_t;
typedef logic [$clog2(26+1)-1:0] way_cnt_t;

module test_ver_bug( input logic clk,
                      input id_t  id );

    way_cnt_t completed_cnt   [32-1:0][2-1:0];
    way_cnt_t completed_cnt_dp        [2-1:0];

    assign completed_cnt_dp = completed_cnt[id];

    always_ff @(posedge clk) begin
       completed_cnt[id] <= completed_cnt_dp + 1;
    end

endmodule // test_ver_bug

The result:

verilator -sv --sp --top-module test_ver_bug test_ver_bug.v
%Error: Internal Error: test_ver_bug.v:13: ../V3Slice.cpp:277: ArraySel dtyping failed when resolving slice
%Error: Internal Error: See the manual and http://www.veripool.org/verilator for more assistance.
%Error: Command Failed /tools/verilator/verilator-3.860/bin/verilator_bin -sv --sp --top-module test_ver_bug test_ver_bug.v

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-06-28T00:18:32Z


This code is illegal. You are adding an unpacked array ([4:0] completed_cnt_dp [1:0]) with the integer 1 which is not an array. On other simulators this gives an error. This bug therefore is to make the error more readable.

The assert case (#�) is similar just an AND instead of increment.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2014-06-28T01:04:29Z


Another similar case in pin expression:

    logic [4-1:0] uop_state_dp[2-1:0];

    e_flop #($bits(r_rc_state)) u_r_rc_state_ff( .o(r_rc_state), 
                                                 .i((r_enq &&
                                                     r_would_be_empty &&
                                                     (uop_state_dp != `STATE_COMP0)) ? rc_state :
                                                                                       rc_state[r_head_id_comb]),
                                                 .en((r_enq && r_would_be_empty) ||
                                                     (!(r_enq && r_would_be_empty) && (r_deq && r_cnt_not_zero && !r_cnt_is_one)) ),
                                                 .* );

It should be uop_state_dp[0] in the pin expression but verilator does not say anything, instead producing incorrect C++ (as in #�).

Of course, the RTL is incorrect in this case but it is hard figure out what's wrong because C++ line must be correlated to Verilog source.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-11-23T16:38:13Z


A warning was added some time earlier as part of another bug. Test added to git so doesn't (re-)break in the future.

%Error: t/t_mem_slice_dtype_bad.v:22: ADD unexpected in assignment to unpacked array

@veripoolbot veripoolbot added area: lint Issue involves SystemVerilog lint checking 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: lint Issue involves SystemVerilog lint checking resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

1 participant