Monday, 2021-01-04

*** tpb has joined #litex00:00
*** shenki has quit IRC00:11
*** lf has quit IRC00:19
*** lf has joined #litex00:19
*** martinraison has joined #litex00:24
*** martinraison has quit IRC00:28
*** Bertl_oO is now known as Bertl_zZ02:48
*** futarisIRCcloud has joined #litex03:53
*** martinraison has joined #litex04:12
*** martinraison has quit IRC04:17
*** Degi_ has joined #litex04:32
*** Degi has quit IRC04:33
*** Degi_ is now known as Degi04:33
acathlaI have 2 questions. Context : we ( st-gourichon-fid and I ) are developping a replacement for the Kilobot (an ATMega328p with infrared and vibrating motors mostly).06:56
acathlaThe goal was to have a faster CPU, more RAM, and faster and directional infrared communication (some Kb/s for the kilobot).06:58
acathlaWe have a prototype board which is based on the fomu plus 4 infrared sensors (4 TS4231 chips to do basic analog to digital) and a K210 MCU.07:00
acathlaI modified the RS323PHYRX and TX modules for infrared and it works fine, but since it's an UART, writing 8 bits at a time makes it really slow.07:03
acathlaWhat would be the best idea to speed things up? Using parts of liteeth? (the memory mapped part to wishbone?)07:05
*** lkcl has quit IRC07:06
acathlaThe first idea was to use a vexriscv as a main CPU, but it was too big at first so we added a K210 on the prototype. I don't know what's the best way to access the wishbone bus from an external MCU. It's using an UART now. SPIbone never passes the timings so I gave up.07:08
acathlaAnd a final question : are we doing it right?07:09
*** lkcl has joined #litex07:20
keesjdo I understand correctly that the bootleneck is the communication between the CPU and the infrared modules and that you have as many uarts as infrared sensors?07:35
keesjWhat is a K210?07:36
*** martinraison has joined #litex07:48
acathla4 UARTs now as it was the most simple to do. And yes, the bottleneck is the communication between the SoftCore and the infrared UARTs. The second bottleneck is between the IR UARTs and the external MCU09:01
acathlaThe K210 is a dual core 64 bits RISC-V MCU from Kendryte, with "IA" acceleration.09:03
keesjhow fast is the core running? and what bitrare is the IR uart sending data?09:05
acathlaEverything is now running @12MHz and the UARTs... I need to measure or calculate this, but that's the wait between each byte that is the worst09:08
keesjso you kinda need a buffer on the uart side09:14
keesjor be able to pipe requests09:16
acathlaAbout 8ms per byte.09:16
acathlakeesj, exactly. There is a FIFO, we tried to make it bigger than 16 bytes and it helps to send blindly bytes without losing them, but there are many writes to do on the bus for each byte09:18
acathlaAnd making the UART-wishbone interface more than 8 bits makes the design use too many LCs09:19
keesjmy understanding of withbone is mostly from reading https://zipcpu.com/zipcpu/2017/05/29/simple-wishbone.html is that wishbone itself would allow to send bytes every clock cycle09:22
tpbTitle: Building a simple wishbone slave (at zipcpu.com)09:22
*** Dolu has joined #litex09:27
keesjso.. . would the bus bandwith not be like 12Mhz * 8 bits -> 96Mbis v.s. sending at 1 kbits.. it is like 3 order of magnitude faster ? so the fifo can't be a bottle neck right? if must be sendling logic e.g. while(!full) . push v.s. if (empty) push byte or possible the (!full itself that would cause wishbone interaction?)09:29
keesjacathla: (I am an interested user) with only limited knowledge.09:30
*** Bertl_zZ is now known as Bertl09:34
acathlaThe TS4231 receives signals from 1MHz to 10MHz, we chose to send 1 pulse (@ 6MHz, 80ns) and wait 240ns for a 0 and 480ns for a 1, plus a header.09:44
acathlaSo the teorical speed is low if we send byte per byte. The real speed now is even slower.09:46
acathlakeesj, it's more 12MHz / 8 bits than a multiplication.09:48
*** hansfbaier has joined #litex09:55
acathlaThanks for the link keesj. I have limited knowledge too, we all have. Except _florent_ about litex :)10:00
*** hansfbaier has quit IRC10:37
*** martinraison has quit IRC11:26
*** martinraison has joined #litex11:29
*** martinraison has quit IRC12:43
*** martinraison has joined #litex12:58
*** martinraison has quit IRC13:02
*** martinraison has joined #litex13:12
*** _whitelogger has quit IRC13:55
*** _whitelogger has joined #litex13:58
_florent_acathla: what's your target speed for the transfers between the CPU and the UARTs?14:30
_florent_UART is not very fast, not with lxterm we are already able to upload code at up to 500KB/s to the CPU with the USB FIFO (with a 75MHz CPU)14:32
_florent_You are probably using a lite variant of CPU + 12MHz, so that's not helping, but not sure the bottleneck is really related to using UART14:34
_florent_Have you tried using a simulation (litex_sim for example) to try to understand the real bottleneck?14:35
_florent_You could also use a larger FPGA board (Arty for example) with your design + LiteScope to analyze the transfers on the wishbone bus14:35
acathla_florent_, I captured the transmission but it was a long time ago with probably a SERV CPU...14:38
_florent_acathla: ah ok, with SERV it's also not helping14:39
acathlaI just thought it could be better to send a frame of 1500 bytes like in ethernet, with header, CRC, etc14:40
_florent_acathla: in fact I'm not sure to understand, are you still using SERV or switch to VexRiscv?14:40
_florent_switch/switched14:40
acathlaI switch to SERV when the design is full but the goad is to use VexRiscv of course.14:40
acathlagoal*14:40
_florent_and what's your target speed vs achieved speed?14:44
zypacathla, remote wishbone is gonna have a latency no matter what transport you pick, so you should probably consider doing a purpose-designed protocol instead14:45
acathlazyp, you mean avoid wishbone?14:45
*** _whitelogger has quit IRC14:46
acathlai thought of that, since it's UARTs and the K210 have UARTs available14:46
zypwhat purpose is the fpga serving in the design when you've got a K210?14:46
acathlathe k210 could probably not handle the signal of the TS4231 directly without bigbanging, so 4 at a time doesnt seem feasible.14:48
*** _whitelogger_ has joined #litex14:48
acathlaBut first we hoped we could do without a real MCU14:48
acathlaI'm not sure the K210 will stay, it will probably be optionnal.14:49
acathlaThe goal is to build hundreds of robots, so the cost must stay as low as possible.14:50
acathla_florent_, probably 100KB/s would be enough, I don't remember how much we can achieve now, but much more less, around a 2KB/s probably.14:59
acathlaYou think it's overkill to add a shared memory like it's done in liteeth?15:00
*** lkcl has quit IRC15:16
_florent_acathla: I'm not sure I have all the info I need, but that's sure that 12MHz + SERV + 8-bit CSR is limiting the capabilities15:18
_florent_just taking into account maximum bus efficiency and freq + 1/32 ratio of SERV: 12e6/(2*32*4) = 47KB/s max15:19
acathlaI'll make some more tests now I got rid of USB and I have more room for everything.15:22
somlo_florent_: apparently the litesdcard linux driver *does* have a say in whether single- or multi-block transfers are used (cmd 17 vs. 18 for e.g., reading): https://github.com/litex-hub/linux/blob/litex-rebase/drivers/mmc/host/litex_mmc.c#L45215:24
somloright now the max block count is set to 1, which somehow percolates through the mmc subsystem and results in cmd17 being used exclusively :)15:25
somloif I try to bump max_blk_count I get data transfer errors, so debugging *that* will be my next goal15:25
somlothat and figuring out why I can't meet timing in vivado for the genesys2 board...15:25
*** lkcl has joined #litex15:30
_florent_somlo: Hi, ok thanks. I've not yet been able to do the P&R on the Genesys2, I'll try it soon15:31
*** andrewb1999 has joined #litex17:44
*** martinraison has quit IRC18:56
mithro_florent_: You might find https://ohwr.org/project/conv-ttl-blo-gw/wikis/xil-multiboot interesting....19:00
tpbTitle: Xil multiboot · Wiki · Projects / Conv TTL Blocking - Gateware · Open Hardware Repository (at ohwr.org)19:00
*** Bertl is now known as Bertl_oO19:06
*** martinraison has joined #litex19:50
keesjwhat is serv?19:54
*** martinraison has quit IRC19:55
keesjhttps://github.com/litex-hub/pythondata-cpu-serv ?19:55
keesj SERV is an award-winning bit-serial RISC-V core19:56
Findethere's your answer20:02
Findealways love Olof's "award winning" prefix20:03
*** martinraison has joined #litex20:05
keesjhttps://www.zerotoasic.com/contact/20:31
tpbTitle: Sign up | Zero to ASIC (at www.zerotoasic.com)20:31
keesj500 Euro but it .. sounds very cool20:34
*** _franck_ has joined #litex20:38
keesjI have played a little with some of the parts but love the idea20:39
*** kgugala has joined #litex20:40
oterjoseng I haven't used LiteDRAMFIFO specifically. In my case, the solution to my difficulty in using LiteDRAMDMAReader (which LiteDRAMFIFO build upon) was that I botched the translation from the 32 bit memory map address to the 25 bit width for DMA. Solved now, but doesn't sound like it'll help in your case - the DMA etc is completely hidden inside LiteDRAMFIFO.  My only thought is that perhaps there's something wrong with how the read and21:14
oter write ports you pass into the FIFO module are obtained, or that the base is set wrong (since they are native, they will be very wide, e.g. 128 bit in case of my board)?21:14
*** martinraison has quit IRC21:46
*** martinraison has joined #litex23:01
*** martinraison has quit IRC23:07

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