_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
lkcl has quit [Ping timeout: 246 seconds]
Degi_ has joined #litex
Degi has quit [Ping timeout: 252 seconds]
Degi_ is now known as Degi
lkcl has joined #litex
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 260 seconds]
kgugala has joined #litex
kgugala_ has quit [Ping timeout: 240 seconds]
cr1901_modern has quit [Read error: Connection reset by peer]
cr1901_modern has joined #litex
pauluzs has joined #litex
Bertl_oO is now known as Bertl_zZ
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 240 seconds]
<shorne> hello, I am trying to use paulumack's sdcard IRQ patches from here: https://github.com/litex-hub/linux/pull/8
<shorne> To do that I am updating the dts generator: litex/tools/litex_json2dts.py, to define the sdirq details, but I am not seeing the interrupt number in the output csr.json
<shorne> I guess the soc.py is missing something like self.irq.add(name, use_loc_if_exists=True)
<shorne> ok, I can confirm in my output digilent_arty.v, the sdirq_irq wire is dangling and not connected to anything
<shorne> it looks like magically adding the "self.irq.add(name, use_loc_if_exists=True)" works
<shorne> maybe not
kgugala_ has quit [Read error: Connection reset by peer]
kgugala has joined #litex
<shorne> I kind of see how this works, in LiteXSoC we do self.irq.add, at the end the module.ev.irq will get wired to the cpu interrupt location.
<shorne> however, sdcard or sdirq doesnt have module.ev, so it never gets wired to the cpu irq bus, I wonder what paulusmack is doing?
<shorne> ok, I think I got it working, I will send a patch maybe its wrong
Melkhior has joined #litex
pauluzs has quit [Quit: Connection closed]
<somlo> shorne: cool, I had tried the "self.irq.add()" part too, without luck... I'll try your version later today when I get out of work
<shorne> somlo: it does seem to work as I commented on the linux/litex-rebase PR
<somlo> shorne: yeah, my plan was to grab those and add them to litex-rebase as well, as soon as your litex PR 901 lands
<somlo> s/was/is/ :)
<Melkhior> @somlo @shorne Good to improve the micro-sd support, hopefully it won't degrade the reliability - i've been running on the multi-block update including large usage of swap at time with no issue at all :-)
<Melkhior> (Litex was able so self-host both Perl and Python to install from/to NFS and the toolchain/swap on the micro-sd)
<shorne> Melkhior: I wanted sd support for swap too. Its running now and seems to be working fine (with the interrupt code).
<Melkhior> Excellent thanks :-)
<shorne> Though, my benchmarks show using interrupts in the driver results is slightly lower IO throughput, it may be my board/mor1kx limiting the performance though
<Melkhior> @shorne Only one core I suppose ? (I think only VexRiscv has SMP support in Litex) ? Which frequency ?
<Melkhior> On VexRiscv-SMP my one issue with ethernet is that interrupts are always handled by core 0:
<Melkhior> (dolbeau)buildroot:~> cat /proc/interrupts
<Melkhior>            CPU0 CPU1 CPU2 CPU3
<Melkhior>   2: 821252 0 0 0 SiFive PLIC 2 eth0
<Melkhior>   3: 3 0 0 0 SiFive PLIC 3 f0005000.ps2kbd
<Melkhior> But it won't affect you if you have just one core.
<shorne> I have just one core, I haven't setup SMP on litex yet
<shorne> I guess you can get irq balancing by using the user space irqbalance daemon, https://linux.die.net/man/1/irqbalance
<tpb> Title: irqbalance(1) - Linux man page (at linux.die.net)
<shorne> or you can se the affinity to move the irqs
<Melkhior> @shorne Darn I forgot about irqbalance
<shorne> echo 2 >/proc/irq/2/smp_affinity
<Melkhior> Will have to try that, thanks
<shorne> to manually move
<Melkhior> It's really about distributing rather than moving
<shorne> yeah
<Melkhior> though I could probably pin the userland processes to non-zero cores
<Melkhior> not as if I could compile with all 4 of them - not enough memory
<Melkhior> BTW, on my SoC reading from the sd-card seems much faster
<shorne> Melkhior: yea, also thanks for suggesting SMP, maybe its time I make it work on litex. There are some SMP kernel patches I need to test. And if it helps speed up my other workloads its a doulbe win.
<shorne> oh yeah, me too
<Melkhior> a ~ 2MiB file that was definitely not in memory reads in about 0.8s
<shorne> but my numbers are ~500 kB/s writes, ~750 kB/s reads
<shorne> not sure about page cache, I think I was avoiding it
<Melkhior> sorry I wasn't clear - I don't have your patch yet
<Melkhior> but the baseline pre-irq is already much faster than your baseline
<shorne> before the recent sd-card fixups both under 100 kB/s, and reads/writes were corrupt
<Melkhior> i seem to be around 1.5-2 MiB/s for pure reading (cat'ing into /dev/null) large file
<Melkhior> yes, I'm post-fixup, pre-irq
<shorne> I understood that, those ~500/750 kB/s numbers I mentioned are the pre-irq numbers I was seeing to
<Melkhior> so if you see a lot lower than that, maybe you're CPU-bound/memory-bound somehow already ?
<Melkhior> OK
<shorne> ok, I am a bit off
<shorne> pre-irq:
<shorne> ~ 618 kB/s write
<shorne> ~ 775 kB/s read
<shorne> irq:
<shorne> ~ 541 kB/s write
<shorne> ~ 790 kB/s read
<Melkhior> i'll have to try the updated version, but right now my code has diverged a bit (I added a keyboard controller and was trying a hardware bitblitter for the FB when I discovered linux removed the accelerated fbcon:-(  )
<shorne> they are close, it might just be jitter
<Melkhior> could be yes
<Melkhior> another hour, another conf call :-)
<shorne> enjoy, Japan was on holidy today :)
<Melkhior> bye thanks will try irqbalance and see what it does to NFS
<shorne> time for bed
<geertu> shorne: Enjoy Golden Week under lockdown ;-)
Bertl_zZ is now known as Bertl
rj has quit [Ping timeout: 240 seconds]
RaivisR has joined #litex
<RaivisR> good time of day, is there any special reason why DifferentialInput for ECP5PLL is not implemented like it is for Xilinx devices? Or should I just go ahead and make it happen?
rj has joined #litex
<gatecat> RaivisR: ECP5 doesn't need any special primitive for differential inputs
<gatecat> just a regular one with a suitable IO standard
<RaivisR> so as long as input standard is differential it will work
<gatecat> yeah
<RaivisR> thanks
<gatecat> (e.g. LVDS)
<RaivisR> that´s what I have
<RaivisR> still trying to get litex run on ecp5_vip, but having trouble with external DDR3
<RaivisR> do sys and sys2x for ecp5ddrpy have to be derived from the same external clock and have their phase in sync?
<gatecat> yes, iirc sys should be divided down from sys2x
<RaivisR> that is what I see in every sample, but on this board I have 2 external clk inputs and I can´t meet timing constraints for sys if I use any single one of them
<gatecat> I'd recommend trying a lower clock frequency rather than multiple clock inputs
<RaivisR> how low DDR3 can go? I have no experience with that
<gatecat> 50MHz should be fine with the current LiteX setup
<RaivisR> ok, thanks, will keep learning and trying
pauluzs has joined #litex
pauluzs has quit [Quit: Connection closed]
pauluzs has joined #litex
pauluzs has quit [Client Quit]
pauluzs has joined #litex
pauluzs has quit [Quit: Leaving.]
<acathla> I have a small design on an iCE40UP5k (lattice breakout board), I put a wishbone bridge to uart and it works without a CPU, with a SERV, but timeout with a vexriscv... What could do that?
pauluzs has joined #litex
Bertl is now known as Bertl_oO
<_florent_> RaivisR: I would really recommend trying to use settings/sys_clk_freq close to the other ECP5/DDR3 boards we are already supporting: Versa ECP5, OrangeCrab, Trellisboard, ECPIX5
<_florent_> acathla: I don't obvious reasons, this could be related to timings or to the CPU not behaving correctly and not releasing the Wishbone bus
pftbest has quit [Remote host closed the connection]
pftbest_ has joined #litex
<acathla> I'll make a simple target for the board...
pftbest_ has quit [Remote host closed the connection]
pftbest has joined #litex
pftbest has quit [Remote host closed the connection]
pftbest has joined #litex
pftbest_ has joined #litex
<acathla> _florent_, it works! I probably had a missing ASyncResetSynchroniser.
<acathla> Can I contribute to litex-boards? How can I add that Lattice board to the list?
RaivisR has quit [Ping timeout: 260 seconds]
pftbest_ has quit [Remote host closed the connection]
<geertu> acathla: Fork the litex-boards repo, add support for your bord, and send a pull request
<geertu> s/bord/board/
pftbest has joined #litex
<_florent_> nice hardware to test the recent LiteX/Linux progress: https://twitter.com/enjoy_digital/status/1387820615973982208 :)
<_florent_> it just lacks a SDCard, but adding one should be possible on the HDMI/SBUS connector...
<nickoe> nice
<nickoe> _florent_: How do I get the "port" to the ram, for use with LiteDRAMDMAReader()?
<geertu> _florent_: Cool! Thanks to litescope, you no longer need a real scope, so found a new use for it? ;^)
<nickoe> If I try self.sdram.crossbar.get_port(mode="read", data_width=8) then I get AttributeError: 'SimSoC' object has no attribute 'sdram' even though I hvae a self.add_sdram("sdram",....
<nickoe> or, maybe I need to enable --with-sdram?
<nickoe> What memory is used if not using --with-sdram?
rj has quit [Ping timeout: 240 seconds]
jhu has joined #litex
<jhu> Hi, I was wondering there were any prebuilt existing docker containers for running the Litex projects and specificaly the linux-on-litex project in a docker container with symbiflow toolchain?
<jhu> if there
<nickoe> I have not seen any, but I won't call my self an expert :D
FFY00_ has quit [Ping timeout: 250 seconds]
FFY00_ has joined #litex
rj has joined #litex
<nickoe> I think I got it added eventually, but .... hmmm
<nickoe> I just don't understand all the signals in the fifo thing
<nickoe> Ok, so it appears to fill the fifo of the default 16 bytes in four "bursts"
<nickoe> when I run the sim with my app to dump the address there is data https://dpaste.com/FM4W2A8SW.txt .. but I don't see it in my dma reader thing. https://dpaste.com/FM4W2A8SW.txt
<nickoe> Is that USB implemented via some gateware and an interface to poke memory on the target?
<nickoe> I wonder how to empty that fifo, should I wiggle a signal?
<zyp> nickoe, yeah, it's a usb-wishbone-bridge, except axi-lite instead of wishbone
<nickoe> zyp: ok.. not that I have really understood the differences between the different axi's
<zyp> they are all memory buses
<nickoe> zyp: Do you happen to know anything about LiteDRAMDMAReader()?
<zyp> I've looked at it, but never used it
<nickoe> It appears to have a fifo, and it gets full, but I don't really see my data anywhere in the trace
<zyp> what are you trying to do?
<nickoe> read data from SDRAM and stuff it through an AXI bus to some verilog code somene else wrote that will push some data to a DAC.
<nickoe> right now it looks like https://i.snipboard.io/shQSFG.jpg
<zyp> the mydma_source_source_ready signal is stuck low
<zyp> that's flow control for the dma data source
<zyp> you see valid goes high, so it got data for you, but you're never accepting it
<nickoe> so I need to pull up mydma_source_source_ready ?
<nickoe> based on the stuff from bist.py
<nickoe> in litedram
<zyp> yeah, you'll want to do dma.source.ready.eq(1) somewhere
<zyp> e.g. right next to dma.sink.valid.eq(1)
<nickoe> ok, now it certainly seem to run more!
<nickoe> but I don't appear to get anything on dma.source.data.eq(self.output_sig),
<zyp> that's the wrong way around
<zyp> you want self.output_sig.eq(dma.source.data)
<nickoe> mmm, right, but that does not appear to change the traces
<zyp> how does your code look now?
<zyp> also, how does the traces look now?
<zyp> how much memory do you have?
<nickoe> mmm
<nickoe> size = kwargs.get("max_sdram_size", 0x40000000),
<nickoe> ?
<zyp> nope
<nickoe> mm, where can I see it? It is a simulation.
<zyp> okay, you've got 64M
<zyp> hence why you've got a 26-bit address
<zyp> are you sure the DMA address makes sense?
<nickoe> No! I am new to this :D
<nickoe> I use this command whe running
<nickoe> zyp: but the addres when read from the demo app works
<zyp> yeah, looks fine
<nickoe> even if I change the address from 0x41000000 to 0x40000000, the same address as the demo.bin I don't see anything on the output_sig
<nickoe> Does the address need to be offset?
<zyp> the dma address is just the offset into the dram, not the whole 32-bit address
<zyp> but since it's mapped at 0x40000000 it works out the same when the top six bits are stripped off by the assignment
<nickoe> There could very well be some signal that I may be missing or something I have forgot because I didn't know about it :S
<nickoe> But it is getting at bit late for me now, and I am getting quite tired, so I should probably call it a day.
<nickoe> anyway, my goal was to see my data in the trace, and then I can start to stuff that into some AXI stream or something
<zyp> it is already in a steram
<zyp> stream*
<zyp> you're picking it out of a stream, doesn't make sense to do that just to stuff it back in :)
<zyp> and you don't have to think about axi streams, plain litex streams are pretty much the same
<nickoe> But I guess I must see some data here before I move on
<nickoe> if just ...
<nickoe> ... I could realize how
rj has quit [Remote host closed the connection]
rj has joined #litex
pftbest has quit [Remote host closed the connection]
pftbest has joined #litex
lf has quit [Ping timeout: 250 seconds]
lf has joined #litex