Tuesday, 2023-08-15

*** tpb <[email protected]> has joined #litex00:00
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has quit IRC (Read error: Connection reset by peer)00:21
*** lexano <[email protected]> has quit IRC (Ping timeout: 248 seconds)00:37
*** Degi_ <[email protected]> has joined #litex01:52
*** Degi <[email protected]> has quit IRC (Ping timeout: 246 seconds)01:52
*** Degi_ is now known as Degi01:52
*** TMM_ <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)02:42
*** TMM_ <[email protected]> has joined #litex02:42
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has joined #litex07:01
*** RaYmAn <[email protected]> has quit IRC (Ping timeout: 246 seconds)08:19
*** lexano <[email protected]> has joined #litex12:38
*** RodolfoAzevedo <RodolfoAzevedo!~RodolfoAz@2801:8a:c811:1:ec78:31b6:35ff:a9f5> has joined #litex13:19
*** _whitelogger <[email protected]> has quit IRC (Remote host closed the connection)13:21
*** _whitelogger <[email protected]> has joined #litex13:23
*** TMM_ <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)13:30
*** TMM_ <[email protected]> has joined #litex13:31
*** RodolfoAzevedo <RodolfoAzevedo!~RodolfoAz@2801:8a:c811:1:ec78:31b6:35ff:a9f5> has quit IRC (Quit: Client closed)16:07
*** RodolfoAzevedo <RodolfoAzevedo!~RodolfoAz@2801:8a:c811:1:ec78:31b6:35ff:a9f5> has joined #litex16:27
RodolfoAzevedoHello. I am having trouble using litex. I followed the install procedures and everything went fine. After that, I tried to execute the board demo (tang_nano_9k.py) and it complained: ModuleNotFoundError: No module named 'litex'16:27
RodolfoAzevedoHello. I am having trouble using litex. I followed the install procedures and everything went fine. After that, I tried to execute the board demo (tang_nano_9k.py) and it complained: ModuleNotFoundError: No module named 'litex'16:27
RodolfoAzevedoI followed the tutorial from here: https://github.com/enjoy-digital/litex/wiki/Installation16:28
josuahHello RodolfoAzevedo! Did anything go wrong with this command? ./litex_setup.py --init --install16:32
josuahThis is what was expected to install the various modules.16:32
josuahIt will install everything to the current directory, so you might want to create a ./litex/ directory first16:32
josuahand then: cd litex16:33
josuahand then: ./litex_setup.py --init --install16:33
RodolfoAzevedoI added the --user option and it went fine16:33
josuahnice!16:33
RodolfoAzevedoI created litex, cd to it.16:33
RodolfoAzevedoand the --user in the command line: ./litex_setup.py --init --install --user16:34
RodolfoAzevedowithout --user it does not work16:34
josuahwhat does this give to you? python --version16:35
RodolfoAzevedopython3 --version16:35
RodolfoAzevedoPython 3.8.616:35
RodolfoAzevedopython --version16:35
RodolfoAzevedoPython 3.11.416:35
RodolfoAzevedoI have oss_cad_suite installed16:35
RodolfoAzevedowith python316:35
josuahoh, it looks like you have different python versions running around here16:35
RodolfoAzevedoshould I install litex outside it?16:35
josuahpython -m litex16:36
RodolfoAzevedothe 3.8.6 is oss_cad_suite version, the 3.11.4 is systemwide16:36
josuahpython3 -m litex16:36
josuahdo these two give you different result?16:36
josuahYou are expected to get the same error message about 'litex' is a package and cannot be directly executed16:36
RodolfoAzevedoboth give error,16:36
RodolfoAzevedoNo module named litex16:37
josuahyou might have to use the same python implementation that installed litex16:37
josuahwhich operating system is it/16:37
josuahs,/,?,16:37
RodolfoAzevedoI am using ubuntu 23.0416:37
RodolfoAzevedoit has that new thing on pip16:38
RodolfoAzevedoI can not pip to install16:38
RodolfoAzevedo(I think)16:38
josuahit tells you something about virtualenvs?16:38
josuah"This environment is externally managed"16:39
RodolfoAzevedoyes, pip complains about messing the system. It recommends using pipx16:39
RodolfoAzevedoAm I supposed to install outside any virtualenv or other environment?16:40
somloI might be late to the party, and y'all have likely gotten it all figured out; but `--user` will install (links to) your litex & friends' python modules in ~/.local16:40
somlo*not* using `--user` will try (and likely fail) to install everything system-wide16:40
RodolfoAzevedoside note: I did it two months ago and it worked (even configured my board)16:40
josuahsomlo: which might not work anymore as per python EXTERNALLY_MANAGED flag enabled for the system python, AFAIK16:41
josuahRodolfoAzevedo: what is the error message when trying to use pip?16:41
RodolfoAzevedo× This environment is externally managed16:41
RodolfoAzevedo╰─> To install Python packages system-wide, try apt install16:41
RodolfoAzevedo    python3-xyz, where xyz is the package you are trying to16:41
RodolfoAzevedo    install.16:41
RodolfoAzevedo    If you wish to install a non-Debian-packaged Python package,16:41
RodolfoAzevedo    create a virtual environment using python3 -m venv path/to/venv.16:41
RodolfoAzevedo    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make16:41
RodolfoAzevedo    sure you have python3-full installed.16:41
RodolfoAzevedo    If you wish to install a non-Debian packaged Python application,16:41
RodolfoAzevedo    it may be easiest to use pipx install xyz, which will manage a16:41
RodolfoAzevedo    virtual environment for you. Make sure you have pipx installed.16:41
RodolfoAzevedo    See /usr/share/doc/python3.11/README.venv for more information.16:41
josuahsomlo: to be honest, I am surprised that the python community did not want to tolerate per-use packages and pushes everyone to use virtualenvs for everything.16:42
RodolfoAzevedoI tried again as fresh install without oss_cad_suite environment16:42
whitequark[cis]per-use packages? do you mean pypackages?16:43
whitequark[cis]s/pypackages?/`__pypackages__`?/16:43
josuahwhitequark[cis]: that is the cure to the problem! ^_^'16:43
whitequark[cis]I'm just unsure what "per-use packages" are16:43
josuahI think per-user packages as ~/.local, the `--user` flag to pip16:43
whitequark[cis]oh, per-user, not per-use16:44
josuahwhitequark[cis]: I wish PEP 582 was adopted https://peps.python.org/pep-0582/16:44
tpbTitle: PEP 582 – Python local packages directory | peps.python.orgSelected dark colour schemeSelected light colour scheme (at peps.python.org)16:44
somloI'm still using the ~/.local stuff installed (a long time ago) with `--user` on fedora; updating litex repos from git works fine as long as all the ~/.local stuff is still there16:44
josuahoh my bad, typo of mine!16:44
whitequark[cis]josuah:  the problem is that if you have a global system binary, e.g. `/usr/bin/systemapplication`, and it uses Python, it will pick up both Python packages from `/usr`, as well as from `~/.local`16:44
somloI get the occasional need to re-install when python versions change and the directory name under ~/.local goes obsolete16:44
whitequark[cis]this means that if LiteX installs some random dependency of it into ~/.local, it can break completely unrelated system packages16:45
somlomaybe ubuntu and other distros are getting more prickly with their python setups, dunno about that16:45
whitequark[cis]and I actually had this happen multiple times on my system, it is a PITA to debug16:45
josuahRodolfoAzevedo: you might need to lear about virtualenvs. I use python's venv or pdm (thanks to whitequark[cis]).16:45
RodolfoAzevedoI had it working two months ago. then I decided to use it in a course I am teaching this semester.16:46
RodolfoAzevedoI will look to virtualenvs16:46
RodolfoAzevedothanks!16:46
josuahthis likely came all of a sudden with a python update, maybe an automated one16:46
somloI only have the litex stuff in ~/.local, any non-litex "dependencies" are installed as distro packages (I am a fan of distro packages, if I haven't made that clear enough in the past :P )16:46
josuahRodolfoAzevedo: crash course: cd ~/litex; python -m .venv; . .venv/bin/activate16:47
whitequark[cis]josuah RodolfoAzevedo: you could use PDM to simplify venv management, this is what we do in Amaranth16:48
whitequark[cis]you can see a simple PDM setup here: https://github.com/amaranth-lang/template-fpga16:48
josuahRodolfoAzevedo: that is for creating a virtual environment, and then you'd be able to use it with just `cd ~/litex; . .venv/bin/activate`, that is the rawest possible venv16:48
whitequark[cis]the pyproject.toml is sufficient: https://github.com/amaranth-lang/template-fpga/blob/main/pyproject.toml16:48
whitequark[cis]the main utility of using PDM is that you can check the lockfile, containing the actual solved package versions, into VCS, and have reproducible installs16:48
josuahwhitequark[cis]: do you use `__pypackages__` with them?16:49
whitequark[cis]josuah: no, venvs only16:49
whitequark[cis]__pypackages__ PEP was rejected so I do not use them16:49
whitequark[cis]venvs are standard16:49
josuahthanks! this makes sense16:50
RodolfoAzevedothank you. I will follow these tips16:50
josuahnice! https://github.com/amaranth-lang/template-fpga/blob/main/pyproject.toml#L1716:50
josuahRodolfoAzevedo: https://pdm.fming.dev/latest/ this is the PDM it is all about16:50
tpbTitle: Introduction - PDM (at pdm.fming.dev)16:50
RodolfoAzevedoAmaranth is the new migen, right? Litex install still requires migen?16:56
whitequark[cis]LiteX is a fork of Migen, Amaranth is a new language borrowing from Migen's syntax17:02
whitequark[cis]I am linking you the example because it shows the use of PDM; I am not suggesting you use Amaranth (if you want to use LiteX, at the moment, it's not very useful to you)17:03
josuahrelated: https://github.com/enjoy-digital/litex/wiki/Migen-Amaranth17:12
*** pbsds <[email protected]> has quit IRC (Ping timeout: 246 seconds)17:31
*** pbsds <[email protected]> has joined #litex17:32
whitequark[cis]note that the 2nd paragraph is currently being rethought17:38
somlowhitequark: "LiteX is a fork of Migen" -- maybe you meant "LiteX uses Migen" ? :)18:49
somloor "is written in migen", or something :D18:49
whitequark[cis]I was fairly sure LiteX includes the source code of Migen and builds of it18:50
whitequark[cis]s/of/on/18:50
somlomigen is a dependency of litex, perhaps one of those things you don't want installed in your ~/.local (fedora has it packaged as an "official" rpm)18:51
whitequark[cis]ohhh I see, LiteX stopped doing that, uh, many years ago apparently18:51
whitequark[cis]I think back in 2015 or so when I first encountered LiteX it did that and I think it got changed shortly after; my apologies for the confusion18:52
whitequark[cis]this is actually relevant to my work on having LiteX be Amaranth-compatible because I thought I'd be able to modify of the vendored-copy-of-Migen-sources-in-LiteX but I guess that won't be the case18:53
somlo2015 was a bit before my time; so I understand what you're saying as "litex used to use a vendored/bundled version of migen, and it got unbundled in the mean time" or some such18:53
whitequark[cis]no, it was also renamed to be under the litex namespace18:53
whitequark[cis]this is functionally a fork18:53
somlofrom where I'm looking at it, the problem is one of *porting* litex from migen to amaranth :)18:53
somloit's like "rocketchip is written in chisel" === "litex is written in migen" (at least as of right now, no idea on how it evolved to be like that)18:55
somlo(and yeah, the rocketchip repo has a bunch of sub-repos pulling in chisel, sbt, and the kitchen sink, but that's neither here nor there :D :D)18:56
whitequark[cis]if rocketchip pulled in an entire copy of chisel and renamed it to be under "rocketchip" namespace I would consider that a fork of chisel, fwiw18:57
whitequark[cis]but since litex does not do that anymore (and I honestly have a hard time remembering exactly what happened a decade ago) none of this especially matters18:57
whitequark[cis]it would actually be easier if litex was 'written in litex', because then I would not have to consider doing questionable things like installing amaranth.compat under migen in the Python package namespace18:58
somlowhitequark: looks like one day in the near term future I might need to package https://github.com/amaranth-lang/amaranth as a fedora RPM (same as the way I have migen packaged currently) -- any death traps I should be aware of ? :)19:02
whitequark[cis]none I can think of19:02
whitequark[cis]you'll want to wait until the 0.4 release since most software is currently using a git checkout19:02
whitequark[cis]but this will change with the said release, which has many highly anticipated features19:03
somloright, I'll most likely wait until litex can be viably built with amaranth as a dependency instead of migen19:03
whitequark[cis]I don't think you will see it built with amaranth instead19:04
whitequark[cis]neither me nor Florent have concrete plans for that19:04
whitequark[cis]instead, the current plan is to take the current amaranth.compat module out of Amaranth (it was deprecated since 2018) or even rewrite it so that LiteX could evaluate Amaranth as a replacement in a piecewise fashion instead of replacing the entire thing at once19:05
whitequark[cis]the reason is that LiteX has a lot of code and there is only one Florent, and it would take a lot of effort, more than can be spared, to revalidate literally everything on top of Amaranth19:06
somlook, maybe I misunderstood then -- the "amaranth.compat" module is what might end up as an alternative to today's "migen", then?19:06
whitequark[cis]no19:07
whitequark[cis]to try and clarify once again: I have no interest in maintaining amaranth.compat and I would like to remove it entirely. however LiteX is the largest potential user of amaranth.compat which was also precluded from using it due to certain technical constraints19:07
whitequark[cis]to align our interests, there is a plan to take amaranth.compat out of Amaranth proper, (perhaps to a separate repo, perhaps to LiteX), update it so that it does not have to be a part of upstream Amaranth, and let LiteX use it as Florent and the LiteX community see fit19:08
somlooh so you're talking about litex *incorporating* amaranth.compat as a "glue layer" between litex (which expects things to look like migen) and amaranth (which can use amaranth.compat to *make things look like migen*) ?19:09
whitequark[cis]correct19:09
somloI see; in that case, what I said: litex (post-amaranth.compat-assimilation, or whatever) will end up depending on amaranth instead of "old" migen19:10
somloand then it will be possible to "viably build litex with amaranth instead of migen", and I will need amaranth to be a packaged rpm on fedora so I can do that without too much fuss :)19:11
whitequark[cis]yes. the misunderstanding there is that I thought you had envisioned some other use for Amaranth19:11
somloI mean, once it exists as an rpm and someone installs it, they can do whatever *else* (besides litex) they want with it, I'm sure litex isn't the only thing it's for ;)19:15
somlobut thanks for helping clear things up, makes perfect sense in retrospect!19:15
whitequark[cis]no problem19:15
cr1901Yea, LiteX was a fork from Migen/MiSoC, and has changed so much since then that it effectively its own unique ecosystem that uses Migen as a git dep. What about updating litex_setup.py to point to a different Migen repo?21:34
somlocr1901: litex_setup.py assumes none of the "significant" dependencies are installed, and pulls them all in (including m-labs/migen). You wouldn't *want* to point it at another migen repo unless/until the amaranth.compat thing whitequark was talking about actually happens)21:47
somlohaving a *packaged* systemwide install of m-labs/migen (like on Fedora) is a different thing (I just edit out the part of litex_setup.py that pulls in migen explicitly, since I already have it available locally)21:47
cr1901Hmmm... I figured you could just rm -rf the existing migen repo and check out the new one. But I realize that actually breaks _my_ own setup as well where migen is a symlink to the copy I've kept around since 201521:50
cr1901w/ all its history, branches, etc21:50
somlom-labs/migen has slowed down *a lot* over the last few years -- there's the occasional maintenance commit (e.g. to support python 3.11), but what's in Fedora right now is practically equivalent to the current tip of the m-labs/migen git repo21:52
somloadmittedly, there *might* be a few things that changed since 2015 :)21:52
somloand if you're not using fedora or simply run litex_setup.py, you essentially get the same thing21:53
cr1901I'm a little bit surprised if a Litex design builds w/ a Migen from 2015. I didn't think the language changed _that_ little since 2015.21:54
somlopersonally, I'm no expert, only know enough to be a slight danger to myself :) But it's *infinitely* more legible than e.g. Chisel ;P21:54
gurkisomlo: how much effort does litex / enjoy digital actually put into migen maintenance?21:55
somloi.e, even if you're a [n]migen / amaranth n00b, one can still follow what's actually going on by reading the sources, which is most definitely *not* nothing :D21:56
somlogurki: I think that's the entire point of whitequark and _florent_ working on adding a "glue layer" that would alow litex to use amaranth instead of migen21:57
gurkibut why wouldnt people just continue developing migen?21:58
gurkias in: whats the problem with migen?21:58
somloamaranth is actively maintained (by whitequark, mainly, afaik) -- and migen not so much, from my observation21:58
gurkii found https://github.com/enjoy-digital/litex/wiki/Migen-Amaranth which kinda would stop me using litex for production, honestly21:58
gurkiwell. theres a company ultimately making $$$ out of it, they could have sb do things :)21:59
gurki(sorry for jumping this conversation, i was not aware of this ...)21:59
somloI'll have to step back and let others speak more authoritatively about that sort of thing -- I don't have any insider knowledge, just a rando on the internet issuing observation based opinions :D21:59
cr1901Programming does not exist in a technical vacuum22:01
somlocr1901: 100% agree -- it's one of the main reasons I'm volunteering to package things for my distro of choice -- I like to know how the tools I use (or the dependencies of things I care about) hang together, where they come from, and their "health and sustainability" status...22:04
somlowhich makes the current trend of "vendoring" I've noticed in many projects somewhat ... suboptimal (at least from that specific angle)22:07
mithrohttps://www.researchgate.net/profile/Sergiu-Mosanu/publication/372986669_PiMulator_A_Processing-in-Memory_Emulation_Platform/links/64d3fefab684851d3d9494d7/PiMulator-A-Processing-in-Memory-Emulation-Platform.pdf22:25
mithroSeems to mention LiteX and LiteDRAM quite a lot22:28
*** RodolfoAzevedo <RodolfoAzevedo!~RodolfoAz@2801:8a:c811:1:ec78:31b6:35ff:a9f5> has quit IRC (Quit: Client closed)22:40

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!