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/migen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fc1fb7ef6c67
Choose a base ref
...
head repository: m-labs/migen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 462005f18023
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 1, 2016

  1. Copy the full SHA
    9964693 View commit details
  2. import module2 with *

    sbourdeauducq committed Aug 1, 2016
    Copy the full SHA
    462005f View commit details
Showing with 8 additions and 1 deletion.
  1. +1 −0 migen/__init__.py
  2. +7 −1 migen/fhdl/module2.py
1 change: 1 addition & 0 deletions migen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from migen.fhdl.structure import *
from migen.fhdl.module import *
from migen.fhdl.module2 import *
from migen.fhdl.specials import *
from migen.fhdl.bitcontainer import *
from migen.fhdl.decorators import *
8 changes: 7 additions & 1 deletion migen/fhdl/module2.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
from migen.fhdl.structure import _Assign, _Operator, _Fragment


__all__ = ["Module2", "ports", "sync"]
__all__ = ["Module2", "ports", "comb", "sync"]


class PortManager:
@@ -107,6 +107,12 @@ def ast_stmt_to_fhdl(node, globs, locs):
assert t.attr == "next"
r.append(_Assign(eval_ast(t.value, globs, locs), value))
return r
elif isinstance(node, ast.If):
return If(ast_expr_to_fhdl(node.test, globs, locs),
*ast_stmt_to_fhdl(node.body, globs, locs)).Else(
*ast_stmt_to_fhdl(node.orelse, globs, locs))
elif isinstance(node, ast.Expr):
return eval_ast(node.value, globs, locs)
else:
raise NotImplementedError