Wednesday, 2019-09-18

*** tpb has joined #litex00:00
*** shenki has joined #litex00:06
shenkihello! i am attempting to boot linux on vexriscv in verilator, and it has been sitting on "--========== Booting Linux =============--" for several minutes00:07
shenkiis there a way to see what is going on under the hood?00:07
*** freeemint has quit IRC00:59
xobsjohn_k: I didn't include Python because I assume the user has a Python on their system already.  If I were to include a Python I'd want one statically linked against musl at least.01:02
*** freemint has joined #litex01:07
guanhas anyone here gotten linux-on-litex-vexriscv working on the versa ecp5 board? using the prebuilt bitstream, my lxterm says "[LXTERM] Starting...." and then stops01:19
guani'm on a mac, i can get blinky and other stuff working on the board fine, and it says "svf file programmed successfully"; there are two tty's associated with the FTDI chip, i'm using the first one01:20
*** freemint has quit IRC01:55
*** freemint has joined #litex02:02
*** freemint has quit IRC02:07
*** freemint has joined #litex02:07
shenkiguan: i'm trying to get the same going on arty02:27
guanshenki: oh that reminds me, i also tried on an arty, same result iirc :-)02:27
guanthe README says speed is 1e6 (1 MHz?), I wonder where to check if that’s correct02:28
shenkiyeah. iw wonder when this last worked02:38
shenki_florent_: when did you last have the vexriscv linux booting?02:38
CarlFK it worked when I gave a talk https://chicagolug.org/meetings/2019-07-13/02:59
tpbTitle: July 2019 Meeting of ChicagoLUG (at chicagolug.org)02:59
*** freeemint has joined #litex03:10
*** freemint has quit IRC03:12
shenkiguan: I got it to work just now, using linux-on-litex-vexriscv and the prebuild kernel/dtb/rootfs03:21
*** CarlFK has quit IRC03:22
*** CarlFK has joined #litex03:24
*** rohitksingh has quit IRC03:39
*** _whitelogger has quit IRC03:51
*** freeemint has quit IRC03:52
*** _whitelogger has joined #litex03:54
futarisIRCcloudshenki: Have you tried with a kernel / dtb / rootfs that you built on  your system?03:54
*** CarlFK has quit IRC03:59
*** rohitksingh has joined #litex04:11
shenkiuroot@buildroot:~# uname -a04:45
shenkiLinux buildroot 5.0.13 #1 Tue Sep 17 22:24:09 ACST 2019 riscv32 GNU/Linux04:45
shenkiroot@buildroot:~# dmesg |head04:45
shenki[    0.000000] No DTB passed to the kernel04:45
shenki[    0.000000] Linux version 5.0.13 (joel@voyager) (gcc version 8.3.0 (Buildroot 2019.11-git-00298-g5c9e9ef10087)) #1 Tue Sep 17 22:24:09 ACST 201904:45
shenkifutarisIRCcloud: yes!04:45
futarisIRCcloudCool04:50
shenkidoes someone have a git tree with the linux kernel patches?05:03
*** CarlFK has joined #litex05:09
_florent_shenki: i think you had an issue with emulator.bin, i need to add compilation of emulator when building the board05:27
_florent_shenki: i'll try to do that now, otherwise, i'm using linux-on-litex-vexriscv regularly to check we don't have regressions on LiteX and the cores05:30
_florent_guan: maybe you can give a try on the versa/arty with the prebuilt bistreams/images: https://github.com/litex-hub/linux-on-litex-vexriscv-prebuilt05:31
tpbTitle: GitHub - litex-hub/linux-on-litex-vexriscv-prebuilt: Prebuilt bitstreams / linux images for litex-on-litex-vexriscv repository (at github.com)05:31
_florent_guan: just to verify everything is correct on the hardware side05:32
_florent_guan: when the bitstream is loaded and you open litex_term, you should be able to interact with the bios05:33
shenki_florent_: ok. I have the hardware working now, so that looks good for testing05:48
shenki_florent_: i rebased the linux patches on 5.3 and it fails to boot. it looks like with the 5.0 kernel it wasn't getting a dtb, but it is with 5.3? https://gist.github.com/shenki/3dcf7829efef7cc1d8e3a7ca065d904505:48
tpbTitle: linux 5.3 on vexriscv on arty · GitHub (at gist.github.com)05:48
shenkihere's the working boot: https://gist.github.com/shenki/8eb53fbcf5658440f2deb8e98761fc8105:49
tpbTitle: linux 5.0 on vexriscv on arty · GitHub (at gist.github.com)05:49
_florent_shenki: i saw the warning on linux 5.0, but the behaviour was clearly different depending the dtb i was providing, so even if there is a warning, the kernel seems to use the dtb05:52
shenkiokay05:54
_florent_shenki: i know we had issues with linux 5.1: https://github.com/litex-hub/linux-on-litex-vexriscv/pull/2005:56
tpbTitle: force buildroot commit rev to 982a61b6adabbcd68a0eb9ad1e348a732915e9e4 by futaris · Pull Request #20 · litex-hub/linux-on-litex-vexriscv · GitHub (at github.com)05:56
shenkiok. that looks buildroot/userspace related05:58
*** forksand has quit IRC06:04
shenki_florent_: do we have a watchdog or something that can reset the CPU?06:18
*** forksand has joined #litex06:18
shenkibeing able to type 'reboot' and have it reset the CPU would be handy :)06:18
_florent_shenki: there is a CSR to reset the cpu yes, and was also thinking about adding reboot support: https://github.com/litex-hub/linux-on-litex-vexriscv/issues/4506:30
tpbTitle: Add reboot support · Issue #45 · litex-hub/linux-on-litex-vexriscv · GitHub (at github.com)06:30
_florent_if you know how to do that in linux, here we just need to write 1 to CSR_CTRL_RESET_ADDR to reboot the CPU06:31
shenkiOh, we have that in hardware already?06:32
shenkiI can write the linux driver for it06:32
_florent_yes it's already there :)06:33
shenki_florent_: cool. how do we make it show up in the device tree?06:33
_florent_i can add it if you tell me what structure need to be added to the device tree for that06:34
futarisIRCcloudhttps://www.kernel.org/doc/Documentation/devicetree/bindings/reset/reset.txt06:36
shenkithat's the wrong kind of reset06:36
daveshahguan: you want to use the second tty on the Versa for serial comms, the first is for programming06:36
shenkithat subsystem is about reset lines for IP blocks06:36
shenkifor when you have a GPIO that keeps a bit of IP in reset when it's not being used06:37
futarisIRCcloudWhoops. :P06:37
shenkiyou are not the first person to make that assumption06:38
shenkiit looks like there are a pair of drivers that do use it for resetting the CPU06:38
shenkiregister_restart_handler is where lots of SoCs register their reboot handler06:39
shenkilots appear to put their driver in drivers/power/reset06:39
_florent_shenki: in case you want to customize the .dts for that, in json2dts.py, you will get the csr reset address for the CPU with: d["csr_registers"]["ctrl_reset" ]["addr"]06:45
shenkicool. I'll cook up a patch06:46
_florent_great, thanks!06:52
shenki_florent_: can we use gdb on the host to debug code on the FPGA?06:56
_florent_shenki: i've not used it (yet), but i know others are using it, xobs created a tool for that: https://github.com/xobs/wishbone-utils06:59
tpbTitle: GitHub - xobs/wishbone-utils: Utilities for working with a Wishbone bridge (at github.com)06:59
shenkiah. mithro was telling me about this the other day07:00
shenkido I need to add something to the hardware design?07:01
_florent_but to use it, you will need to use linux+debug variant instead of linux: https://github.com/litex-hub/linux-on-litex-vexriscv/blob/master/soc_linux.py#L5507:01
tpbTitle: linux-on-litex-vexriscv/soc_linux.py at master · litex-hub/linux-on-litex-vexriscv · GitHub (at github.com)07:01
_florent_yes ^ :)07:02
shenki:D07:02
xobsshenki: You can use the uart bridge, USB bridge, SPI bridge... basically any bridge ought to work.07:02
shenkihey xobs. i am on the arty, so i'll try uart to start with07:03
xobsSure.  Just enable the bridge, map the debug region, and run "wishbone-tool -u [/dev/serial-port] -s gdb"07:04
_florent_shenki: since the uart is already used by linux, maybe it would be easier to use a USB<-->Serial module on a PMOD and do a UART wishbone bridge with it07:04
xobsYou might also want to add "--bind-addr 0.0.0.0" if you're debugging it from a different machine.07:04
shenkixobs: okay07:05
xobswishbone-tool binaries are at https://github.com/xobs/wishbone-utils/releases/latest -- though I've never had the occasion to test the s390x versions.07:06
tpbTitle: Release v0.3.2: travis: disable tests on ppc64le · xobs/wishbone-utils · GitHub (at github.com)07:06
shenkithat is amusing. i wonder if i could find a machine on the work network to test them with07:06
shenki_florent_: do you have a snippet for soc_linux.py to use a pmod?07:08
xobsshenki: I'm not sure about _florent_, but I'd imagine pmod is a Connector, which i haven't found any good documentation on.07:10
xobsI did, however, manage to get it working here: https://github.com/im-tomu/foboot/blob/foboot-2/hw/foboot-bitstream.py#L18907:11
tpbTitle: foboot/foboot-bitstream.py at foboot-2 · im-tomu/foboot · GitHub (at github.com)07:11
xobs... and https://github.com/im-tomu/foboot/blob/foboot-2/hw/foboot-bitstream.py#L57707:11
tpbTitle: foboot/foboot-bitstream.py at foboot-2 · im-tomu/foboot · GitHub (at github.com)07:11
xobsAnd I'd imagine the uart is somewhat similar.07:11
_florent_shenki: i'm preparing a patch for soc_linux to add a UART wishbone bridge07:11
shenkithanks07:12
shenkixobs: I'm intrigued by RandomFrimwareROM. What did you do there?07:13
xobsshenki: I filled the ROM with random data, then as part of `fomu-flash` I look for that data and replace it on the fly.07:14
xobsIt's similar to what `icebram` does.  I think xilinx has similar options.07:14
xobsIf you want to bundle the software in the image itself, it's very handy.  Litex seems to prefer having a bios that calibrates DDR, and then stores firmware XIP on SPI following the bitstream image.07:15
shenkiso it gives you a magic number to search and replace with the actual firmware image?07:16
xobsCorrect.  If it was something like all zeroes or ones, or a repeating pattern, you wouldn't know which bits of the input file you're looking at.07:20
_florent_shenki: here is how to add the a serial bridge on pmod: https://hastebin.com/oruzulinud.rb07:25
_florent_shenki: just change tx/rx mapping to what is used on your pmod07:26
_florent_before trying gdb with it you can try to access some CSRs or Wishbone regions with wishbone-tool07:27
xobsYeah, depending on your mapping you can examine ROM data by looking at offset 0.07:33
shenkiok, thanks07:37
xobsOh, I thought triple quotes """ in Python trimmed whitespace, but I guess that's not true by default.  (Currently trying to do something with the CSRField documentation)07:42
xobsI suppose that's fine if it gets passed to Markdown, which will reformat it anyway.07:44
*** rohitksingh has quit IRC08:18
_florent_xobs: i was also thinking about that. Keeping the whitespace allow the code to be clean, but is maybe not convenient for the documentation. If the documentation can handle that that would be nice.08:28
xobsflorent: Markdown shouldn't care, so let's keep it like it is.08:28
mithroTextwrap.deindent09:14
kgugalahi all09:20
kgugalaxobs: We have released the first version of USB test suite based on your work in valentyusb09:21
kgugalaxobs: you can take a look on this here https://github.com/antmicro/usb-test-suite-build09:22
tpbTitle: GitHub - antmicro/usb-test-suite-build (at github.com)09:22
xobskgugala: Oh wow.  Cool!09:22
kgugalaxobs: please take a look and comment/open issues09:22
kgugalaxobs: right now we want to make this more generic so more IPs can be tested + we want to add enumeration tests09:24
kgugalaxobs: like full enumeration process in different OSes09:24
xobsThat's huge.09:24
xobsI always tell people to test with Windows, because it's always the pickiest.  But if that can be codified that's even better.09:25
kgugalaIt will be some work, but I think useful09:25
futarisIRCcloudkgugala: Looks good.09:28
*** CarlFK has quit IRC09:29
*** _whitelogger has quit IRC09:33
*** _whitelogger has joined #litex09:35
_florent_kgugala: nice09:40
john_k[m]xobs: understood re: python in tool chain. I raised the issue since it was there in 1.3 but missing in later builds09:56
john_k[m]Will re-test a bit today09:56
xobsHere's a first draft of what I have in mind for generating reference manuals: https://doctest.xobs.io/timer.html11:34
tpbTitle: TIMER0_LOAD3 doctest documentation (at doctest.xobs.io)11:34
xobsIt needs more documentation around the modules themselves, and probably could use a reference table up top. And more vertical space.11:35
xobsBut the idea is there!11:36
xobsIt has real address offsets, field tables, and multiple csr types. I just only had the one timer module in the system.11:42
guandaveshah _florent_: ah thanks, i just tried the second tty with same results, it just gets stuck at "[LXTERM] Starting...". nothing else shows up (even after i hit enter). this is using the prebuilt bitstream. i'll try from a linux box later.11:49
*** freemint has joined #litex12:58
guani should dig out the logic analyzer and see what's actually going across the uart pins14:18
*** forksand has quit IRC15:52
*** forksand has joined #litex16:07
daveshahxobs: those autogenerated docs are very nice!16:08
daveshahguan: yeah, could be an odd baud rate issue or something16:08
guandaveshah: is soc_linux.py:56 the only place i have to change to make it slower? (+ the command line argument for lxterm)16:11
daveshahI think that's it16:12
somlomithro: re. PR 260, Rocket has a built-in L1 cache, so arguably it might be worth spending fpga bram on just making that bigger, instead of also having a LiteX l2 in front of the sdram controller16:29
somloif I'm not mistaken, l2 is the *only* cache for most of the 32-bit CPUs LiteX supports, there is no L1 on any of them (might be wrong about that, appreciate someone kicking me if that's the case :)16:30
mithrosomlo: The L2 cache is shared between DMA controllers and the CPU, which can be good / can be bad depending on time16:30
mithrokgugala / xobs: Did you see https://github.com/JohnDMcMaster/usbrply ? Convert a .pcap file (captured USB packets) to Python or C code that replays the packets in the .pcap file16:31
tpbTitle: GitHub - JohnDMcMaster/usbrply: Replay USB messages from Wireshark (.cap) files (at github.com)16:31
mithroDone by a person who was on my team a while back but I totally didn't know about it until 2 days ago16:31
somlook, so I have to understand how dma will fit into my plan of just connecting the SDRAM data path to the appropriate rocket axi master port16:31
*** freemint has quit IRC17:23
*** freemint has joined #litex17:23
*** freemint has quit IRC17:50
*** freemint has joined #litex17:50
*** rohitksingh has joined #litex18:07
*** rohitksingh has quit IRC18:15
*** CarlFK has joined #litex19:06
*** rohitksingh has joined #litex19:10
_florent_xobs: sorry just back but i really like the generated documentation19:22
*** rohitksingh has quit IRC19:23
somlo_florent_: re. litedram commit d93dded, may I suggest printing the actual values of the mismatched width values: https://pastebin.com/UzETkgqT19:45
tpbTitle: [Diff] diff --git a/litedram/frontend/wishbone.py b/litedram/frontend/wishbone.py inde - Pastebin.com (at pastebin.com)19:45
somloand thanks for the explanation re. l2_cache as an alternative "UpConverter" :)19:47
*** CarlFK has quit IRC20:00
*** rohitksingh has joined #litex20:09
*** Dolu has quit IRC20:50
*** rohitksingh has quit IRC21:07
*** rohitksingh has joined #litex21:26
*** rohitksingh has quit IRC22:11
*** Dolu has joined #litex22:48

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!