Tuesday, 2022-04-12

ghostmansd[m]A quick question: can we, like vanilla PPC, have optional operands?10:16
ghostmansd[m]If not, this would greatly simplify the parsing. PPC code is a gory mess in this part.10:20
lkclno there's no optional operands10:35
lkclbut there are "aliases"10:35
lkclso there is no instruction mtlr r510:36
lkclbecause it is an alias for "mtspr 8, r5" (LR = SPR number 8)10:36
ghostmansd[m]Good, so count of operands is always fixed, right?10:37
lkclfor now, it would be reasonable to assume that aliases are not supported (or done at a later stage)10:37
lkclyes10:37
ghostmansd[m]A perfect design choice!10:38
lkcla trick there maaaay be to perform a dumb parsing phase, working on the alias to substitute the [missing, non-optional] operands10:38
lkclnone of the examples - anywhere - use aliases, at all.  not the svp64 openpower-isa repo ones, and not the v3.0B ones either10:39
ghostmansd[m]Well, unlike PPC, I _do_ decouple functions10:39
lkcljoy10:39
ghostmansd[m]So we can re-use the code which parses the registers10:40
ghostmansd[m]Unlike they who put every single shitty bit into md_assemble10:40
lkcland do alias substitution10:40
ghostmansd[m]Yep, exactly10:40
lkclwell i'm assuming they thought that a hash-table would make it ok10:41
ghostmansd[m]hash table is OK, it's the parsing code which sucks :-)10:41
ghostmansd[m]The function is almost 1000 lines long10:42
lkclye frickin gods10:44
ghostmansd[m]Just in case: we _do_ have the same count of operands for sv-extended insns as non-extended have at most, right? For example, "dcbf" has at most 3 operands, so "sv.dcbf." always has 3, right?13:04
lkclthat's a fundamental and absolute inviolate requirement13:05
ghostmansd[m]Perfect13:05
lkclprefixing is fundamentally independent from the suffix13:05
lkcllike x86 REP instruction13:05
lkcli broke that rule once, just to see how bad it would be13:05
lkclit was... bad13:05
ghostmansd[m]:-D13:05
lkclthat's the LD-with-RC-taking-some-of-its-bits-from-the-immediate-to-use-as-a-shift-parameter13:06
lkclwhich when i have time i will stamp on with prejudice and much glee13:06
lkcland relief13:06
lkclyou asked "what's this all about" a couple days ago and i said "please ignore it"13:07
lkclhttps://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py;h=65aa1768fc2cff1a615bbd27c33babdb1a96099b;hb=de70844521d6b6e88e380c729f8384971803454d#l35513:07
lkclall of that has to die, die, die13:07
lkclthe *right* way to do that is for it to be added to Power ISA v3.0 first13:08
ghostmansd[m]So this will go through the committee?13:14
lkclit requires a proposal to be written, and submitted as an RFC.13:14
ghostmansd[m]Aha, got it13:14
ghostmansd[m]Thank you so much for explanation!13:14
lkclhttps://openpowerfoundation.org/groups/isa/13:15
ghostmansd[m]It's always great to know the details like this13:15
lkclyehyeh totally, gives some context13:15
lkclguess the size SVP64 specification?13:15
lkclguess how many pages13:16
lkclgo on, have a guess :)13:17
ghostmansd[m]Well, this must be much smaller than OpenPOWER15:51
ghostmansd[m](unless we have to copy that one)15:51
ghostmansd[m]Considering how many pages there are in PPC... 1000, 1500...15:52
ghostmansd[m]I'd bet less than 100 pages?15:52
lkclaround 120-150.  it's over 10,000 words16:34
lkcllkcl@fizzy:~/src/libresoc/libresoc/openpower/sv$ find . -name "*.mdwn" | xargs wc16:34
lkcl 10962  74439 491949 total16:34
ghostmansd[m]Still really good.16:41
ghostmansd[m]One of things why I like C is because the specs and many books are simple16:41
ghostmansd[m]I mean, compared to many other languages16:42
programmerjakesimple...like: "if you stray off this very-specific path everything is UB...have fun with that!"16:44
programmerjakepart of why I prefer Rust16:45
programmerjake...not that rust has a particularly short spec...currently the spec is not fully elaborated...so it effectively boils down to whatever stable rustc does + misc. safety fixes16:50
ghostmansd[m]That's not the simplicity I meant17:03
ghostmansd[m]Anyway, I feel no desire to start yet another holy war :-)17:04
ghostmansd[m]lkcl, refactored operands parsing in svp64 binutils, looks really cool17:04
lkclmaaagic, hm must take a look17:05
ghostmansd[m]And now we are able to detect the exact type of each and every operand17:05
ghostmansd[m]The next step is to drop that custom mapping for GPR/FPR/etc.17:05
* lkcl twitches, no code-comments17:05
lkclghostmansd[m], this little tick, in my eye, is twitching uncontrollably... :)17:06
ghostmansd[m]What do you mean? :-)17:06
ghostmansd[m]Sorry, I don't quite get what you mean by twitching :-)17:07
lkclno code-comments *twitch*17:07
lkclah this was what i was referring to that isn't going to go in the spec17:07
lkclhttps://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=gas/config/tc-ppc-svp64.c;h=a5444ff440d70a5a8c60b782eb8ee4199f982a21;hb=0c3cd699a0b3041f7f80caf49fcbb1ab03c086a2#l22517:07
lkclsvp64->ldst_shift - that should be removed.17:08
lkclsats, satu, all good...17:09
lkclnice!17:10
lkclhttps://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=gas/config/tc-ppc-svp64.c;h=a5444ff440d70a5a8c60b782eb8ee4199f982a21;hb=0c3cd699a0b3041f7f80caf49fcbb1ab03c086a2#l77017:10
lkclbit of a pig that the ld/st has to be identified in that horrible way, but hey17:11
programmerjake> That's not the simplicity I meant17:11
programmerjakeyeah, I know, just imho it's a major flaw in the C/C++ specs...17:11
lkclah.17:12
lkclghostmansd[m], the bits for the "modes" are different depending on which type is detected17:12
lkcl* normal-mode has its own set of bits17:13
lkcl* ldst-mode has its own set17:13
lkcl* branch-mode has another set17:13
lkcl* cr_ops-mode another17:13
lkclannoyingly, for example, SZ is *not* in the same place for all those 4 modes17:13
programmerjakeone thing the assembly parser should handle at some point is `1<<r3` having spaces in it and/or different capitalization...idk if you got it to already handle that17:13
lkclnot in the least :)17:14
lkclthis is waaay early days17:14
ghostmansd[m]lkcl, could you, please, refer to svp64.py with these bits?17:15
lkclwilldo, 1 sec...17:15
ghostmansd[m]All but recent parts were done mostly by looking at svp64.py, sometimes it's a literal translation17:16
lkclhttps://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py;hb=HEAD#l84717:16
ghostmansd[m]But I could misunderstand the thing17:16
lkclmmmm yeah, ok, it's all good17:17
ghostmansd[m]Ah, this17:17
ghostmansd[m]This follows after parsing17:17
ghostmansd[m]There's "post-parsing" stage17:17
ghostmansd[m]1 sec...17:17
ghostmansd[m]svp64_canonicalize17:17
lkcli haven't looked at this in 6+ months so i may find, after looking at it, that i've actually been "sane and sensible" and properly matched things up17:17
lkcl(!)17:17
lkclwhich iirc took frickin forever17:17
ghostmansd[m](name's dumb, I know)17:18
ghostmansd[m]That's OK :-)17:18
ghostmansd[m]TBH it took me damn lot of time to even recall what I did17:18
ghostmansd[m]And it was not even close to 6+ months17:18
lkcl:)17:18
ghostmansd[m]I'll rebase the branch and drop or squash some commits17:19
ghostmansd[m]Because some commits are crap, and some should be better organized17:19
ghostmansd[m]Beware!17:19
lkcl2 formats that are not included yet in svp64.py - cr_ops and branches17:20
lkcli'm just going to add links to the top of svp64.py now...17:20
ghostmansd[m]I think even with binutils support it'd be great to update svp64.py eventually17:21
lkclyehyeh17:22
ghostmansd[m]And that'd better be you, I'm terrible at reading specs17:22
lkclah, i *do* have the branches (beginnings of it, anyway) started https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py;hb=HEAD#l83917:22
ghostmansd[m]But at least as they say even a monkey can be taught to write code, so here I am17:22
lkclhaha17:23
lkclghostmansd[m], ok there we go https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py;hb=HEAD#l84417:32
lkclso you can see, in both LD/ST and "normal", i did, it seems, actually go to the trouble of making sure that the bits with same names do actually line up17:33
lkclsz is always bit 4, dz always bit 317:34
lkclno matter if it's LD/ST-mode or Normal-Arithmetic-mode17:34
ghostmansd[m]Out of curiosity, why did you change double with dbl? :-)17:51
lkcl80-char limit17:51
ghostmansd[m]Ah, OK17:51
ghostmansd[m]I'm somewhat more liberal in such cases :-)17:52
lkclthis helps illustrate why17:52
lkclhttps://libre-soc.org/HDL_workflow/2020-01-24_11-56.png17:52
lkcli have memory-recall issues and a strange type of dyslexia17:54
lkclmeans i have to have everything that's context-related on-screen, simultaneously17:54
ghostmansd[m]For me the effect would be contrary, I'd simply be lost :-)17:55
lkcljobs | grep "keyword" helps with that17:55
lkcl"fg 120" is not uncommon :)17:55
lkclps auxww | grep "vim" | wc17:56
lkclthe record is 1540, after 300 days17:56
lkclsomething really frickin weird going on with the simulations when programs are moved to address 0xFF00_000017:58
lkclahh damnit, st-with-update is borked18:07
lkclwhat the hell18:08
lkcli have a sudden urge for no good reason i can explain for fish fingers, peas, and mash potato18:22
lkcl:)18:22
* lkcl going shopping18:22
ghostmansd[m]Bene sapiat!18:30
Veera[m]lkcl: TypeError: Object (rec <unnamed> st_data_i st_data_i_ok) cannot be used as a key in value collections18:55
Veera[m]make: *** [Makefile:63: microwatt_external_core] Error 118:55
Veera[m]lkcl: What can be done18:56
lkclVeera[m], you have the wrong source code19:00
lkclpip3 has downloaded s***19:00
lkclyou will find nmigen 0.2 from the internet has been randomly downloaded19:00
lkcland installed without your consent19:00
Veera[m]I remember nmigen being installed from pip19:01
Veera[m]so what should be done19:01
Veera[m]how to prevent pip from installing nmigen19:01
Veera[m]ah. I did python setup.py develop in nmigen git source and now it compiles successfully. thanks luke!19:09
tplatenI got the uart working on tplaten_3d_game, so I hope I will be able to run the 3d game on libre-soc on the orangecrab before Easter19:10
lkcltplaten, great20:00
lkclVeera[m], yeah i know it's annoying. we need control over the pypi packaging but it's currently cyber-squatted20:01
lkclmeeting in 2hr (21:00 UTC) jn cesar octavius sadoon[m] toshywoshy lxo programmerjake markos anyone else who'd like to20:12
Veera[m]lkcl:  successfully compiled ls2 microwatt (hello_world) bitstream!20:48
Veera[m]lkcl: logged on to uoregon server20:49
Veera[m]but could not find out ls2 directory20:49
Veera[m]neither xc3sprog binary20:50
Veera[m]tried sudo bash; su - coriolis2; there is no src/ls2 dir20:50
lkclVeera: once su - coriolis2, then do "schroot -c nextpnr-xilinx"21:37
lkclin future, use updatedb and locate21:37
lkcl(nextpnr-xilinx)root@silicon:/home/coriolis2/src# ls21:37
lkclc4m-jtag    lambdasoc       nmigen-soc     sphinxcontrib-verilog-diagrams21:37
lkclethmac      ls2             nmigen-stdio   tercel-qspi21:37
lkclgram        nextpnr-xilinx  nmutil         uart1655021:37
lkclhdl_tools   nmigen          openpower-isa  xc3sprog21:38
lkclieee754fpu  nmigen-boards   soc21:38
lkclyou can see there i've run at least 3 of the dev-env-setup scripts21:38
lkclbut, don't break that schroot :)21:41
lkcluse it as a template to look at21:42
lkclwhen creating an entirely new one, from scratch21:42
Veera[m]ok won't break that schroot21:44
Veera[m]just did "schroot -c nextpnr-xilinx" and can access it21:45
lkclexcellent21:49
lkclmeeting cesar toshywoshy programmerjake lxo jn sadoon_albader[m octavius rsc markos21:50
lkclmoved 1hr early, remember :)21:56

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