UCSBarchlab / PyRTL

A collection of classes providing simple hardware specification, simulation, tracing, and testing suitable for teaching and research. Simplicity, usability, clarity, and extensibility are the overarching goals, rather than performance or optimization.
http://ucsbarchlab.github.io/PyRTL
BSD 3-Clause "New" or "Revised" License
253 stars 76 forks source link

Python 3.10 Support #421

Closed benjaminmordaunt closed 3 months ago

benjaminmordaunt commented 2 years ago

When trying to run the basic FIR example, Python 3.10 complains:

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyrtl/simulation.py:983, in <module>
    979             return s
    980     return [tryint(c) for c in re.split('([0-9]+)', w)]
--> 983 class TraceStorage(collections.Mapping):
    984     __slots__ = ('__data',)
    986     def __init__(self, wvs):

It seems that accessing collections.Mapping in this way was previously deprecated and is now removed.

timsherwood commented 2 years ago

Hi @benjaminmordaunt, thank you for the clear report -- in fact this issue should already be fixed in the development branch. If you could try that out I am hoping it addresses your problem ... it appeared to pass all test in 3.10 here just now (including the fir example) although I don't have those test ready for release yet. I was planing to do a major release around the end of summer which would solve this problem on the PyPI release. Let me know if that helps! I will leave this issue open until that major release in case anyone else hits this problem.

All the best,

-Tim

fdxmw commented 3 months ago

PyRTL 0.10.2 and newer should support Python 3.10. Please reopen if there are further issues, thanks!