Closed sbourdeauducq closed 5 years ago
I had to update Yosys and nextpnr to get the new I/O system to work, otherwise Yosys would complain about an unknown cell
IB
.
Yes, this is expected. Until we release 0.1, you should always run nMigen against master branch of Yosys and nextpnr. The next version of Yosys, 0.9, is the current target, and I'll make sure every patch required for functionality is merged there.
Repro (without Nix)
Did you attach the repro?
https://git.m-labs.hk/M-Labs/HeavyX/src/branch/master/examples/simplesoc_ecp5.py You only need to add minerva and jtagtap from lambdaconcept in addition to the usual packages.
Can you zip the build directory and attach it here?
That's a bug in nextpnr, I believe.
@sbourdeauducq Looks like Nix breaks Versioneer:
# Automatically generated by nMigen 0+unknown. Do not edit.
Can you fix that?
Yeah, that's because .git
is not present in the downloaded sources. It breaks in exactly the same way if you use the "Download ZIP" link on GitHub to get nmigen.
It breaks in exactly the same way if you use the "Download ZIP" link on GitHub to get nmigen.
It does not, which you can check if you want. The reason is the gitattributes file, which causes the following block in nmigen/_version.py
:
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
git_date = "$Format:%ci$"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
to be turned into:
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = " (HEAD -> master)"
git_full = "da1f58b7aef99912b32b65fe32cd72b61fd5dc34"
git_date = "2019-07-07 01:03:59 +0000"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
So nix should do the same thing then.
Interesting, but even though this replacement does happen correctly in both cases, versionneer still breaks on GitHub archives downloaded and extracted manually and those in the Nix store.
nmigen-master> python
>>> import nmigen
>>> nmigen
<module 'nmigen' from '/home/sb/Downloads/nm/nmigen-master/nmigen/__init__.py'>
>>> nmigen.__version__
'0+unknown'
5x2c0kh722dncpbdlyipjxzd3f2kjj2w-source> python
>>> import nmigen
>>> nmigen
<module 'nmigen' from '/nix/store/5x2c0kh722dncpbdlyipjxzd3f2kjj2w-source/nmigen/__init__.py'>
>>> nmigen.__version__
'0+unknown'
Ah, sorry, my bad. I'll take a look at it myself then.
This is also affecting ARTIQ (and leaving .git
around with Nix is actually annoying), and I didn't know about this gitattributes thing so I ended up bypassing versioneer.
I'm not sure is this is actually related to nMigen or if this is purely a nextpnr bug, but HeavyX simplesoc_ecp5 no longer works after attempting to use
nmigen.build
. I had to update Yosys and nextpnr to get the new I/O system to work, otherwise Yosys would complain about an unknown cellIB
. Now using Yosys YosysHQ/yosys@8455d1f4ffb942c802b65e20748e54a123e08df0 and nextpnr YosysHQ/nextpnr@ff958830d1097b9bfa3c3b34094e6717.Repro (without Nix) and error: