Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1414

Multi dimensional variable in function causing issues

Added by Johan Wouters 6 months ago. Updated 3 months ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
% Done:

0%


Description

Hi,

I added a small example of a structure that causes issues in our codebase. We use a function to calculate a localparam and Verilator seems to fail because the function contains a multi-dimensional variable.

The message I get is: %Error: test.v:19: Expecting expression to be constant, but can't determine constant for FUNCREF 'problematic function' %Error: test.v:13 ... Location of non-constant ASSIGN: LHS isn't simple variable

this is with Verilator 4.012 and swithes -sv -Wno-lint -cc test.v --top-module test

The code can be simulated, logic synthesis and logic equivalence checking also works fine

verilator_testcase.PNG View - Code example (24 KB) Johan Wouters, 04/03/2019 03:29 PM

History

#1 Updated by Wilson Snyder 3 months ago

  • Status changed from New to Duplicate

Sorry, forgot to reply to this when filed. This is duplicate of bug1315, basically at present you can't have unpacked arrays in constant functions. A woraround is to use a packed array.

reg signed [127:0] [0:4-1] blah;

Also available in: Atom