You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Translation does not work for ranges involving negative indices. The pythonic way to get the last element in a list is x[-1]. This translates fine. However, the semantics of list slicing involving negative indices are not translated properly and you get a verilator error about backwards bit ordering:
For example, both of these fail to translate:
x[:-1] (get everything up to the last element)
x[0:-1]
[-2:0] Range extract has backward bit ordering, perhaps you wanted [0:-2]
A common example of where you would want to do list slicing such as this is dealing with signed numbers, where you want to extract the sign bit x[-1] as well as everything else x[:-1]
The text was updated successfully, but these errors were encountered:
Translation does not work for ranges involving negative indices. The pythonic way to get the last element in a list is
x[-1]
. This translates fine. However, the semantics of list slicing involving negative indices are not translated properly and you get a verilator error about backwards bit ordering:For example, both of these fail to translate:
x[:-1]
(get everything up to the last element)x[0:-1]
[-2:0] Range extract has backward bit ordering, perhaps you wanted [0:-2]
A common example of where you would want to do list slicing such as this is dealing with signed numbers, where you want to extract the sign bit
x[-1]
as well as everything elsex[:-1]
The text was updated successfully, but these errors were encountered: