Skip to content

Commit

Permalink
Apply comments from review.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekcyjna committed Mar 17, 2024
1 parent a353247 commit 88fc55c
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 17 deletions.
3 changes: 2 additions & 1 deletion scripts/core_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from transactron.graph import TracingFragment # noqa: E402
from test.test_core import CoreTestElaboratable # noqa: E402
from coreblocks.params.configurations import basic_core_config # noqa: E402
from transactron.core import TransactionManagerKey, TransactionModule # noqa: E402
from transactron.core import TransactionModule # noqa: E402
from transactron.core.keys import TransactionManagerKey # noqa: E402

gp = GenParams(basic_core_config)
elaboratable = CoreTestElaboratable(gp)
Expand Down
2 changes: 1 addition & 1 deletion test/regression/pysim.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from amaranth.utils import exact_log2
from amaranth import *

from transactron.core import TransactionManagerKey
from transactron.core.keys import TransactionManagerKey

from .memory import *
from .common import SimulationBackend, SimulationExecutionResult
Expand Down
7 changes: 2 additions & 5 deletions test/transactions/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
from transactron.lib import Adapter, AdapterTrans
from transactron.utils import Scheduler

from transactron.core import (
Priority,
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.manager import TransactionScheduler
from transactron.utils.dependencies import DependencyContext

Expand Down
1 change: 0 additions & 1 deletion transactron/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from .tmodule import * # noqa: F401
from .schedulers import * # noqa: F401
from .transaction_base import * # noqa: F401
from .method import * # noqa: F401
from .transaction import * # noqa: F401
Expand Down
13 changes: 13 additions & 0 deletions transactron/core/keys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from transactron.utils import *
from typing import TYPE_CHECKING
from dataclasses import dataclass

if TYPE_CHECKING:
from .manager import TransactionManager # noqa: F401 because of https://github.com/PyCQA/pyflakes/issues/571

__all__ = ["TransactionManagerKey"]


@dataclass(frozen=True)
class TransactionManagerKey(SimpleKey["TransactionManager"]):
pass
9 changes: 2 additions & 7 deletions transactron/core/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
from amaranth import tracer
from typing import Optional, Iterator, TYPE_CHECKING
from .transaction_base import *
from .keys import *
from contextlib import contextmanager
from dataclasses import dataclass

if TYPE_CHECKING:
from .tmodule import TModule
from .manager import TransactionManager

__all__ = ["Transaction", "TransactionManagerKey"]


@dataclass(frozen=True)
class TransactionManagerKey(SimpleKey["TransactionManager"]):
pass
__all__ = ["Transaction"]


class Transaction(TransactionBase):
Expand Down
3 changes: 2 additions & 1 deletion transactron/testing/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from .gtkw_extension import write_vcd_ext
from transactron import Method
from transactron.lib import AdapterTrans
from transactron.core import TransactionManagerKey, TransactionModule
from transactron.core.keys import TransactionManagerKey
from transactron.core import TransactionModule
from transactron.utils import ModuleConnector, HasElaborate, auto_debug_signals, HasDebugSignals

T = TypeVar("T")
Expand Down
3 changes: 2 additions & 1 deletion transactron/utils/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from amaranth.back import verilog
from amaranth.hdl import Fragment

from transactron.core import TransactionManager, TransactionManagerKey
from transactron.core import TransactionManager
from transactron.core.keys import TransactionManagerKey
from transactron.core.manager import MethodMap
from transactron.lib.metrics import HardwareMetricsManager
from transactron.utils.dependencies import DependencyContext
Expand Down

0 comments on commit 88fc55c

Please sign in to comment.