cjdrake / pyeda

Python EDA
BSD 2-Clause "Simplified" License
307 stars 55 forks source link

farray slices steps are broken #74

Closed cjdrake closed 10 years ago

cjdrake commented 10 years ago
from pyeda.inter import *
X = exprvars('x', 8)
X[::2]

throws: ValueError: expected shape volume to match items

The reason is that the new shape is not correctly adjusted by the step of the slice. It's probably better to forbid using a slice step than to modify the array shape. Modifying the shape would lose some information. SystemVerilog doesn't have slice steps, so it's not a big deal. The only other "correct" way to handle it would be to add step information to the shape. That would be ... complicated.