_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
shenki has quit [Remote host closed the connection]
lf has quit [Ping timeout: 268 seconds]
lf has joined #litex
martinraison has joined #litex
martinraison has quit [Ping timeout: 246 seconds]
Bertl_oO is now known as Bertl_zZ
futarisIRCcloud has joined #litex
martinraison has joined #litex
martinraison has quit [Ping timeout: 246 seconds]
Degi_ has joined #litex
Degi has quit [Ping timeout: 260 seconds]
Degi_ is now known as Degi
<acathla> I 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).
<acathla> The goal was to have a faster CPU, more RAM, and faster and directional infrared communication (some Kb/s for the kilobot).
<acathla> We 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.
<acathla> I 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.
<acathla> What would be the best idea to speed things up? Using parts of liteeth? (the memory mapped part to wishbone?)
lkcl has quit [Ping timeout: 256 seconds]
<acathla> The 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.
<acathla> And a final question : are we doing it right?
lkcl has joined #litex
<keesj> do 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?
<keesj> What is a K210?
martinraison has joined #litex
<acathla> 4 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 MCU
<acathla> The K210 is a dual core 64 bits RISC-V MCU from Kendryte, with "IA" acceleration.
<keesj> how fast is the core running? and what bitrare is the IR uart sending data?
<acathla> Everything 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 worst
<keesj> so you kinda need a buffer on the uart side
<keesj> or be able to pipe requests
<acathla> About 8ms per byte.
<acathla> keesj, 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 byte
<acathla> And making the UART-wishbone interface more than 8 bits makes the design use too many LCs
<keesj> my 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 cycle
<tpb> Title: Building a simple wishbone slave (at zipcpu.com)
Dolu has joined #litex
<keesj> so.. . 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?)
<keesj> acathla: (I am an interested user) with only limited knowledge.
Bertl_zZ is now known as Bertl
<acathla> The 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.
<acathla> So the teorical speed is low if we send byte per byte. The real speed now is even slower.
<acathla> keesj, it's more 12MHz / 8 bits than a multiplication.
hansfbaier has joined #litex
<acathla> Thanks for the link keesj. I have limited knowledge too, we all have. Except _florent_ about litex :)
hansfbaier has quit [Read error: Connection reset by peer]
martinraison has quit [Remote host closed the connection]
martinraison has joined #litex
martinraison has quit [Remote host closed the connection]
martinraison has joined #litex
martinraison has quit [Ping timeout: 246 seconds]
martinraison has joined #litex
_whitelogger has joined #litex
<_florent_> acathla: what's your target speed for the transfers between the CPU and the UARTs?
<_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)
<_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 UART
<_florent_> Have you tried using a simulation (litex_sim for example) to try to understand the real bottleneck?
<_florent_> You could also use a larger FPGA board (Arty for example) with your design + LiteScope to analyze the transfers on the wishbone bus
<acathla> _florent_, I captured the transmission but it was a long time ago with probably a SERV CPU...
<_florent_> acathla: ah ok, with SERV it's also not helping
<acathla> I just thought it could be better to send a frame of 1500 bytes like in ethernet, with header, CRC, etc
<_florent_> acathla: in fact I'm not sure to understand, are you still using SERV or switch to VexRiscv?
<_florent_> switch/switched
<acathla> I switch to SERV when the design is full but the goad is to use VexRiscv of course.
<acathla> goal*
_whitelogger has quit [Ping timeout: 260 seconds]
_whitelogger_ has joined #litex
<acathla> But first we hoped we could do without a real MCU
<acathla> I'm not sure the K210 will stay, it will probably be optionnal.
<acathla> The goal is to build hundreds of robots, so the cost must stay as low as possible.
<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.
<acathla> You think it's overkill to add a shared memory like it's done in liteeth?
lkcl has quit [Ping timeout: 240 seconds]
<_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 capabilities
<_florent_> just taking into account maximum bus efficiency and freq + 1/32 ratio of SERV: 12e6/(2*32*4) = 47KB/s max
<acathla> I'll make some more tests now I got rid of USB and I have more room for everything.
<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#L452
<somlo> right now the max block count is set to 1, which somehow percolates through the mmc subsystem and results in cmd17 being used exclusively :)
<somlo> if I try to bump max_blk_count I get data transfer errors, so debugging *that* will be my next goal
<somlo> that and figuring out why I can't meet timing in vivado for the genesys2 board...
lkcl has joined #litex
<_florent_> somlo: Hi, ok thanks. I've not yet been able to do the P&R on the Genesys2, I'll try it soon
andrewb1999 has joined #litex
martinraison has quit [Remote host closed the connection]
<mithro> _florent_: You might find https://ohwr.org/project/conv-ttl-blo-gw/wikis/xil-multiboot interesting....
<tpb> Title: Xil multiboot · Wiki · Projects / Conv TTL Blocking - Gateware · Open Hardware Repository (at ohwr.org)
Bertl is now known as Bertl_oO
martinraison has joined #litex
<keesj> what is serv?
martinraison has quit [Ping timeout: 256 seconds]
<keesj> SERV is an award-winning bit-serial RISC-V core
<Finde> there's your answer
<Finde> always love Olof's "award winning" prefix
martinraison has joined #litex
<tpb> Title: Sign up | Zero to ASIC (at www.zerotoasic.com)
<keesj> 500 Euro but it .. sounds very cool
_franck_ has joined #litex
<keesj> I have played a little with some of the parts but love the idea
kgugala has joined #litex
<oter> joseng 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 and
<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)?
martinraison has quit [Remote host closed the connection]
martinraison has joined #litex
martinraison has quit [Ping timeout: 256 seconds]