Tuesday, 2021-09-07

lkclkylel, awesome, go for it.. ah yes sorry00:17
lkclavl, let me just add things to the bugreport00:18
lkclkylel, i've added you to openpower-isa and soc00:19
lkclavl: git.libre-soc.org binutils repo00:20
lkclavl: ok, so basically, sv/trans/svp64.py *already* supports the assembly syntax needed, but, go figure, it's in python00:24
lkclhttps://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py;h=45b292b4c4c32bbff548f2bf299235633d31db6c;hb=HEAD#l105200:24
lkclyou can see a couple of instances where i've added workarounds for instructions that don't even exist in Power ISA v3.0B00:24
lkclconverting them to .long XXXXXX; .long YYYYYY;00:25
lkclhttps://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py;h=45b292b4c4c32bbff548f2bf299235633d31db6c;hb=HEAD#l105200:25
lkclthe critical thing to note: that program relies heavily on the CSV-parsing-system, "svanalysis.py"00:26
lkclhttps://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/sv_analysis.py;hb=HEAD00:26
lkclit is *really important* not to hand-create the information created by that file00:26
lkclbut00:27
lkclfor a first (one, single) instruction just to see what the c and header files should look like00:27
lkclit's probably a good idea to do just *one* svp64 instruction, entirely without sv_analysis.py00:28
lkclby the time you add 2 instructions, you'll be going, "ok, this is regular and obvious now, i see how it can be auto-generated"00:28
lkclif you experiment with sv/trans/svp64.py it already creates the required output, and you can see i have been experimenting with multiple listings, towards the end of the file, and inspecting the binary and hex output by hand00:30
lkclkylel, i should have given you write perms several days ago, the general rule is, "if it's not in use commit it anyway, if it is in use do incremental development and test the hell out of it"00:45
lkclto save time you can optimise that by analysing how far down the code-hierarchy the change is.00:46
lkclif it's close to a leaf node it needs only a few unit tests00:46
lkclif it's low-level it needs aaaalll of theeeem00:46
lkclbut00:46
lkclthat takes so long, that there's _another_ rule/heuristic: run *smaller* (shorter) tests, make sure those work00:47
lkclthen if those pass run longer ones00:47
lkclwhat you're doing, i *deliberately* chose to give you because there's zero dependence - at all. it's a full "leaf-node".00:48
lkclso you can commit as often as you like.00:48
lkclthat has the advantage that we can check it and make sure you're on the right track00:48
kylelAh sorry, it was my fault.  SSH issue with git...took me a bit to figure it out. Thank you.02:21
kylelI used nearly all from the test_case that was there and added some of my own to test some interesting cases and for my own edification02:29
lkclkylel, looks great11:06
* lkcl going through it...11:08
lkcltest_0_proof_regression_rlwnm doesn't have an assert to test its effect11:09
lkcli removed run_tst and used the version from test_runner.py (that's why it's there, so there's not 2x 3x 4x 5x 9x duplicated code)11:10
kylelgood to hear12:14
*** kylel1 is now known as kylel12:27
lkclkylel, would you like to add an assert checking the value produced by test-0_proof_regression_rlwnm?12:30
kylelOh sure I'll add it.12:31
lkclare you happpy to work (incrementally) towards being able to run these exact same tests on the soc HDL?12:32
lkclthe first step on that would be to produce an "expected results" class12:33
lkclor a "some-sort-of-current-state" class.12:33
kylelhappy as a clam12:33
lkcl:)12:34
lkclthere's a couple of functions in soc, called check_regs and check_sim_memory12:34
lkclthese are basically part of what needs to be gener-i-fied12:35
lkclhttps://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/simple/test/test_core.py;h=a35545024e23ba05a8ad71ac96e2500e0c5b4612;hb=75bdc1747f32a4fb6cf848ed8b5c68ef2f683f4c#l14712:35
lkclyou can see it's used here:12:38
lkclhttps://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/simple/test/test_runner.py;h=1d792fe51b6094a4172deb35e05c8b39f3b599f9;hb=75bdc1747f32a4fb6cf848ed8b5c68ef2f683f4c#l29812:38
lkclit should be possible, at the end of the run, to also check against the "expected regs" of test_caller_shift_rot.py12:38
lkclwhich, if you look at this12:40
lkclhttps://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/test_caller_svp64.py;h=0265b2ae9caadc713695430441ba39b5f1c9fbed;hb=6e43a194f3d07ed5a8daa297187a32746c4c4d3c#l2112:40
lkclyou can see i started, with _check_regs, a "very basic" version of that12:40
lkclso12:41
lkclall the explicit self.assertEqual() testing, it all goes12:41
lkclreplaced with one single call to check_regs12:41
lkclthere's an advantage to this approach:12:41
lkclbecause you are comparing the *entire* GPRs, it catches the (unlikely) instance where an instruction modifies registers it should *NOT* have modified12:42
kylellooking through links...12:46
kylelok...so expected is or should come from check_regs?12:52
lkclexpected is handed *to* check_regs12:57
kyleloh yeah sorry twas thinking backwards on that.12:57
lkclthe "final" (target) version should receive the *entire* reg state - GPRs, FPRs, SPRs, XER, CR, everything12:58
lkcljuuuust like you can see in the test_core.py version12:58
lkclbasically all of the "checking" code needs to morph into being the exact same format12:58
lkclcalling the exact same function12:59
lkcldoing the exact same job12:59
lkclwhilst retaining full functionality at all time and passing all current unit tests at all times12:59
lkclso for example, in test_core.py, you can see that *that* version of check_regs is different from the fledgeling one(s) being used in openpower-isa13:00
lkclbecause the test_core.py version actually does two jobs:13:00
lkcl1) extracts register values from an HDL instance13:01
lkcl2) ***THEN*** does the actual checking13:01
lkclguess what the first migration-step / code-morph would be?13:01
lkclbtw can you raise a bugreport about this one? or look for an existing one (i'll search as well)13:02
* lkcl can't find one but did find this, which it should link to https://bugs.libre-soc.org/show_bug.cgi?id=24213:03
kylelbrain turning...13:07
kylelor churninig13:07
kyleljust imagining the what the final outcome should be or look like from a class perspective13:12
lkclthat's indeed part of what needs to be designed13:18
kylelSo as far the asserting goes...it will basically come down to one call that compares all the registers13:19
lkclits purpose will be to check - compare - the "state" of two "things"13:19
lkclall the registers13:19
lkcland13:19
lkclall the memory13:19
lkclor, if requested, a subset of memory locations (optional argument)13:19
lkclthe class itself should *not* actually *contain* state13:19
lkclit should take two things *containing* state13:20
lkclthus, that pretty much defines the API, as a *cross-interaction* between two classes13:20
lkcl1) the checker13:20
lkcl2) the thing(s) being checked13:20
lkclwhich is so brain-dead simple it's why they're currently done as functions13:21
lkclmeaning: if you really wanted to make a class out of it, it would actually be static member functions13:21
lkclbecause under no circumstances should there be any "state" in the actual checker itself13:22
lkclunless.... unless you want to pass in a "dut" (device-under-test)13:22
lkclwhich you would store in the class self.dut13:22
lkclthen call self.dut.AssertEqual(thing1.register1, thing2.register2)13:23
lkcland13:23
lkclself.dut.AssertEqual(thing1.memorylocation1, thing2.memorylocation1)13:23
kylelstill processing...13:33
lkclok can you first raise the bugreport, "create Power ISA test API" and cross-reference the irclog here13:36
lkclhttps://libre-soc.org/irclog/%23libre-soc.2021-09-07.log.html#t2021-09-07T00:17:5413:36
kylelsure13:38
kylelhttps://bugs.libre-soc.org/show_bug.cgi?id=68613:50
lkclkylel, updated, can we carry on the conversation there, i have to jump up and use a different computer otherwise :)14:37
lkclhttps://bugs.libre-soc.org/show_bug.cgi?id=686#c314:49
kylelunderstood, thank you17:03
richardwilbur[m]Interesting news:17:51
richardwilbur[m]https://www.nbcnews.com/news/latino/el-salvador-adopts-bitcoin-official-currency-first-country-rcna191017:51
lkclrichardwilbur[m], intriguing17:59
programmerjakeinteresting...I heard about that like a month ago when the law was originally made18:31
Las[m]Considering that they were previously using USD, pretty much anything else is better lol22:26
Las[m]Great move economically though, will likely make the country a hub for cryptocurrency-related companies22:26
lkcli'm not entirely sure why they think using BTC to "save bank fees" is a good idea22:26
lkcl4 years ago the bitcoin conference was cancelled because the cost of mining a payment was DOUBLE the cost of the conference itself22:27
Las[m]lkcl: BTW: the commands listed on https://libre-soc.org/HDL_workflow/coriolis2/ don't actually work on a fresh Debian 10 installation22:28
Las[m]Get a bunch of errors, like `E: std::bad_alloc` and `E: You must put some 'source' URIs in your sources.list`22:29
lkclLas[m], sigh. yes, i thought that might happen - i tried changing it to not modify (as root) your /etc/fstab file, and clearly screwed that up.22:30
lkcli'll deal with that tomorrow (not at 22:30 hrs)22:30
Las[m]Thanks!22:31
lkclmeeting 15m22:44
lkcllxo cesar programmerjake jn klys22:44

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