_florent_ changed the topic of #litex to: LiteX FPGA SoC builder and Cores / Github : https://github.com/enjoy-digital, https://github.com/litex-hub / Logs: https://freenode.irclog.whitequark.org/litex
tpb has quit [Remote host closed the connection]
tpb has joined #litex
HoloIRCUser has quit [Ping timeout: 246 seconds]
scanakci has quit [Quit: Connection closed for inactivity]
<xobs> dkozel: If you have easy access to that, I could get started shortly.
<xobs> (It would be helpful to have a compiler on the machine as well)
<xobs> (And, unfortunately, root access)
gregdavill has quit [Ping timeout: 240 seconds]
scanakci has joined #litex
CarlFK has quit [Ping timeout: 256 seconds]
CarlFK has joined #litex
Degi has quit [Ping timeout: 260 seconds]
Degi has joined #litex
CarlFK has quit [Quit: Leaving.]
CarlFK has joined #litex
HoloIRCUser has joined #litex
HoloIRCUser1 has joined #litex
HoloIRCUser has quit [Ping timeout: 260 seconds]
CarlFK has quit [Quit: Leaving.]
HoloIRCUser has joined #litex
HoloIRCUser1 has quit [Ping timeout: 244 seconds]
<_florent_> xobs: i prepared the setup, i'm sending you the info to connect to it
CarlFK has joined #litex
CarlFK has quit [Read error: Connection reset by peer]
CarlFK has joined #litex
david-sawatzke[m has quit [Quit: killed]
synaption[m] has quit [Quit: killed]
john_k[m] has quit [Quit: killed]
bunnie has quit [Quit: killed]
abeljj[m] has quit [Quit: killed]
disasm[m] has quit [Quit: killed]
sajattack[m] has quit [Quit: killed]
xobs has quit [Quit: killed]
david-sawatzke[m has joined #litex
CarlFK has quit [Ping timeout: 260 seconds]
CarlFK has joined #litex
sajattack[m] has joined #litex
john_k[m] has joined #litex
synaption[m] has joined #litex
xobs has joined #litex
abeljj[m] has joined #litex
disasm[m] has joined #litex
bunnie has joined #litex
<dkozel> xobs: I'll test the wishbone tool right now.
<xobs> dkozel: For some reason, the top few bits don't seem to be set:
<xobs> sudo ./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)
<dkozel> permission error without sudo, segfault with. Might be using the wrong pci resource. checking
<xobs> Oh, it works fine if I put wishbone-tool into server mode and use the litex tests to read and write those regiseters.
<xobs> Ah, 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.
<xobs> Okay, good.
<dkozel> I'm using the right pci device
<dkozel> dmesg: litepcie 0000:03:00.0: enabling device (0000 -> 0002)
<xobs> what's your command line?
<dkozel> sudo ./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_scratch
<xobs> That should be it, yeah. What address is `ctrl_scratch` according to your csr.csv?
<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 ?
<tpb> Title: WIP: Implement cmd_latency calibration by jedrzejboczar · Pull Request #190 · enjoy-digital/litedram · GitHub (at github.com)
<daveshah> I thought all modules are addressed at once, so there can only be one command/clock delay for all of them?
<dkozel> 0x82000004
<xobs> That seems super high, and we probably need input from florent on this one.
<dkozel> 0x82000000 is the CSR base
<dkozel> memory_region,csr,0x82000000,65536,io
<xobs> Yeah, but on the system I'm testing, it's: `memory_region,csr,0x00000000,131072,io`
<xobs> And 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.
<dkozel> right, this seems like a reasonable error then
<dkozel> I don't see an immediate way to reduce the CSR address or remap the CSR portion to a separate region
<xobs> And I'm not familiar with this at all, which is why I think florent is the best person to give us input.
<dkozel> Thanks for adding the code! I'll have a read through to see how you've done it and try some standalone Rust utils
<xobs> I admit, the bridge innards are pretty hairy, mostly because they support having the connection go away and come back.
<dkozel> Yep, 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 that
<xobs> It was designed to debug Fomus over USB where you're resetting the connection a lot. Or via SPI where you're reflashing the board.
<dkozel> I'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 system
<xobs> But overall it works well. And now we have binaries for 16 platforms! :D
<xobs> Including s390x for some reason...
<dkozel> very likely because someone could
<xobs> Might as well, right?
<xobs> I'll have to get 64-bit wishbone support at some point...
<xobs> Oh 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.
<dkozel> look to the future, add 128bit support
<zyp> xobs, 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)
<zyp> oh, and also, wishbone-tool doesn't seem to want to open my uart at 3Mbaud, litex_server does
<xobs> zyp: my guess is that it's using "logical" registers. when was the last time you tried?
<zyp> a week ago or so
<xobs> It 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/56ed52ff6fa19dff701690c74921c15dc214fb73
<tpb> Title: wishbone-tool: first pass at support for multiword read and write · litex-hub/wishbone-utils@56ed52f · GitHub (at github.com)
<zyp> I only got into this stuff recently, so my previous build of wishbone-tool was certainly not that old
<xobs> One big difference is that `wishbone-tool` doesn't have streaming support, it only does single-word operations.
<zyp> but actually it seems to work now
<xobs> It may be that litescope requires streamed writes. I haven't looked.
<xobs> Oh. Well okay then.
<xobs> I did convert a bunch of `write()` calls into `write_all()` calls, so perhaps that fixed it.
<zyp> I 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 now
<xobs> I discovered clippy.
<tpb> Title: wishbone-tool: fix most clippy warnings · litex-hub/wishbone-utils@49d32ed · GitHub (at github.com)
<zyp> hmm, actually now it only works once
<tpb> Title: JVnV Pastebin View paste – Untitled (at paste.jvnv.net)
<xobs> You can set the environment variable `RUST_LOG=debug` to get more information.
<xobs> But it looks like it's trying to peek or poke, and the other side isn't responding.
<_florent_> xobs, dkozel: sorry i was away
<_florent_> xobs: so from what i undertand, you managed to get wishbone tool working on the setup?
<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.
<_florent_> dkozel: in your design there is an address translation happening: https://github.com/enjoy-digital/netv2/blob/master/netv2.py#L180
<tpb> Title: netv2/netv2.py at master · enjoy-digital/netv2 · GitHub (at github.com)
<_florent_> dkozel: so you have to substract 0x82000000 when doing the read/write on the host
<_florent_> xobs: ok nice!
<_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 one
<dkozel> Works!
<xobs> _florent_: that's fine, I figured it out in the end!
<dkozel> thanks xobs and _florent_
<zyp> xobs, actually it seems to be sometimes working, sometimes failing, here's a failed run followed by a succeeding run: https://paste.jvnv.net/view/ncKEl
<tpb> Title: JVnV Pastebin View paste – Untitled (at paste.jvnv.net)
<xobs> zyp: 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?
anuejn_ is now known as anuejn
<zyp> no, I don't, and I haven't had any problems using litex_server with the same setup
m4ssi has joined #litex
<zyp> is the wishbone serial protocol documented anywhere?
<xobs> Not that I'm aware of.
<_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.
<xobs> zyp: 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.
<tpb> Title: litex/comm_uart.py at master · enjoy-digital/litex · GitHub (at github.com)
<xobs> Oh, except now that I look at that, it's actually just doing single-word writes as well.
<xobs> florent, do you see the link that zyp posted? what is that address it's writing? could that be the device missing a packet?
<_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 m4
<tpb> Title: ZCU104: get ddram_64 working · Issue #49 · litex-hub/litex-boards · GitHub (at github.com)
<zyp> xobs, the failing peek is for polling analyzer_storage_done
<zyp> I 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 yet
<zyp> and it also looks like this might actually be a problem with my usb uart
<xobs> one difference I can think of is that wishbone-tool is faster.
<zyp> https://bin.jvnv.net/file/GtKiI.png <- as far as I can tell, these are the pokes happening right before the peek
<zyp> and I have no idea why that packet gets stalled, that shouldn't happen
<xobs> you can use `-s random-test --random-range [base-of-ram]` to write random values to RAM to test your UART integrity.
<zyp> no errors for 16000 iterations, but also no usb packets larger than ten bytes
<zyp> that STALL handshake is a pretty red flag, that shouldn't happen, and I assume it is because it chokes on too much data or something
<zyp> which it also shouldn't, because it's not too much data
<xobs> Right, and it's doing a read followed by a write, so nagle won't get involved.
<zyp> but that'd explain the random behavior, since it depends on how the host are putting stuff into the packets
<xobs> I have a theory.
<xobs> Try this.
<xobs> Actually, 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.
<xobs> I can force a flush in between, but that will just slow it down.
<xobs> It will just mask the underlying problem.
<zyp> I'm looking at the source for the usb-uart now to see if I can spot anything
<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)
<xobs> You can try this, which will space out the writes and slow it down slightly: https://gist.github.com/xobs/36058c2a3ecc10b55674a2ca028c551b
<tpb> Title: Add a flush to wishbone-tool uart · GitHub (at gist.github.com)
<xobs> Actually, I see a flush in the litex code.
<xobs> So let me commit that.
<xobs> Can you try the latest wishbone-tool and see if that fixes it for you?
CarlFK has quit [Quit: Leaving.]
<zyp> sure
<zyp> I also found that cat /dev/zero > /dev/… produces the same STALL handshakes, so there's an obvious issue with large packets there
<tpb> Title: Nagle's algorithm - Wikipedia (at en.wikipedia.org)
<zyp> that seems to be a working workaround
<zyp> while we're at it, is it possible to get the serial port set to 3Mbaud? currently it's giving the following error:
<zyp> ERROR [wishbone_tool::bridge::uart] unable to reconfigure serial port Invalid argument -- connection may not work
<zyp> (litex_server manages to open it in 3Mbaud, so it should be possible)
<xobs> zyp: you're initializing it with --baud 3000000?
<zyp> yes
<tpb> Title: Higher baud rates for macOS · Issue #37 · dcuddeback/serial-rs · GitHub (at github.com)
<zyp> ah, right
<zyp> I second that request then :)
<zyp> or I could take a look at implementing it myself, it's just that I don't know rust :)
<xobs> I'm just a bit concerned since there has been no activity since 2018.
<zyp> oh, right, that was a ticket on the serial lib
<xobs> I'll look into switching to `serialport-rs`. But I'll need help testing it.
<xobs> There, can you try that?
CarlFK has joined #litex
<zyp> yeah, 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)
<tpb> Title: BMP serial interface ignores write (PC->device) bigger 16 byte. · Issue #538 · blacksphere/blackmagic · GitHub (at github.com)
<zyp> thanks, works fine at 3Mbaud now
<tpb> Title: Travis CI - Test and Deploy with Confidence (at travis-ci.com)
<zyp> ha
<xobs> I probably just need to switch to musl everywhere.
<tpb> Title: Travis CI - Test and Deploy with Confidence (at travis-ci.com)
<xobs> Could people please give v0.6.13 a try? It adds pcie support as well as the high-speed serial fixes for zyp.
spacekookie_ has joined #litex
spacekookie has quit [Ping timeout: 272 seconds]
rohitksingh has quit [Ping timeout: 244 seconds]
spacekookie_ is now known as spacekookie
<scanakci> What 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 time
<scanakci> violations 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 :).
<daveshah> It varies, on Artix-7 and ECP5 problems tend to be below 55MHz
<daveshah> On the ECP5 it seems to vary between batches of FPGA or DRAM....
<zyp> if you get nonsense characters, it sounds like the baudrate is not calculated correctly
<scanakci> I actually did not specify baudrate. I will tweak it and see what changes
<daveshah> are you rebuilding the software after changing frequency?
<scanakci> yes I am
<_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 look
<tpb> Title: litex-boards/genesys2.py at master · litex-hub/litex-boards · GitHub (at github.com)
HoloIRCUser has quit [Read error: Connection reset by peer]
HoloIRCUser has joined #litex
lambda has quit [Ping timeout: 240 seconds]
lambda has joined #litex
m4ssi has quit [Remote host closed the connection]
HoloIRCUser1 has joined #litex
HoloIRCUser has quit [Read error: Connection reset by peer]
zyp has quit [*.net *.split]
shuffle2 has quit [*.net *.split]
Xark has quit [*.net *.split]
Finde has quit [*.net *.split]
tnt has quit [*.net *.split]
zyp has joined #litex
shuffle2 has joined #litex
Xark has joined #litex
Finde has joined #litex
Xark has joined #litex
Xark has quit [Changing host]
tnt has joined #litex
CarlFK has quit [Ping timeout: 256 seconds]
CarlFK has joined #litex