[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
  Schedule::Load
  SVN::S4
  Synopsys-modes
  SystemPerl
  Verilog-Pli
  Voneline
  Vregs
General Info
  Papers

Patch #226

Improve error handling on slices of packed arrays

Added by Byron Bradley about 2 years ago. Updated about 2 years ago.

Status:Closed Start date:03/19/2010
Priority:Normal Due date:
Assignee:Byron Bradley % Done:

0%

Category:WrongRuntimeResult
Target version:-

Description

The attached patch improves error handling on slices of packed arrays:
  • We didn't throw an error if a constant value was assigned to an entire array. This could give wrong runtime results.
  • Because an assign was cloned, an error would be printed once for each clone. Only print one slice error per assign.

improve_packed_errors.diff (5.1 kB) Byron Bradley, 03/19/2010 07:54 pm

History

Updated by Wilson Snyder about 2 years ago

  • Status changed from New to Resolved

Thanks! A test even!

In git for 3.802+

Updated by Wilson Snyder about 2 years ago

From: Lane Brooks Subject: [Verilator-dev] array issues

I haven't been following the array/slice changes, but I recently pulled and rebased the tristate changes I have been working on and my design is now failing to verilate with an error:

%Error: ../../UXN1230/lib/rtl/HostInterface/models/fx2.v:46: Unsupported: Assignment between packed arrays of different dimensions

The verilog of line in question is:

reg [15:0] wbuf[0:255] /* verilator public */;

I git reverted commit 6715cb988001917ec341413f7ea133bc04a94fd4 and it verilates fine as before.

Do you need me to further isolate the problem or is this sufficient? The error message and line number are cryptic enough that I do not really know how what the issue is. The array in question has been working without issue prior to this.

Lane

Updated by Wilson Snyder about 2 years ago

  • Status changed from Resolved to Assigned

Updated by Lane Brooks about 2 years ago

Previously I mentioned that even after reverting this patch that I was still having problems. That was not correct. So in summary, this patch causes the above mentioned error. If I remove the /* verilator public */, then the error changes to
%Error: Internal Error: ../../UXN1230/lib/rtl/HostInterface/models/fx2.v:75: ../V3Slice.cpp:178: Couldn't find VarRef under the ArraySel
Line 75 is a read from the array inside a clocked process:
         datao <= wbuf[wptr + 1];

If I revert this patch, everything works fine.

Updated by Byron Bradley about 2 years ago

I haven't been able to reproduce this but I have found some possible issues with the code. Some of these were found as part of #227 so I'll probably put most/all of the patches there.

Wilson, at the moment V3Slice runs on every AstNodeAssign but I don't think it should. I've skipped AstAssignAlias nodes and all of the Verilator and my regression passes. Can you think of any other assign nodes that don't make it to V3Emit?

Updated by Byron Bradley about 2 years ago

Spoke too soon, AstAssignAlias nodes do make it to V3Emit so they do need to be expanded for slices.

Updated by Lane Brooks about 2 years ago

I did a little more digging into this problem, and it seems like a false alarm. I checked out the main branch without my new tristate changes and I do not see these errors. Likewise if I leave my changes in but revert this patch, I do not see the errors. So there is a conflict between this patch and my tristate changes.

So I dug a little deeper and found that the array was being tristate expanded because it did not have an any drivers (the drivers are actually in C). I decided that I will not tristate expand public variables when they have no drivers. That resolves the conflict.

Updated by Byron Bradley about 2 years ago

  • Status changed from Assigned to Resolved

Great, thanks Lane, that explains why I couldn't reproduce it :)

Updated by Wilson Snyder about 2 years ago

  • Status changed from Resolved to Closed

In 3.802

Also available in: Atom