Menu

#14 For-Loops with negative Increment

closed-fixed
5
2008-04-18
2007-07-03
No

> for i in range(len(mem)-1,0,-1):
> mem[i].next=mem[i-1]

converts to

> for (i=(4 - 1); i<0; i=i+(-1)) begin
> mem[i] <= mem[(i - 1)];
> end

but the while term should be i>0.

Discussion

  • Jan Decaluwe

    Jan Decaluwe - 2008-03-18

    Logged In: YES
    user_id=144795
    Originator: NO

    Given the existence of 'downrange' it's probably not worthwhile to support negative steps. So I propose to flag an error instead. Moreover, for VHDL, steps other than 1 can't be supported anyway (because for-loops are done differently in VHDL). So steps other than 1 are flagged as error by the VHDL convertor.

    Implemented in 0.6dev7.

     
  • Jan Decaluwe

    Jan Decaluwe - 2008-03-18
    • status: open --> pending-fixed
     
  • SourceForge Robot

    • status: pending-fixed --> closed-fixed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 30 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

Auth0 Logo