transactron package

Subpackages

Submodules

transactron.graph module

Utilities for extracting dependency graphs from Amaranth designs.

class transactron.graph.Direction

Bases: IntFlag

IN = 1
INOUT = 3
NONE = 0
OUT = 2
__new__(value)
class transactron.graph.Owned

Bases: Protocol

__init__(*args, **kwargs)
name: str
owner: Optional[Elaboratable]
class transactron.graph.OwnershipGraph

Bases: object

__init__(root)
dump(fp, format: Literal['dot', 'elk', 'mermaid'])
dump_dot(fp, owner: Optional[int] = None, indent: str = '')
dump_elk(fp, owner: Optional[int] = None, indent: str = '')
dump_mermaid(fp, owner: Optional[int] = None, indent: str = '')
get_hier_name(obj: Owned) str

Get hierarchical name. Might raise KeyError if not yet hierarchized.

get_name(obj: Owned) str
insert_edge(fr: Owned, to: Owned, direction: Direction = Direction.OUT)
insert_node(obj: Owned)
mermaid_direction = ['---', '-->', '<--', '<-->']
prune(owner: Optional[int] = None)

Mark all empty subgraphs.

remember(owner: Elaboratable) int
remember_field(owner_id: int, field: str, obj: Elaboratable)

transactron.profiler module

class transactron.profiler.MethodSamples

Bases: object

Runtime value of method control signals in a given clock cycle.

Attributes
run: bool

The value of the method’s run signal.

__init__(run: bool) None
run: bool
class transactron.profiler.Profile

Bases: object

Transactron execution profile.

Can be saved by the simulator, and then restored by an analysis tool. In the profile data structure, methods and transactions are referred to by their unique ID numbers.

Attributes
transactions_and_methodsdict[int, ProfileInfo]

Information about transactions and methods indexed by ID numbers.

cycleslist[CycleProfile]

Profile information for each cycle of the simulation.

__init__(transactions_and_methods: dict[int, transactron.profiler.ProfileInfo] = <factory>, cycles: list[transactron.profiler.CycleProfile] = <factory>) None
analyze_methods(recursive=False) list[transactron.profiler.RunStatNode]
analyze_transactions(recursive=False) list[transactron.profiler.RunStatNode]
cycles: list[transactron.profiler.CycleProfile]
static decode(file_name: str) Profile
encode(file_name: str)
classmethod from_dict(kvs: Optional[Union[dict, list, str, int, float, bool]], *, infer_missing=False) A
classmethod from_json(s: Union[str, bytes, bytearray], *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, Optional[Union[dict, list, str, int, float, bool]]]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: Optional[Union[int, str]] = None, separators: Optional[Tuple[str, str]] = None, default: Optional[Callable] = None, sort_keys: bool = False, **kw) str
transactions_and_methods: dict[int, transactron.profiler.ProfileInfo]
class transactron.profiler.ProfileData

Bases: object

Information about transactions and methods from the transaction manager.

This data is required for transaction profile generation in simulators. Transactions and methods are referred to by their unique ID numbers.

Attributes
transactions_and_methods: dict[int, ProfileInfo]

Information about individual transactions and methods.

method_parents: dict[int, list[int]]

Lists the callers (transactions and methods) for each method. Key is method ID.

transactions_by_method: dict[int, list[int]]

Lists which transactions are calling each method. Key is method ID.

transaction_conflicts: dict[int, list[int]]

List which other transactions conflict with each transaction.

__init__(transactions_and_methods: dict[int, transactron.profiler.ProfileInfo], method_parents: dict[int, list[int]], transactions_by_method: dict[int, list[int]], transaction_conflicts: dict[int, list[int]]) None
static make(transaction_manager: TransactionManager)
method_parents: dict[int, list[int]]
transaction_conflicts: dict[int, list[int]]
transactions_and_methods: dict[int, transactron.profiler.ProfileInfo]
transactions_by_method: dict[int, list[int]]
class transactron.profiler.ProfileInfo

Bases: object

Information about transactions and methods.

In Profile, transactions and methods are referred to by their unique ID numbers.

Attributes
namestr

The name.

src_locSrcLoc

Source location.

is_transactionbool

If true, this object describes a transaction; if false, a method.

__init__(name: str, src_loc: tuple[str, int], is_transaction: bool) None
classmethod from_dict(kvs: Optional[Union[dict, list, str, int, float, bool]], *, infer_missing=False) A
classmethod from_json(s: Union[str, bytes, bytearray], *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
is_transaction: bool
name: str
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
src_loc: tuple[str, int]
to_dict(encode_json=False) Dict[str, Optional[Union[dict, list, str, int, float, bool]]]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: Optional[Union[int, str]] = None, separators: Optional[Tuple[str, str]] = None, default: Optional[Callable] = None, sort_keys: bool = False, **kw) str
class transactron.profiler.ProfileSamples

Bases: object

Runtime values of all transaction and method control signals.

Attributes
transactions: dict[int, TransactionSamples]

Runtime values of transaction control signals for each transaction.

methods: dict[int, MethodSamples]

Runtime values of method control signals for each method.

__init__(transactions: dict[int, transactron.profiler.TransactionSamples] = <factory>, methods: dict[int, transactron.profiler.MethodSamples] = <factory>) None
methods: dict[int, transactron.profiler.MethodSamples]
transactions: dict[int, transactron.profiler.TransactionSamples]
class transactron.profiler.RunStat

Bases: object

Collected statistics about a transaction or method.

Attributes
namestr

The name.

src_locSrcLoc

Source location.

lockedint

For methods: the number of cycles this method was locked because of a disabled call (a call under a false condition). For transactions: the number of cycles this transaction was ready to run, but did not run because a conflicting transaction has run instead.

__init__(name: str, src_loc: str, locked: int = 0, run: int = 0) None
locked: int = 0
static make(info: ProfileInfo)
name: str
run: int = 0
src_loc: str
class transactron.profiler.RunStatNode

Bases: object

A statistics tree. Summarizes call graph information.

Attributes
statRunStat

Statistics.

callersdict[int, RunStatNode]

Statistics for the method callers. For transactions, this is empty.

__init__(stat: ~transactron.profiler.RunStat, callers: dict[int, transactron.profiler.RunStatNode] = <factory>) None
callers: dict[int, transactron.profiler.RunStatNode]
static make(info: ProfileInfo)
stat: RunStat
class transactron.profiler.TransactionSamples

Bases: object

Runtime value of transaction control signals in a given clock cycle.

Attributes
request: bool

The value of the transaction’s request signal.

runnable: bool

The value of the transaction’s runnable signal.

grant: bool

The value of the transaction’s grant signal.

__init__(request: bool, runnable: bool, grant: bool) None
grant: bool
request: bool
runnable: bool

transactron.tracing module

Utilities for extracting dependencies from Amaranth.

class transactron.tracing.TracingEnabler

Bases: object

class transactron.tracing.TracingFragment

Bases: Fragment

static get(obj: HasElaborate, platform) TracingFragment

This function code is based on Amaranth, which originally loses all information. It was too difficult to hook into, so this has to be a near-exact copy.

Relevant copyrights apply.

prepare(*args, **kwargs) TracingFragment
subfragments: list[tuple[amaranth.hdl._ir.Elaboratable, str, tuple[str, int]]]
class transactron.tracing.TracingFragmentTransformer

Bases: FragmentTransformer

on_fragment(fragment)
class transactron.tracing.TracingInstance

Bases: Instance, TracingFragment

get(platform) TracingFragment

This function code is based on Amaranth, which originally loses all information. It was too difficult to hook into, so this has to be a near-exact copy.

Relevant copyrights apply.

Module contents