ITADN

Discrepancy in `amaranth/sim/__init__.py` for `v0.5.7` (missing Period import)

#1626ClosedTimSchimansky 创建于 2025-08-31
T
TimSchimanskycommented
Hello everyone. I wanted to follow the "Getting started" guide and when trying to simulate the counter i ran into an error, that the name `Period`cannot be imported from `amaranth.sim`: ``` Traceback (most recent call last): File "/home/user/.../amaranth_test/testbench.py", line 1, in <module> from amaranth.sim import Simulator, Period ImportError: cannot import name 'Period' from 'amaranth.sim' (/home/user/.../amaranth_test/.venv/lib/python3.13/site-packages/amaranth/sim/__init__.py) ``` ## Description: There is a mismatch between the `amaranth/sim/__init__.py` file in the Amaranth v0.5.7 here on GitHub and the file installed from PyPI via `pip3 install --user --upgrade amaranth`. ### Observed (installed package 0.5.7): ```python from .core import Simulator from ._async import DomainReset, BrokenTrigger, SimulatorContext, TickTrigger, TriggerCombination from ._pycoro import Settle, Delay, Tick, Passive, Active __all__ = [ "DomainReset", "BrokenTrigger", "SimulatorContext", "Simulator", "TickTrigger", "TriggerCombination", # deprecated "Settle", "Delay", "Tick", "Passive", "Active", ] ``` ### Expected (GitHub 0.5.7): ```python from .core import Simulator from ._async import DomainReset, BrokenTrigger, SimulatorContext, TickTrigger, TriggerCombination from ._pycoro import Settle, Delay, Tick, Passive, Active from ..hdl import Period __all__ = [ "DomainReset", "BrokenTrigger", "SimulatorContext", "Simulator", "TickTrigger", "TriggerCombination", "Period", # deprecated "Settle", "Delay", "Tick", "Passive", "Active", ] ``` ## Steps to Reproduce: - Install Amaranth 0.5.7 from PyPI `pip install amaranth==0.5.7` - Inspect amaranth/sim/__init__.py in the installed package - Compare with the corresponding file on GitHub
关闭于 2025-08-31 4 条评论