Monday, 2020-08-03

*** tpb has joined #litex00:00
*** Degi has quit IRC00:44
*** Degi has joined #litex00:47
*** FFY00 has quit IRC01:43
*** FFY00 has joined #litex01:44
*** jaseg has quit IRC02:21
*** jaseg has joined #litex02:22
*** FFY00 has quit IRC02:45
*** FFY00 has joined #litex02:46
*** HoloIRCUser1 has joined #litex04:41
*** HoloIRCUser has quit IRC04:42
*** HoloIRCUser has joined #litex04:42
*** HoloIRCUser1 has quit IRC04:42
*** kgugala_ has joined #litex05:28
*** HoloIRCUser1 has joined #litex05:30
*** HoloIRCUser has quit IRC05:30
*** kgugala_ has quit IRC05:31
*** kgugala_ has joined #litex05:31
*** kgugala has quit IRC05:32
*** HoloIRCUser has joined #litex05:39
*** HoloIRCUser1 has quit IRC05:42
*** HoloIRCUser1 has joined #litex05:43
*** HoloIRCUser has quit IRC05:43
*** HoloIRCUser has joined #litex06:00
*** HoloIRCUser1 has quit IRC06:02
*** HoloIRCUser1 has joined #litex06:03
*** HoloIRCUser has quit IRC06:03
*** HoloIRCUser has joined #litex06:15
*** HoloIRCUser1 has quit IRC06:18
*** jeanthom has joined #litex06:32
*** kgugala has joined #litex06:49
*** kgugala has quit IRC06:51
*** kgugala_ has quit IRC06:51
*** kgugala has joined #litex06:51
*** kgugala_ has joined #litex07:09
*** kgugala has quit IRC07:12
*** kgugala__ has joined #litex07:18
*** kgugala_ has quit IRC07:18
*** kgugala_ has joined #litex07:20
*** kgugala__ has quit IRC07:24
*** jeanthom has quit IRC08:06
*** st-gourichon-fid has joined #litex08:18
*** m4ssi has joined #litex08:29
*** jeanthom has joined #litex09:28
*** CarlFK has joined #litex09:35
*** kgugala has joined #litex09:55
*** kgugala has quit IRC09:55
*** kgugala_ has quit IRC09:56
*** kgugala has joined #litex09:56
*** kgugala_ has joined #litex10:06
*** kgugala has quit IRC10:09
*** kgugala_ has quit IRC10:09
*** kgugala has joined #litex10:09
*** kgugala_ has joined #litex10:11
*** kgugala has quit IRC10:13
*** kgugala_ has quit IRC10:13
*** kgugala_ has joined #litex10:14
pepijndevosdaveshah, I'm not changing the netlist at all, just reloading the RISC-V code.10:39
daveshahoh, that's much weirder then10:39
daveshahis the CPU resetting consistently with the same code?10:39
pepijndevosHowever, the idea that it could not only be a bug in my code, or even the compiler, but it could even be a CPU bug or a synthesis bug is dreadful haha10:40
pepijndevosYea10:40
pepijndevosI can 100% reliably break it by commenting or uncommenting a certain line10:41
pepijndevosI'm not even sure what sort of crash it is tbh10:41
disasm[m]What's the line?10:41
disasm[m]Maybe you have a bus stall10:41
pepijndevosSome library code that calls my HAL/PAC stuff10:42
pepijndevosI think if it's a hard reset it'd litex_term would try to reload it again10:42
pepijndevosI think if it's a panic it'd at least run up to that point10:43
pepijndevosThe LED tracer animation it has on boot remains active10:43
pepijndevosThe first thing I do in my code is set the LEDs to something10:43
pepijndevosIf I have the broken code, nothing happens at all.10:44
pepijndevosdisasm[m], how would I detect a buss stall?10:44
disasm[m]Just define your own panic handler and set LEDs to something inside it10:44
disasm[m]<pepijndevos "disasm, how would I detect a bus"> By dumping one of the bus signals to one of LEDs10:44
pepijndevosI did define a custom panic handler, which is not it seems.10:45
disasm[m]This looks like a very long request on bus that doesn't finish10:45
pepijndevos*not run10:45
pepijndevosHow... do I dump a bus signal to an LED? I assume that involves some deep digging around in LiteX internals...10:47
disasm[m]`self.comb += led.eq(somewhere.inside.your.soc)`10:50
disasm[m]But yeah, you need to extract the signal somehow10:50
disasm[m]You can also create another wishbone master and examine its signals10:50
pepijndevosBut... okay, so imagine my HAL is horribly broken and it locks up the bus, would it not still run the first part of the code up to it touching the HAL?10:51
pepijndevosWhat kind of thing can stall the bus? Is just busywaiting enough to have that effect? I would hope not.10:53
disasm[m]<pepijndevos "What kind of thing can stall the"> Incorrect address or size, for example10:53
disasm[m]Hmm, now I think you probably have a stack overflow10:53
pepijndevosThis sounds more likely actually...10:54
pepijndevoshold on...10:54
disasm[m]Check that you do not store there anything huge10:54
pepijndevosBut still... would that not at least run up to that point?10:55
pepijndevosOk I'll experiment a bit more10:55
disasm[m]Because stack layout changes and you may end up with overflow earlier10:55
pepijndevosMaybe it's another wonky linking issue -.-10:56
_florent_pepijndevos: if you want to work on software with a good visibility of what is going on in the hardware, you can use litex_sim: https://github.com/enjoy-digital/litex/blob/master/litex/tools/litex_sim.py11:11
tpbTitle: litex/litex_sim.py at master · enjoy-digital/litex · GitHub (at github.com)11:11
_florent_it's a LiteX SoC similiar to the examples targets that instead of running on hardware will run with Verilator11:12
_florent_just try litex_sim and you should see the BIOS prompt11:12
_florent_you can then add custom peripherals, run custom software, etc...11:13
_florent_and just add --trace to generate the waveform which you'll be able to analyze11:13
_florent_We are using for example a custom version here: https://github.com/litex-hub/linux-on-litex-vexriscv/blob/master/sim.py to boot linux with it in simulation and this has been very useful to the the VexRiscv SMP integration11:15
tpbTitle: linux-on-litex-vexriscv/sim.py at master · litex-hub/linux-on-litex-vexriscv · GitHub (at github.com)11:15
pepijndevos_florent_, thanks, that's a good suggestion. The question is just if it's reproducible when removing my Rust HAL hacks from the equation. But it's a good test to rule out some problems.11:22
pepijndevosOMG I fixed it... it was a linker problem11:28
pepijndevosI was putting my bss and stack in sram, I thought that would make sense.11:28
pepijndevosBut apparently Rust uses enough stack space that that does not make sense.11:29
pepijndevosEverything is in main ram now, and it does not crash.11:29
pepijndevosIt does not properly work either, but that's probably my own fault.11:29
pepijndevos*also* my own fault11:29
pepijndevosIs there *any* data that makes sense to store in the sram?11:33
zypsram exists because bios needs some working memory while it's initializing the main_ram11:34
zypafter bios you can use it for whatever fits11:35
zype.g. .data and/or .bss11:35
zypor you could use it for particularly latency sensitive stuff11:37
pepijndevosI see ok11:41
pepijndevosactually no you should be able to use that but it's disabled by default11:56
pepijndevosoops11:56
*** kgugala has joined #litex12:38
*** kgugala_ has quit IRC12:39
*** kgugala has quit IRC12:39
*** kgugala has joined #litex12:39
*** kgugala_ has joined #litex12:41
*** kgugala has quit IRC12:44
*** kgugala_ has quit IRC12:45
*** kgugala has joined #litex12:45
*** kgugala_ has joined #litex12:47
*** kgugala has quit IRC12:47
*** kgugala has joined #litex12:47
*** kgugala_ has quit IRC12:48
*** kgugala_ has joined #litex12:48
*** kgugala__ has joined #litex12:49
*** kgugala has quit IRC12:49
*** kgugala_ has quit IRC12:52
*** kgugala has joined #litex12:59
*** kgugala__ has quit IRC13:00
*** kgugala has quit IRC13:01
*** kgugala has joined #litex13:01
*** kgugala_ has joined #litex13:02
*** kgugala_ has quit IRC13:03
*** kgugala has quit IRC13:03
*** kgugala has joined #litex13:03
*** kgugala_ has joined #litex13:04
*** kgugala has quit IRC13:07
*** kgugala has joined #litex13:07
*** kgugala_ has quit IRC13:09
*** kgugala has quit IRC13:09
*** kgugala has joined #litex13:09
*** kgugala_ has joined #litex13:11
*** kgugala has quit IRC13:11
*** kgugala has joined #litex13:13
*** kgugala has quit IRC13:15
*** kgugala has joined #litex13:16
*** kgugala_ has quit IRC13:16
*** kgugala_ has joined #litex13:17
*** kgugala has quit IRC13:17
*** kgugala_ has quit IRC13:20
*** kgugala_ has joined #litex13:20
*** kgugala has joined #litex13:21
*** kgugala__ has joined #litex13:22
*** kgugala has quit IRC13:22
*** kgugala_ has quit IRC13:25
*** kgugala has joined #litex13:38
*** kgugala__ has quit IRC13:42
*** kgugala_ has joined #litex13:44
*** kgugala has quit IRC13:48
somlo_florent_: re. PR #617 -- dropping the sdcard speed to 25000000 (half) gets the DMA-ed boot.bin to work perfectly13:55
somloI'll run a binary "search" to isolate the maximum speed that works for me, then update the PR with that information13:56
pepijndevoshurray, my SPI peripheral is working great, but my GPIO one doesn't do anything.13:56
somlolooks like routing DMA through Rocket is slow, for some reason -- might be the repeated WB-to-AXI and data width conversions, or might just be rocket internals, that's still TBD...13:57
*** kgugala has joined #litex14:02
*** kgugala_ has quit IRC14:03
*** kgugala_ has joined #litex14:03
*** kgugala has quit IRC14:04
*** kgugala has joined #litex14:04
*** kgugala_ has quit IRC14:05
*** kgugala_ has joined #litex14:05
*** kgugala has quit IRC14:06
*** kgugala has joined #litex14:06
*** kgugala_ has quit IRC14:07
*** kgugala_ has joined #litex14:07
*** kgugala has quit IRC14:11
*** kgugala has joined #litex14:14
*** kgugala has quit IRC14:15
*** kgugala_ has quit IRC14:15
*** kgugala_ has joined #litex14:15
*** kgugala has joined #litex14:17
*** kgugala_ has quit IRC14:17
*** kgugala_ has joined #litex14:18
*** kgugala has quit IRC14:21
*** kgugala_ has quit IRC14:21
*** kgugala has joined #litex14:21
*** kgugala has quit IRC14:28
*** kgugala_ has joined #litex14:30
*** kgugala_ has quit IRC14:31
*** kgugala has joined #litex14:31
pepijndevosWhat am I doing wrong??? I can set the pins and it works, but if I use GPIOOut I can write to the register but nothing happens. https://bpa.st/AFDA14:40
tpbTitle: View paste AFDA (at bpa.st)14:40
pepijndevosThe SPI is working great14:41
_florent_somlo: interesting, so that's why i suspected, strange the DMA bus is that slow on Rocket, i know how to handle this easily (stopping the SD clocker when the read fifo is almost full) and will try to implement it in the next days15:21
_florent_somlo: we could merge the PR once update to work at a lowered frequency and i could implement the feature/increase the frequency.15:22
pepijndevosahhhhhh going crazy... I can manually configure the pins with some nMigen, so my pin mapping is ok. To rule out my Rust code I'm now poking the address right from litex_term, if I write 0xffffffff to it, it reads back as 0x07000000, seemingly indicating 3 ones corresponding to my 3 wires15:28
_florent_pepijndevos: strange, can you check the verilog or provide it?15:29
_florent_pepijndevos: looking at your code, it seems correct15:29
pepijndevosuh oh...15:30
pepijndevosinput wire oled_ctl_resn occurs once in the port and nowhere else15:30
pepijndevoshold on... why is that an input??15:31
pepijndevosI can upload the verilog if you want and know a suitable pastebin15:34
pepijndevosThere are some other oled bits present, so it's not like it's completely missing or anything15:35
pepijndevoshttps://hastebin.com/jatucaliho.php15:36
tpbTitle: hastebin (at hastebin.com)15:36
pepijndevosSo maybe some nMigen bug then? Super weird.15:38
_florent_i'm going to test your code snipet15:44
pepijndevoswhich snippet? the code to add the GPIO?15:46
_florent_yes15:47
_florent_can you share the pads definition?15:47
pepijndevos_florent_, https://bpa.st/YEPA15:48
tpbTitle: View paste YEPA (at bpa.st)15:48
pepijndevosit's the OLED display on the ULX3S :))15:49
pepijndevosI can also make a PR with all the changes if you want. This header is kinda specifically for this display, and it's behind a flag like the SD card.15:55
somlo_florent_: ok, updated PR #617 -- Rocket DMA works fine with slowed-down LiteSDCard clock at 25MHz16:11
*** MyGreenBalloon has joined #litex16:26
_florent_pepijndevos: sorry got interrupted, the issue is that GPIOOut does not work on record or pads (we should allow it, or generate an error).16:30
_florent_you can do16:30
_florent_https://www.irccloud.com/pastebin/JfD2NxMT/16:30
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)16:30
_florent_then16:30
_florent_https://www.irccloud.com/pastebin/kvdzjniW/16:30
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)16:30
pepijndevos_florent_, waaaah, what does that do?16:35
pepijndevosIs it something that is easy to fix? Would be happy to make a PR, but know basically zero nmigen.16:36
_florent_i will have a look to fix this16:37
_florent_BTW, we are still using Migen in LiteX, not nMigen :)16:37
somlo_florent_: oh, and my microSD pmod dongle just got delivered, so I can try it on my trellisboard -- can you shoot me the build command line you used to direct LiteSDCard to use the pmod instead of the built-in pins?16:45
_florent_pepijndevos: this should now be fine with: https://github.com/enjoy-digital/litex/commit/2ec4604c41a828634be9029babe17281d4be082516:49
tpbTitle: cores/gpio: add support for Record on GPIOOut, GPIOIn and GPIOInOut. · enjoy-digital/litex@2ec4604 · GitHub (at github.com)16:49
_florent_somlo: you can comment out: https://github.com/litex-hub/litex-boards/blob/master/litex_boards/platforms/trellisboard.py#L152-L15716:50
tpbTitle: litex-boards/trellisboard.py at master · litex-hub/litex-boards · GitHub (at github.com)16:50
_florent_and here: https://github.com/litex-hub/litex-boards/blob/master/litex_boards/platforms/trellisboard.py#L24916:51
*** m4ssi has quit IRC16:51
tpbTitle: litex-boards/trellisboard.py at master · litex-hub/litex-boards · GitHub (at github.com)16:51
_florent_add: platform.add_extension("_sdcard_pmod_io")16:51
pepijndevos_florent_, awesome thanks :)) time to update I guess16:53
*** kgugala_ has joined #litex17:02
*** kgugala has quit IRC17:04
*** kgugala has joined #litex17:15
*** kgugala_ has quit IRC17:19
*** MyGreenBalloon has quit IRC17:22
*** jeanthom has quit IRC17:33
*** CarlFK has quit IRC17:40
somlo_florent_: I'm a total CI n00b, but if it's simply a matter of getting it to stop complaining about wishbone adr_width being bumped to 31 (probably a  bunch of the tests are hardcoding 30?) -- I can try and pattern-match my way through an attempt to shut it up :)17:59
*** jeanthom has joined #litex18:28
*** jeanthom has quit IRC18:54
*** jeanthom has joined #litex19:00
somlo_florent_: turns out, CI had a valid complaint regarding axi_lite vs. wishbone address width assertions in the axi_lite <-> wishbone conversion modules19:04
* somlo wonders how come these assertions didn't get triggered during actual builds, in which case I'd have figured it out before CI got all upset with me :)19:04
*** jeanthom has quit IRC19:25
*** tcal has joined #litex19:30
*** jeanthom has joined #litex19:40
*** DerFetzer[m] has joined #litex20:11
*** CarlFK has joined #litex20:12
*** FFY00 has quit IRC20:17
*** FFY00 has joined #litex20:18
*** FFY00 has quit IRC20:19
*** FFY00 has joined #litex20:20
*** jeanthom has quit IRC20:27
*** FFY00 has quit IRC20:46
*** FFY00 has joined #litex20:48
somlo_florent_: I added a temporary patch that makes assert print out the offending values. When building with rocket, axi address width is 32, length of wb_adr is 29, and the wb_adr_shift is 3, and they all add up nicely with the original assert21:05
somloI want to see the values CI gets when the assertion fails, and how they're calculated21:08
somloI suspect those asserts will have to be updated, but simply adding a " - 1" to the mix isn't enough (while it shuts up CI, it doesn't actually work on Rocket :) )21:09
*** FFY00 has quit IRC21:16
*** jeanthom has joined #litex21:16
*** FFY00 has joined #litex21:17
*** FFY00 has quit IRC21:18
*** FFY00 has joined #litex21:19
*** jeanthom has quit IRC21:28
*** lf has quit IRC23:23
*** lf has joined #litex23:23

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