Menu

#286 inline: trouble with delayed assignment inside loop

devel
open
5
2014-05-02
2009-08-04
Ed Spittles
No

Hi Trevor
there is a problem when annotating a design with loops: I'm seeing
%Error-BLKLOOPINIT: ../../aos_x/src/aos_x_m.v:1405: Unsupported:
Delayed assignment to array inside for loops (non-delayed is ok - see
docs)

when the following snippet
387: for ( a1043 =`aos_x_hi ; a1043 >0; a1043 = a1043 -1)
388: begin
389: a1023 [ a1043 ] <= a1022 [ a1043 ];
390: a1025 [ a1043 ] <= a1024 [ a1043 ];

is being translated into this (sorry, mismatched obfuscation)
1772: for ( a1041 =( a1015 16)-1; a1041 >0; a1041 = a1041 -1) begin
\covered$Xe_714_714_38004a = a1041 > 0;
1773: \covered$U714_714_38004a$u$23/u$24/u$25 = (
\covered$Xe_714_714_38004a > 0);
1774:
1775: begin \covered$L716_716_3c$u$23/u$24/u$25/u$26 = 1'b1;
\covered$I716_716_2a$ a1021 $u$23/u$24/u$25/u$26 = (( a1041 )-((((
a1015 * 16 - 1)>(1))?(1):( a1015 * 16 - 1))))
(8);
\covered$X25_716_716_34003c = {8{1'b0}};
1776: a1021 [ a1041 ] <= {8{1'b0}}; \covered$W716_716_2a$ a1021
$u$23/u$24/u$25/u$26 = { \covered$X25_716_716_34003c [((8)-1)+(0):0],
\covered$I716_716_2a$ a1021 $u$23/u$24/u$25/u$26 };
\covered$L717_717_3c$u$23/u$24/u$25/u$26 = 1'b1; \covered$I717_717_2c$
a1023 $u$23/u$24/u$25/u$26 = (( a1041 )-(((( a1015 * 16 -
1)>(1))?(1):( a1015 * 16 - 1))))*(8); \covered$X25_717_717_34003c =
{8{1'b0}};

I hope that's enough for you to reproduce the problem, if not please ask and I'll try to put together a testcase.

Thanks
Ed

Discussion

  • Ed Spittles

    Ed Spittles - 2009-08-06

    Hi Trevor
    as discussed, it turns out I'm seeing valgrind errors, and the verilator error is very sensitive to the exact text in the original source, so I'm thinking this is a low level bug. I've sent you a private testcase.

    cheers
    Ed

     
  • Trevor Williams

    Trevor Williams - 2009-08-10

    Bug fix patch for valgrind errors

     
  • Trevor Williams

    Trevor Williams - 2009-08-10

    Added bug fix patch for the valgrind errors that are reported. Memory coverage has not yet been removed from FOR loops at this point, however.

     

Log in to post a comment.

MongoDB Logo MongoDB