Wednesday, 2023-08-16

*** gnucode <gnucode!~gnucode@user/jab> has quit IRC00:53
*** gnucode <gnucode!~gnucode@user/jab> has joined #libre-soc00:53
*** gnucode <gnucode!~gnucode@user/jab> has quit IRC02:44
openpowerbot[irc] <sadoon[m]1> Yes that's actually really good!04:27
lkcloctavius: i regularly and systematically deleted the state files. and saving them (at all) slows down the simulation08:31
lkclthe login i believe is "root" and there should be no password08:32
*** ghostmansd <ghostmansd!> has quit IRC08:34
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has quit IRC08:35
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has joined #libre-soc08:36
lkclit takes *tens of seconds* to get a response.  imagine using a 1/10th Baud Modem.  no i did not say "imagine using a 10 baud modem" i said "imagine using a modem with a baud rate of one bit every ten SECONDS"08:45
lkclyou cannot go "oh it didn't respond let me type that character again. hm still no response let me type it again. and again. and again. hm now i will hit delete"08:45
lkclthat first character caused an interrupt to service the 16550 UART08:46
lkclthe linux kernel - running at only 5,000 instructions per second - will take about TEN SECONDS to swap out of the userspace prompt to get into the Interrupt Service Routine08:47
lkcl... etc. etc. ...08:47
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has quit IRC09:34
*** ghostmansd[m] <ghostmansd[m]!> has joined #libre-soc09:35
*** octavius <octavius!> has joined #libre-soc09:55
*** ghostmansd <ghostmansd!> has joined #libre-soc10:41
*** markos_ <markos_!~markos_@user/markos/x-1838887> has quit IRC10:50
openpowerbot[irc] <sadoon[m]1> If I can run literally two programs on this I am happy11:06
openpowerbot[irc] <sadoon[m]1> 1- ls11:06
openpowerbot[irc] <sadoon[m]1> 2- mc11:06
openpowerbot[irc] <sadoon[m]1> To test that the code is compliant11:06
openpowerbot[irc] <sadoon[m]1> After that perhaps FPGA stuff is a better test11:07
*** markos_ <markos_!> has joined #libre-soc11:08
*** markos_ <markos_!~markos_@user/markos/x-1838887> has joined #libre-soc11:08
lkclok so there's only an initramfs at the moment in the verilog simulator11:20
lkclthe only two "peripherals" are:11:20
lkcl1) wishbone bus (where quotes "Memory" quotes is simulated in c++ by doing literally read/write to a malloc'd area)11:20
lkcl2) 16550 UART11:21
lkclthe c++ "implementation" of a 16550 UART was written i think by anton or benh?11:21
lkclwhat i did was:11:22
lkcl* allowed the verilator simulator program, on startup, to specify "hey please read this file and stuff it into that malloc'd block you created earlier? the one that you're going to use as Wishbone-accessed "Memory"?"11:23
*** markos_ <markos_!~markos_@user/markos/x-1838887> has quit IRC11:23
lkcl* allowed the verilator simulator program, on startup, to specify a *second* file11:23
lkclthe first file, guess what it is?11:23
lkclit's the linux kernel11:23
lkclthe second file, guess what it is?11:23
lkclit's the initramfs.11:23
lkclbut you *can* if you want specify that first file as, say, "helloworld.bin" or "coldboot.bin"11:24
openpowerbot[irc] <lkcl> sadoon[m]1, ^11:25
openpowerbot[irc] <lkcl> this is all far, FAR more basic and low-level than ANYTHING you are expecting to deal with, when faced with "a box with a motherboard, PCIe Graphics Card and 4 TB of NVME SSDs"11:26
openpowerbot[irc] <lkcl> you think "oh i will just replace the bootloader with skiboot on my Blackbird / TALOS?"11:27
openpowerbot[irc] <lkcl> "by flashing the QSPI chip?"11:27
openpowerbot[irc] <sadoon[m]1> Nononono, I have a very intuitive plan :)11:27
openpowerbot[irc] <lkcl> here in the verilator simulation you have to goddamn *WRITE* the f*****g QSPI interface in c++!!!11:27
openpowerbot[irc] <lkcl> does it involve networking?11:27
openpowerbot[irc] <sadoon[m]1> Take the initramfs, put debian inside it, and try to run ls/mc11:28
openpowerbot[irc] <sadoon[m]1> That's all11:28
openpowerbot[irc] <lkcl> ahhhh yes i've done that before :)11:28
openpowerbot[irc] <sadoon[m]1> Success? Debian is good11:28
openpowerbot[irc] <sadoon[m]1> Same for gentoo11:28
openpowerbot[irc] <lkcl> i did that in 2003 when reverse-engineering HTC's second smartphone11:28
openpowerbot[irc] <lkcl> except.... how big is that image?11:28
openpowerbot[irc] <sadoon[m]1> And most importantly it is critical for later seeing if libc is fine11:28
openpowerbot[irc] <lkcl> how big is the image11:28
openpowerbot[irc] <sadoon[m]1> lkcl: Shouldn't be more than 100mb11:29
openpowerbot[irc] <sadoon[m]1> Maybe even less11:29
openpowerbot[irc] <sadoon[m]1> Depends on what I include11:29
openpowerbot[irc] <lkcl> it cannot be compressed because uncompressing when running at 5,000 instructions per second will be many hours11:29
openpowerbot[irc] <lkcl> and there is only 128 mb of "emulated" RAM so you will need to increase that....11:30
openpowerbot[irc] <lkcl> and make sure that the number of address bits in the "emulated" RAM are correctly connected up, yes?11:30
openpowerbot[irc] <lkcl> then you will need to tolerate the fact that when you type the command to pivot_root it will be FOREVER11:31
openpowerbot[irc] <lkcl> you are better off copying the absolute bare minimum (/bin/bash) and associated libraries11:31
openpowerbot[irc] <lkcl> lkcl@fizzy:~$ ldd /bin/bash11:32
openpowerbot[irc] <lkcl> (0x00007ffe0ebe8000)11:32
openpowerbot[irc] <lkcl> => /lib/x86_64-linux-gnu/ (0x00007f0b97f84000)11:32
openpowerbot[irc] <lkcl> => /lib/x86_64-linux-gnu/ (0x00007f0b97d5a000)11:32
openpowerbot[irc] <lkcl> => /lib/x86_64-linux-gnu/ (0x00007f0b97d55000)11:32
openpowerbot[irc] <lkcl> => /lib/x86_64-linux-gnu/ (0x00007f0b97b95000)11:32
openpowerbot[irc] <lkcl> /lib64/ (0x00007f0b981f6000)11:32
openpowerbot[irc] <lkcl> and starting with that11:32
openpowerbot[irc] <lkcl> okok ppc64 versions of the same11:32
openpowerbot[irc] <lkcl> don't make the dreadful mistake i made in 2010 with cpio of forgetting that file names are absolute UNLESS specified otherwise?11:33
openpowerbot[irc] <lkcl> i ended up overwriting /lib and /bin with armel binaries and libraries, on an amd64 system. sigh.11:33
lkclbottom line... go easy ok? :) all of this is far more detailed and time-consuming than anyone without first-hand experience could possibly imagine :)11:39
*** mx08 <mx08!~mx08@user/mx08> has quit IRC12:05
*** mx08 <mx08!~mx08@user/mx08> has joined #libre-soc12:07
openpowerbot[irc] <sadoon[m]1> Then I keep that for FPGA stuff12:33
openpowerbot[irc] <sadoon[m]1> I'm just toying with it atm, I need to do my tasks anyway and that's top priority12:33
lkclFPGA is *even more* fun :)12:39
lkclfor that, we *might* be able to configure the Arty-A7-100t using ls2 to use the RGM-II PHY, just like tpearson did for Zephyr / Kestrel BMC.12:40
lkclbut i believe he used litex and... well... it barely fits into an ECP5-85K LUTs12:41
lkclit *might* be possible on the Digilent Arty A7-100t - with Quad HyperRAM PMODs giving a (whole, gosh, shock) 64 MBytes of RAM12:42
lkclto then explicitly partition up the QSPI.... but wait... there's only 16 MB of QSPI12:42
lkcl100 mb of "image" is far too great12:43
lkclsee how "even just something as simple as running in an FPGA" is a whole insane level of detail?12:43
lkclso now you have to either:12:43
lkcla) get RGM-II working, configure the kernel with root-NFS-mount12:44
lkcl   (i did this back in 2003 as the next phase on from putting XF86-3.1 and dropbear into an initramfs)12:44
lkclb) add ANOTHER peripheral - say.... a Micro-SD Card reader.12:44
lkcl   this AGAIN is a two to THREE month task ALL ON ITS OWN12:45
lkclnaively saying "i will wait to run in FPGA" well... err... which FPGA, on which board, running which bitstream, compiled with which HDL, including which HDL peripherals, configured with what linux kernel that may *OR MAY NOT* have suitable drivers that you will have to first write?12:46
lkcland by "first write the linux kernel drivers" i mean "write IN CONJUNCTION with the Memory-Mapping and IRQ-Mapping that goes into the HDL Peripheral Fabric... which you now **ALSO** have to write"12:47
lkclbasically "keep that for FPGA stuff" requires a six to EIGHT **MONTH** hard committment from someone, in order to achieve that stated goal12:49
*** ghostmansd <ghostmansd!> has quit IRC13:08
*** ghostmansd <ghostmansd!> has joined #libre-soc13:34
*** ghostmansd <ghostmansd!> has quit IRC13:50
*** ghostmansd <ghostmansd!> has joined #libre-soc13:51
*** ghostmansd <ghostmansd!> has quit IRC14:00
*** ghostmansd <ghostmansd!> has joined #libre-soc14:03
*** ghostmansd <ghostmansd!> has quit IRC14:14
*** ghostmansd[m] <ghostmansd[m]!> has quit IRC14:26
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has joined #libre-soc14:26
openpowerbot[irc] <programmerjake> can't the sdcard just be run in qspi mode? so we could just use the existing peripheral hw14:27
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has quit IRC16:44
*** ghostmansd[m] <ghostmansd[m]!> has joined #libre-soc16:47
lkclprogrammerjake: if someone is prepared to spend the time...16:48
lkcla) researching that16:48
lkclb) confirming it16:49
lkclc) finding a suitable piece of HDL16:49
lkcld) adding it as a peripheral to ls216:49
lkcle) writing the unit tests (cocoa-tb) to test the peripheral16:50
openpowerbot[irc] <programmerjake> don't we already have qspi hdl?16:50
lkclf) writing more unit tests under microwatt-verilator to simulate it16:50
lkcl  (this will include writing some ppc64 code to run *under* the microwatt-verilator16:51
openpowerbot[irc] <programmerjake> in any case, i'm not saying i want to work on that rn, just that it's an idea that you can do what you like with16:51
lkclg) writing and configuring a linux kernel driver that uses the sdcard in QSPI mode (which will itself require research)16:51
*** ghostmansd[m] <ghostmansd[m]!> has quit IRC16:52
lkcljacob: i'm illustrating to you that *even the most basic* simple-sounding questions at this fundamental level have a MASSIVE amount of work behind them16:52
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has joined #libre-soc16:52
lkclyou asked, "don't we already have QSPI HDL?" - yeeees... but it's QSPI HDL that is specifically targetted and customised for *NOR FLASH*16:53
lkclnot for micro-sd cards, which take *radically* different command-sets16:53
openpowerbot[irc] <programmerjake> yeah, ok16:53
lkcleven just to answer the idea, that took me several minutes to explain how long it would take to do! :)16:54
openpowerbot[irc] <programmerjake> i knew that about the command sets differing...didn't think too hard about that suggestion16:54
lkclit's... that kind of innnsaaaane amount of low-level work16:54
lkclall needs testing, then integrating16:54
lkclwhen i was able to focus on these things i knew what i was getting myself in to, mostly because back in 2010 and 2003 i'd done reverse-engineering of ARM embedded hardware16:56
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@> has quit IRC16:56
openpowerbot[irc] <programmerjake> makes me wonder if linux supports bitbang spi to sdcards through gpio...if so all you need is gpio and linux handles the rest16:56
lkclincluding taking 8 weeks onec literally hunting for one bit needed to change a PLL's state to get it to wake up after it went into "sleep" mode16:56
lkclthere is an I2C driver that does that16:57
*** ghostmansd[m] <ghostmansd[m]!> has joined #libre-soc16:58
lkclit would be highly amusing to write a fuse userspace driver that bit-banged a full SD card stack in software :)16:58
lkclbut also extremely useful as it would be useable for unit tests16:58
openpowerbot[irc] <programmerjake> well, i'd be surprised if linux doesn't already have a driver that handles sdcards over a spi bus16:59
lkclit would be *even more* amusing to write it in nmigen HDL then cross-wire cocotb over to it!16:59
lkclprogrammerjake: they still need wiring up by specifying the IRQs, GPIOs and so on in linux kernel source code17:00
lkclthose GPIO pins don't magically connect themselves17:00
openpowerbot[irc] <programmerjake> spi doesn't need irqs...17:00
lkclit does if you want the "card detect insert/remove" line to work17:00
openpowerbot[irc] <programmerjake> unless you have special spi hw that isn't just bitbanging17:01
lkclwithout which you have risk of data corruption17:01
openpowerbot[irc] <programmerjake> just assume the sdcard is always there and figure that out later17:01
openpowerbot[irc] <programmerjake>
lkclplus a number of QSPI PHYs actually have *six* IRQs (!!!)17:01
openpowerbot[irc] <programmerjake>
openpowerbot[irc] <programmerjake> so it looks like gpio will be enough to get linux to use a sdcard...17:03
lkclthat just leaves the unit tests, device-tree configuration, finding the HDL side, and so on17:04
openpowerbot[irc] <programmerjake> yeah, yeah...can do that if we think it's worth it17:05
openpowerbot[irc] <programmerjake> imho gpio is useful anyway, so we'll eventually want it17:05
lkcland if the full analysis of the chain of tasks needed can fit into the available budget17:06
lkcli already added GPIO to ls2. i think. it's very basic. i can't properly remember, it was well over a year ago and i was in a hurry to get NGI POINTER completed alongside everything else17:07
*** markos_ <markos_!> has joined #libre-soc17:14
*** markos_ <markos_!~markos_@user/markos/x-1838887> has joined #libre-soc17:14
*** ghostmansd <ghostmansd!> has joined #libre-soc17:17
openpowerbot[irc] <programmerjake> well, your very basic gpio already has a linux driver:
openpowerbot[irc] <programmerjake> so all we'd need to make linux work with that is just the appropriate device tree config17:21
*** ghostmansd <ghostmansd!> has quit IRC17:21
*** ghostmansd <ghostmansd!> has joined #libre-soc17:43
ghostmansdHi folks! Since #995 is completed, I'd like to choose some other tasks. Preferably instructions-related. Any ideas?17:47
ghostmansdHm. What do we use to update task_db page?
ghostmansdIt still lists 1068 as "in progress"17:55
openpowerbot[irc] <programmerjake> luke has to manually run budget-sync (from utils.git), you can run it yourself to see what it would put on those pages17:58
ghostmansdI'm looking at 1054, 1056, 1063, 1089. I'm not sure about their state. 1063 should be resolved by now, but I'm unsure. The rest is unclear, what's the goal to be reached when these can be marked as done?17:58
openpowerbot[irc] <programmerjake> idk if you did the binutils parts of yet...17:59
openpowerbot[irc] <programmerjake> seems like something available to work on17:59
ghostmansd#1035: That's the first time I see these instructions... :-)18:00
openpowerbot[irc] <programmerjake> well, all you need is to ensure the svp64 versions of those work, the scalar insns should already be in binutils18:01
ghostmansd1079, 1083: also unclear. I've missed a lot on DD FFirst mode and LD/ST with EXTRA3.18:01
ghostmansdprogrammerjake, let me check. I guess this should fit 1003 niche, right?18:01
openpowerbot[irc] <programmerjake> no, 1035 is already a top-level task with budget assigned18:02
*** markos_ <markos_!~markos_@user/markos/x-1838887> has quit IRC18:03
openpowerbot[irc] <programmerjake> e.g. explicitly has budget set aside for you (or will when luke changes it to >0)18:03
openpowerbot[irc] <programmerjake> for the other insns in #1035, just create new subtask(s) for binutils support, luke can review and assign budget and give the go-ahead18:07
ghostmansdprogrammerjake: OK, I realized that's way too much to hold in one move. So I raised it on e-mail, including you and Luke.18:23
openpowerbot[irc] <sadoon[m]1> Just ran hello_world!18:33
openpowerbot[irc] <sadoon[m]1> THREADS=72 was a mistake heheheh18:34
openpowerbot[irc] <sadoon[m]1> 34 seconds to simulate on a single thread, impressive!18:39
*** markos_ <markos_!> has joined #libre-soc18:39
*** markos_ <markos_!~markos_@user/markos/x-1838887> has joined #libre-soc18:39
openpowerbot[irc] <sadoon[m]1> 29 seconds with 4 threads18:44
openpowerbot[irc] <programmerjake> nice!18:49
openpowerbot[irc] <programmerjake> luke, can you review and let me know if i can start work on it?18:51
openpowerbot[irc] <programmerjake> thx!18:51
openpowerbot[irc] <sadoon[m]1> THREADS=20 slows it down by half, looks like the sweet spot is somewhere between 4 and 20, time to find out18:52
openpowerbot[irc] <sadoon[m]1> I'll add this info in the wiki page as it seems useful for simulations18:53
octaviusThanks for doing that sadoon18:54
openpowerbot[irc] <sadoon[m]1> No probs :D I'm enjoying it18:55
octaviusIt will be interesting to see if the number you find works for the micropython and linux kernel examples18:55
octaviusMost I tested with was 11 threads18:55
openpowerbot[irc] <sadoon[m]1> So 8 threads still slows it down by a bit, 39 seconds total18:55
openpowerbot[irc] <sadoon[m]1> This is all on the talos 20 core btw18:55
openpowerbot[irc] <sadoon[m]1> Yep that's the next step!18:55
openpowerbot[irc] <programmerjake> i imagine the speedup greatly depends on which cpu you're running the simulation on18:55
openpowerbot[irc] <sadoon[m]1> I suspect my intel laptop will be quite a bit faster thanks to the modern architecture18:56
octaviusIndeed, but also, as Luke mentioned, verilator has its own limitations18:57
openpowerbot[irc] <sadoon[m]1> Also have you guys considered adding -jN to the makefile? it speeds up compilation of verilator by a LOT18:57
openpowerbot[irc] <sadoon[m]1> Of the core* in verilator18:57
octaviusLuke tends to be against -jN because it could overload your system18:57
octaviusWho knows what the user might be running while compiling?18:58
openpowerbot[irc] <sadoon[m]1> It'd be nice to at least have a makefile variable that's set to 1 by default18:58
openpowerbot[irc] <sadoon[m]1> So I don't have to do it 2 or 3 times :P18:58
openpowerbot[irc] <sadoon[m]1> Anyways, onto micropython18:58
octaviusThanks for doing this, good to know someone's running it as well18:59
openpowerbot[irc] <sadoon[m]1> Hey of course, dw about it18:59
openpowerbot[irc] <sadoon[m]1> Multiples pairs of eyes on code will help19:00
openpowerbot[irc] <sadoon[m]1> Multiple*19:00
openpowerbot[irc] <sadoon[m]1> 33 seconds to micropython on 8 threads19:01
openpowerbot[irc] <sadoon[m]1> 30 on one thread, 25 on 4 and 27 on 619:07
openpowerbot[irc] <sadoon[m]1> 26 on 2, 23 on 3!19:10
openpowerbot[irc] <sadoon[m]1> 3 is the sweetspot on micropython19:11
openpowerbot[irc] <programmerjake> i just use -j$(nproc)19:11
openpowerbot[irc] <sadoon[m]1> I would but I have other stuff running so -j72 uses 72/80 which is good enough19:11
openpowerbot[irc] <programmerjake> or use ninja or other programs that have the imo sane default of nproc19:12
openpowerbot[irc] <sadoon[m]1> Time to try linux19:13
octaviusI suggest you start with 3 threads sadoon19:23
openpowerbot[irc] <sadoon[m]1> Alright19:24
openpowerbot[irc] <sadoon[m]1> git cloning the kernel is taking a while, I'm gonna let this go overnight19:37
octaviusDont compile the kernel, just downloaded the compiled one from ftp19:39
octaviusPlease save that for another time19:39
octaviusIt's important to use the compiled one because we know it works19:39
octaviusLater you can compile and compare the two19:39
octaviussdram_init.bin you will need to compile though (in the microwatt repo, shouldn't take more than a few sec)19:40
openpowerbot[irc] <sadoon[m]1> Oh20:20
openpowerbot[irc] <sadoon[m]1> Alright then, was following the steps one by one that's why20:20
openpowerbot[irc] <sadoon[m]1> make: *** No rule to make target 'dtbImage.microwatt.hex', needed by 'microwatt.v'.  Stop.20:26
openpowerbot[irc] <sadoon[m]1> Nvm, need to change the name I guess20:27
openpowerbot[irc] <sadoon[m]1> No meeting today?20:40
octaviusAh yes, I just left that parameter as hello_world.bin that's why, need to update20:40
octaviusWe had one last week, didn't we>20:40
octaviusEventually will hit the right key...20:40
openpowerbot[irc] <sadoon[m]1> No it's actually dtbImage-microwatt.hex instead of $that but not .hex20:41
openpowerbot[irc] <sadoon[m]1> Yeah we did, forgot it is biweekly20:41
octaviusDuring hello_world compilation, the .hex file is created by a python script20:43
octaviushello_world.hex: hello_world.bin20:43
octavius../scripts/ $^ > $@20:43
openpowerbot[irc] <sadoon[m]1> Weird it just worked fine for me20:43
octaviusBut I seem to remember that the file you specify doesn't matter20:43
openpowerbot[irc] <sadoon[m]1> Yeah20:43
octaviusYou have to specify the file you want to load into memory when calling microwatt-verilator binary20:44
lkcltplaten tried building the buildroot created and used by joel shenki, and failed to reproduce it.20:44
openpowerbot[irc] <sadoon[m]1> Alright I'll leave it to simulate and go to bed20:44
openpowerbot[irc] <sadoon[m]1> Night everyone20:44
lkclmicropython should "just work" and get to a prompt within 20 seconds20:45
lkclthe amount of locking in the data structures inside verilator is *SO GREAT* that threads simply spend their entire time waiting for access to spinlocks.20:46
lkcloctavius, thrashing (any swap space usage) on my laptop is absolutely catastrophic.20:47
lkcladditionally there are people who build with only 16 GB of RAM on their laptop.20:47
lkcl*under no circumstances* are any of the build scripts or Makefiles to involve parallel make.20:48
octaviuslkcl, hehe, most of my computers have 16GB or RAM or less20:54
octaviusAlso updated the Linux section on the microwatt page a little sadoon.20:56
*** octavius <octavius!> has quit IRC21:48
*** gnucode <gnucode!~gnucode@user/jab> has joined #libre-soc22:17
*** gnucode <gnucode!~gnucode@user/jab> has quit IRC22:53
*** gnucode <gnucode!~gnucode@user/jab> has joined #libre-soc22:53
*** gnucode <gnucode!~gnucode@user/jab> has quit IRC23:40
*** gnucode <gnucode!~gnucode@user/jab> has joined #libre-soc23:41

Generated by 2.17.1 by Marius Gedminas - find it at!