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: 9bce35098f65
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: db5fd1e4c49e
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 16, 2018

  1. Copy the full SHA
    db5fd1e View commit details
Showing with 6 additions and 2 deletions.
  1. +6 −2 nmigen/compat/fhdl/structure.py
8 changes: 6 additions & 2 deletions nmigen/compat/fhdl/structure.py
Original file line number Diff line number Diff line change
@@ -30,12 +30,16 @@ def Constant(value, bits_sign=None):
class If(ast.Switch):
@deprecated("instead of `If(cond, ...)`, use `with m.If(cond): ...`")
def __init__(self, cond, *stmts):
cond = Value.wrap(cond).bool()
cond = Value.wrap(cond)
if len(cond) != 1:
cond = cond.bool()
super().__init__(cond, {"1": ast.Statement.wrap(stmts)})

@deprecated("instead of `.Elif(cond, ...)`, use `with m.Elif(cond): ...`")
def Elif(self, cond, *stmts):
cond = Value.wrap(cond).bool()
cond = Value.wrap(cond)
if len(cond) != 1:
cond = cond.bool()
self.cases = OrderedDict(("-" + k, v) for k, v in self.cases.items())
self.cases["1" + "-" * len(self.test)] = ast.Statement.wrap(stmts)
self.test = Cat(self.test, cond)