Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/nmigen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ce1eff5464e5
Choose a base ref
...
head repository: m-labs/nmigen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 083016d747f2
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 21, 2019

  1. 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.
    whitequark committed Apr 21, 2019
    Copy the full SHA
    083016d View commit details
Showing with 3 additions and 3 deletions.
  1. +3 −3 nmigen/back/rtlil.py
6 changes: 3 additions & 3 deletions nmigen/back/rtlil.py
Original file line number Diff line number Diff line change
@@ -299,9 +299,6 @@ class _ValueCompiler(xfrm.ValueVisitor):
def __init__(self, state):
self.s = state

def on_value(self, value):
return super().on_value(self.s.expand(value))

def on_unknown(self, value):
if value is None:
return None
@@ -375,6 +372,9 @@ class _RHSValueCompiler(_ValueCompiler):
(3, "m"): "$mux",
}

def on_value(self, value):
return super().on_value(self.s.expand(value))

def on_Const(self, value):
if isinstance(value.value, str):
return "{}'{}".format(value.nbits, value.value)