Thursday, 2020-04-30

*** tpb has joined #litex00:00
*** HoloIRCUser has quit IRC02:41
*** scanakci has quit IRC02:43
xobsdkozel: If you have easy access to that, I could get started shortly.02:47
xobs(It would be helpful to have a compiler on the machine as well)02:47
xobs(And, unfortunately, root access)02:47
*** gregdavill has quit IRC02:51
*** scanakci has joined #litex03:17
*** CarlFK has quit IRC03:48
*** CarlFK has joined #litex03:53
*** Degi has quit IRC03:54
*** Degi has joined #litex03:56
*** CarlFK has quit IRC04:11
*** CarlFK has joined #litex04:58
*** HoloIRCUser has joined #litex06:39
*** HoloIRCUser1 has joined #litex06:40
*** HoloIRCUser has quit IRC06:43
*** CarlFK has quit IRC06:50
*** HoloIRCUser has joined #litex06:57
*** HoloIRCUser1 has quit IRC07:01
_florent_xobs: i prepared the setup, i'm sending you the info to connect to it07:07
*** CarlFK has joined #litex07:16
*** CarlFK has quit IRC08:10
*** CarlFK has joined #litex08:43
*** synaption[m] has quit IRC08:56
*** john_k[m] has quit IRC08:56
*** bunnie has quit IRC08:56
*** abeljj[m] has quit IRC08:56
*** disasm[m] has quit IRC08:56
*** david-sawatzke[m has quit IRC08:56
*** sajattack[m] has quit IRC08:56
*** xobs has quit IRC08:56
*** david-sawatzke[m has joined #litex09:12
*** CarlFK has quit IRC09:14
*** CarlFK has joined #litex09:24
*** sajattack[m] has joined #litex09:51
*** john_k[m] has joined #litex09:51
*** xobs has joined #litex09:51
*** synaption[m] has joined #litex09:51
*** abeljj[m] has joined #litex09:51
*** disasm[m] has joined #litex09:51
*** bunnie has joined #litex09:51
dkozelxobs: I'll test the wishbone tool right now.10:14
xobsdkozel: For some reason, the top few bits don't seem to be set:10:15
xobssudo ./target/debug/wishbone-tool --pcie-bar /sys/bus/pci/devices/0000\:02\:00.0/resource0 --csr-csv ~/pcie_sdi/csr.csv pcie_dma0_writer_table_value -> 0xx03ffffff (after writing 0xffffffff there)10:16
dkozelpermission error without sudo, segfault with. Might be using the wrong pci resource. checking10:18
xobsOh, it works fine if I put wishbone-tool into server mode and use the litex tests to read and write those regiseters.10:22
xobsAh, it's because it's a register that spans two physical registers.  That's why I wasn't able to properly write it with the command line.10:22
xobsOkay, good.10:22
dkozelI'm using the right pci device10:22
dkozeldmesg: litepcie 0000:03:00.0: enabling device (0000 -> 0002)10:22
xobswhat's your command line?10:23
dkozelsudo ./target/debug/wishbone-tool --pcie-bar /sys/bus/pci/devices/0000\:03\:00.0/resource0 --csr-csv ~/src/litepcie_aller_test/soc_pciesoc_aller/csr.csv ctrl_scratch10:23
xobsThat should be it, yeah.  What address is `ctrl_scratch` according to your csr.csv?10:24
daveshah_florent_: to avoid polluting the issue comments, how would individual delays to the command/clock work for https://github.com/enjoy-digital/litedram/pull/190#issuecomment-621339178 ?10:24
tpbTitle: WIP: Implement cmd_latency calibration by jedrzejboczar · Pull Request #190 · enjoy-digital/litedram · GitHub (at github.com)10:24
daveshahI thought all modules are addressed at once, so there can only be one command/clock delay for all of them?10:25
dkozel0x8200000410:25
xobsThat seems super high, and we probably need input from florent on this one.10:26
dkozel0x82000000 is the CSR base10:26
dkozelmemory_region,csr,0x82000000,65536,io10:27
xobsYeah, but on the system I'm testing, it's: `memory_region,csr,0x00000000,131072,io`10:27
xobsAnd he mentioned that the biggest aperture he's seen is 512 MB, but in order to be at that address it would need a 2 GB aperture.10:28
dkozelright, this seems like a reasonable error then10:28
dkozelI don't see an immediate way to reduce the CSR address or remap the CSR portion to a separate region10:31
xobsAnd I'm not familiar with this at all, which is why I think florent is the best person to give us input.10:32
dkozelThanks for adding the code! I'll have a read through to see how you've done it and try some standalone Rust utils10:32
xobsI admit, the bridge innards are pretty hairy, mostly because they support having the connection go away and come back.10:32
dkozelYep, I'm more than happy to wait. I'm going to get the DMA transfers wrapped into GNU Radio today, don't need the wishbone utils to get going on that10:32
xobsIt was designed to debug Fomus over USB where you're resetting the connection a lot.  Or via SPI where you're reflashing the board.10:33
dkozelI'm hoping one day to get partial reconfig working so the PCIe portion can be put into some idle state and various DSP components hanging off the wishbone bus can be reconfigured without taking down the system10:33
xobsBut overall it works well.  And now we have binaries for 16 platforms! :D10:34
xobsIncluding s390x for some reason...10:34
dkozelvery likely because someone could10:34
xobsMight as well, right?10:37
xobsI'll have to get 64-bit wishbone support at some point...10:38
xobsOh right, that's why I removed 32-bit darwin support.  Because it's now a tier 3 in Rust.  Because Apple removed 32-bit darwin support.10:47
dkozellook to the future, add 128bit support10:48
zypxobs, at some point I'd have to ask for your help to look into why litescope doesn't work properly via wishbone-tool (but does via litex_server)10:58
zypoh, and also, wishbone-tool doesn't seem to want to open my uart at 3Mbaud, litex_server does10:59
xobszyp: my guess is that it's using "logical" registers. when was the last time you tried?10:59
zypa week ago or so10:59
xobsIt used to be that it didn't work due to not supporting multi-word reads and writes, but tom keddie added support for that here: https://github.com/litex-hub/wishbone-utils/commit/56ed52ff6fa19dff701690c74921c15dc214fb7311:03
tpbTitle: wishbone-tool: first pass at support for multiword read and write · litex-hub/wishbone-utils@56ed52f · GitHub (at github.com)11:03
zypI only got into this stuff recently, so my previous build of wishbone-tool was certainly not that old11:04
xobsOne big difference is that `wishbone-tool` doesn't have streaming support, it only does single-word operations.11:05
zypbut actually it seems to work now11:05
xobsIt may be that litescope requires streamed writes.  I haven't looked.11:05
xobsOh.  Well okay then.11:05
xobsI did convert a bunch of `write()` calls into `write_all()` calls, so perhaps that fixed it.11:06
zypI do believe the only change between the version I ran now and the previous one was the config fix from yesterday, so I'm not sure why it suddenly works now11:07
xobsI discovered clippy.11:08
xobshttps://github.com/litex-hub/wishbone-utils/commit/49d32ed97652567875eff30c7af5e87a98caaf8c#diff-1d22e5dac94f01fd2bd9fbd0f39fb055R176 is the fix that probably has the most impact.11:08
tpbTitle: wishbone-tool: fix most clippy warnings · litex-hub/wishbone-utils@49d32ed · GitHub (at github.com)11:08
zyphmm, actually now it only works once11:09
zyphttps://paste.jvnv.net/view/ISeQo11:10
tpbTitle: JVnV Pastebin View paste – Untitled (at paste.jvnv.net)11:10
xobsYou can set the environment variable `RUST_LOG=debug` to get more information.11:11
xobsBut it looks like it's trying to peek or poke, and the other side isn't responding.11:11
_florent_xobs, dkozel: sorry i was away11:13
_florent_xobs: so from what i undertand, you managed to get wishbone tool working on the setup?11:13
xobs_florent_: that's correct, it was able to read and write memory, and I could run it as a wishbone server instead of running `litex_server`, and the two test scripts could work with it as a drop-in replacement.11:14
_florent_dkozel: in your design there is an address translation happening: https://github.com/enjoy-digital/netv2/blob/master/netv2.py#L18011:15
tpbTitle: netv2/netv2.py at master · enjoy-digital/netv2 · GitHub (at github.com)11:15
_florent_dkozel: so you have to substract 0x82000000 when doing the read/write on the host11:16
_florent_xobs: ok nice!11:16
_florent_xobs: BTW, for the issue you had, one of the DMA register is only 24-bit, i planned to used the scratch register for testing, but it was not present in this design so used this one11:17
dkozelWorks!11:17
xobs_florent_: that's fine, I figured it out in the end!11:18
dkozelthanks xobs and _florent_11:18
zypxobs, actually it seems to be sometimes working, sometimes failing, here's a failed run followed by a succeeding run: https://paste.jvnv.net/view/ncKEl11:25
tpbTitle: JVnV Pastebin View paste – Untitled (at paste.jvnv.net)11:25
xobszyp: do you have something else that's opening that serial port by any chance? maybe your OS is trying to treat it like a modem?11:25
*** anuejn_ is now known as anuejn11:26
zypno, I don't, and I haven't had any problems using litex_server with the same setup11:26
*** m4ssi has joined #litex11:30
zypis the wishbone serial protocol documented anywhere?11:34
xobsNot that I'm aware of.11:37
_florent_daveshah: indeed, i was wrong in my reasoning for the cmd/clk delay for each module. I'll think about what we could do to improve the write leveling in your case.11:37
xobszyp: but the client implementation for litex_server is at https://github.com/enjoy-digital/litex/blob/master/litex/tools/remote/comm_uart.py and my guess is that I'll need to implement multi-word writes in order for it to work reliably.11:38
tpbTitle: litex/comm_uart.py at master · enjoy-digital/litex · GitHub (at github.com)11:38
xobsOh, except now that I look at that, it's actually just doing single-word writes as well.11:38
xobsflorent, do you see the link that zyp posted? what is that address it's writing? could that be the device missing a packet?11:39
_florent_daveshah: the write leveling results are generally more linear (ex: https://github.com/litex-hub/litex-boards/issues/49#issuecomment-604297096), in your case there is a jump between m3 and m411:39
tpbTitle: ZCU104: get ddram_64 working · Issue #49 · litex-hub/litex-boards · GitHub (at github.com)11:39
zypxobs, the failing peek is for polling analyzer_storage_done11:40
zypI started digging into it now, and it can seem like after the peek fails, the client retries, reads a 1 erroneously, and then dumps an empty buffer since the analyzer didn't finish yet11:41
zypand it also looks like this might actually be a problem with my usb uart11:42
xobsone difference I can think of is that wishbone-tool is faster.11:42
zyphttps://bin.jvnv.net/file/GtKiI.png <- as far as I can tell, these are the pokes happening right before the peek11:44
zypand I have no idea why that packet gets stalled, that shouldn't happen11:44
xobsyou can use `-s random-test --random-range [base-of-ram]` to write random values to RAM to test your UART integrity.11:44
zypno errors for 16000 iterations, but also no usb packets larger than ten bytes11:51
zypthat STALL handshake is a pretty red flag, that shouldn't happen, and I assume it is because it chokes on too much data or something11:52
zypwhich it also shouldn't, because it's not too much data11:52
xobsRight, and it's doing a read followed by a write, so nagle won't get involved.11:53
zypbut that'd explain the random behavior, since it depends on how the host are putting stuff into the packets11:53
xobsI have a theory.11:54
xobsTry this.11:54
xobsActually, hmm... Yes, the problem is probably due to the lack of flow control.  I'm not sure what else can be done aside from lowering the timeout so it retries again.11:58
xobsI can force a flush in between, but that will just slow it down.11:58
xobsIt will just mask the underlying problem.11:58
zypI'm looking at the source for the usb-uart now to see if I can spot anything11:59
zyp(I'm using the uart port of a blackmagic probe, because the ftdi adapters I've got got so much latency that dumping the litescope buffer gets super slow)12:01
xobsYou can try this, which will space out the writes and slow it down slightly: https://gist.github.com/xobs/36058c2a3ecc10b55674a2ca028c551b12:02
tpbTitle: Add a flush to wishbone-tool uart · GitHub (at gist.github.com)12:02
xobsActually, I see a flush in the litex code.12:03
xobsSo let me commit that.12:03
xobsCan you try the latest wishbone-tool and see if that fixes it for you?12:05
*** CarlFK has quit IRC12:06
zypsure12:06
zypI also found that cat /dev/zero > /dev/… produces the same STALL handshakes, so there's an obvious issue with large packets there12:07
xobshttps://en.wikipedia.org/wiki/Nagle's_algorithm12:08
tpbTitle: Nagle's algorithm - Wikipedia (at en.wikipedia.org)12:08
zypthat seems to be a working workaround12:11
zypwhile we're at it, is it possible to get the serial port set to 3Mbaud? currently it's giving the following error:12:15
zypERROR [wishbone_tool::bridge::uart] unable to reconfigure serial port Invalid argument -- connection may not work12:15
zyp(litex_server manages to open it in 3Mbaud, so it should be possible)12:16
xobszyp: you're initializing it with --baud 3000000?12:35
zypyes12:36
xobshttps://github.com/dcuddeback/serial-rs/issues/3712:37
tpbTitle: Higher baud rates for macOS · Issue #37 · dcuddeback/serial-rs · GitHub (at github.com)12:37
zypah, right12:37
zypI second that request then :)12:37
zypor I could take a look at implementing it myself, it's just that I don't know rust :)12:38
xobsI'm just a bit concerned since there has been no activity since 2018.12:39
zypoh, right, that was a ticket on the serial lib12:39
xobsI'll look into switching to `serialport-rs`.  But I'll need help testing it.12:41
xobsThere, can you try that?12:54
*** CarlFK has joined #litex12:54
zypyeah, sure, I just spent some time digging into the usb-uart, apparently I'm not the first to see the issue (https://github.com/blacksphere/blackmagic/issues/538)13:01
tpbTitle: BMP serial interface ignores write (PC->device) bigger 16 byte. · Issue #538 · blacksphere/blackmagic · GitHub (at github.com)13:01
zypthanks, works fine at 3Mbaud now13:08
xobsExcept it broke every other build :P https://travis-ci.com/github/litex-hub/wishbone-utils/builds/16297411413:13
tpbTitle: Travis CI - Test and Deploy with Confidence (at travis-ci.com)13:13
zypha13:14
xobsI probably just need to switch to musl everywhere.13:22
xobsThere, now everything is green: https://travis-ci.com/github/litex-hub/wishbone-utils/builds/16300001714:07
tpbTitle: Travis CI - Test and Deploy with Confidence (at travis-ci.com)14:07
xobsCould people please give v0.6.13 a try?  It adds pcie support as well as the high-speed serial fixes for zyp.14:15
*** spacekookie_ has joined #litex15:24
*** spacekookie has quit IRC15:27
*** rohitksingh has quit IRC15:50
*** spacekookie_ is now known as spacekookie15:53
scanakciWhat is the minimum frequency that LiteDRAM operates? I am using very recent version of LiteX (20 commits behind) and notice some problems. If I synthesize SoC below 125 MhZ (genesys board),  the SoC prints nonsense characters (something is going wrong with UART?) rather than BIOS terminal. With 125MhZ, I actually get the BIOS terminal  and type commands. However, memory tests fail for 125MhZ. There are lots of time17:18
scanakciviolations and most probably they are the problems. 50 MhZ was working fine before, I am curious if recent version has some limitations/constraints that I am not aware of :).17:18
daveshahIt varies, on Artix-7 and ECP5 problems tend to be below 55MHz17:19
daveshahOn the ECP5 it seems to vary between batches of FPGA or DRAM....17:19
zypif you get nonsense characters, it sounds like the baudrate is not calculated correctly17:24
scanakciI actually did not specify baudrate. I will tweak it and see what changes17:30
daveshahare you rebuilding the software after changing frequency?17:30
scanakciyes I am17:32
_florent_scanakci: are you testing with the default genesys2 target with Vexriscv? (https://github.com/litex-hub/litex-boards/blob/master/litex_boards/targets/genesys2.py), if not, could you do a test? if it's failing, i could have a look18:12
tpbTitle: litex-boards/genesys2.py at master · litex-hub/litex-boards · GitHub (at github.com)18:12
*** HoloIRCUser has quit IRC18:37
*** HoloIRCUser has joined #litex18:37
*** lambda has quit IRC19:47
*** lambda has joined #litex20:05
*** m4ssi has quit IRC20:36
*** HoloIRCUser1 has joined #litex20:51
*** HoloIRCUser has quit IRC20:51
*** zyp has quit IRC20:53
*** shuffle2 has quit IRC20:53
*** Finde has quit IRC20:53
*** tnt has quit IRC20:53
*** Xark has quit IRC20:53
*** zyp has joined #litex20:53
*** shuffle2 has joined #litex20:53
*** Xark has joined #litex20:53
*** Finde has joined #litex20:54
*** Xark has quit IRC20:54
*** Xark has joined #litex20:54
*** tnt has joined #litex20:58
*** CarlFK has quit IRC21:41
*** CarlFK has joined #litex22:02
futarisIRCcloudhttps://twitter.com/Claude1079/status/1255438834042654726?s=1923:13

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