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: ecea721f432f
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: 9010805040ee
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 15, 2018

  1. Copy the full SHA
    9010805 View commit details
Showing with 2 additions and 0 deletions.
  1. +2 −0 nmigen/compat/fhdl/structure.py
2 changes: 2 additions & 0 deletions nmigen/compat/fhdl/structure.py
Original file line number Diff line number Diff line change
@@ -29,10 +29,12 @@ 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()
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()
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)