back.rtlil: only expand legalized values in Array/Part context on RHS.
authorwhitequark <cz@m-labs.hk>
Sun, 21 Apr 2019 06:41:35 +0000 (06:41 +0000)
committerwhitequark <cz@m-labs.hk>
Sun, 21 Apr 2019 06:43:31 +0000 (06:43 +0000)
commitcccbc07e52a1bf650e0e9f1c27d54da9f9d1ba44
treea733f95712de96eb4cdf3932058b8c208d091231
parentd01822dda5c1ddcb78d41fd907dd18975f1947d6
back.rtlil: only expand legalized values in Array/Part context on RHS.

Otherwise the following code fails to compile:

    index = Signal(1)
    array = Array(range(2))
    with m.If(0 == array[index]):
        m.d.sync += index.eq(0)

Fixes #51.
nmigen/back/rtlil.py