Thursday, 2021-02-04

*** tpb has joined #litex00:00
nickoemaybe I am mixing up the soc clases00:06
*** lf has quit IRC00:36
*** lf has joined #litex00:36
*** futarisIRCcloud has quit IRC01:39
*** Bertl_oO is now known as Bertl_zZ01:46
*** Degi_ has joined #litex03:30
*** Degi has quit IRC03:30
*** Degi_ is now known as Degi03:30
*** futarisIRCcloud has joined #litex04:46
*** _whitelogger has quit IRC05:00
*** _whitelogger has joined #litex05:02
*** FFY00 has quit IRC05:16
*** kgugala_ has joined #litex06:54
*** kgugala has quit IRC06:57
*** kgugala has joined #litex07:07
*** kgugala_ has quit IRC07:10
*** Bertl_zZ is now known as Bertl10:27
*** dayjaby has joined #litex11:22
dayjabyHello everyone o/ currently trying to run NuttX on a Litex/VexRISCV cpu, but NuttX requires CLINT support, which seems to be available only in VexRISCV SMP. Is it possible for a common human like me to implement it in VexRISCV?11:43
dayjabyNuttX requires CLINT for some time-related stuff like "sleep 5". Does VexRISCV offer any other interrupts to handle this?11:43
*** kgugala_ has joined #litex12:03
*** kgugala has quit IRC12:07
*** Melkhior has joined #litex12:31
Melkhiorhello; following on yesterday's problem - gettimeofday() not working - seems that I ran into a 'known issue': there was a Linux ABI change at some point, the kernel for RV32 no longer define __ARCH_WANT_TIME32_SYSCALLS, so syscall 169 (gettimeofday) isn't there anymore. But that's still what is used by the SiFive binary toolchain I was using (it12:56
Melkhiorhas g++) and that creates static binaries... That's likely what caused my problems - seems gettimeofday inside buildroot is using the 64 bits version (syscall 403) instead.12:56
MelkhiorSo I'm trying to rebuild buildroot with a cross-g++ so I can use that directly instead of the SiFive toolchain...12:56
*** Bertl is now known as Bertl_oO13:03
geertuMelkhior: correct, RV32 should only use the new 64-bit time syscalls13:06
*** dayjaby has quit IRC13:38
*** Melkhior has quit IRC13:38
*** Melkhior has joined #litex13:44
*** Zguig has joined #litex14:03
*** futarisIRCcloud has quit IRC14:39
*** FFY00 has joined #litex14:54
*** kgugala_ has quit IRC15:20
*** kgugala has joined #litex15:20
MelkhiorYep, seems switching to the C++-enabled version of the buildroot toolchain solved my problem, now my (new) binaries work15:23
Melkhior... at least the ones I tried :-)15:23
Melkhior@ius I've been running my tests of B/Zkne/Zknh on dual-core VexRiscV, never saw a userland error like you see...15:31
MelkhiorI'm running 6 copies of an AES benchmark on 2 cores ATM, so far so good no issue...15:31
Melkhiorthey are not memory-intensive though, probably always run in-L1$15:32
*** dayjaby has joined #litex15:58
mithro_florent_: I think we can just merge https://github.com/litex-hub/pythondata-auto/pull/7 and continue to iterate further16:06
*** lkcl has quit IRC16:24
_florent_mithro: yes I agree16:33
mithro_florent_: Sorry I didn't do it sooner16:33
_florent_mithro: no problem, it takes time to convert the different CI to Github Actions... and the Travis-CI breakage was a bit un-expected...16:35
*** lkcl has joined #litex16:37
*** dayjaby has quit IRC17:22
*** Melkhior has quit IRC17:31
*** Zguig has quit IRC17:40
somlo_florent_: trying to switch back to using uartbone and console-over-jtag, and unsure if things changed in a small way or I started doing something wrong18:14
somlo1. it appears I can't type to the bios prompt over the jtag console18:15
somlo2. after I disconnect from the jtag console (hit double-ctrl-c in litex_term), I can no longer program the bitstream with openocd: I get "Error: couldn't bind gdb to socket: Address already in use"18:15
somloI'll try backing out of a few of the latest commits and retry, then try to bisect (unless you pre-empt me by figuring out what actually happened based only on the above symptoms :)18:16
somloneed to figure out how to recover from #2 without having to reboot my host computer :) Otherwise it'll be a very slow debug process...18:23
_florent_somlo: I did a fix to jtagbone today: https://github.com/enjoy-digital/litex/commit/4d1deffbb037fc3cda4756d5d90432e3ea69f5dc but haven't tested yet in console mode. You can maybe try to revert this one.18:46
*** tpb has joined #litex18:51
somloor whatever, the server/client software side of the jtag link (i.e. nothing that would go into the bios or gateware) -- I get it18:51
somloin that case, I should try *adopting* it (I am using two-day-old versions of litex_[server|client|term] and litescope_client)18:52
*** kgugala has quit IRC18:52
*** kgugala has joined #litex18:53
somlobut in that case there should be some bios/gateware changes that made pre-4d1deffb server|client|terminal *stop* working (from a week or so ago, when I was using them, pre-jtagbone)18:56
somlolots of moving parts :)18:56
somloanyway, litex_term leaves behind an openocd program running in the background, which then prevents new instances from being used explicitly from the cmdline to program the board19:16
somlokilling that will allow me to program the board once again19:18
somlo_florent_ : not exactly sure about #1 (not being able to type to the bios prompt) -- maybe that was a lingering side effect of having multiple openocd instances fighting over the same jtag serial link19:22
somlobut difference between yesteday and today's litex_term is that today's version inserts a \n after each keypress, making it impossible to type commands into the bios prompt19:23
somlois there a command line argument to litex_term that would control this behavior, or do I need to revert 4d1deffb for now?19:24
somlo_florent_: I guess it has something to do with the new `binary_mode` flag, and how it should probably stay false when the jtag is used for tunneling console traffic? Not quite familiar with how all that hangs together :)19:30
somlo_florent_: final conclusion: after programming the nexys4ddr with openocd from the command line, then connecting via `litex_term jtag_uart`, I can't type to the bios prompt until I push the reset switch (not the *board* reset, just the *lite* reset)19:35
somlothat is true whether I use pre- or post- 4d1deffb litex_term19:35
somlo_florent_: also, post-4d1deffb is unusable right now, as it inserts a \n after each character typed at the prompt, preventing any multi-character command from being issued (the `binary_mode` thing, most likely)19:36
somloso I'm able to get stuff done on my end for now. Happy to test any fixup over 4d1deffb you might want to try out.19:37
nickoemithro: So I added this and it seem to work, https://github.com/timvideos/litex-buildenv/compare/master...nickoe:mars_ax3  except for the platform.reqest_all in https://github.com/timvideos/litex-buildenv/compare/master...nickoe:mars_ax3#diff-b22d2c876f42c0b5738e4268ab3b1e000977b05c7b175ce2cb8470f153942e1bR104-R10820:30
nickoeI can't figure out why, but maybe the "platform" object is missing something?20:31
nickoeBut it looked like if I renamed my user_led's to something else and used that in the comb code (not request_all, but just request) then it built fine.20:32
shornesomlo: I ordered an sdcard pmod for my arty development board, I see you are working on the litex_mmc driver recently.  I'll be testing it soon21:51
nickoeshorne: can't you just use https://github.com/enjoy-digital/litesdcard ?22:30
somlonickoe: that's the "gateware" (a.k.a. "hardware); there's a linux driver that talks to it from the kernel side of things22:35
nickoesomlo: there are some software for it here, I think. https://github.com/enjoy-digital/litex/tree/master/litex/soc/software/liblitesdcard22:38
somloshorne: in the (linux) driver's current state (in the litex-rebase branch of litex-hub/linux) I get frequent data timeouts during (single-block/cmd17 only) transfers22:39
somloincreasing the cmd and data timeouts (i.e., appending ", cmd_timeout=10e-1, data_timeout=10e-1" here: https://github.com/enjoy-digital/litex/blob/master/litex/soc/integration/soc.py#L1483 seems to help22:40
somloenabling multi-block transfers results in read errors at the moment, and I'm looking for a few days of relative peace and quiet at $DAYJOB to properly attempt to track down where (likely in the gateware state machines) things get stuck. Additionall fun provided by the fact that multi-block transfers work fine in the bios, just not in Linux :)22:41
somlonickoe: ^^22:43
nickoesomlo: ok, I don't really know too much about it, I was just looking at trying to add sdcard to my project.22:44
somlonickoe: if your target supports it, add `--with-sdcard` to your build command line, then you should get the bios functionality automatically, and should be able to boot from the sdcard22:45
nickoesomlo: I just added the pin definitions, but -- I use litex-buildenv, and that appears to be a bit out of data to all the other litex stuff, so now I am just considering what to do next. Just updating litex in the thirdparty dir gives other errors when making gateware.22:45
nickoesomlo: it looks like those "arguments" only exist for the targets in litex-boards?22:46
nickoeand not the stuff in litex-buildenv22:46
nickoesomlo: this is my platform https://github.com/timvideos/litex-buildenv/compare/master...nickoe:mars_ax322:47
somloonce you boot a kernel (e.g. linux), it will want to use its own drivers to talk to the hardware, rather than whatever exists in the bios. Right now I've been staring at the linux driver for hours, and can't see anything it does that's fundamentally different from the bios, so I suspect timing related issues (bios is bare-metal with no competition, linux will be doing "other things" interleaved with tickling the sdcard gateware) -- this is obviously a22:47
somlovery simplistic thing for me to say, but that's about as much as I know right now :)22:47
nickoeI was also trying to understan if there was support for a card detect pin, but it appears that one "misuses" a dat signal for that.22:47
nickoesomlo: ok, I don't really intend to run linux on this, just some simple firmware.22:48
somlonickoe: right, litex-boards has arguments for boards that are known to have an sdcard reader soldered on, or sometimes have pins for one of the "well known" pmod sockets where one would plug in a pmod sdcard reader22:48
nickoeBut the point is, litex-buildenv does not use litex-boards22:49
somlonickoe: then you should be ok with the bios (sdcard driver code in litex/soc/software/litblitesdcard)22:49
nickoeor it may do, but an old one, I dunno. It appears to be slightly messy all in all.22:49
somlonickoe: I don't know much about litex-buildenv -- the generic (and probably next-to-useless) advice is "dig around in litex-boards, and cut'n'paste whatever makes sense into your design) :)22:49
nickoeyeah, that is what I have done until now22:51
nickoeugh riscv64-unknown-elf-ld: region `rom' overflowed by 6460 bytes22:53
nickoewhen I added the         self.add_spi_sdcard()22:53
somlonickoe: re. card-detect, I think a pmod based sdcard reader will have a dedicated pin for that; otherwise, it depends on what the designer of your specific board did when they, well, designed the board22:53
somlosome boards' sdcard readers have dedicated cd signals, some don't22:53
nickoeyeah, I know the hardware, but I am just not familiar with the migen/litex module api22:54
somlonickoe: I assume you've already heard about the `--ingetraged-rom-size` argument? Again, modulo how things are done in litex-buildenv, I have found I need to set that to 0x10000 to fit the entire bios (when building with ethernet and/or sdcard gateware)22:56
somlo*integrated :)22:56
nickoesomlo: yes, there is this https://github.com/nickoe/litex-buildenv/blob/mars_ax3/targets/mars_ax3/base.py#L26-L3022:57
nickoeI am just trying to figure out how to interpret that properly.22:57
nickoeI don't reall know the difference between the different cpu types :S22:59
somlowell, something is going to instantiate a BaseSoC and then pass it on to an instance of Builder (see for example https://github.com/litex-hub/litex-boards/blob/master/litex_boards/targets/nexys4ddr.py#L136)22:59
somlothat something will have a bunch of arguments that it will pass in, including the size of the rom, the cpu model, etc.23:00
nickoeyeah, but the litex stuff from august did not have that as far as I can see, hence the litex-buildenv stuff does not have it as args.23:01
nickoeanyway, I just tried to select that mor1kx cpu instead23:02
somloNot sure about tradeoffs between cpu models -- I need rv64gc, whic at the moment is Rocket; the other popular choice for linux-capable is vexriscv; if you need simple, there's lm32 and pico4v32 for risc-v, and a bunch of other stuff that implements other ISAs (mor1kx, microwatt, etc) that I'm *really* not familiar with at all23:03
zyplm32 is not risc-v23:04
somlothere you go, I said I don't know :D23:04
zypbut there's a couple other risc-v options though23:04
nickoeI still have not really found how to run own firmware projects on it23:04
nickoeI mean, I have not really tried that hard yet.23:05
zypjust load it and run?23:05
somlomight look through "git log" for the "ascii donut" -- I remember _florent_ added an example on "how to run bare-metal stuff on LiteX" -- again, I'm very fuzzy on the details :)23:06
nickoeyeah, well, sure.23:06
nickoezyp: is there a way to test if the SD card works?23:06
zypI've had custom baremetal code running on vexriscv, IIRC I just fed the binary to the loader-function in litex_term23:06
zyphaven't tried SD card23:06
nickoewhat about regular flash?23:06
zyphaven't tried that either :)23:07
somlozyp: maybe the goal is to have the bare-metal program built into the bitstream (i.e., in addition to or instead of the bios)23:07
zypyeah, I eventually wanna do that too23:07
zypmaybe23:07
zypon the other hand I want to be able to change it without changing the bitstream :)23:07
somlonickoe, zyp: there's litex/soc/software/bios/main.c -- you can figure out where to add a call to your own C stuff from there, in case you want things built directly into the bios23:08
zypyeah23:08
somlozyp: agree on "rapid prototyping" -- waiting for the bistream to rebuild just for a small software/bios change is wasting lots of time :)23:08
zypI'm pretty sure I can figure out how, I just haven't had time yet :)23:08
somlozyp: "It's a simple matter of programming!" :D23:09
zypgot a bunch of other stuff I wanna do as well, and I just started a new job on monday so it's limited how much time I've got23:09
somlozyp: congrats on the new gig!23:09
zypthanks :)23:09
nickoezyp: What are you going to do?23:11
zypembedded stuff, both software and hardware, probably mostly software23:11
nickoeis there a way to see the generated memory map?23:12
zypcsr.csv?23:12
nickoeah, cool23:14
nickoeBy the way, how do you make a custom register that one can just write to via sw?23:15
zypjust write to, as in write only?23:16
nickoeyeah, but also read if possible23:16
nickoeThis should be SDRAM, dos this look right? https://dpaste.com/5P8U8YEMB23:17
tpbTitle: dpaste: 5P8U8YEMB (at dpaste.com)23:17
zypno23:18
nickoeif I write a four byte hex, https://dpaste.com/HRB72SXUZ23:18
tpbTitle: dpaste: HRB72SXUZ (at dpaste.com)23:18
zypwait, which cpu is this? looks big endian23:19
zypif it's big endian then it's correct, just confusing the way the last argument is a number of bytes, while it writes words23:20
nickoezyp: https://dpaste.com/7QHSRXLC523:21
tpbTitle: dpaste: 7QHSRXLC5 (at dpaste.com)23:21
zypah, right, mor1kx is big endian23:21
zyprisc-v is little endian23:22
nickoeright23:22
zypso you should see the opposite order if you do the same on a little endian cpu23:22
nickoeok23:23
*** FFY00 has quit IRC23:24
*** FFY00 has joined #litex23:25
nickoezyp: to me it does not look like the flash works properly? https://dpaste.com/2VNYBXCHU23:25
tpbTitle: dpaste: 2VNYBXCHU (at dpaste.com)23:25
zypnot sure how this particular flash controller works, but generally you can't just write to flash like that23:27
nickoemm, how can I write to flash from the bios then?23:27
zypdunno, have you checked help if it has any particular commands? :)23:28
nickoeyes, there are nothin else, as far as I can see.23:29
nickoehttps://dpaste.com/5RBH5M67D23:29
tpbTitle: dpaste: 5RBH5M67D (at dpaste.com)23:29
zypwhat's that on line 24? :)23:30
nickoeugh23:31
nickoeI wonder what interface to the flash it uses, 1x or 4x spi?23:34
nickoeboth are defined23:34
nickoeah,     def __init__(self, platform, spiflash="spiflash_1x", **kwargs): ?23:35
nickoeand https://github.com/nickoe/litex-buildenv/blob/mars_ax3/targets/mars_ax3/base.py#L68-L9923:35
nickoeI wonder what that "spiflash_dummy" ..  is23:35
nickoeoh right, so fewrites ff's https://dpaste.com/86NNM4CAK23:36
tpbTitle: dpaste: 86NNM4CAK (at dpaste.com)23:36
nickoezyp: It is not quite working as expected, https://dpaste.com/4MX5Q6DRU23:37
tpbTitle: dpaste: 4MX5Q6DRU (at dpaste.com)23:37
nickoebut there are also a couple of parameters that I have not double checked, although I beleive they are correct as is https://github.com/nickoe/litex-buildenv/blob/mars_ax3/platforms/mars_ax3.py#L102-L11323:40
nickoezyp: the sdcard does not seem to be memory mapped, so I can't really test that easily from the bios? https://dpaste.com/FYCTH458B23:48
tpbTitle: dpaste: FYCTH458B (at dpaste.com)23:48

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