_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
<tmbinc> _florent_: https://github.com/litex-hub/litex-boards/pull/176 for further review, this is really just a first iteration
<tmbinc> but it appears to work correctly after ~1 minute of scoping
lf_ has joined #litex
lf has quit [Ping timeout: 260 seconds]
lkcl has quit [Ping timeout: 240 seconds]
lkcl has joined #litex
hansfbaier has joined #litex
TMM has quit [Remote host closed the connection]
TMM has joined #litex
Degi_ has joined #litex
Degi has quit [Ping timeout: 240 seconds]
Degi_ is now known as Degi
Bertl_oO is now known as Bertl_zZ
hansfbaier has quit [Ping timeout: 264 seconds]
yqszxx has joined #litex
yqszxx has quit [Client Quit]
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 240 seconds]
<nickoe> _florent_: How does one normally go about using the RAM memory space in gateware together witH the CPU having access to memory as well? Does the memory have an AXI interface that the CPU uses? Does this mean that gateware can just use AXI as well?
<nickoe> tmbinc: Is that the siglent scope?
<zyp> nickoe, is that a litedram question, or are you thinking RAM in general?
<zyp> the general question is bus interconnects that arbitrates access from multiple masters
<zyp> general answer*
<zyp> this can be wishbone or AXI or whatever
<nickoe> zyp: I am talking in general, but I want to implememt it specifically with litex, so I guess it is a litedram question in gemeral.
<zyp> litedram has an internal crossbar interconnect so that you can attach multiple masters directly
<nickoe> My current goal is to stuff some IQ samples in memory. I can do that with the boot.jsom and load it from the SD card.
<nickoe> Ghen I want to stuff those samples to a DAC at a 100MHz rate if possible somehow. I am still trying to understamd how to arch this sanely.
<nickoe> After that I would need to add some DSP in gateware (in verilog) to generate those IQ samples.
<zyp> a typical litex system will have a main wishbone interconnect across the various slaves, including litedram, and then if you've got a high performance cpu it might also be plugged directly into the litedram so it can bypass the main interconnect when accessing the main ram
<zyp> so if you wanna do some sort of DMA, you can either make something that plugs into the main interconnect and can access the whole system memory space, or something that plugs directly into litedram if it only needs access to the main ram
<zyp> in the latter case, you might want to use one of these adapters: https://github.com/enjoy-digital/litedram/blob/master/litedram/frontend/dma.py
<nickoe> Ok, I think that is what I want, but I have no previous resl experince i using AXI or Wishbone directly, so i am also trying to understand how it can be used.
<nickoe> Mm, I guess I can somehow connect the data unbuffered to some registers that I map to the output pins of the FPGA that connecto the the DAC, but wouldn't that sufffer from read/access latencies?
<nickoe> maybe there exist some other SDR implemented with litex that I can look at?
kgugala has joined #litex
kgugala_ has quit [Ping timeout: 246 seconds]
hansfbaier has joined #litex
FFY00 has quit [Ping timeout: 268 seconds]
hansfbaier has left #litex [#litex]
<_florent_> tmbinc: nice you've been able to reuse and integrate your previous offsetdac code!
<_florent_> tmbinc: in LiteX-Boards I generally try to only have the base support for hardware (Serial, Ethernet, DRAM, etc...), and add custom peripherals in application projects
<_florent_> tmbinc: we could maybe continue developing the scope part in the 360nosc0pe organization? (and have offsetdac code + test code + others custom peripherals there)
<_florent_> nickoe: the default LiteX SoC are using a single DRAM port that is mapped on the main bus of the SoC (Wishbone or AXI)
<_florent_> nickoe: this is convenient for CPU accesses but the main bus can be a bottleneck
<_florent_> nickoe: so it's also possible to create direct ports to the DRAM too, with get_port of the crossbar: https://github.com/enjoy-digital/litedram/blob/master/litedram/core/crossbar.py#L79
<_florent_> nickoe: this will provide you a native LiteDRAM interface, that you can then convert to Wishbone/AXI if more convenient
<_florent_> nickoe: the BIST module is for example creating two additional ports (one for write, one for read) and use them to stress the DRAM:
<_florent_> integrated with:
<shorne> somlo: thanks, I will look at these issues too then. This is blocking me using the mmc card as swap to run the glibc test. It works but way too slow and the linux start killing things
<acathla> _florent_, your patch : moving the ibus out of main wishbone bus to an Arbiter (or interconnectShared) to ROM (and RAM) worked well. But adding an icache to the vexriscv give me almost the same results for a bit less LC
<_florent_> acathla: ah ok, the issue was indeed that access on dbus were preventing instructions to be fetched, the instructions are now in your icache so yes the bypass will be less useful, but I thought it was not possible in your case to add the icache (using too much resources)
<_florent_> acathla: even if no longer useful in your case, the things we experimented will probably be useful later
<_florent_> acathla: so now you are able to saturate your link with the CPU?
<acathla> I did the math again, this time the icache (1024) costs 47LC and 4 RAM
<acathla> _florent_, yes, I also passed everything in 32 bits, so 4 times faster to write to the FIFO (but it costs some LC)
<acathla> I think there is something overkill with the actual UART, taking too much LC for the iCE40 (but you don't care on bigger FPGAs)
<acathla> as I said on #tomu : 317 LC for a simple UART, 511LC if it's a master on wishbone
<_florent_> acathla: have you tried reducing the FIFO's depth?
<_florent_> also are you using the RS232PHY or just a custom PHY?
<acathla> _florent_, behaviors is strange, sometimes it only uses RAM so not much LC, sometimes it uses a lot of LC.
<_florent_> if using the RS232PHY, disabling the dynamic baudrate could help: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L136
<_florent_> acathla: we you are out it RAM, RAM is implemented in Luts, which can cause this behavior
<_florent_> we/when
<acathla> I tried that and it seems to help. I tried to understand https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L126-L129 a long time ago and forgot to take notes...
<acathla> _florent_, even when not out of RAM at all sometime it seems it prefers to use LC.
<acathla> Calculations are for a real RS232 UART
<_florent_> acathla: could you eventually do a test?
<acathla> I was using UART class with a custom PHY, now I exploded parts of the code to separate RX and TX
<_florent_> this should reduce resource usage, is significant we could add a parameter to disable dynamic baudrate
<acathla> I'll re-do that and measure
<_florent_> ok thanks
<acathla> _florent_, 114 LC ! For only one UART
<_florent_> acathla: instead of 317?
<acathla> 114 LC less without the register than with it
<acathla> 203 instead of 317 if you prefere
<_florent_> ah ok, so that could be worth adding a parameter! (and even disable dynamic baudrate by default since I'm not sure anyone use it)
<acathla> That's a good idea. I'm not using USB anymore so I can now fit icache + 1cycle mult + 1cycle shift and the rest of my design (4 Infrared transceivers)
<acathla> 1 cycle shift takes 126 LC
<acathla> Hum, that's not linear...
Bertl_zZ is now known as Bertl
<nickoe> _florent_: What does that "BIST" stuff mean or refer to? I mean I see it mentione in the files, but I don't really understand what it is about.
<nickoe> Ahh, I see """Built In Self Test (BIST) modules for testing LiteDRAM functionality."""
<nickoe> Is that what is used to do the memtests?
<nickoe> in the bios?
FFY00 has joined #litex
lambda has quit [Remote host closed the connection]
hansfbaier1 has joined #litex
hansfbaier1 has left #litex [#litex]
<_florent_> nickoe: the memtest from the CPU is a good diagnostic but not stressing that much the memory. The BIST is using hardware generator/checker to write/read at the maximum speed and with optional random data/addressing.
rj has joined #litex
<nickoe> _florent_: Is there an example on how to use that to verify ddr ram settings for the platform comoletely?
<tmbinc> _florent_: Makes sense. I'll put that under 360nosc0pe repo and make sure I'll rebase on top of yours. Is there a similar setup for other boards/
<tmbinc> Would be great if thereÃ's a standard way to handle this
<_florent_> nickoe: you can just set with_bist to True in add_sdram: https://github.com/enjoy-digital/litex/blob/master/litex/soc/integration/soc.py#L1187
<_florent_> nickoe: you'll then have a sdram_bist command available in the BIOS
<_florent_> tmbinc: I'm doing this in some benches for the cores, 2s that I find an example
<_florent_> It's a specialized bench for LiteSDCard based on the Arty platform/target from LiteX-Boards
<_florent_> so you reuse all from BaseSoC in LiteX-Boards and then add your own peripherals
<_florent_> but will depends from cases, sometimes it's also more convenient to only use the platform from LiteX-Boards and duplicate part of the target in the project
<_florent_> I'm using this second method in the LiteDRAM bench for example: https://github.com/enjoy-digital/litedram/blob/master/bench/arty.py
<_florent_> since need specific clocking/peripherals
<_florent_> maybe in 360nosc0pe you can have a copy of the platform/target from LiteX-Boards that we will customize and as progress are made we could integrate changes in LiteX-Boards if this is useful
<tmbinc> ok that sounds reasonable. Let me continue in 360nosc0pe then (and we can still figure out the details later).
<tmbinc> What about the memory IOSTANDARD? the chips (K4B2G1646FBYMA) seem to be DDR3 not DDR3L so they should use SSTL_1.5 not 1.35
<tmbinc> which matches the LVCMOS15 VCCQ that is used for the other ios
<tmbinc> (which are on the same bank as some of the DDR IOs)
<_florent_> tmbinc: indeed, that's probably a copy/paste error on my side while copying ddram pins definition from another platform, I can do the changes, test and update LiteX-Boards
<tmbinc> _florent_: Ok. Shoudl we still add the SPI bus and pin definitions for the other peripherals (even if there's no user then) to regular litex-boards?
<_florent_> that's what we are trying to do generally yes, but for test it's also possible to include this in a target file: https://github.com/enjoy-digital/litesdcard/blob/master/bench/arty.py#L55-L62
lambda has joined #litex
<_florent_> I also just tested it on hardware
<_florent_> ah sorry, just saw this was already fixed in your branch...
<acathla> Ok, I need help : VexRiscV without icache : 4336 LC, VexRiscV with iCacheSize 1024 : 4243 LC. How is it possible to have a negative cost to add a nice feature?
<tmbinc> _florent_: thanks! (I'm sorry - I should have split my up the PR)
<mithro> _florent_: Does the pythondata-misc-opentitan repository look okay?
rj has quit [Ping timeout: 268 seconds]
rj has joined #litex
<_florent_> mithro: yes thanks, thanks for noticing that ibex was already in opentitan repo
<mithro> We could make the pythondata-cpu-ibex just be a dummy package which depends on pythondata-misc-opentitan ?
<_florent_> mithro: yes, don't know pythondata-cpu-ibex is worth now that we know it's already in opentitan?
<mithro> It's not like we have to "do" anything to maintain it however...
<_florent_> but it's still one package that has for now no utility if we use the code from opentitan :)
<_florent_> but if we can have a package called pythondata-cpu-ibex that has both ibex and the fex opentitan prim libs that are used, I can use just this one
<mithro> _florent_: The less we do changes / modify the upstream repository the less likely it will break in the future
<_florent_> I meant: if pythondata-cpu-ibex is just a copy of pythondata-misc-opentitan, that also fine for me
<nickoe> _florent_: What optoins should I use for sdram_bist? sdram_bist <burst_length> <random>
<_florent_> you can try sdram_bist 128 0 (no random) and sdram_bist 128 1
<nickoe> it looks like this for example, https://dpaste.com/34LQR32PX.txt
<nickoe> oh, that looks different, https://dpaste.com/H3XNGP8MG.txt
<nickoe> when does it stop?
<_florent_> when you press a key :)
<_florent_> do you have errors with sdram_bist 128 1?
<_florent_> the max burst length supported is 256 IIRC
<nickoe> after a while, https://dpaste.com/GJETP4LZF
<tpb> Title: dpaste: GJETP4LZF (at dpaste.com)
<nickoe> I am not sure what to make of that..
<_florent_> you were saying previously that you had occasional memtest failures?
<nickoe> yes
<nickoe> Like, after flashing
<_florent_> can you share the calibration log?
<_florent_> you could try to use https://github.com/enjoy-digital/litedram/blob/master/bench/ddr3_mr_gen.py to change the electrical settings directly from the BIOS
<nickoe> this thing? https://dpaste.com/CD2M5NE55
<tpb> Title: dpaste: CD2M5NE55 (at dpaste.com)
<_florent_> yes
<_florent_> this looks fine
<_florent_> for ddr3_mr_gen, you can get cl/cwl from the BIOS log
<_florent_> then you can try to play with --rtt-nom --rtt-wr --rtt --ron
<_florent_> ex: ./ddr3_mr_gen.py --cl=5 --cwl=5 --rtt-nom=60ohm
<_florent_> this will generate commands that you can copy-paste to the BIOS
<_florent_> you can then to sdram_cal
<_florent_> sdram_test
<_florent_> and sdram_bist 128 1
<_florent_> and see if it improves things
<tpb> Title: dpaste: E52ZNNU5Z (at dpaste.com)
<_florent_> ok sorry, that's --rtt_nomù
<_florent_> --rtt_nom
<_florent_> but don't use cl=5 / cwl=5, you should use the ones you have in the BIOS log
<nickoe> ugh, lots of errors, https://dpaste.com/AAE37GJK6
<tpb> Title: dpaste: AAE37GJK6 (at dpaste.com)
<nickoe> mmm
<nickoe> I am not sure what number I should look for.
<nickoe> I mean there is no cl or cwl in the bios log.
CarlFK has joined #litex
<_florent_> before the initialization, you should have SDRAM: .... (CL-X CWL-Y)
<nickoe> SDRAM:262144KiB 16-bit @ 800MT/s (CL-6 CWL-5) ?
<_florent_> yes
<nickoe> it seems to be the same
<_florent_> so you can try: ./ddr3_mr_gen.py --cl=6 --cwl=5 --rtt_nom=60ohm --rtt_wr=60ohm --ron=34ohm
<tpb> Title: dpaste: 3L95KXRHS (at dpaste.com)
<_florent_> are you doing sdram_cal after the copy/paste?
<nickoe> yes
<nickoe> it should be visible in the log, https://dpaste.com/2V9JPY4W5
<tpb> Title: dpaste: 2V9JPY4W5 (at dpaste.com)
<nickoe> do I need to reflash or reboot?
<_florent_> ok, so with this you are using the default values (that are also the default values of the BIOS) and you can now change --rtt_nom --rtt_wr --ron and see if it improves things or not. If not, this could be a timing an issue in the DDR3 module definition
<_florent_> yes
<_florent_> eventually, you can also do a test with --cl=7
<nickoe> cl=7 also errors, but slightly slower -- maybe, https://dpaste.com/BPZMTMH7C
<tpb> Title: dpaste: BPZMTMH7C (at dpaste.com)
rj has quit [Ping timeout: 268 seconds]
rj has joined #litex
<nickoe> I tried to adjust them a bit, maybe ti will work better onw.
kgugala_ has joined #litex
gatecat has quit []
gatecat has joined #litex
gatecat has quit [Client Quit]
gatecat has joined #litex
<nickoe> mm, about the same.
kgugala has quit [Ping timeout: 265 seconds]
kgugala_ has quit [Read error: Connection reset by peer]
<_florent_> it seems you are using SSTL135 while it should be SSTL15: https://ohwr.org/project/fmc-mtlu-gw/commit/3ac8a4735350beb7c8220690dfabbde96fc0f69b?expanded=1
<tpb> Title: Adding Vivado constraints file for Enclustra AX3/PM3 with fmcTLU-c attached (3ac8a473) · Commits · Projects / AIDA-2020 TLU - Gateware · Open Hardware Repository (at ohwr.org)
<_florent_> can you change it?
kgugala has joined #litex
<nickoe> hmm, yeah, maybe I reverted that change at some point, I am certainly not using that now
<_florent_> you are already using SSTL15?
<nickoe> mm, io standard?
<nickoe> it lists SSTL135 in the platform
<nickoe> maybe I should try that instead?
<_florent_> I would first try to get it working with the MIG's settings at 1.5V
<nickoe> mmm, something is not good.. ohh, yeah, forgot the voltage reference pin https://dpaste.com/4J9XTQGPM
<tpb> Title: dpaste: 4J9XTQGPM (at dpaste.com)
shorne_ has joined #litex
<nickoe> mm, still no good after that.
shorne has quit [Ping timeout: 265 seconds]
<acathla> _florent_, cool, thanks
Bertl is now known as Bertl_oO
rj has quit [Ping timeout: 268 seconds]
rj has joined #litex
<nickoe> _florent_: The settings that they use in the mig project, are thsye for 800 timings? It appears so for me. Anyway, with 1.5V AND 800 timings from my current litedram timings config, it seems to work STABLE! :D
FFY00 has quit [Ping timeout: 268 seconds]
FFY00 has joined #litex
<shorne_> somlo: I think I reproduced the timeout issue setting max_blk_count to the default of 8 I got a kernel lockup in sdcard_wait_done() in send_cmd
rj has quit [Quit: rj]
Bertl_oO is now known as Bertl
<somlo> shorne_: thanks for confirming! I'm staring at the FSMs in LiteSDCard -- I could have really used the whiteboard I have at the office :)
rj has joined #litex
rj has quit [Client Quit]
rj has joined #litex
rj has quit [Remote host closed the connection]
rj has joined #litex
rj has quit [Quit: rj]
rj has joined #litex