Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autumn cleaning part 3 - split transactron/core.py #471

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions coreblocks/utils/fifo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from amaranth import *
from transactron import Method, def_method, Priority, TModule
from transactron._utils import MethodLayout
from transactron import Method, def_method, Priority, TModule, MethodLayout
from coreblocks.utils._typing import ValueLike


Expand Down
3 changes: 2 additions & 1 deletion test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from amaranth.sim import *
from amaranth.sim.core import Command

from transactron.core import SignalBundle, Method, TransactionModule
from transactron.core import Method, TransactionModule
from transactron.core.typing import SignalBundle
from transactron.lib import AdapterBase, AdapterTrans
from transactron._utils import method_def_helper
from coreblocks.utils import ValueLike, HasElaborate, HasDebugSignals, auto_debug_signals, LayoutLike, ModuleConnector
Expand Down
9 changes: 3 additions & 6 deletions test/transactions/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
from transactron.lib import Adapter, AdapterTrans
from transactron._utils import Scheduler

from transactron.core import (
Priority,
TransactionScheduler,
trivial_roundrobin_cc_scheduler,
eager_deterministic_cc_scheduler,
)
from transactron.core import Priority
from transactron.core.schedulers import trivial_roundrobin_cc_scheduler, eager_deterministic_cc_scheduler
from transactron.core.typing import TransactionScheduler


class TestNames(TestCase):
Expand Down
12 changes: 1 addition & 11 deletions transactron/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
from .core import *

__all__ = [
"TModule",
"TransactionManager",
"TransactionContext",
"TransactionModule",
"Transaction",
"Method",
"def_method",
]
from .core import * # noqa: F401
5 changes: 0 additions & 5 deletions transactron/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
from inspect import Parameter, signature
from typing import Callable, Iterable, Optional, TypeAlias, TypeVar, Mapping
from amaranth import *
from coreblocks.utils._typing import LayoutLike
from coreblocks.utils import OneHotSwitchDynamic

__all__ = [
"Scheduler",
"_graph_ccs",
"MethodLayout",
"ROGraph",
"Graph",
"GraphCC",
Expand Down Expand Up @@ -118,9 +116,6 @@ def _graph_ccs(gr: ROGraph[T]) -> list[GraphCC[T]]:
return ccs


MethodLayout: TypeAlias = LayoutLike


def method_def_helper(method, func: Callable[..., T], arg=None, /, **kwargs) -> T:
parameters = signature(func).parameters
kw_parameters = set(
Expand Down
Loading