Tuesday, 2021-08-17

lkclha, irony, for assuming that qemu would have addg6s. sigh10:07
richardwilbur[m]Do we know what coverage qemu has of POWER ISA?19:04
richardwilbur[m]Could I implement say addg6s and test against POWER HW?19:06
programmerjakeI'd assume qemu implements all the commonly used instructions...19:15
mwielgushello19:16
*** mwielgus is now known as mikolajw19:16
programmerjakerichard.wilbur yes, we have access to a Power9 server provided by Raptor, lkcl can give you a user account19:17
programmerjakemwielgus hi19:17
programmerjakerichard.wilbur if you know Rust, modify power-instruction-analyzer to add addg6s, cbcdtd, and cdtbcd.19:22
programmerjakefor an example, see https://git.libre-soc.org/?p=power-instruction-analyzer.git;a=commitdiff;h=de665083a9d36e6ed82890c23272c3c7c046ccbe;hp=50cab0eace9512917b46538ec2ee3fec350dc3a019:22
programmerjakeif you don't know/want to learn Rust, then you can probably find/write a different program for testing addg6s19:24
programmerjakepower-instruction-analyzer is a combined OpenPower instruction tester and reference implementation with Rust models for each instruction that can be called from Python19:29
programmerjakeallowing you to write the reference implementation and then develop the hardware to match it allowing development on a non-Power cpu (e.g. I do my development on x86-64).19:31
programmerjakethat's what we used to figure out the exact behavior of Power9 for the div/mod instructions, which aren't completely specified by the OpenPower spec19:32
richardwilbur[m]My dev env. is also presently x86-64.19:34
richardwilbur[m]I have nothing against learning Rust but expect to need both a good reference and probably some hand holding along the way.  I expect there’s example code for several other instructions.19:34
programmerjakeyes, lots of example code...19:34
richardwilbur[m]Are we running a source build of qemu or distro package?19:35
programmerjakeyou probably won't need to learn much Rust since addg6s, etc. are pretty simple19:35
programmerjakeidk, I just use qemu from debian (though I think I use a more recent version)19:36
mikolajwI'm interested in helping you with your project. I currently work as a hardware verification engineer in a company that designs silicon cores (basically I just do measurements and process the data). I'm also a developer of KiCad. I can currently contribute about 5 hours per week to the project, but this is likely to increase significantly in this year.19:37
programmerjakemikolajw welcome! introduce yourself on the mailing list https://lists.libre-soc.org/mailman/listinfo/libre-soc-dev19:39
richardwilbur[m]That’s good for the speed of implementing this but disappointing from the perspective of trying to learn a new language.  Enough to whet my appetite, I suppose.19:39
programmerjakewell, the parts of Rust you'll likely need for this aren't really the parts where Rust stands out from all the other programming languages19:40
programmerjakeinstall rust via https://rustup.rs/19:41
programmerjakeyou'll need a nightly version since inline assembly has not been stabilized yet19:41
programmerjakea significant way rust differs from C for bit-manipulation is the `!` operator means bitwise-not for integers -- Rust doesn't need to disambiguate `~` vs. `!` since it has a separate bool type19:44
programmerjakeyou'll want to use the `overflowing_add` and/or `wrapping_add` methods: https://doc.rust-lang.org/std/primitive.u64.html#method.overflowing_add19:46
programmerjakehttps://doc.rust-lang.org/std/primitive.u64.html#method.wrapping_add19:46
programmerjakelet me know if you need help, or you can ask on the rust users forum (they're very friendly): https://users.rust-lang.org/19:54
programmerjaketo run the native instruction tests, run gen-output.sh19:59
programmerjakeit'll create a json file with all inputs/outputs and will output `model_mismatch` fields where they don't match20:01
richardwilbur[m]Thanks for the pointers.  I’ve almost got my wife’s laptop back together.  Had to mostly disassemble it to replace the DC Power input daughter card (on which the broken power jack was soldered).20:03
programmerjakefun...20:04
programmerjakeI had to fix a laptop where the dc power input jack broke off the mobo, soldered a jumper across the cracked mobo20:04
programmerjakeit only sorta worked20:05
richardwilbur[m]My youngest brother and his family are stopping by this afternoon and staying the night.  So I’ll be preoccupied till tomorrow after they leave.20:06
programmerjakeok, have fun!20:06
lkclmikolajw, hi, welcome, fantastic to hear20:18
lkclif you know kicad, you're almost certainly also know gate-level design, which is hugely useful in this project. do you know python as well?20:19
lkclif not, there's a series of gate diagrams on the wiki which need converting to SVG - veera is currently doing some of them20:23
lkclthere's all sorts of small things that need doing20:24
mikolajwlkcl: yes, I use Python everyday20:41
lkclmikolajw, ah fantastic, because the HDL - and all the unit tests - are in python20:48
lkclyes, really: HDL in python. we use something called nmigen (has its own IRC channel here on libera.chat)20:49
mikolajwyes, that sounds cool. In fact that was what exactly piqued my interest to this project when I read about it on Wikipedia for the first time20:50
lkclnice20:51
lkclyou'll like this: i learned recently that the nmigen HDL gate-level simulator actually translates the Abstract Syntax Tree into a python program, in ASCII...20:52
lkclthen hands it to exec() and then compile()!20:52
lkclyou end up with an in-memory function which can be called to execute the combinatorial logic circuit :)20:52
lkcli mean, i've done that sort of thing myself before, for expression evaluation in a website, but... dang20:53
mikolajwso a computer simulation can be performed easily as I understand20:56
lkclyes.20:58
mikolajwwhen I was a university student I had a HDL class (Verilog) during which we wrote a VGA driver (from instructions) and then students had to make their own video games in Verilog (not from instructions)20:58
lkclif you're used to circuits (and thinking about how to test them) then that's basically what it helps with20:58
lkclnice20:58
mikolajwwe used Vivado. One of the more unpleasant parts was that the final part of the implementation (I don't remember the terminology, I mean the part where you turn it into an actual FPGA program) took a significant amount of time20:59
mikolajw"FPGA program"20:59
lkclwell it's a lot simpler to think about in terms of classes and objects than it is to think in a programming language designed in the early 90s, which has reminiscent hints of BASIC and PASCAL... :)20:59
lkclyyeah, well, compiling libre-soc for an ECP5 (using yosys and nextpnr-ecp5) still takes... mmm.... 8-10 minutes?21:00
lkclit's not "short" but it's not completely mad, either21:00
lkcldo you have an FPGA board at all?21:00
mikolajwI don't anymore21:00
mikolajwbut I can buy21:00
mikolajwbut you said it is turned into an actual Python program -- can this be done to speed up testing?21:01
programmerjakewell, when I had a similar project for a digital design class, I built a RV32I cpu: https://github.com/programmerjake/rv3221:01
lkclyes, definitely21:01
lkcli love how that only took you what... 2 weeks?21:02
lkclok by "speed up", this is relative :)21:02
lkclwe actually only execute about 3-6 instructions per unit test, some even less than that21:02
lkclit's just that there's hundreds (thousands) of them21:03
lkclwe need a test for add, a test for addi, a test for cmp, a test for cmpl, a test for cmpi, a test for bc, ld, lw, lwz, popcnt, etc. etc. etc. etc.21:03
lkclit's actually very boring :)21:04
lkclbut, it's essential work21:04
lkcland creates a solid foundation, you know what i mean21:04
lkclif you're interested in learning nmigen, here's some starting points: https://nmigen.info/nmigen/latest/tutorial.html21:05
lkclrobert baruch's one is one of the best21:05
lkclplease do install from latest git, don't use 'pip install nmigen', though.21:06
lkclif you want to be lazy but also install the libre-soc HDL, use this21:06
lkclhttps://libre-soc.org/HDL_workflow/devscripts/21:06
lkclyou will end up with all the dependencies21:07
lkclprogrammerjake: i did a comparative video of SVP64 Vertical-First and Horizontal-First Mode for you, i've got to upload it.21:08
lkclas i was going through it i realised it still needs thought21:08
programmerjakeneat!21:09
lkclcesar: nicely done with the ldst exceptions21:10
lkcltobias is fixing some things with dcbz as well21:10
programmerjakeI'm pretty sure I understand them...sorta like you understand how a compiler works but it is still more complex/confusing than table lookup21:11
mikolajwok, I'll play with the toolchain and hopefully I'll be able to contribute within the following weeks21:12
programmerjakethe video will probably be useful for others too21:12
lkclmikolajw, cool. one thing i recommend doing:21:12
lkcl* get nmigen to compile to verilog (or ilang)21:12
lkcl* run yosys21:12
lkcl* type "read_verilog {file.v}" or "read_ilang {file.il}"21:12
lkclthen type "show top"21:13
lkclor "show {press tab twice}" and select a module (one of which _should_ be named "top")21:13
lkclyou need graphviz and xdot installed for that to work btw21:13
lkclwhat you get is a *graphical 2D* gate-level representation of the HDL21:13
lkcli was LITERALLY incapable of understanding nmigen HDL without seeing the gate-level design21:14
lkcli had to run "show top" after every single edit, for about 2-3 months.21:14
lkclafter 6 months i didn't need to do it any more, but until i had that "brain understanding" of the link between the HDL and the logic connections, i was wasting my time!21:15
lkclsome people can make the connection instantly, others can't [couldn't, including me].21:16
mikolajwdo you refer to Nmigen HDL specifically or HDL in general?21:16
lkclif you're struggling with nmigen, because you've used KiCAD, you may find "show top" to be really useful21:16
lkclwell, actually, yes, it could well be21:16
lkclbut surprisingly, i find verilog to be readable.  i don't _like_ it, but it's readable :)21:17
lkclnmigen on the other hand, i just couldn't mentally cross-associate the python code with the gates21:17
lkcland i've been using python since 1999/2000 :)21:17
programmerjakeI am one of the make-the-connection-instantly people, maybe because of my experience with writing compilers?21:18
lkclyehyeh, if you're used to ASTs that makes a lot of sense21:18
lkclrichardwilbur[m], jn, klys, lxo meeting!23:31

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