Sunday, 2023-08-13

lkclmarkos_, if you were using vivado it would always be "simple"00:15
lkclbut when using FOSS FPGA tools you simply don't have the luxury of saying "i want to use one tool just like in the commercial world and if it fails i give up". and yes, openocd *is* simple.00:16
lkclyou need to progress from one thing to the next. if you have an LED working that means the bitstream is programmable.00:17
lkclthe next step would be to get blinky running (this will tell you that the PLL is properly programmed), and after that the hello_world uart example00:18
lkclall of this is far, far eaiser if you are "just" prepared to use the proprietary FPGA tools.00:18
*** octavius <octavius!> has quit IRC01:09
*** yambo <yambo!> has joined #libre-soc01:41
markos_lkcl, I'm a practical person and I pick my battles, plus it's a matter of experience. For you or cesar, it might be a couple of days/hours to get this board working with open source tools, because you have done fpga for years. For me, it's been just a few days and I just cannot allocate more time on something I know someone more experienced will take just a couple of hours09:11
markos_because I may be interested in learning -some- fpga development, but not interested in investing my time to enabling those said fpga to use only open source tools09:12
markos_I already have too many things to worry about09:12
markos_I will definitely prefer spending a couple hundred euros to get a known working fpga than wasting my precious time getting the nexys video working, I'm already close to burnout as it is09:15
*** cesar <cesar!~cesar@2804:14d:688a:59ea:bd4e:1a53:81fb:ba0> has joined #libre-soc09:30
cesarmarkos_, does the oled display show something, or just the green led?09:35
cesarIs it possible to give me SSH access to some machine connected to the board by USB?09:38
markos_that's going to be hard, at least now, it's connected to my laptop now, I can prepare another system for this purpose, but I can't do it atm09:39
markos_reg oled, by default it has the nexys video demo application09:40
markos_and it shows temperature/voltage/ip address in the oled09:40
cesarJust for the record, it keeps this way after transferring that system_wrapper.bit?09:43
markos_I think I pressed reset at one point09:44
markos_so it probably reset the programming to the factory default?09:44
markos_hm, no09:46
lkclmarkos_, no, it would need several clear days and a lot of persistence. it really isn't easy.09:46
cesarNot if the jumpers are in the USB position.09:46
lkclyes following a path that has been done before and is working is the key lesson here09:46
lkclin the case of attempting to run ls2 on an unknown board, there are about *18* possible things that could have gone "wrong"09:47
markos_cesar, ah yes, indeed, I need to move the jumper to QSPI to have it show the info in the oled screen09:47
markos_if still in USB position, it will turn green and stay that way09:48
lkcl1. clock rate too high. 2. PLL set up incorrectly 3. LED wire defined incorrectly (pin and voltage) 4. UART wire defined incorrectly (pin and voltage) .....09:48
markos_but I have no way of knowing what it does, nothing on serial (uart)09:48
lkclthen the first thing you need to do markos_ is is write an FPGA program that sets the serial pin "high" and *nothing* else09:48
lkclnot even from a clock (using nmigen "sync" domain) but just a combinatorial "set" of that pin09:49
lkclthen you will know the answer to the question "is the board definition file correct in regards to the uart pin"09:49
markos_lkcl, I really wish I had more time to allocate to dedicate to this, but sadly I do not, not at this time anyway09:50
lkclit's *that* level of basic checking of the massive chain, any one thing in which could prevent you from getting results09:50
lkclmarkos_, i'm explaining it to you quite how fundamentally low-level this really is so that you have the right expectations09:50
markos_I would prefer to just send this board to whomever is willing to do this work and just a get a known working onw09:50
lkclcesar, you up for that? :)09:51
lkclmarkos_, arty a7-100t. it's what we kinda standardised on as it's easy to get hold of09:52
lkcland it is also one of the microwatt targets09:52
markos_lkcl, I only have today to spare, tomorrow I'm resuming work on vectorscan which needs a lot of attention as well09:52
markos_yeah, that one will do, I expected this to be much easier since it's supposedly in the supported list and it's in the same family of fpga chips09:53
lkclanother lesson learned there, i feel, that these things take one hell of a lot of sustained focus.09:53
lkclnaah. i was at the time willing to do it because i knew what would be involved. now i simply can't - it's been too much09:54
markos_I wouldn't mind doing it if I had more time, but right now is not a good time for me to start yet another project, as I said I'm already close to a burnout juggling more than 5 -full-time- projects09:54
markos_and I can't seem to be able to find good coders, the juniors require way too much training that I just cannot afford to do, no time, the seniors who know their stuff require too much money, which I also cannot afford at the moment09:55
markos_it's a vicious cycle09:55
markos_interviewing university graduates seems to disappoint me even more, seems they don't teach C properly in the universities anymore and I'm constantly asking "wtf, how can you get a degree and not know basic C and Linux?"09:57
markos_I'm not even talking about advanced topics09:57
lkclmarkos_, we were not taught c at Imperial because the lecturers had seen too many of us be poached by Industry and not complete the degree09:59
lkclinstead we were taught the fundamentals that would allow us to learn pretty much anything10:00
openpowerbot[irc] <lkcl> programmerjake, can you please make sure that any bugreport that you create is linked to at least one other by "See also, depends or blocks"10:01
markos_well, I didn't learn C myself at the university, but I was studying physics, they only taught us FORTRAN :D10:01
openpowerbot[irc] <lkcl> as a mandatory project requirement that should be done *immediately* as a matter of routine, so that i do not have to remind you10:01
openpowerbot[irc] <lkcl> i have reminded you many times, i need to stop reminding you and you to take on responsibility for proper project management for yourself10:02
markos_but for a person doing CS/CE (esp the latter) I would consider entirely obvious that learning C/Linux should be one of the basic things to learn10:02
openpowerbot[irc] <lkcl> bugs that are isolated from the Group/Set (using math term) become extremely hard to find, as they are isolated and require "search" to track down, forcing people to do far more work10:03
markos_I mean, how they hell can you teach OS design and implementation without doing some examples in C?10:03
cesarmarkos_, no worries about SSH.10:04
lkclmarkos_, it's the difference between education and training.10:04
markos_s/they hell/the hell10:04
markos_lkcl, yes, but in order to train someone you expect some basic knowledge10:05
cesarIf sending the board to me, I'd have to pay a hefty import tax.10:05
lkcllinux OS usage does not require "education" it requires *training*.  "run this command, do this thing, it gets these results"10:05
markos_cesar, not if I send it as gift10:05
cesarOk, we can try that.10:06
markos_I receive a lot of stuff from overseas (US/UK/China), tax is only applicable when there is an actual sale10:06
lkclwe were taught instead about how the George III Operating System worked, as a way to demonstrate one of the very first Virtual Memory systems10:06
lkcl(by one of the people whom i believe had actually worked on it)10:06
markos_lkcl, I'm not talking about linux commands usage, but yes, basic things like how files are organized in the Linux FHS and why (what are block devices, what are char devices, etc) should be things in a university course, also for OS, what are interrupts, what are semaphores, spinlocks, etc etc10:07
markos_these are *fundamental* OS concepts10:07
lkclAndrew Tanenbaum taught OS basics to his students through minux - because it's so much simpler.10:07
cesarWell, maybe its different here (import tax over gifts).10:07
markos_of course10:08
markos_cesar, really?10:08
markos_ok, I'll try to set up a system with ssh access connected to the nexys video10:08
lkcli didn't get to spinlocks (didn't know what they were) until 2000, 12 years after i finished my degree.10:08
markos_cesar, would you like me to set up the environment on this system or would you do it yourself?10:09
lkcli also had no idea what block and char devices are, nor what FHS was.10:09
lkclbut i knew about interrupts and i think i had vaguely heard of semaphores10:09
lkclthe basics i had been *educated* in - not trained - *educated* - allowed me to absorb all of those concepts in my stride when i encountered them10:10
markos_you're missing my point10:10
lkclsomeone from the British Computing Society did a presentation about this, about 15 years ago10:11
lkclhe said he explains to parents the difference:10:11
markos_it's the constant complaint many companies have, graduates are just not work-ready10:11
lkcl"if this were sex we were talking about, in this school, would you prefer that your child be given sex education or sex training?"10:11
markos_hahaha, good one, but it's not the same thing10:12
lkclit is indeed.10:12
lkclanyone can look up "how to do X" by running a google search query10:12
cesarNo hurry about SSH. How about I just send you bit files for you to flash into the USB drive, once in a while?10:12
markos_cesar, yes please10:12
lkclbut yes if they don't *know* that that's even possible, then yes they're in trouble10:13
markos_lkcl, no, knowledge is not acquired just by googling10:13
markos_it's the fundamental difference between knowledge and information10:13
lkclDavid tells the story about how he would select engineers, by giving them a PCB they'd never seen10:13
markos_one you actually possess, the other you do not, big difference10:13
lkclby the first few questions they asked, he knew whether he could train them or not10:14
lkclpeople such as you and i are auto-didacts (and also know our limitations)10:15
lkcl(what's practical within a set time and committment, and what isn't)10:15
lkcland it's a whooole new level compared to most people in computing (new and old)10:17
markos_indeed, hence the whole discussion, I know my limits and I know I cannot make this board work on my own in the short timeframe that I have :)10:17
lkclawesome! progress! :)10:18
*** ghostmansd[m] <ghostmansd[m]!> has quit IRC10:27
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has joined #libre-soc10:29
*** cesar <cesar!~cesar@2804:14d:688a:59ea:bd4e:1a53:81fb:ba0> has quit IRC11:40
*** cesar <cesar!~cesar@2804:14d:688a:59ea:b6dc:1926:357d:cf4> has joined #libre-soc11:42
cesarmarkos_, can we try again, together? When convenient, try to repeat the steps, up to the green light. Nothing more.11:46
markos_well, getting the green light works11:58
markos_both jumpers to USB, usb stick in the usb port, usb cable to UART port (only ttyUSB0), BUSY led on for a few seconds and then green light appears11:59
markos_but nothing on minicom11:59
markos_usb stick has only proj/nexys_video_demo.runs/impl_1/system_wrapper.bit12:00
cesarGood. The OLED in not showing any messages, right?12:04
markos_nothing at all12:06
markos_not sure what this demo is supposed to do, I also don't get anything in the UART12:06
cesarNo worries. Now, press the red PROG button next to JP4.12:07
markos_ok, now BUSY led is on12:09
cesarHow about the OLED?12:09
markos_and then again it goes off and green led is on12:09
markos_still nothing on it12:09
cesarWeird. Try pushing a button, see if some LED light up.12:10
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has quit IRC12:10
markos_well, green light is on as I said12:11
markos_if I switch the JP4 to QSPI then the oled will work as before12:11
markos_I guess the default image in the QSPI flash is the demo12:12
markos_with the oled info that12:12
markos_that is12:12
markos_the problem is getting the usb PROG functionality with xc3sprog or another program, if you could tell me what to look for and modify the code for it, I'd be happy to do it, but I just don't know where to start12:14
markos_or even build the bitstream for the nexys_video and then try that bit file12:14
markos_even with usb12:14
cesarFrom my understanding, that bit file, in the zip archive, was exactly the factory design, in bit file form.12:14
cesarSo, it should have displayed messages in the OLED, not just the green LED.12:15
markos_from the readme: This application is loaded from the QSPI flash by the bootloader. Upon warm-boot (reset with CPU_RESETN) the12:15
markos_   processor jumps to the reset vector. If the demo application is compiled normally, it populates the reset vector.     This means that the processor is reset to the demo, not to the bootloader. Unfortunately the memory sections for12:15
markos_   demo are not re-initialized and contain the previous run's values. This will result in driver init failures and12:15
markos_   heap allocation errors. To fix this the reset vectors needs to point to the bootloader in BRAM. This requires12:15
markos_   the demo to be compiled with specific settings. See my forum post for solution:12:16
markos_I guess it won't work with a simple upload?12:16
markos_similarly, ls2/top.bit when copied to the USB stick just has the BUSY led flashing fast12:20
cesarMaybe it's stuck in the bootloader, yes. If so, I consider it a success. Means we can upload designs (even if made with Vivado) through USB for now.12:23
markos_ok, let's try something else, how can I try blinky on the board?12:25
cesarAbout top.bit, you mean the one created with "nmigen_boards/", right? If so, it's not ls2, the full core. It's just a Blinky. Just to get terminology right,12:26
cesar* "python3 nmigen_boards/"12:27
markos_no, it was the one generated in ls2 directory following Andrey's instructions12:28
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has joined #libre-soc12:28
markos_I did install fasm however12:29
markos_xc3sprog fails as expected, serial was connected to UART12:29
cesarIt generated a bit file, however. Please try saving that "/tmp/nmigen_sjssw2ha_top.bit" to the USB drive, removing the other.12:31
openpowerbot[irc] <sadoon[m]1> Ok so still has all the VSX insns and co, but that's probably like programmerjake  said, it'll only use them when they are needed12:31
markos_cesar, it gets deleted12:32
openpowerbot[irc] <sadoon[m]1> Even the gentoo has it so I assume it's fine12:34
cesarLook in the "build" directory under your current directory.12:34
cesar... for a top.bit.12:34
cesar... with a recent timestamp.12:35
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has quit IRC12:36
markos_ok, that one works12:36
markos_but I don't see anything :)12:36
*** ghostmansd[m] <ghostmansd[m]!> has joined #libre-soc12:37
markos_it seems to program (BUSY led on) and then just gives a green led12:37
markos_but nothing on serial12:37
markos_I mean, it seems to have worked, but I'm not sure what it's supposed to do12:39
cesarThis is a Blinky, it should blink all leds on the board (not just turn them on).12:39
markos_nope, nothing happens12:39
cesarNow, try pressing the red PROG button next to JP4.12:39
markos_same result12:40
markos_green led on, nothing else happens12:40
markos_cleaning up the build directory just in case there was a leftover file from before12:41
markos_nope, removed build/ and reran python3 nmigen_boards/, same result12:44
markos_there are microswitches for each led, and they were all set to off12:46
markos_ah no, still nothing when set to on12:47
cesarNo worries.12:47
lkclsadoon: toshywoshy described when you weren't at tuesday's meeting that he had to do a backport of libc6.12:48
lkcland that "latest" required a very simple compile-switch12:48
lkclmarkos_, "python3 nmigen_boards/nexys_video --build"12:50
lkclunless "program=True" has been set in the last line12:50
lkclif you just want "build only" and "program=True" has been set, it should be obvious to change that to "program=False" then look in the build/ directory12:50
lkclobvious what that means?12:51
markos_do_program=True -> call xc3sprog else don't call it :)12:52
lkcl*when* it fails it has *NO* impact on the contents of the build/ directory12:52
lkclactually, "call the abstracted-out 'build' script which in the case of the nexys_video platform *HAPPENS* to call xc3sprog"... yes12:52
openpowerbot[irc] <sadoon[m]1> openpowerbot: That's cool, will look into that then12:53
lkclif you look at the derivation chain for NexysVideoPlatform, guess what it derives from? XilinxPlatform!12:53
lkcland guess what VERSA_ECP5 and other ECP5 platform classes derive from?12:53
markos_either my board is broken or something else is amiss here, no leds are flashing12:54
lkcland guess what the program() function in LatticePlatform does? call the appropriate script for programming the ECP5!12:54
lkclit's all very logical12:54
markos_it /appears/ to program the fpga at least12:54
markos_I'm looking at the blinky class now12:54
lkclok so this is why i said "do a combinatorial thing instead"12:54
lkclbecause a combinatorial thing (no "m.d.sync) will hard-wire a line to HI (or LO) and it's done12:55
lkclremember that all classes are abstracted-out.12:55
lkcl"platform" argument is completely separate from "the thing that *USES* the platform"12:56
lkclotherwise just to do a "Blinky lights" test you have to write *one frickin test program per frickin board*12:56
lkclwhich is total madness.12:56
markos_yes, apparently digilent must have done something differently to the platform default here12:56
lkcltherefore the platform defines things like "a uart"12:56
lkclthat is highly unlikely given that the litex nexys_video platform python code is near-identical to the litex arty_a7 platform python board12:57
markos_yes, yes, I understand the principles just fine, it's something like uboot, only scaled down (a lot!)12:57
markos_I've done uboot development in the past12:57
lkclby an order of magnitude, minimum, yes.12:57
markos_so I need to basically put the expected values for the actual platform specs in order for abstractions to properly match what the board expects12:58
lkclyou have to think of eeevvverything, right down to "is the PLL programmed up with the correct settings which involves plugging in the correct *wires* to it not just the right *settings* like you have to in u-boot"12:58
markos_which needs time, which I don't have :/12:58
lkclmarkos_, it's already been done - in litex. cesar simply copied and converted the litex platform file to nmigen platform file12:59
markos_because I don't suppose it's going to be easy to do, unless it's a trivial 10-minute deal12:59
lkclcesar, can you check to see if there are any differences in the setup of the PLL for nexys_video, in litex?13:00
lkcli doubt it very much13:00
markos_ok, I found this:
lkcl> <markos_> so I need to basically put the expected values13:00
lkclno you don't: the *platform* file ( defines them for you.13:00
lkclbut we are in the situation of having to be the first to do it13:01
markos_well, yes, but someone has to put them in the file first that's what I mean :)13:01
lkclnow if you find the equivalent platform file13:01
markos_I seem that some values that cesar has already filled in13:01
lkcland compare *that* to the nmigen platform file13:01
markos_but the litex has a lot more info in it13:01
lkclthen you have an "A is to B as C is to D" against which to check the (new) board file13:02
cesarlkcl_, sure, I'll check the PLL. As you say, better to try a combinatorial design first.13:02
cesar(just turn on a LED)13:03
lkclcesar, or use a very-simple-modifed which combinatorially turns on an LED, yes13:03
lkcl        self.toolchain.additional_commands = \13:04
lkcl            ["write_cfgmem -force -format bin -interface spix4 -size 16 "13:04
lkclthose look like they're openocd commands to me13:04
lkclor... urrrr they're vivado commands13:04
* lkcl throws up13:04
lkclignore them13:05
* lkcl need to go for a walp13:05
markos_but similar commands are on the file13:05
markos_though that one I see uses Symbiflow13:06
markos_not yosys_nextpnr that nexys_video is calling13:06
markos_could that be a problem?13:06
cesarI'll look into it.13:09
markos_could you also add a UARTResource so that I can see some output on serial?13:11
markos_I added it but I guess the pins are wrong :)13:12
cesarLike lkcl says, I think UART is a bit ahead of us right now.13:13
markos_oh, I thought it was an easy thing :)13:14
cesarTo see anything on serial, you need a UART HDL design, which is more complex that a blinking LED.13:14
cesarWell, at least a baud rate generator, and a shift register. Not that more complex.13:15
markos_lunchtime bbl :)13:15
cesarI'm wondering how to send you Python programs and bit files.14:06
cesarMaybe some FTP service. Not worth it to use Git for that.14:06
markos_temporary git branch?14:07
markos_that will be removed later?14:07
markos_I mean they're not huge binary files14:07
markos_it *is* for testing nexys_video enablement after all :)14:10
cesarSure. You have my branch of nmigen-boards checked out already, we will use that then.14:14
cesarOK. I'll create a simple design (simpler than a Blinky) which will simply turn on one led.14:33
cesarGoing for a  walk, be back later.14:35
*** cesar <cesar!~cesar@2804:14d:688a:59ea:b6dc:1926:357d:cf4> has quit IRC14:40
*** cesar <cesar!~cesar@2804:14d:688a:59ea:b6dc:1926:357d:cf4> has joined #libre-soc15:18
openpowerbot[irc] <sadoon[m]1> toshywoshy  do you remember the compile time options that disables vsx and co?15:24
openpowerbot[irc] <sadoon[m]1> for glibc*15:24
openpowerbot[irc] <sadoon[m]1> Weirdly I can see the gcc invokations during the build process actually using my custom flags so I assumed that would be enough15:25
openpowerbot[irc] <sadoon[m]1> # Stupid GCC requires us to pass all these ridiculous switches.  We need to... (full message at <>)15:34
openpowerbot[irc] <sadoon[m]1> Even the glibc guys are frustrated15:34
*** cesar <cesar!~cesar@2804:14d:688a:59ea:b6dc:1926:357d:cf4> has quit IRC15:50
*** ghostmansd[m] <ghostmansd[m]!> has quit IRC16:46
*** ghostmansd[m] <ghostmansd[m]!> has joined #libre-soc16:49
*** cesar <cesar!~cesar@2804:14d:688a:59ea:b6dc:1926:357d:cf4> has joined #libre-soc17:55
cesarmarkos_, please try:18:56
cesargit pull18:56
cesarpython3 nmigen_boards/test/nexys_video/led_on.py18:57
markos_Warning: No clocks found in design19:10
markos_flashing now19:11
markos_sigh, same result, green light, no leds blinking19:11
cesarNo worries.19:16
cesarThis one should have turned on led LD0 (T14). No blinking.19:18
cesarFor the record, the green light is labeled "DONE", right?19:21
markos_tell you what, I will investigate further but now now, towards the end of the month, I can do some more reading on openocd, litex and what all these numbers and elements in the definitions of a board are and I can retry19:39
markos_litex for comparison I mean19:39
cesarWell, my idea was to do exactly that, and tell you the commands to try...20:01
cesarmarkos_, I suggest to try:20:22
cesaropenocd -f /usr/share/openocd/scripts/board/digilent_nexys_video.cfg -c "transport select jtag; init; exit"20:23
cesaropenocd -f /usr/share/openocd/scripts/board/digilent_nexys_video.cfg -c "transport select jtag;init;pld load 0 build/top.bit;exit"20:23
markos_ok this seems to work, it flashed the board, green led again22:04
markos_but same result, no other blinking leds22:04
cesarProgress! For good measure, try with NexysVideo_User_Demo/proj/nexys_video_demo.runs/impl_1/system_wrapper.bit22:09
cesarI guess you can put jumper JP1 in the JTAG position.22:20
markos_well, it programs ok, but nothing else22:23
cesarWhere did you get openocd?22:25
markos_I installed it on the host not the schroot if you're asking that, and copied the bit file there22:26
cesarHow did you install openocd? I tried the Debian version, in the schroot, and it doesn't have the file /usr/share/openocd/scripts/board/digilent_nexys_video.cfg.22:27
markos_yes that one is too old22:27
markos_the one in the host works though22:27
markos_bookworm version22:27
cesarI'll see about adding it to the fpga dev script (compiled from source).22:32
*** cesar <cesar!~cesar@2804:14d:688a:59ea:b6dc:1926:357d:cf4> has quit IRC22:39
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has quit IRC22:59

Generated by 2.17.1 by Marius Gedminas - find it at!