Skip to content

Commit

Permalink
Add missing __all__ (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk authored Dec 3, 2024
1 parent 08fd4ba commit 6520af4
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion test/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import random
from amaranth import *
from amaranth.sim import *
from amaranth.lib.data import StructLayout

from transactron.testing import TestCaseWithSimulator, TestbenchIO, data_layout

Expand Down Expand Up @@ -45,7 +46,7 @@ def definition(arg):
self.do_test_definition(definition)

def test_fields_valid2(self):
rec = Signal(from_method_layout([("bar1", 4), ("bar2", 6)]))
rec = Signal(StructLayout({"bar1": 4, "bar2": 6}))

def definition(arg):
return {"foo1": Signal(3), "foo2": rec}
Expand Down
3 changes: 2 additions & 1 deletion test/testing/test_method_mock.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import random
from amaranth import *
from amaranth.sim import *
from amaranth.lib.data import StructLayout

from transactron import *
from transactron.testing import TestCaseWithSimulator, TestbenchContext
Expand All @@ -11,7 +12,7 @@

class ReverseMethodMockTestCircuit(Elaboratable):
def __init__(self, width):
self.method = Method(i=from_method_layout([("input", width)]), o=from_method_layout([("output", width)]))
self.method = Method(i=StructLayout({"input": width}), o=StructLayout({"output": width}))

def elaborate(self, platform):
m = TModule()
Expand Down
5 changes: 3 additions & 2 deletions transactron/core/manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import defaultdict, deque
from typing import Callable, Iterable, Sequence, TypeAlias, Tuple
from collections.abc import Callable, Iterable, Sequence, Collection, Mapping
from typing import TypeAlias, Optional
from os import environ
from graphlib import TopologicalSorter
from amaranth import *
Expand Down Expand Up @@ -89,7 +90,7 @@ def add_transaction(self, transaction: "Transaction"):
self.transactions.append(transaction)

@staticmethod
def _conflict_graph(method_map: MethodMap) -> Tuple[TransactionGraph, PriorityOrder]:
def _conflict_graph(method_map: MethodMap) -> tuple[TransactionGraph, PriorityOrder]:
"""_conflict_graph
This function generates the graph of transaction conflicts. Conflicts
Expand Down
3 changes: 2 additions & 1 deletion transactron/core/transaction_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections import defaultdict
from collections.abc import Iterator
from contextlib import contextmanager
from enum import Enum, auto
from itertools import count
Expand All @@ -12,7 +13,7 @@
Self,
runtime_checkable,
TYPE_CHECKING,
Iterator,
Optional,
)
from amaranth import *

Expand Down
3 changes: 3 additions & 0 deletions transactron/lib/fifo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
from transactron.utils.transactron_helpers import from_method_layout, get_src_loc


__all__ = ["BasicFifo", "Semaphore"]


class BasicFifo(Elaboratable):
"""Transactional FIFO queue
Expand Down
4 changes: 4 additions & 0 deletions transactron/lib/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
from transactron.utils._typing import ModuleLike, ValueLike
from transactron.utils.dependencies import DependencyContext, ListKey


__all__ = ["LogLevel", "LogRecordInfo", "LogRecord", "LogKey", "HardwareLogger", "get_log_records", "get_trigger_bit"]


LogLevel: TypeAlias = int


Expand Down
3 changes: 3 additions & 0 deletions transactron/utils/debug_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from collections.abc import Collection, Mapping


__all__ = ["auto_debug_signals"]


def auto_debug_signals(thing) -> SignalBundle:
"""Automatic debug signal generation.
Expand Down

0 comments on commit 6520af4

Please sign in to comment.