Tuesday, 2021-01-19

*** tpb has joined #litex00:00
*** somlo has quit IRC00:07
*** somlo_ has joined #litex00:07
*** lf_ has quit IRC01:02
*** lf has joined #litex01:02
*** ambro718 has quit IRC01:13
*** Bertl is now known as Bertl_zZ01:54
*** mntmn has joined #litex02:27
*** Degi_ has joined #litex04:00
*** Degi has quit IRC04:02
*** Degi_ is now known as Degi04:02
*** kgugala_ has joined #litex06:21
*** kgugala has quit IRC06:23
*** kgugala_ has quit IRC07:45
*** kgugala has joined #litex07:45
*** FFY00 has quit IRC08:11
*** FFY00 has joined #litex08:11
*** hansfbaier has joined #litex08:37
*** DerFetzer[m] has quit IRC09:00
acathlaAny advice on how to get wishbone-tool work on a versa-ecp5 through ethernet? I don't even know which ethernet port is the default.10:09
acathlaI ran : ./versa_ecp5.py --device=LFE5UM --load --csr-csv csr.csv --with-etherbone --eth-ip 192.168.52.1  --build10:10
*** Bertl_zZ is now known as Bertl10:11
acathlaOh, does --eth-phy select the port?10:12
acathlait does10:18
*** _whitelogger has quit IRC10:25
*** _whitelogger has joined #litex10:28
*** shorne has quit IRC10:58
*** shorne has joined #litex10:58
*** kgugala has quit IRC11:58
*** captain_morgan has quit IRC11:58
*** d_olex has quit IRC11:58
*** simeonm has quit IRC11:58
*** simeonm has joined #litex11:58
*** kgugala has joined #litex11:58
*** captain_morgan has joined #litex11:58
*** hansfbaier has quit IRC12:12
*** kgugala_ has joined #litex13:59
*** kgugala has quit IRC14:01
*** kgugala has joined #litex14:01
*** kgugala_ has quit IRC14:03
*** TMM has quit IRC14:54
*** TMM has joined #litex14:54
somlo_wish the nexys4ddr had two ethernet ports... too bad --with-etherbone and --with-ethernet are mutually exclusive :)15:53
daveshahthere might be an ethernet pmod around?15:59
*** feldim2425 has quit IRC15:59
*** feldim2425 has joined #litex15:59
daveshah(*not* the NIC100 thats some silly SPI ethernet thing, but I'm sure I've seen a proper RMII or similar one before)15:59
somlo_thanks! (honestly, in retrospect I feel like I should have been able to come up with that idea *eventually*) -- but I'm not in a very sharp frame of mind right now :D16:05
somlo_I'll order a pmod and do some hacking, should make for a much less painful litescope debugging experience...16:06
daveshahlooks like there are some LAN8720 modules out there that should work with liteeth16:06
daveshahdon't know if anyone has actually tested one yet though16:06
daveshahhttps://www.amazon.co.uk/Waveshare-performance-LAN8720-Board-Transceiver/dp/B00N4JW3YK16:06
somlo_daveshah: thanks! I think the US-ified amazon link would be https://www.amazon.com/Waveshare-performance-LAN8720-Board-Transceiver/dp/B00N4JW3YK16:10
somlo_looks like the exact same thing, hopefully16:10
daveshahyep16:10
somlo_ordering now... (thanks again!)16:11
*** oter has joined #litex16:50
_florent_somlo_: that's not integrated in the targets, but you can use the hybrid mode of LiteEthMAC for that: https://github.com/enjoy-digital/litex/blob/master/litex/tools/litex_sim.py#L224-L24817:02
_florent_somlo_: but using an additional PMOD is also a nice way to decouple things/issues.17:03
somlo__florent_: I'll check out the hybrid mode (one already has to modify the target files to instrument them for litescope, so a bit more hackery while at it should be ok)17:32
somlo_it's just that I have a lot of moving parts (bitstream changes x kernel sdcard driver changes) and not having netboot capabilities leads to lots of plugging and unplugging of the sdcard to copy updated boot.bin images to it... Wanted to streamline my workflow before I really dive in and test my new-found skills with litescope :D17:34
*** Zguig has joined #litex17:48
*** kgugala has quit IRC18:17
*** kgugala has joined #litex18:17
*** oter has quit IRC18:21
_florent_somlo_: sure :), also if that can be useful: LiteScope can also be run over UART18:33
acathla_florent_, right, but can you run litex_term while litescope is running, on the same uart with crossover?18:37
acathlaI couldn't find how18:38
_florent_acathla: yes it's possible18:38
_florent_litex_server --uart --uart-port=/dev/ttyUSBX18:39
_florent_then litex_term crossover18:39
acathlabut the port is already opened by litex_server for the litexscope thing18:40
acathlaI'll try again soon...18:40
_florent_litex_server accepts multiple clients18:40
acathlalitex_term can use litex_server?18:41
_florent_that's very useful to avoid mixing things in scripts :)18:41
_florent_it's recent but yes18:41
somlo__florent_: can I keep using "screen /dev/ttyUSBX" or do I have to use litex_term via litex_server to access the console ?18:42
somlo_i.e., will there be an additional /dev/ttyUSBXYZ device for litescope debugging, or (probably this, since you already mentioned multiplexing) it's all multiplexed over the same serial link (console *and* litescope transfers) ?18:42
_florent_somlo_: in you case I was suggesting adding a second UART dedicated to the bridge (through a PMOD)18:42
somlo_ah18:43
somlo_so I'll need extra pmod hardware either way18:43
_florent_just that it's probably easier than adding a second ethernet18:43
somlo_have a (link to) a component handy? The ethernet pmod thing I ordered shows delivery by mid-February, so maybe I can find a pmod-uart thing that ships faster, and use whichever one I get first :)18:44
daveshahhttps://www.mouser.co.uk/ProductDetail/Digilent/410-212?qs=s%2FdyVPQMB4wcQVUQRTwfoQ==&mgh=1&vip=1&gclid=CjwKCAiAo5qABhBdEiwAOtGmbiv4WLlkHAoIOZ-_QarRJtI_-ZAqbSp4G24KS_KFPRDge5yQWpXyLxoCWA8QAvD_BwE18:44
daveshahis a PMOD UART I've used before18:45
somlo_daveshah: thanks!18:45
daveshahalso at digikey et al.18:45
_florent_it's just a matter of adding a debug_serial to the platform and doing in your SoC: self.add_uartbone("debug_serial", sys_clk_freq)18:45
_florent_and you have a debug bridge that can communicate with litex_server --uart --uart-port=/dev/ttyUSBX18:46
acathlahttps://github.com/enjoy-digital/litex/wiki/Use-Host-Bridge-to-control-debug-a-SoC#add-a-uart-bridge-to-your-soc18:47
somlo_acathla: I remember now seeing that and ignoring it, I was on a mission to set it up over ethernet :)18:51
somlo_but yeah, digikey stuff is likely to win the shipping race, so I'll likely end up using the uart method for "real" debugging :)18:51
_florent_somlo_: ah another option: generate your SoC with uart_name=jtag_uart,  then use litex_term jtag_uart and use the default serial for uartbone, does not require an additional PMOD :)18:55
somlo_so that would be multiplexing the console and litescope data over the same serial link?19:07
ZguigHi all, trying to understand and use litex, here are some questions I have:19:08
Zguig1. When I start the sim.py of linux-on-litex-vexriscv, with prebuild stuff, my Linux boot "hangs" at "[    0.014830] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns". I waited some quite long time for me. Shoudl I just be patient and wait for hours?19:08
Zguig2. When I try to generate the bitstream for ecpix5 board (./make.py --board=ecpix5 --cpu-count=1 --build), I always got a timing issue with 1 path: Warning: Max frequency for clock                   '$glbnet$sdrio_clk': 69.76 MHz (FAIL at 75.01 MHz). Max I could get is 71MHz. Is it a known issue? Should I just ignore the warning and program the board?19:08
Zguig3. Do you have any tutorial for implementing a custom core to advice? I want to rewrite and finalize this project I worked some time ago and was passing more time to fight with or1k stuff than working on the added value I have. Basically, I want to do a wishbone controlled generic RX/TX. There are some functions written in VHDL that I want to port to litex (and some new to be done/finished).The closest example I could find is the liteth core.19:08
Zguighttps://github.com/euryecetelecom/euryspace/tree/master/hw/rtl/ccsds_rxtx19:08
somlo_oh wait, do I already have two serial devices in play over the same serial cable (the jtag used to program the board, and the "regular" serial console uart)? And here I'd be re-using the jtag for actual console i/o, and the "normal" serial uart for litescope purposes?19:09
somlo_wonder what changes I'd have to make to the DT to get BBL and linux to play along (probably reflected in the csr.csv file)19:10
acathlasomlo_, what's your board?19:11
somlo_nexys4ddr19:12
somlo_I have /dev/ttyUSB0 (presumably the jtag), and I use console over /dev/ttyUSB119:12
acathlaOn a versa_ecp5 there are ttyUSB0 and USB1, USB0 disappear after FPGA being configure, and USB1 as console too19:12
somlo_guess what _florent_ suggested is to *reuse* /dev/ttyUSB0 (jtag) for the console, and dedicate the "regular" uart to litescope/uart-bone19:13
acathlacool19:13
somlo_acathla: sadly my stuff won't fit on a versa (rocket chip with mmu to run "real" linux)19:13
acathlabecause I failed at using ethernet19:13
somlo_I can barely fit a non-MMU bare-metal-only rocket on the versa19:13
acathlaWow. I try to use a versa_ecp5 because my design + debug is too big for an iCE40up5K :)19:14
somlo_ethernet works great (for litescope) on the nexys, but that in turn means I can't netboot the kernel, which means I have to screw around moving the microSD card back and forth between the board and my laptop to update the kernel+bbl I'm trying to boot and debug, in conjunction with the bitstream/gateware I'm *also* trying to debug at the same time :)19:17
acathlanexys4ddr Logic Slices : 15,850 (4 6-input LUTs &19:17
acathla8 flip-flops each)19:17
acathlaIs that big?19:17
somlo_It's significantly bigger than the 45k ecp5 (or even the 85k ecp5). Rough guesstimate is that I can fit about three times as much "gateware" on the artix7 provisioned on the nexys (with vivado) as I can fit stuff on the 85k ecp5 (with yosys/trellis/nextpnr)19:19
somlo_and I know that because the fpu-less rocket soc occupies about 80% of the ecp5-85k, and the fpu is about twice as big as everything else, and I can fit the fpu-in-gateware based rocket on the nexys19:20
somlo_I'm really not qualified to be saying all this stuff though, I never really sat down to do a systematic study of how much logic I can fit on each type of chip :)19:20
somlo_acathla: btw, it's called the "nexys a7" these days (should be compatible and/or functionally identical to the nexys4ddr): https://store.digilentinc.com/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/19:23
tpbTitle: Nexys A7 Artix-7 FPGA Trainer Board - Digilent (at store.digilentinc.com)19:23
somlo_I think I have the A7-100T version (of the older nexys4ddr board), i.e. the one with the larger capacity19:25
somlo_or maybe that was the only kind of nexys4ddr, and now the a7 has a "cheap" option that's new, I don't really know for sure...19:26
acathlaOh, ok, A7-100 means it's the equivalent of 100 old style cells19:34
acathla_florent_, that's nice, "litex_term crossover" uses directly the running litex_server. It would be nice if it was visible with --help option.19:44
acathlaAnd it's faster than wishbone-tool -s terminal19:45
_florent_Zguig: Hi, it seems the simulation is indeed not going to the Linux prompt:20:32
_florent_https://github.com/litex-hub/linux-on-litex-vexriscv/issues/18620:32
_florent_I'll have a look, it could be related to the clock frequencies passed in the .dts20:34
_florent_for the ecpix5, I don't remember the timings results, but you can try to lower the clock or disable SDCard/Ethernet if you want more margin20:35
_florent_we don't have yet a tutorial to integrate a custom core, but Betrusted is a good example project for that20:36
_florent_for example:20:37
_florent_https://github.com/betrusted-io/gateware/tree/master/gateware/i2c20:37
_florent_or20:37
_florent_https://github.com/betrusted-io/gateware/tree/master/gateware/sha51220:37
_florent_somlo_: yes I was suggesting reusing /dev/ttyUSB0 (JTAG) as a JTAG UART20:38
cr1901_modern_florent_: Will you be around in 5 minutes? I had an error w/ linux-on-litex that I don't understan20:39
cr1901_modernbut I need to rerun it to get the error20:39
_florent_somlo_: the only change required to your SoC is passing --uart-name=jtag_uart and then use litex_term jtag_uart (and have OpenOCD installed)20:40
_florent_cr1901_modern: Hi, yes I'll be around20:42
cr1901_modernAwesome I'm building now... as soon as device-tree-compiler installs20:43
cr1901_modern(is this a new dep? Don't seem to remember that last I built)20:43
cr1901_modernHeAP Placer Time: 32.10s Wow, that's the longest I've ever seen nextpnr take. It must be working20:47
cr1901_modern(If daveshah sees this: I'm not being too serious. Still pretty fast.)20:47
cr1901_modern_florent_: Okay, I can't duplicate the error this time around. And I found the original error: http://ix.io/2KBL20:51
cr1901_modernThis was with "python3 make.py --board orangecrab --build" on Dec 31st. Seems in the past 3 weeks whatever bug I saw is gone.20:52
cr1901_modernNow gonna upload the firmware/see what happens20:52
somlo__florent_: haven't yet used litex_term -- is it a wrapper around openocd, and if so, am I supposed to program the board through it as well as access the console, or is that a separate (direct) openocd command as I've been using it so far (with console on ttyUSB1)?20:52
cr1901_modernsomlo_: litex_term is a terminal app like minicom20:54
cr1901_modernthe reason you use it to program boards is that litex BIOS looks for a special ASCII string that tells the BIOS to send a binary over the serial port20:54
cr1901_modernand litex_term knows how to send that special ASCII string to commence programming20:54
cr1901_modern(it's a string that a user is very unlikely to type themselves)20:55
somlo_cr1901_modern: ok, so I would *not* use it to program the board's *bitstream*, only software as an *alternative* to sdcard/tftp boot, etc.20:55
cr1901_modernYes20:55
cr1901_modernEvery board that litex supports should support that boot mode (send over serial)20:56
somlo_what confused me was _florent_'s suggestion to use it with the `port` argument set to "jtag" and the "need to have openocd installed"20:56
cr1901_modernI'm not familiar w/ using openocd w/ jtag, so I'm not sure what _florent_ means there20:56
somlo_I'm supposed to use console-over-jtag to free up my "regular" uart for litescope debugging20:56
cr1901_modernerr sorry, not familiar w/ litex and openocd*20:56
cr1901_modernOh, it might be possible to send UART traffic over the JTAG port20:57
ZguigHi _florent_, thanks for your feedbacks. Regarding to my last question (an example advice), the TX part was semi-functional and all the RX has to be done. I have to admit that VHDL writing makes me going a bit crazy/with headaches... So I search more an example to write from scratch a litex core (and not encapsulate the existing one like the betrusted project did).20:57
cr1901_modernand litex_term knows how to connect to openocd as well20:57
cr1901_modernto interpret UART traffic sent over the JTAG port20:58
cr1901_modernbut even in that case, you're _not_ using litex_term to program the bitstream20:58
somlo_and my obvious attempt to connect `screen /dev/ttyUSB0` (i.e., the jtag device) instead of the "regular" ttyusb1 (the "usual" serial port) didn't work, so I'm assuming there's some magic serial-over-jtag encapsulation that a regular minicom/screen/whatever terminal program wouldn't be capable of20:58
cr1901_modernCorrect- that "magic" is what litex_term will be doing I think. Nothing prevents someone from adding it to other terminal programs20:59
cr1901_modernI started adding serial boot to another terminal, but am holding off on that project for now20:59
somlo_right, so I am openocd-ing the bitstream as before; then, I'm using litex-term to drive openocd to tunnel serial traffic to the "jtag uart" :)20:59
cr1901_modernyes21:00
somlo_cr1901_modern: ok, that makes sense -- just trying to mentally place all the moving parts into their rightful little boxes :)21:00
somlo_thanks!21:00
cr1901_modernYw21:00
cr1901_modernNow if you're running into issues w/ using UART-over-JTAG, well I've never used that, so I don't think I can help :P.21:02
somlo_then I'll wait for the digikey shipment of my external 2nd (pmod) uart :D21:02
*** Zguig has quit IRC21:09
*** somlo_ has quit IRC21:43
*** _florent_ has quit IRC21:50
*** _florent_ has joined #litex21:53
*** somlo has joined #litex21:54
cr1901_modern_florent_: This doesn't seem good: http://ix.io/2MCo21:57
cr1901_modernWhat might be causing this (orangecrab, default settings)21:57
somlo_florent_: after programming a "--uart-name jtag_uart" bitstream to the nexys4ddr board, it appears to wait until I connect with "litex_term jtag_uart" before it starts the self-test and boot sequence22:11
somlois that expected?22:11
somlootherwise looks like it's working OK, now on to bridging litescope over the "regular" uart22:12
acathlasomlo, I have the same behaviour with a normal uart22:15
cr1901_modernI would say that's expected- the firmware stops while the transmit buffer is full22:16
cr1901_modernand the banner will certainly take up the buffer22:17
somloI *think* I remember it progressing independently with the normal uart, but then again, I usually had that open in screen or minicom22:59
somloI seem to remember that, if I did NOT have minicom open right during/after the openocd bitstream push, I'd later find it fully booted, at the linux busybox prompt22:59
somlonow with the jtag uart, if I connect to it 20 minutes after pushing the bitstream with openod, it starts booting right then and there, clearly having waited for me23:00
somlonot a problem, just different from what (I think) I saw before23:01
somlobut so far so good, I now have an open UART to try to use for litescope.23:02
cr1901_modern_florent_: For some reason when I reset my board when UART_POLLING is not defined _and_ I'm using a USB uart, the UART stops receiving characters properly (transmitting unaffected). Is this a known bug?23:05
cr1901_modernsomlo: Maybe you can teach me something... is JTAG UART a separate second UART you attach to a litex design?23:33
cr1901_modernIIRC, add_uart() in soc.py is sugar for manually adding a UART that the BIOS expects to exist. If you add a second UART for debugging the first UART, as is my intent, I'm on my own lmao23:35
*** Zambyte has joined #litex23:40
zypsomlo, I figure the normal uart doesn't have flow control, so it'll just transmit regardless of whether anybody is listening or not23:47

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