lkcl | kylel, awesome, go for it.. ah yes sorry | 00:17 |
---|---|---|
lkcl | avl, let me just add things to the bugreport | 00:18 |
lkcl | kylel, i've added you to openpower-isa and soc | 00:19 |
lkcl | avl: git.libre-soc.org binutils repo | 00:20 |
lkcl | avl: ok, so basically, sv/trans/svp64.py *already* supports the assembly syntax needed, but, go figure, it's in python | 00:24 |
lkcl | https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py;h=45b292b4c4c32bbff548f2bf299235633d31db6c;hb=HEAD#l1052 | 00:24 |
lkcl | you can see a couple of instances where i've added workarounds for instructions that don't even exist in Power ISA v3.0B | 00:24 |
lkcl | converting them to .long XXXXXX; .long YYYYYY; | 00:25 |
lkcl | https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py;h=45b292b4c4c32bbff548f2bf299235633d31db6c;hb=HEAD#l1052 | 00:25 |
lkcl | the critical thing to note: that program relies heavily on the CSV-parsing-system, "svanalysis.py" | 00:26 |
lkcl | https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/sv_analysis.py;hb=HEAD | 00:26 |
lkcl | it is *really important* not to hand-create the information created by that file | 00:26 |
lkcl | but | 00:27 |
lkcl | for a first (one, single) instruction just to see what the c and header files should look like | 00:27 |
lkcl | it's probably a good idea to do just *one* svp64 instruction, entirely without sv_analysis.py | 00:28 |
lkcl | by 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 |
lkcl | if 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 hand | 00:30 |
lkcl | kylel, 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 |
lkcl | to save time you can optimise that by analysing how far down the code-hierarchy the change is. | 00:46 |
lkcl | if it's close to a leaf node it needs only a few unit tests | 00:46 |
lkcl | if it's low-level it needs aaaalll of theeeem | 00:46 |
lkcl | but | 00:46 |
lkcl | that takes so long, that there's _another_ rule/heuristic: run *smaller* (shorter) tests, make sure those work | 00:47 |
lkcl | then if those pass run longer ones | 00:47 |
lkcl | what you're doing, i *deliberately* chose to give you because there's zero dependence - at all. it's a full "leaf-node". | 00:48 |
lkcl | so you can commit as often as you like. | 00:48 |
lkcl | that has the advantage that we can check it and make sure you're on the right track | 00:48 |
kylel | Ah sorry, it was my fault. SSH issue with git...took me a bit to figure it out. Thank you. | 02:21 |
kylel | I 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 edification | 02:29 |
lkcl | kylel, looks great | 11:06 |
* lkcl going through it... | 11:08 | |
lkcl | test_0_proof_regression_rlwnm doesn't have an assert to test its effect | 11:09 |
lkcl | i 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 |
kylel | good to hear | 12:14 |
*** kylel1 is now known as kylel | 12:27 | |
lkcl | kylel, would you like to add an assert checking the value produced by test-0_proof_regression_rlwnm? | 12:30 |
kylel | Oh sure I'll add it. | 12:31 |
lkcl | are you happpy to work (incrementally) towards being able to run these exact same tests on the soc HDL? | 12:32 |
lkcl | the first step on that would be to produce an "expected results" class | 12:33 |
lkcl | or a "some-sort-of-current-state" class. | 12:33 |
kylel | happy as a clam | 12:33 |
lkcl | :) | 12:34 |
lkcl | there's a couple of functions in soc, called check_regs and check_sim_memory | 12:34 |
lkcl | these are basically part of what needs to be gener-i-fied | 12:35 |
lkcl | https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/simple/test/test_core.py;h=a35545024e23ba05a8ad71ac96e2500e0c5b4612;hb=75bdc1747f32a4fb6cf848ed8b5c68ef2f683f4c#l147 | 12:35 |
lkcl | you can see it's used here: | 12:38 |
lkcl | https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/simple/test/test_runner.py;h=1d792fe51b6094a4172deb35e05c8b39f3b599f9;hb=75bdc1747f32a4fb6cf848ed8b5c68ef2f683f4c#l298 | 12:38 |
lkcl | it should be possible, at the end of the run, to also check against the "expected regs" of test_caller_shift_rot.py | 12:38 |
lkcl | which, if you look at this | 12:40 |
lkcl | https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/test_caller_svp64.py;h=0265b2ae9caadc713695430441ba39b5f1c9fbed;hb=6e43a194f3d07ed5a8daa297187a32746c4c4d3c#l21 | 12:40 |
lkcl | you can see i started, with _check_regs, a "very basic" version of that | 12:40 |
lkcl | so | 12:41 |
lkcl | all the explicit self.assertEqual() testing, it all goes | 12:41 |
lkcl | replaced with one single call to check_regs | 12:41 |
lkcl | there's an advantage to this approach: | 12:41 |
lkcl | because you are comparing the *entire* GPRs, it catches the (unlikely) instance where an instruction modifies registers it should *NOT* have modified | 12:42 |
kylel | looking through links... | 12:46 |
kylel | ok...so expected is or should come from check_regs? | 12:52 |
lkcl | expected is handed *to* check_regs | 12:57 |
kylel | oh yeah sorry twas thinking backwards on that. | 12:57 |
lkcl | the "final" (target) version should receive the *entire* reg state - GPRs, FPRs, SPRs, XER, CR, everything | 12:58 |
lkcl | juuuust like you can see in the test_core.py version | 12:58 |
lkcl | basically all of the "checking" code needs to morph into being the exact same format | 12:58 |
lkcl | calling the exact same function | 12:59 |
lkcl | doing the exact same job | 12:59 |
lkcl | whilst retaining full functionality at all time and passing all current unit tests at all times | 12:59 |
lkcl | so 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-isa | 13:00 |
lkcl | because the test_core.py version actually does two jobs: | 13:00 |
lkcl | 1) extracts register values from an HDL instance | 13:01 |
lkcl | 2) ***THEN*** does the actual checking | 13:01 |
lkcl | guess what the first migration-step / code-morph would be? | 13:01 |
lkcl | btw 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=242 | 13:03 | |
kylel | brain turning... | 13:07 |
kylel | or churninig | 13:07 |
kylel | just imagining the what the final outcome should be or look like from a class perspective | 13:12 |
lkcl | that's indeed part of what needs to be designed | 13:18 |
kylel | So as far the asserting goes...it will basically come down to one call that compares all the registers | 13:19 |
lkcl | its purpose will be to check - compare - the "state" of two "things" | 13:19 |
lkcl | all the registers | 13:19 |
lkcl | and | 13:19 |
lkcl | all the memory | 13:19 |
lkcl | or, if requested, a subset of memory locations (optional argument) | 13:19 |
lkcl | the class itself should *not* actually *contain* state | 13:19 |
lkcl | it should take two things *containing* state | 13:20 |
lkcl | thus, that pretty much defines the API, as a *cross-interaction* between two classes | 13:20 |
lkcl | 1) the checker | 13:20 |
lkcl | 2) the thing(s) being checked | 13:20 |
lkcl | which is so brain-dead simple it's why they're currently done as functions | 13:21 |
lkcl | meaning: if you really wanted to make a class out of it, it would actually be static member functions | 13:21 |
lkcl | because under no circumstances should there be any "state" in the actual checker itself | 13:22 |
lkcl | unless.... unless you want to pass in a "dut" (device-under-test) | 13:22 |
lkcl | which you would store in the class self.dut | 13:22 |
lkcl | then call self.dut.AssertEqual(thing1.register1, thing2.register2) | 13:23 |
lkcl | and | 13:23 |
lkcl | self.dut.AssertEqual(thing1.memorylocation1, thing2.memorylocation1) | 13:23 |
kylel | still processing... | 13:33 |
lkcl | ok can you first raise the bugreport, "create Power ISA test API" and cross-reference the irclog here | 13:36 |
lkcl | https://libre-soc.org/irclog/%23libre-soc.2021-09-07.log.html#t2021-09-07T00:17:54 | 13:36 |
kylel | sure | 13:38 |
kylel | https://bugs.libre-soc.org/show_bug.cgi?id=686 | 13:50 |
lkcl | kylel, updated, can we carry on the conversation there, i have to jump up and use a different computer otherwise :) | 14:37 |
lkcl | https://bugs.libre-soc.org/show_bug.cgi?id=686#c3 | 14:49 |
kylel | understood, thank you | 17:03 |
richardwilbur[m] | Interesting news: | 17:51 |
richardwilbur[m] | https://www.nbcnews.com/news/latino/el-salvador-adopts-bitcoin-official-currency-first-country-rcna1910 | 17:51 |
lkcl | richardwilbur[m], intriguing | 17:59 |
programmerjake | interesting...I heard about that like a month ago when the law was originally made | 18:31 |
Las[m] | Considering that they were previously using USD, pretty much anything else is better lol | 22:26 |
Las[m] | Great move economically though, will likely make the country a hub for cryptocurrency-related companies | 22:26 |
lkcl | i'm not entirely sure why they think using BTC to "save bank fees" is a good idea | 22:26 |
lkcl | 4 years ago the bitcoin conference was cancelled because the cost of mining a payment was DOUBLE the cost of the conference itself | 22: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 installation | 22: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 |
lkcl | Las[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 |
lkcl | i'll deal with that tomorrow (not at 22:30 hrs) | 22:30 |
Las[m] | Thanks! | 22:31 |
lkcl | meeting 15m | 22:44 |
lkcl | lxo cesar programmerjake jn klys | 22:44 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!