{,_}tools→{,_}utils

In context of nMigen, "tools" means "parts of toolchain", so it is
confusing to have a completely unrelated module also called "tools".
This commit is contained in:
whitequark 2019-10-13 18:53:38 +00:00
parent ccd28b40c2
commit 2f9dab361f
39 changed files with 43 additions and 43 deletions

View file

@ -5,7 +5,7 @@ from collections import OrderedDict
from collections.abc import Iterable from collections.abc import Iterable
from contextlib import contextmanager from contextlib import contextmanager
from .tools import * from .utils import *
__all__ = ["flatten", "union" , "log2_int", "bits_for", "memoize", "final", "deprecated"] __all__ = ["flatten", "union" , "log2_int", "bits_for", "memoize", "final", "deprecated"]

View file

@ -6,7 +6,7 @@ from bitarray import bitarray
from vcd import VCDWriter from vcd import VCDWriter
from vcd.gtkw import GTKWSave from vcd.gtkw import GTKWSave
from .._tools import flatten from .._utils import flatten
from ..hdl.ast import * from ..hdl.ast import *
from ..hdl.ir import * from ..hdl.ir import *
from ..hdl.xfrm import ValueVisitor, StatementVisitor from ..hdl.xfrm import ValueVisitor, StatementVisitor

View file

@ -3,7 +3,7 @@ import textwrap
from collections import defaultdict, OrderedDict from collections import defaultdict, OrderedDict
from contextlib import contextmanager from contextlib import contextmanager
from .._tools import bits_for, flatten from .._utils import bits_for, flatten
from ..hdl import ast, rec, ir, mem, xfrm from ..hdl import ast, rec, ir, mem, xfrm

View file

@ -1,19 +1,19 @@
from ... import tools from ... import utils
from ...hdl import ast from ...hdl import ast
from ..._tools import deprecated from ..._utils import deprecated
__all__ = ["log2_int", "bits_for", "value_bits_sign"] __all__ = ["log2_int", "bits_for", "value_bits_sign"]
@deprecated("instead of `log2_int`, use `nmigen.tools.log2_int`") @deprecated("instead of `log2_int`, use `nmigen.utils.log2_int`")
def log2_int(n, need_pow2=True): def log2_int(n, need_pow2=True):
return tools.log2_int(n, need_pow2) return utils.log2_int(n, need_pow2)
@deprecated("instead of `bits_for`, use `nmigen.tools.bits_for`") @deprecated("instead of `bits_for`, use `nmigen.utils.bits_for`")
def bits_for(n, require_sign_bit=False): def bits_for(n, require_sign_bit=False):
return tools.bits_for(n, require_sign_bit) return utils.bits_for(n, require_sign_bit)
@deprecated("instead of `value_bits_sign(v)`, use `v.shape()`") @deprecated("instead of `value_bits_sign(v)`, use `v.shape()`")

View file

@ -2,7 +2,7 @@ from ...hdl.ast import *
from ...hdl.xfrm import ResetInserter as NativeResetInserter from ...hdl.xfrm import ResetInserter as NativeResetInserter
from ...hdl.xfrm import EnableInserter as NativeEnableInserter from ...hdl.xfrm import EnableInserter as NativeEnableInserter
from ...hdl.xfrm import DomainRenamer as NativeDomainRenamer from ...hdl.xfrm import DomainRenamer as NativeDomainRenamer
from ..._tools import deprecated from ..._utils import deprecated
__all__ = ["ResetInserter", "CEInserter", "ClockDomainsRenamer"] __all__ = ["ResetInserter", "CEInserter", "ClockDomainsRenamer"]

View file

@ -1,6 +1,6 @@
from collections.abc import Iterable from collections.abc import Iterable
from ..._tools import flatten, deprecated from ..._utils import flatten, deprecated
from ...hdl import dsl, ir from ...hdl import dsl, ir

View file

@ -1,6 +1,6 @@
import warnings import warnings
from ..._tools import deprecated, extend from ..._utils import deprecated, extend
from ...hdl.ast import * from ...hdl.ast import *
from ...hdl.ir import Elaboratable from ...hdl.ir import Elaboratable
from ...hdl.mem import Memory as NativeMemory from ...hdl.mem import Memory as NativeMemory

View file

@ -1,6 +1,6 @@
from collections import OrderedDict from collections import OrderedDict
from ..._tools import deprecated, extend from ..._utils import deprecated, extend
from ...hdl import ast from ...hdl import ast
from ...hdl.ast import (DUID, Value, Signal, Mux, Slice as _Slice, Cat, Repl, Const, C, from ...hdl.ast import (DUID, Value, Signal, Mux, Slice as _Slice, Cat, Repl, Const, C,
ClockSignal, ResetSignal, ClockSignal, ResetSignal,

View file

@ -1,6 +1,6 @@
import warnings import warnings
from ..._tools import deprecated from ..._utils import deprecated
from ...lib.cdc import FFSynchronizer as NativeFFSynchronizer from ...lib.cdc import FFSynchronizer as NativeFFSynchronizer
from ...hdl.ast import * from ...hdl.ast import *
from ..fhdl.module import CompatModule from ..fhdl.module import CompatModule

View file

@ -1,4 +1,4 @@
from ..._tools import deprecated, extend from ..._utils import deprecated, extend
from ...lib.fifo import (FIFOInterface as NativeFIFOInterface, from ...lib.fifo import (FIFOInterface as NativeFIFOInterface,
SyncFIFO as NativeSyncFIFO, SyncFIFOBuffered as NativeSyncFIFOBuffered, SyncFIFO as NativeSyncFIFO, SyncFIFOBuffered as NativeSyncFIFOBuffered,
AsyncFIFO as NativeAsyncFIFO, AsyncFIFOBuffered as NativeAsyncFIFOBuffered) AsyncFIFO as NativeAsyncFIFO, AsyncFIFOBuffered as NativeAsyncFIFOBuffered)

View file

@ -1,6 +1,6 @@
from collections import OrderedDict from collections import OrderedDict
from ..._tools import deprecated, _ignore_deprecated from ..._utils import deprecated, _ignore_deprecated
from ...hdl.xfrm import ValueTransformer, StatementTransformer from ...hdl.xfrm import ValueTransformer, StatementTransformer
from ...hdl.ast import * from ...hdl.ast import *
from ..fhdl.module import CompatModule, CompatFinalizeError from ..fhdl.module import CompatModule, CompatFinalizeError

View file

@ -1,4 +1,4 @@
from ..._tools import deprecated from ..._utils import deprecated
from ...lib.cdc import ResetSynchronizer as NativeResetSynchronizer from ...lib.cdc import ResetSynchronizer as NativeResetSynchronizer

View file

@ -8,7 +8,7 @@ from collections.abc import Iterable, MutableMapping, MutableSet, MutableSequenc
from enum import Enum from enum import Enum
from .. import tracer from .. import tracer
from .._tools import * from .._utils import *
__all__ = [ __all__ = [

View file

@ -4,7 +4,7 @@ from contextlib import contextmanager
from enum import Enum from enum import Enum
import warnings import warnings
from .._tools import flatten, bits_for, deprecated from .._utils import flatten, bits_for, deprecated
from .. import tracer from .. import tracer
from .ast import * from .ast import *
from .ir import * from .ir import *

View file

@ -5,7 +5,7 @@ import warnings
import traceback import traceback
import sys import sys
from .._tools import * from .._utils import *
from .ast import * from .ast import *
from .cd import * from .cd import *

View file

@ -3,7 +3,7 @@ from collections import OrderedDict
from functools import reduce from functools import reduce
from .. import tracer from .. import tracer
from .._tools import union, deprecated from .._utils import union, deprecated
from .ast import * from .ast import *

View file

@ -2,7 +2,7 @@ from abc import ABCMeta, abstractmethod
from collections import OrderedDict from collections import OrderedDict
from collections.abc import Iterable from collections.abc import Iterable
from .._tools import flatten, deprecated from .._utils import flatten, deprecated
from .. import tracer from .. import tracer
from .ast import * from .ast import *
from .ast import _StatementList from .ast import _StatementList

View file

@ -1,4 +1,4 @@
from .._tools import deprecated from .._utils import deprecated
from .. import * from .. import *

View file

@ -2,7 +2,7 @@
from .. import * from .. import *
from ..asserts import * from ..asserts import *
from .._tools import log2_int, deprecated from .._utils import log2_int, deprecated
from .coding import GrayEncoder from .coding import GrayEncoder
from .cdc import FFSynchronizer from .cdc import FFSynchronizer

View file

@ -1,4 +1,4 @@
from ..._tools import _ignore_deprecated from ..._utils import _ignore_deprecated
from ...compat import * from ...compat import *
from ...compat.fhdl import verilog from ...compat.fhdl import verilog

View file

@ -1,6 +1,6 @@
import unittest import unittest
from ..._tools import _ignore_deprecated from ..._utils import _ignore_deprecated
from ...compat import * from ...compat import *

View file

@ -1,7 +1,7 @@
from collections import OrderedDict from collections import OrderedDict
from ..build.dsl import * from ..build.dsl import *
from .tools import * from .utils import *
class PinsTestCase(FHDLTestCase): class PinsTestCase(FHDLTestCase):

View file

@ -3,7 +3,7 @@ from ..hdl.rec import *
from ..lib.io import * from ..lib.io import *
from ..build.dsl import * from ..build.dsl import *
from ..build.res import * from ..build.res import *
from .tools import * from .utils import *
class ResourceManagerTestCase(FHDLTestCase): class ResourceManagerTestCase(FHDLTestCase):

View file

@ -1,6 +1,6 @@
from ..hdl.ir import Fragment from ..hdl.ir import Fragment
from ..compat import * from ..compat import *
from .tools import * from .utils import *
class CompatTestCase(FHDLTestCase): class CompatTestCase(FHDLTestCase):

View file

@ -2,7 +2,7 @@ import sys
import subprocess import subprocess
from pathlib import Path from pathlib import Path
from .tools import * from .utils import *
def example_test(name): def example_test(name):

View file

@ -2,7 +2,7 @@ import warnings
from enum import Enum from enum import Enum
from ..hdl.ast import * from ..hdl.ast import *
from .tools import * from .utils import *
class UnsignedEnum(Enum): class UnsignedEnum(Enum):

View file

@ -1,5 +1,5 @@
from ..hdl.cd import * from ..hdl.cd import *
from .tools import * from .utils import *
class ClockDomainTestCase(FHDLTestCase): class ClockDomainTestCase(FHDLTestCase):

View file

@ -4,7 +4,7 @@ from enum import Enum
from ..hdl.ast import * from ..hdl.ast import *
from ..hdl.cd import * from ..hdl.cd import *
from ..hdl.dsl import * from ..hdl.dsl import *
from .tools import * from .utils import *
class DSLTestCase(FHDLTestCase): class DSLTestCase(FHDLTestCase):

View file

@ -4,7 +4,7 @@ from ..hdl.ast import *
from ..hdl.cd import * from ..hdl.cd import *
from ..hdl.ir import * from ..hdl.ir import *
from ..hdl.mem import * from ..hdl.mem import *
from .tools import * from .utils import *
class BadElaboratable(Elaboratable): class BadElaboratable(Elaboratable):

View file

@ -1,6 +1,6 @@
from ..hdl.ast import * from ..hdl.ast import *
from ..hdl.mem import * from ..hdl.mem import *
from .tools import * from .utils import *
class MemoryTestCase(FHDLTestCase): class MemoryTestCase(FHDLTestCase):

View file

@ -2,7 +2,7 @@ from enum import Enum
from ..hdl.ast import * from ..hdl.ast import *
from ..hdl.rec import * from ..hdl.rec import *
from .tools import * from .utils import *
class UnsignedEnum(Enum): class UnsignedEnum(Enum):

View file

@ -3,7 +3,7 @@ from ..hdl.cd import *
from ..hdl.ir import * from ..hdl.ir import *
from ..hdl.xfrm import * from ..hdl.xfrm import *
from ..hdl.mem import * from ..hdl.mem import *
from .tools import * from .utils import *
class DomainRenamerTestCase(FHDLTestCase): class DomainRenamerTestCase(FHDLTestCase):

View file

@ -1,4 +1,4 @@
from .tools import * from .utils import *
from ..hdl import * from ..hdl import *
from ..back.pysim import * from ..back.pysim import *
from ..lib.cdc import * from ..lib.cdc import *

View file

@ -1,4 +1,4 @@
from .tools import * from .utils import *
from ..hdl import * from ..hdl import *
from ..asserts import * from ..asserts import *
from ..back.pysim import * from ..back.pysim import *

View file

@ -1,4 +1,4 @@
from .tools import * from .utils import *
from ..hdl import * from ..hdl import *
from ..asserts import * from ..asserts import *
from ..back.pysim import * from ..back.pysim import *

View file

@ -1,4 +1,4 @@
from .tools import * from .utils import *
from ..hdl import * from ..hdl import *
from ..hdl.rec import * from ..hdl.rec import *
from ..back.pysim import * from ..back.pysim import *

View file

@ -1,7 +1,7 @@
from contextlib import contextmanager from contextlib import contextmanager
from .tools import * from .utils import *
from .._tools import flatten, union from .._utils import flatten, union
from ..hdl.ast import * from ..hdl.ast import *
from ..hdl.cd import * from ..hdl.cd import *
from ..hdl.mem import * from ..hdl.mem import *