Tuesday, 2021-02-16

*** tpb has joined #litex00:00
tmbinc_florent_: https://github.com/litex-hub/litex-boards/pull/176 for further review, this is really just a first iteration00:13
tmbincbut it appears to work correctly after ~1 minute of scoping00:13
*** lf_ has joined #litex00:21
*** lf has quit IRC00:21
*** lkcl has quit IRC01:39
*** lkcl has joined #litex02:07
*** hansfbaier has joined #litex02:17
*** TMM has quit IRC02:18
*** TMM has joined #litex02:19
*** Degi_ has joined #litex03:45
*** Degi has quit IRC03:45
*** Degi_ is now known as Degi03:45
*** Bertl_oO is now known as Bertl_zZ04:34
*** hansfbaier has quit IRC04:49
*** yqszxx has joined #litex06:03
*** yqszxx has quit IRC06:07
*** kgugala_ has joined #litex06:22
*** kgugala has quit IRC06:25
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?07:08
nickoetmbinc: Is that the siglent scope?07:12
zypnickoe, is that a litedram question, or are you thinking RAM in general?07:18
zypthe general question is bus interconnects that arbitrates access from multiple masters07:19
zypgeneral answer*07:19
zypthis can be wishbone or AXI or whatever07:19
nickoezyp: I am talking in general, but I want to implememt it specifically with litex, so I guess it is a litedram question in gemeral.07:20
zyplitedram has an internal crossbar interconnect so that you can attach multiple masters directly07:20
nickoeMy 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.07:20
nickoeGhen 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.07:21
nickoeAfter that I would need to add some DSP in gateware (in verilog) to generate those IQ samples.07:23
zypa 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 ram07:24
zypso 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 ram07:25
zypin the latter case, you might want to use one of these adapters: https://github.com/enjoy-digital/litedram/blob/master/litedram/frontend/dma.py07:26
nickoeOk, 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.07:30
zyphttps://github.com/enjoy-digital/litedram/blob/master/litedram/frontend/axi.py or https://github.com/enjoy-digital/litedram/blob/master/litedram/frontend/wishbone.py07:31
nickoeMm, 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?07:39
nickoemaybe there exist some other SDR implemented with litex that I can look at?07:40
*** kgugala has joined #litex07:49
*** kgugala_ has quit IRC07:53
*** hansfbaier has joined #litex08:27
*** FFY00 has quit IRC08:40
*** hansfbaier has left #litex08:54
_florent_tmbinc: nice you've been able to reuse and integrate your previous offsetdac code!09:21
_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 projects09:22
_florent_tmbinc: we could maybe continue developing the scope part in the 360nosc0pe organization? (and have offsetdac code + test code +  others custom peripherals there)09:24
_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)09:27
_florent_nickoe: this is convenient for CPU accesses but the main bus can be a bottleneck09:27
_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#L7909:28
_florent_nickoe: this will provide you a native LiteDRAM interface, that you can then convert to Wishbone/AXI if more convenient09:29
_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:09:31
_florent_https://github.com/enjoy-digital/litedram/blob/master/litedram/frontend/bist.py09:31
_florent_integrated with:09:31
_florent_https://github.com/enjoy-digital/litex/blob/master/litex/soc/integration/soc.py#L1230-L123509:31
shornesomlo: 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 things09:37
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 LC10:27
_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)10:51
_florent_acathla: even if no longer useful in your case, the things we experimented will probably be useful later10:52
_florent_acathla: so now you are able to saturate your link with the CPU?10:55
acathlaI did the math again, this time the icache (1024) costs 47LC and 4 RAM10:56
acathla_florent_, yes, I also passed everything in 32 bits, so 4 times faster to write to the FIFO (but it costs some LC)10:57
acathlaI think there is something overkill with the actual UART, taking too much LC for the iCE40 (but you don't care on bigger FPGAs)10:58
acathlaas I said on #tomu :  317 LC for a simple UART, 511LC if it's a master on wishbone11:00
_florent_acathla: have you tried reducing the FIFO's depth?11:02
_florent_https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L195-L19611:02
_florent_(similar to: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L427)11:02
_florent_also are you using the RS232PHY or just a custom PHY?11:02
acathla_florent_, behaviors is strange, sometimes it only uses RAM so not much LC, sometimes it uses a lot of LC.11:03
_florent_if using the RS232PHY, disabling the dynamic baudrate could help: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L13611:03
_florent_acathla: we you are out it RAM, RAM is implemented in Luts, which can cause this behavior11:04
_florent_we/when11:05
acathlaI 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...11:05
acathla_florent_, even when not out of RAM at all sometime it seems it prefers to use LC.11:06
acathlaCalculations are for a real RS232 UART11:06
_florent_acathla: could you eventually do a test?11:07
_florent_here: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L136-L13811:07
_florent_comment: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L13611:07
acathlaI was using UART class with a custom PHY, now I exploded parts of the code to separate RX and TX11:07
_florent_and use a static tuning_word value here: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L137-L13811:08
_florent_this should reduce resource usage, is significant we could add a parameter to disable dynamic baudrate11:09
acathlaI'll re-do that and measure11:10
_florent_ok thanks11:10
acathla_florent_, 114 LC ! For only one UART11:15
_florent_acathla: instead of 317?11:16
acathla114 LC less without the register than with it11:16
acathla203 instead of 317 if you prefere11:17
_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)11:17
acathlaThat'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)11:40
acathla1 cycle shift takes 126 LC11:41
acathlaHum, that's not linear...11:43
*** Bertl_zZ is now known as Bertl11:55
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.12:28
nickoeAhh, I see """Built In Self Test (BIST) modules for testing LiteDRAM functionality."""12:33
nickoeIs that what is used to do the memtests?12:33
nickoein the bios?12:33
*** FFY00 has joined #litex13:28
*** lambda has quit IRC13:33
*** hansfbaier1 has joined #litex13:42
*** hansfbaier1 has left #litex13:42
_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.14:07
*** rj has joined #litex14:16
nickoe_florent_: Is there an example on how to use that to verify ddr ram settings for the platform comoletely?14:27
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/14:29
tmbincWould be great if thereÃ's a standard way to handle this14:29
_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#L118714:32
_florent_nickoe: you'll then have a sdram_bist command available in the BIOS14:32
_florent_tmbinc: I'm doing this in some benches for the cores, 2s that I find an example14:34
_florent_tmbinc: here for example: https://github.com/enjoy-digital/litesdcard/blob/master/bench/arty.py14:35
_florent_It's a specialized bench for LiteSDCard based on the Arty platform/target from LiteX-Boards14:35
_florent_so you reuse all from BaseSoC in LiteX-Boards and then add your own peripherals14:36
_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 project14:37
_florent_I'm using this second method in the LiteDRAM bench for example: https://github.com/enjoy-digital/litedram/blob/master/bench/arty.py14:38
_florent_since need specific clocking/peripherals14:38
_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 useful14:40
tmbincok that sounds reasonable. Let me continue in 360nosc0pe then (and we can still figure out the details later).14:40
tmbincWhat about the memory IOSTANDARD? the chips (K4B2G1646FBYMA) seem to be DDR3 not DDR3L so they should use SSTL_1.5 not 1.3514:42
tmbincwhich matches the LVCMOS15 VCCQ that is used for the other ios14:43
tmbinc(which are on the same bank as some of the DDR IOs)14:44
_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-Boards14:48
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?14:50
_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-L6214:52
*** lambda has joined #litex15:51
_florent_tmbinc: https://github.com/litex-hub/litex-boards/commit/975150ca6870375f56001f32f881154ae151408416:34
_florent_I also just tested it on hardware16:34
_florent_ah sorry, just saw this was already fixed in your branch...16:36
acathlaOk, 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?16:46
tmbinc_florent_: thanks! (I'm sorry - I should have split my up the PR)17:08
mithro_florent_: Does the pythondata-misc-opentitan repository look okay?17:15
*** rj has quit IRC17:24
*** rj has joined #litex17:25
_florent_mithro: yes thanks, thanks for noticing that ibex was already in opentitan repo17:34
mithroWe could make the pythondata-cpu-ibex just be a dummy package which depends on pythondata-misc-opentitan ?17:36
_florent_mithro: yes, don't know pythondata-cpu-ibex is worth now that we know it's already in opentitan?17:38
mithroIt's not like we have to "do" anything to maintain it however...17:38
_florent_but it's still one package that has for now no utility if we use the code from opentitan :)17:40
_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 one17:42
mithro_florent_: The less we do changes / modify the upstream repository the less likely it will break in the future17:43
_florent_I meant: if pythondata-cpu-ibex is just a copy of pythondata-misc-opentitan, that also fine for me17:44
nickoe_florent_: What optoins should I use for sdram_bist? sdram_bist <burst_length>  <random>17:49
_florent_you can try sdram_bist 128 0 (no random) and sdram_bist 128 117:50
nickoeit looks like this for example, https://dpaste.com/34LQR32PX.txt17:50
nickoeoh, that looks different, https://dpaste.com/H3XNGP8MG.txt17:50
nickoewhen does it stop?17:51
_florent_when you press a key :)17:51
_florent_do you have errors with sdram_bist 128 1?17:52
_florent_the max burst length supported is 256 IIRC17:52
nickoeafter a while, https://dpaste.com/GJETP4LZF17:53
tpbTitle: dpaste: GJETP4LZF (at dpaste.com)17:53
nickoeI am not sure what to make of that..17:54
_florent_you were saying previously that you had occasional memtest failures?17:55
nickoeyes17:55
nickoeLike, after flashing17:56
nickoehttps://github.com/nickoe/litedram/commit/1f70587e4cdfa6639174d0451efed2826b8e6aae17:56
_florent_can you share the calibration log?17:56
_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 BIOS17:57
nickoethis thing? https://dpaste.com/CD2M5NE5517:57
tpbTitle: dpaste: CD2M5NE55 (at dpaste.com)17:57
_florent_yes17:58
_florent_this looks fine17:58
_florent_for ddr3_mr_gen, you can get cl/cwl from the BIOS log17:58
_florent_then you can try to play with --rtt-nom --rtt-wr --rtt --ron17:59
_florent_ex: ./ddr3_mr_gen.py --cl=5 --cwl=5 --rtt-nom=60ohm18:00
_florent_this will generate commands that you can copy-paste to the BIOS18:00
_florent_you can then to sdram_cal18:01
_florent_sdram_test18:01
_florent_and sdram_bist 128 118:01
_florent_and see if it improves things18:01
nickoemmm https://dpaste.com/E52ZNNU5Z18:01
tpbTitle: dpaste: E52ZNNU5Z (at dpaste.com)18:01
_florent_ok sorry, that's --rtt_nomù18:02
_florent_--rtt_nom18:02
_florent_but don't use cl=5 / cwl=5, you should use the ones you have in the BIOS log18:03
nickoeugh, lots of errors, https://dpaste.com/AAE37GJK618:04
tpbTitle: dpaste: AAE37GJK6 (at dpaste.com)18:04
nickoemmm18:04
nickoeI am not sure what number I should look for.18:04
nickoeI mean there is no cl or cwl in the bios log.18:08
*** CarlFK has joined #litex18:10
_florent_before the initialization, you should have SDRAM: .... (CL-X CWL-Y)18:10
nickoeSDRAM:262144KiB 16-bit @ 800MT/s (CL-6 CWL-5)   ?18:11
_florent_yes18:11
nickoeit seems to be the same18:13
_florent_so you can try:  ./ddr3_mr_gen.py --cl=6 --cwl=5 --rtt_nom=60ohm --rtt_wr=60ohm --ron=34ohm18:13
nickoehttps://dpaste.com/3L95KXRHS18:13
tpbTitle: dpaste: 3L95KXRHS (at dpaste.com)18:13
_florent_are you doing sdram_cal after the copy/paste?18:13
nickoeyes18:15
nickoeit should be visible in the log, https://dpaste.com/2V9JPY4W518:15
tpbTitle: dpaste: 2V9JPY4W5 (at dpaste.com)18:15
nickoedo I need to reflash or reboot?18:15
_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 definition18:15
nickoeyou mean this? https://github.com/nickoe/litedram/commit/1f70587e4cdfa6639174d0451efed2826b8e6aae18:16
_florent_yes18:17
_florent_eventually, you can also do a test with  --cl=718:17
nickoecl=7 also errors, but slightly slower -- maybe, https://dpaste.com/BPZMTMH7C18:19
tpbTitle: dpaste: BPZMTMH7C (at dpaste.com)18:19
nickoeThis should be the datasheet for the ram https://www.nanya.com/Files/696?Filename=2Gb_DDR3_I_Die_component_Datasheet.pdf&ProductId=3,77118:19
*** rj has quit IRC18:23
*** rj has joined #litex18:26
nickoeI tried to adjust them a bit, maybe ti will work better onw.18:27
*** kgugala_ has joined #litex18:27
*** gatecat has quit IRC18:28
*** gatecat has joined #litex18:28
*** gatecat has quit IRC18:29
*** gatecat has joined #litex18:29
nickoemm, about the same.18:31
*** kgugala has quit IRC18:31
*** kgugala_ has quit IRC18:39
_florent_it seems you are using SSTL135 while it should be SSTL15: https://ohwr.org/project/fmc-mtlu-gw/commit/3ac8a4735350beb7c8220690dfabbde96fc0f69b?expanded=118:40
tpbTitle: 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)18:40
_florent_can you change it?18:40
*** kgugala has joined #litex18:40
_florent_also be sure to change INTERNAL_VREF to 0.750: https://github.com/nickoe/litex-boards/blob/mars_ax3/litex_boards/platforms/mars_ax3.py#L14018:41
nickoemm, they listed something in https://github.com/enclustra/Mars_AX3_PM3_Reference_Design/blob/cc73a6d4db420303faa1497ef57131e6c4bd3afe/src/mig.prj#L10218:41
nickoehmm, yeah, maybe I reverted that change at some point, I am certainly not using that now18:42
_florent_you are already using SSTL15?18:43
nickoemm, io standard?18:44
nickoeit lists SSTL135 in the platform18:45
_florent_yes but it's SSTL15 in the mig.prj: https://github.com/enclustra/Mars_AX3_PM3_Reference_Design/blob/cc73a6d4db420303faa1497ef57131e6c4bd3afe/src/mig.prj#L4518:46
nickoeSoI specifically try to enable the low voltage mode, https://github.com/nickoe/litex-boards/blob/mars_ax3/litex_boards/platforms/mars_ax3.py#L76-L8318:46
nickoemaybe I should try that instead?18:47
_florent_I would first try to get it working with the MIG's settings at 1.5V18:48
nickoemmm, something is not good.. ohh, yeah, forgot the voltage reference pin https://dpaste.com/4J9XTQGPM18:57
tpbTitle: dpaste: 4J9XTQGPM (at dpaste.com)18:57
*** shorne_ has joined #litex19:01
_florent_acathla: https://github.com/enjoy-digital/litex/commit/285bb96278a5e7d0682c41d0658548958f51685719:02
nickoemm, still no good after that.19:02
*** shorne has quit IRC19:03
acathla_florent_, cool, thanks19:07
*** Bertl is now known as Bertl_oO19:39
*** rj has quit IRC19:43
*** rj has joined #litex19:44
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! :D19:45
*** FFY00 has quit IRC20:41
*** FFY00 has joined #litex20:42
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_cmd21:34
*** rj has quit IRC21:36
*** Bertl_oO is now known as Bertl21:38
somloshorne_: thanks for confirming! I'm staring at the FSMs in LiteSDCard -- I could have really used the whiteboard I have at the office :)21:45
*** rj has joined #litex21:49
*** rj has joined #litex21:50
*** rj has joined #litex21:50
*** rj has quit IRC22:30
*** rj has joined #litex22:31

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