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: 7108111ad061
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: ecea721f432f
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Dec 14, 2018

  1. Fix deprecations in Python 3.7.

    whitequark committed Dec 14, 2018
    Copy the full SHA
    1c7b43e View commit details
  2. Copy the full SHA
    ecea721 View commit details
Showing with 18 additions and 14 deletions.
  1. +10 −9 nmigen/compat/fhdl/module.py
  2. +2 −2 nmigen/compat/fhdl/specials.py
  3. +1 −0 nmigen/fhdl/__init__.py
  4. +2 −1 nmigen/fhdl/dsl.py
  5. +2 −1 nmigen/fhdl/xfrm.py
  6. +1 −1 nmigen/tools.py
19 changes: 10 additions & 9 deletions nmigen/compat/fhdl/module.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from collections import Iterable
from collections.abc import Iterable

from ...tools import flatten, deprecated
from ...fhdl import dsl
@@ -61,12 +61,12 @@ def __setattr__(self, name, value):
class _CompatModuleSpecials(_CompatModuleProxy):
@deprecated("instead of `self.specials.<name> =`, use `m.submodules.<name> =`")
def __setattr__(self, name, value):
self._cm._specials.append((name, value))
self._cm._submodules.append((name, value))
setattr(self._cm, name, value)

@deprecated("instead of `self.specials +=`, use `m.submodules +=`")
def __iadd__(self, other):
self._cm._specials += [(None, e) for e in _flat_list(other)]
self._cm._submodules += [(None, e) for e in _flat_list(other)]
return self


@@ -135,14 +135,15 @@ def __getattr__(self, name):
raise AttributeError("'{}' object has no attribute '{}'"
.format(type(self).__name__, name))

def _finalize_specials(self):
for name, special in self._specials:
self._module._add_submodule(special, name)

def _finalize_submodules(self):
for name, submodule in self._submodules:
if not submodule.get_fragment_called:
self._module._add_submodule(submodule.get_fragment(), name)
if hasattr(submodule, "get_fragment_called"):
# Compat submodule
if not submodule.get_fragment_called:
self._module._add_submodule(submodule.get_fragment(), name)
else:
# Native submodule
self._module._add_submodule(submodule, name)

def finalize(self, *args, **kwargs):
if not self.finalized:
4 changes: 2 additions & 2 deletions nmigen/compat/fhdl/specials.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from ...genlib.io import TSTriple as NewTSTriple
from ...genlib.io import TSTriple as NativeTSTriple


__all__ = ["TSTriple"]


class CompatTSTriple(NewTSTriple):
class CompatTSTriple(NativeTSTriple):
def __init__(self, bits_sign=None, min=None, max=None, reset_o=0, reset_oe=0, reset_i=0,
name=None):
super().__init__(shape=bits_sign, min=min, max=max,
1 change: 1 addition & 0 deletions nmigen/fhdl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .cd import ClockDomain
from .ast import Value, Const, Mux, Cat, Repl, Signal, ClockSignal, ResetSignal
from .ir import Fragment
from .dsl import Module
from .xfrm import ResetInserter, CEInserter
3 changes: 2 additions & 1 deletion nmigen/fhdl/dsl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections import OrderedDict, Iterable
from collections import OrderedDict
from collections.abc import Iterable
from contextlib import contextmanager

from .ast import *
3 changes: 2 additions & 1 deletion nmigen/fhdl/xfrm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections import OrderedDict, Iterable
from collections import OrderedDict
from collections.abc import Iterable

from ..tools import flatten
from .ast import *
2 changes: 1 addition & 1 deletion nmigen/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from collections import Iterable
from collections.abc import Iterable
import functools
import warnings