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 #226

Improve error handling on slices of packed arrays

Added by Byron Bradley over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
WrongRuntimeResult
% Done:

0%


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 View (5.11 KB) Byron Bradley, 03/19/2010 07:54 PM

History

#1 Updated by Wilson Snyder over 9 years ago

  • Status changed from New to Resolved

Thanks! A test even!

In git for 3.802+

#2 Updated by Wilson Snyder over 9 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

#3 Updated by Wilson Snyder over 9 years ago

  • Status changed from Resolved to Assigned

#4 Updated by Lane Brooks over 9 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.

#5 Updated by Byron Bradley over 9 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?

#6 Updated by Byron Bradley over 9 years ago

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

#7 Updated by Lane Brooks over 9 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.

#8 Updated by Byron Bradley over 9 years ago

  • Status changed from Assigned to Resolved

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

#9 Updated by Wilson Snyder over 9 years ago

  • Status changed from Resolved to Closed

In 3.802

Also available in: Atom