_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: 264 seconds]
lkcl has joined #litex
Bertl_oO is now known as Bertl_zZ
lf has quit [Ping timeout: 258 seconds]
lf has joined #litex
lkcl has quit [Ping timeout: 240 seconds]
lkcl has joined #litex
futarisIRCcloud has joined #litex
benh has quit [Quit: ZNC 1.8.2+deb1 - https://znc.in]
benh has joined #litex
lkcl has quit [Ping timeout: 240 seconds]
lkcl has joined #litex
Degi_ has joined #litex
Degi has quit [Ping timeout: 264 seconds]
Degi_ is now known as Degi
awordnot has quit [Ping timeout: 256 seconds]
awordnot has joined #litex
lkcl has quit [Ping timeout: 240 seconds]
kgugala has joined #litex
kgugala_ has quit [Ping timeout: 258 seconds]
lkcl has joined #litex
lkcl has quit [Ping timeout: 240 seconds]
lkcl has joined #litex
Bertl_zZ is now known as Bertl
<somlo> _florent_: some additional data on `--read` and `--write` on the nexys4ddr: I rebuilt the bitstream with analyzer and etherbone, and both writes and reads (to the scratch register) work fine; particularly, I can see written values not only from the bios command line, but also read them back with 100% accuracy
<somlo> so it's only when using jtagbone that reading registers is broken for me
<somlo> haven't tried "classic" uartbone yet, might give that a shot too for completeness
<somlo> _florent_: console-over-jtag, "classic" uartbone debugging also works fine for reading back register values via litex_client
<somlo> hope that narrows down the list of possible places things are going south... I tried looking through the sources last night, but would need a *lot* more time until things start making sense, and right now is not a good time for me from a $DAYJOB perspective :)
<_florent_> Thanks for the feedback somlo, I'll also do some tests on the nexys4ddr but I'm not able to spend too much time on it currently (jtagbone is working fine on the setup I'm currently using with Kintex7 + JTAG HS2 cable and I need to go further on other aspects of this project for now).
Melkhior has joined #litex
<Melkhior> Dumb question, is linux-on-litex-vexxriscv expected to work with the latest version of VexRiscV (rather than the specific commit in pythondata-cpu-vexriscv-smp) ? I've updated it to the latest VexRisCV to update my patch for 3-operands & the whole of B, but while I can synthesize/boot/run synthetic test (to check the new instructions one by one),
<Melkhior> my longer-running binaries never finish, even if they don't use my new instructions. They don't hang the hardware, they just hog cpu until I control-c them... it was working fine with the detached head that pythondata-cpu-vexriscv-smp originally used, so just wondering...
<_florent_> Melkhior: I only tested personally with pythondata-cpu-vexriscv-smp so can't say, but I think pythondata-cpu-vexriscv-smp is based on the dev branch of VexRiscv, is it what you are using?
<Melkhior> I'm inside pythondata-cpu-vexriscv-smp, but I've updated the VexRiscV in 'pythondata_cpu_vexriscv_smp/verilog/ext/VexRiscv' to the head of 'master', added my stuff, and used 'generate.py'
<Melkhior> That got me updated verilog in pythondata_cpu_vexriscv_smp, with which I rebuilt the bitstream with 'linux-on-litex-vexriscv' 'make.py'
<Melkhior> except for that weird 'stuff never seem to finish' behavior, everything else went smoothly...
<Melkhior> Last time I was using stuff not up-to-date enough, now I seem to have gone too far the other way:-)  (at first I didn't realize pythondata_cpu_vexriscv_smp was getting VexRiscV in using a specific commit...)
<Melkhior> Anyway no big deal, but I'm curious as it's a really weird failure mode.
<somlo> Melkhior: sounds like a job for `git bisect` :)
<Melkhior> @somlo yes, but it will take a good chunk of forever as synthesizing the bitstream is not fast :-/
<Melkhior> Fortunately it's the one case where the sd-card work so testing the bitstream is quick :-)
<somlo> yeah, allegedly there's a way to script the test and "good|bad" feedback with git bisect - and one day I'll even gather up all my energy and try it out for myself...
<Melkhior> Not sure I'll find the time so no promise :-/
<Melkhior> yes i've used bisect before - cost me a power supply and an expensive one at that :-)  (lots and lots of power cycle to figure out a bug in LInux on a PowerMac G5 Quad ; a couple boot after I got it figured out, loud 'bang', burnt odor, magic smoke escapes from the very specific 1kW power supply of the G5... grrrr)
<somlo> I've seen that happen too (although on a "vanilla" power supply on a very old pentium I was trying to use for a benchmark)
<somlo> if it's any consolation, the thing was probably on its last legs anyway...
<somlo> probably an old capacitor
<geertu> A former co-worker had that happen with one of the old small-refrigerator-sized Silicon Graphics machines, while he was kneeling near it. Caused him to shake a bit...
<geertu> somlo: git bisect run /path/to/script
<geertu> Usually I'm too lazy to write the script (which has to be perfect ;-)
<Melkhior> @geertu yeah, I jumped in my chair too, must have been a big capa - and then I had to reboot some systems, as it took down the breaker as well...
<somlo> geertu: yeah, for me it's always been a tradeoff between spending time perfecting the script and just brute-forcing through with manual good/bad feedback
<somlo> but in bitstream build situations where it takes a few hours to get feedback for each attempt, it might be worth going for the fire-and-forget script-based feature. It also depends on how bisect-able the upstream repo is (how many "broken" commits there are for you to accidentally land on during bisect, where things don't work for reasons unrelated to what you're hunting for
<somlo> getting to the bottom of all that is a soft bucket-list item of mine, but like you, I'm lazy, so it's going to take a while
<nickoe> mmm, daveshah, I am not sure what requests that cpu reset signal, but I just added it on an unused pin. Now it starts to run vivado with make gateware, but it seems like it is not overly happy with some pin constraints.
<nickoe> like "CRITICAL WARNING: [Common 17-69] Command failed: 'U13' is not a valid site or package pin name. [/.../litex-buildenv/build/mars_ax3_base_vexriscv/gateware/mars_ax3.xdc:5]"
<tpb> Title: dpaste: D8NYZNLLM (at dpaste.com)
<daveshah> nickoe: are you using U13 in your platform file for something?
<nickoe> yes, uart tx
kgugala_ has joined #litex
<daveshah> is that the correct pin?
<nickoe> but I guess I could hack that around if needed, I think it was just added to a random pin without having any idea about the gpio banks.
<nickoe> daveshah: Yeah, I just checked with the pcb design.
<daveshah> Then the package is probably set up wrong
<nickoe> mm, not the package, the pcb design -- right?
<nickoe> daveshah: there are lots ofother pins with that warning, see https://dpaste.com/D8NYZNLLM#line-1415
<tpb> Title: dpaste: D8NYZNLLM (at dpaste.com)
kgugala has quit [Ping timeout: 258 seconds]
<daveshah> you sure it is the cpg236 package?
<nickoe> hm, no it is not
<nickoe> it is xc7a35tcsg324-1
<daveshah> then you'll need to change that in the platform file
<nickoe> yeah, I just did, XilinxPlatform.__init__(self, "xc7a35t-csg324-1", _io, toolchain=toolchain)
<nickoe> the user manual for the module suggests this, https://dpaste.com/9JWMZD7UY
<tpb> Title: dpaste: 9JWMZD7UY (at dpaste.com)
<nickoe> so I guess I need to set that pin to low
<nickoe> how do I do that in the platform code?
<daveshah> if you look at the top of the log file, vivado is trying to build for the xc7a35t-cpg236-1 device
<daveshah> you'll need to sort that first
kgugala_ has quit [Read error: Connection reset by peer]
<daveshah> setting a pin to a constant can be done in the target
kgugala has joined #litex
<nickoe> upated build log https://dpaste.com/A59KBJRXB
<daveshah> is an example of setting a pin to 1, setting a pin to 0 is much the same
<tpb> Title: dpaste: A59KBJRXB (at dpaste.com)
<nickoe> (now using the correct package)
<daveshah> I'm not sure why that error is happening, possibly one of the address pins is wrong
<daveshah> that might be one for _florent_
<_florent_> nickoe: that's probably a missing INTERNAL_VREF constraints on the DRAM bank, ex: https://github.com/litex-hub/litex-boards/blob/master/litex_boards/platforms/arty.py#L326
<nickoe> I used this as a base for my base (pun intended), by the way, https://github.com/timvideos/litex-buildenv/blob/master/targets/arty/base.py
<nickoe> so I have self.add_platform_command("set_property INTERNAL_VREF 0.750 [get_iobanks 34]")
<nickoe> my ddr3 sdram is on bank 15
<nickoe> and if I use low voltage ram, I guess I need to set it to 1.35/2?
<nickoe> So "set_property INTERNAL_VREF 0.675 [get_iobanks 15] ?
<_florent_> nickoe: yes exactly
<nickoe> mm, now I changed something .. I am not sure about.. https://dpaste.com/6SZN4XMBC
<tpb> Title: dpaste: 6SZN4XMBC (at dpaste.com)
<mithro> _florent_: Regarding https://github.com/litex-hub/pythondata-auto/pull/7 -- eine / umarco is the expert on GitHub Actions
<Melkhior> I think I found my problem, it seems the timing functions in the code are broken. I expected the cycle counter (rdycle/rdcycleh) to be the culprit, but no, it's actually getttimeofday() !
<Melkhior> For some reason, this:
<Melkhior> static long long microseconds(void)
<Melkhior> {
<Melkhior>   struct timeval t;
<Melkhior>   gettimeofday(&t,(struct timezone *) 0);
<Melkhior>   return t.tv_sec * (long long) 1000000 + t.tv_usec;
<Melkhior> }
<Melkhior> Returns a constant value, so the difference between call is always 0 and the calibrating goes into an infinite loop...
<Melkhior> Now to figure out why gettimeofday() behave like that, and whether it's a hardware or software problem...
<Melkhior> to be continued :-)
<_florent_> mithro: I think the remaining issue is only a permission issue (for the bot to push changes on the repositories): https://github.com/litex-hub/pythondata-auto/runs/1824573452?check_suite_focus=true
Melkhior has quit [Quit: Ping timeout (120 seconds)]
<nickoe> mm, no, I guess it should just be a "signal" or something?
<nickoe> mm
<somlo> Melkhior: a total shot in the dark, but any chance it's related to either timebase-frequency or clock-frequency in the DTS? :)
<somlo> probably not, but since we were on that topic a few days ago...
Bertl is now known as Bertl_oO
<mithro> _florent_: BTW We will be moving the conda packages from litex-hub organization to the hdl organization as they are now being used in a couple of contexts, not just with litex
<nickoe> hmm, why do I get this error https://dpaste.com/9RPM8ZMWQ from this change trying to add LEDChaser? https://github.com/timvideos/litex-buildenv/commit/ae98c83277eabe7e48acc455138f094b1b4d748c
<tpb> Title: dpaste: 9RPM8ZMWQ (at dpaste.com)
<nickoe> I have four user_led's defined in the platform.
Melkhior has joined #litex
<Melkhior> @somlo I don't think so, gettimeofday() actually fails (once tested...) and errno is 38, "Invalid system call number", so I lean toward a configuration issue in the kernel/buildroot...
<Melkhior> seems that whatever real-time mechanism is backing gettimeofday() is MIA ...
<daveshah> this has strong "64 bit time_t" vibes but I can't point to a specific problem
<Melkhior> perhaps
<Melkhior> but this is the 'latest' buidlroot with Geert's v5.11 kernel, so both should be quite up-to-date and compatible...
<Melkhior> maybe a configuration issue ?
<Melkhior> could have messed that up when I upgraded buildroot/kernel...
<Melkhior> anyway I'll try to track & report
<Melkhior> thanks for the suggestions
<geertu> Melkhior: does "sleep 1" in a shell return after 1s?
<nickoe> OMG OMG OMG daveshah it booted to the litex bios, I can see that via serial. Soo, how can I test the flash and ram?
<daveshah> The ram test should be automatic on boot if your target is supported properly
<daveshah> *set up properly
<daveshah> The flash I'm not so sure about as I've not used flash with litex before
<Melkhior> @geeru yes it seems to work properly
<nickoe> it completed a "fe" with "Flash erased"
<Melkhior> @geertu sorry
<nickoe> oh, there a sdrinit command
<Melkhior> @geertu the 'sleep' is from busybox, dunno if it changes the implementation
<nickoe> daveshah: I am not sure if the pattern seen in the middle for that read levelling is good or not, but https://i.snipboard.io/d1fOT2.jpg
<nickoe> is there a way to generate a memory map over stuff i a litex soc easily?
<_florent_> nickoe: the memtest is passing it seems, congrats :)
<nickoe> I have no idea how much that tests, but I guess it is a good starting point.
<nickoe> how can I test flash?
<_florent_> if the spiflash is integrated, you can do mem_list to get the base address of the flash and then do a mem_read to verify the content
<nickoe> _florent_: I am not sure if this is good? https://dpaste.com/8PJH9DKRD
<tpb> Title: dpaste: 8PJH9DKRD (at dpaste.com)
<_florent_> sorry I have to go
<nickoe> ok
<nickoe> I only have these commands, https://dpaste.com/CA997LUBA
<tpb> Title: dpaste: CA997LUBA (at dpaste.com)
<_florent_> memtest is already testing the main_ram
<_florent_> ah, you are using an old version of LiteX
<_florent_> I would recommend using upstream
<mithro> Litex-BuildEnv lags behind the current upstream version
<nickoe> mithro: How much?
<nickoe> Are there any docs about how to actually do firmware for it? I would like to try to just get a register that I can write a byte in and it will be reflected on some io pins.
<mithro> nickoe: dunno at the moment, the Travis CI breakage hasn't been fixed
<nickoe> mm, ok, but in the meantime, do you see anythin wrong with this change? https://github.com/timvideos/litex-buildenv/commit/ae98c83277eabe7e48acc455138f094b1b4d748c
<nickoe> I mean expect for the comment that says this is static.. I can't compile that and get https://dpaste.com/9RPM8ZMWQ
<tpb> Title: dpaste: 9RPM8ZMWQ (at dpaste.com)
<mithro> Look at the code in home/nickoe/litex_test/litex-buildenv/third_party/litex/litex/build/generic_platform.py around the ValueError
<nickoe> it do seem to hit the value error at 224
<nickoe> in def request_all(self, name):
<nickoe> I still don't get why it fails. The code looks the same to the upstream litex as well.
<ius> _florent_: have you seen any segfaults on linux/vexriscv-smp with n>1 cores? if i build acorn with 1 core everything is fine, if i build with 4 userspace executables crash quite often ( https://p.6core.net/p/uVYThfx2kr1AKdBpYHC5YiUN )
<ius> fact that i have never seen the kernel itself crash makes me wonder whether its perhaps /not/ a hardware bug, but instead some smp-related issue in the kernel?
Melkhior has quit [Quit: Connection closed]
<_florent_> ius: that's indeed possibly related to the updated kernel. I tested various configurations with a 5.10 kernel and haven't seen this crash, but not sure I tested n>1 with the 5.11 kernel.
<ius> guess i could try an older kernel
<ius> i was actually trying to debug something else: i tried to add a second serial port, but that doesn't seem to work either
<ius> added the port to SoC, device tree, modifed kernel config (for some reason liteuart has a Kconfig-configurable limit) - device appears in /dev but it appears to be dead for rx/tx (if i poke the register with devmem2 it works, though)
<_florent_> ius: this could be an issue in the driver, not sure we tested multiple instances of the same peripherals
<ius> yes, i figured, so thats why im trying to get jtag working
dkozel has quit [Quit: WeeChat 1.9.1]
dkozel has joined #litex
<nickoe> _florent_: Why can't I do self.comb += platform.request("user_led", 2).eq(1) ?
<nickoe> I have four leds specified in the platform
<nickoe> mithro: mm, maybe this old issue should just be closed? https://github.com/timvideos/litex-buildenv/issues/71
<nickoe> hmm, if I rename the leds in the platform code away from "user_led" then it works :O Why is this?
<nickoe> I guess the only reason is that the platform object is not quite the right one or something.