_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
<somlo> zyp: thanks, that makes sense
<somlo> cr1901_modern: when I plug in the usb cable to my nexys4ddr, I get *two* /dev/ttyUSB* devices, 0 and 1
<somlo> 0 is the "jtag" (used by openocd to push bitstream). 1 is the "normal" uart that's going to get the console traffic, works fine with screen and minicom, etc.
<somlo> now if you pass '--uart-name jtag_uart', the SoC ends up connecting its uart external "pads" to the jtag (usb0) device
<somlo> the "quirk" is that you can't speak "serial" to it directly, it has to be tunneled over openocd, which litex_term knows how to do
<cr1901_modern> How do you make a SoC with two serial ports?
<somlo> cr1901_modern: heh, I haven't made it to that part *yet* -- once I had the jtag_uart working I declared victory and started running errands (it's evening here) :) I'll figure that part out tomorrow
<cr1901_modern> (The answer might be "you don't")
<somlo> but I have a bunch of pads free (to what connects to my computer as usb1), so I think I need to instantiate another uart IP block connected to those pads, and somehow do the litescope-over-uart thing using *it*
<somlo> it all depends on what litex does when you pass "--uart-name jtag_uart" on the build command line :)
<somlo> per _florent_ (earlier), you definitely should be able to make a SoC with two uarts if you hook up an external (pmod) uart
<cr1901_modern> I think calling "add_uart" twice will do what I want
<somlo> don't have easy access to the source (on IRC through layers of cell hotspots and VPNs :) so I can't easily check, but yeah -- either that, or whatever happens inside add_uart with a bunch of different arguments (selecting the pins/pads/whatever connecting the FPGA to the physical interface you intend to use
Bertl is now known as Bertl_zZ
lf_ has joined #litex
lf has quit [Ping timeout: 260 seconds]
shorne has quit [Ping timeout: 256 seconds]
shorne has joined #litex
FFY00 has quit [Remote host closed the connection]
FFY00 has joined #litex
FFY00 has quit [Remote host closed the connection]
FFY00 has joined #litex
FFY00 has quit [Remote host closed the connection]
FFY00 has joined #litex
FFY00 has quit [Remote host closed the connection]
FFY00 has joined #litex
Degi_ has joined #litex
Degi has quit [Ping timeout: 256 seconds]
Degi_ is now known as Degi
_whitelogger has joined #litex
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 240 seconds]
cr1901_modern has quit [Ping timeout: 272 seconds]
<_florent_> somlo: using two regular UARTs is not supported by the BIOS, with JTAG UART the UART of the SoC will be redirected over JTAG which frees up the regular UART pins that you can use to create a UART bridge (add_uartbone) for LiteScope.
hansfbaier has joined #litex
Bertl_zZ is now known as Bertl
Zguig has joined #litex
hansfbaier1 has joined #litex
tpb has quit [Disconnected by services]
Zguig has quit [Quit: Leaving.]
tpb has joined #litex
Zguig has joined #litex
hansfbaier has quit [Ping timeout: 256 seconds]
Zguig has quit [Ping timeout: 248 seconds]
miek has quit [Ping timeout: 240 seconds]
miek has joined #litex
kgugala_ has quit [Quit: -a- Connection Timed Out]
kgugala has joined #litex
<acathla> Does it seem correct that it takes 156 clock cycles to write a byte on CSR (UART in my case) ?
<acathla> In a simple for loop in C, executed from RAM, on a VexRiscV variant simple.
hansfbaier1 has quit [Read error: Connection reset by peer]
<zyp> how do you measure?
<zyp> sounds like at least an order of magnitude too much to me
Zguig has joined #litex
feldim2425_ has joined #litex
feldim2425 has quit [Ping timeout: 244 seconds]
feldim2425_ is now known as feldim2425
<acathla> zyp, with a capture with LiteScope
<zyp> how does the code look? have you checked the disassembly for the write loop?
<acathla> not yet
Zguig has quit [Quit: Ping timeout (120 seconds)]
kgugala has quit [Quit: -a- Connection Timed Out]
kgugala has joined #litex
<somlo> _florent_, cr1901_modern: I managed to build and test litescope via the "normal" uart (with console tunneled over jtag)
<somlo> --with-ethernet --with-sdcard --integrated-rom-size 0x10000 \
<somlo> --uart-name jtag_uart --with-analyzer --csr-csv ./csr.csv
<somlo> --cpu-type rocket --cpu-variant linux --sys-clk-freq 50e6 \
<somlo> litex-boards/litex_boards/targets/nexys4ddr.py --build \
<somlo> meh, the command line is useless without the patch for the nexys4ddr target: https://pastebin.com/yjXnHPGW
<tpb> Title: diff --git a/litex_boards/targets/nexys4ddr.py b/litex_boards/targets/nexys4ddr. - Pastebin.com (at pastebin.com)
Bertl is now known as Bertl_oO
Zguig has joined #litex
cr1901_modern has joined #litex
cr1901_modern1 has joined #litex
cr1901_modern2 has joined #litex
cr1901_modern has quit [Ping timeout: 260 seconds]
cr1901_modern1 has quit [Ping timeout: 256 seconds]
<cr1901_modern2> _florent_: Idk if this bug exists when using a terminal from Linux, but right now it's possible to end up in a state in the BIOS firmware where the USB CDC core stops firing interrupts
<cr1901_modern2> Is this a known bug?
<somlo> whoo! just managed to order an ecpix5 (85k version) from lambdaconcept \o/
<somlo> (after fighting several layers of automated credit card security systems, due to the international nature of the transaction, but all's well that ends well :D
<Zguig> (y)
<acathla> somlo, if you do some captures with litescope (or an external analyzer), I'm interested in how many clock cycles it takes between two writes.
<_florent_> cr1901_modern2: I've not seen this behavior no with the tests I did (only linux)
<_florent_> somlo: good for the jtag_uart/litescope I think it will be very useful for the work you are doing
kgugala has quit [Read error: Connection reset by peer]
kgugala has joined #litex
<cr1901_modern2> _florent_: Interesting. I'll see if I can find anything.
<cr1901_modern2> FWIW, it only happens during reset
kgugala has quit [Read error: Connection reset by peer]
<cr1901_modern2> And only sometimes (wheee...)
kgugala has joined #litex
<somlo> acathla: I'll have to rebuild it and add the memory port to the list of monitored signals, then I'll try to capture it from the start of memtest
<somlo> I haven't yet tried to make sense of any of the data included in `dump.vcd`, just worked on getting it to capture something/anything until now
<somlo> _florent_: one weird thing is that I can add e.g. l2fb_wb to the analyzer_signals list, but *not* l2fb_axi (the latter results in "object of type 'AXIInterface' has no len()" error)
<_florent_> somlo: probably because l2fb_axi is not a Record but group of Records (aw, ar, w, b, r)
<somlo> and since mem_axi isn't converted to wishbone (I rocket connects to litedram over a point-to-point axi link that isn't converted to WB), I don't know how I'd look at that interface with litescope
<somlo> oh, so I should add the individual records separately?
<_florent_> somlo: yes you can try that
<somlo> worst case, enumerate all the signals (ugh, I'd rather not have to do that :) )
<somlo> _florent_: `[ self.cpu.mem_axi.aw, self.cpu.mem_axi.ar, ...]` seems to work (at least it starts building without erroring out, so I hope that takes care of it -- thanks!
Zguig has quit [Quit: Ping timeout (120 seconds)]
<acathla> Hum, on a versa_ecp5 with a minimal vexriscv, the bios freezes after displaying the date of build.
Zguig has joined #litex
<somlo> ok, I can grab the `depth = 512` samples of all my three axi ports, now I'll look at coming up with some interesting trigger condition (since rocket has an internal L1 cache, and will probably try to burst writes to litedram accordingly)
SpaceCoaster has quit [Ping timeout: 256 seconds]
SpaceCoaster has joined #litex
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 256 seconds]
Zguig has quit [Quit: Ping timeout (120 seconds)]
<_florent_> acathla: make sure to run "rm -rf build" before building your design :)
<acathla> _florent_, right! I forgot it does not clean the software part
<acathla> 42 clock cycles on a vexriscv minimal on the versa_ecp5, 156 on the iCE40...
<somlo> _florent_: in litescope_cli, can you combine trigger criteria, such as "-r sig_1 AND -v sig2 0x80000000" ?
<somlo> basically, use a boolean expression of various individual signals to trigger collection of the sample?
<zyp> acathla, how does your write loop look?
<somlo> _florent_: based on the way add_triggers() is written (https://github.com/enjoy-digital/litescope/blob/master/litescope/software/litescope_cli.py#L53) it looks like there's an implicit AND if one provides multiple triggers on the command line, e.g. "litescope_cli -v basesoc_cpu_mem_axi_aw_payload_addr 0x80000000 -r basesoc_cpu_mem_axi_w_valid"
<somlo> but then I get this:
<somlo> Exact: basesoc_cpu_mem_axi_w_valid
<somlo> Rising edge: basesoc_cpu_mem_axi_w_valid
<somlo> Condition: basesoc_cpu_mem_axi_aw_payload_addr == 0x80000000
<somlo> Exact: basesoc_cpu_mem_axi_aw_payload_addr
<somlo> Exact: basesoc_cpu_mem_axi_aw_payload_addr
<somlo> [running]...
<somlo> which even though confusing (the Exact lines are from the Finder, so ultimately it's right) -- results in a trace that doesn't *start* with all those conditions true
<somlo> I have a few clock cycles, then aw_payload_addr goes to 8000_0000, then a bunch of clock cycles later, when aw_payload_addr goes to some *other* value, I end up with w_valid going high
<somlo> so, the question is, are the criteria supposed to be exact, or is there some window of wiggle room between when all listed conditions must be true?
<somlo> I have more questions like what's the relationship between litescope_cli's "--length" and the analyzer.depth argument built into LiteScopeAnalyzer on the SoC side of things?
<somlo> and maybe a slightly more detailed explanation (man page) for some of the less obvious arguments of litescope_cli, e.g.: "--group", "--subsampling", "--offset", and last but not least, "--length"
<somlo> anyhow, I think I'll just open an issue against litescope, because if you're going to spend the effort of answering any of these questions, it's better if we capture it there :)
<somlo> ok, found issue #21 on "sequence" vs. "and" & "or", so that explains why I don't get what I expect by providing multiple triggers on the command line :)
Claude has quit [Disconnected by services]
<somlo> _florent_: it's https://github.com/enjoy-digital/litescope/issues/29 (in addition to #21, to which I subscribed). So please answer there if/when you can, and sorry for the noise in this channel :)
TMM has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
TMM has joined #litex
<acathla> zyp, I used mem_write from the bios this time, to an uart address. It increments the address but it's ok for a simple test I guess