Tuesday, 2022-06-28

*** kylel1 is now known as kylel03:09
lkclVeera[m], image looks good, needs a couple of corrections.10:01
lkcli appreciate that the diagrams i do aren't exactly great photo quality10:01
octaviuslkcl (and everyone else) good morning. Looking into the pinmux task (adjusting ls180.py for ngi router), but remembered that something changed in pinmux_generator.py because there's a IndexError11:17
octavius"padbank[banknum] = name" banknum is out of range11:18
lkcloctavius, grrr ok 1 sec11:20
lkclthat's because i'd changed things from a single number to a list11:22
lkcloctavius, ok found it, this will work: "python src/pinmux_generator.py -v -o ls180 -s ls180 > /tmp/f"11:43
octaviusThanks lkcl!11:56
lkcloctavius, at least the json file will work now12:08
lkclprogrammerjake, do be careful about making public statements undervaluing the work you're doing!12:15
lkclwe lost samuel because, even with his expertise in formal correctness proofs, he couldn't deal with the complexity and we drastically underestimated the amounts to pay him12:16
lkclwhen i went hunting for people in industry to do the IEEE754 Formal Correctness proof i was quoted FIVE times more money than the amount allocated by NLnet12:17
octaviuslkcl, which json file are you talking about? The litex_pinpads.json file doesn't include mux information, and the /tmp/f file is not pure json12:22
lkcl /tmp/f is clearly debug output12:30
lkcland there is only one json file12:30
lkclcorrect, the json file does not have mux information12:33
lkclfocus on the mdwn file12:33
lkclpython src/pinmux_generator.py -v -o minitest -s minitest  > /tmp/f12:33
lkclyou can see in src/spec/minitest.py how muxing works12:34
lkcl    ps.gpio("", ('A', 1), 0, 0, 1)12:35
lkcl    ps.gpio("", ('A', 0), 0, 1, 1)12:35
lkclcompared to12:35
lkcl    ps.pwm("", ('A', 2), 2, 0, 1)12:35
lkclthat puts PWM on pin A2 on the *second* mux column12:36
lkcl('A', 2') - start at Bank A pin 212:37
lkcl2 - put into Mux2 column12:37
lkcl0 - start the *function* at 0 (PWM_0)12:38
lkcl1 - only add one function12:38
lkclresult (minitest/minitest.mdwn):12:38
lkcl| Pin | Mux0        | Mux1        | Mux2        | Mux3        |12:38
lkcl| --- | ----------- | ----------- | ----------- | ----------- |12:38
lkcl|   2 | A GPIOA_A3  | A UART3_TX  | A PWM_0     |             |12:38
lkclthis line:12:39
lkcl    ps.pwm("", ('A', 4), 2, 1, 3)12:39
octaviusAaaaaaaaah! Yes! It finally makes sense,12:39
lkcl(A, 4) - start at pin 412:39
octaviuswait let me try to decode this one12:39
lkcl2 - put into row M.... ok :)12:39
lkclit's pretty bleedin obvious, just not documented12:40
octaviusPin A4, mux 2, named PWM_1, 3 long (so I'm guessing PWM_1 PWM_2 PWM_3 on pins A4, A5, A6?)12:40
lkcllet's take a look....12:42
lkcl|   4 | A GPIOA_A5  |             | A PWM_1     |             |12:42
lkcl|   5 | A GPIOA_A6  |             | A PWM_2     |             |12:42
lkcl|   6 | A GPIOA_A9  |             | A PWM_3     |             |12:42
lkcl|   7 | A GPIOA_A13 | A MSPI2_CK  |             |             |12:42
lkcllooks about right, doesn't it?12:42
octaviusYeah, just wanted to make sure I got it through my thick skull XD12:43
octaviusAs for adding a pinmux, what format should I use (if there is no json)? Do I need to construct the file myself?12:44
lkclso *go easy* - go slowly - and make lots of commits.12:44
octaviusParsing mdwn sounds like more work12:45
octaviusFor now I'll just probably hard-code a dummy set in the pinmux code12:45
lkclthe code's extremely fragile and if you add too many functions in one go and you get an error it will be extremely difficult to work out what the hell's going on12:45
lkclyou don't have to parse the markdown12:45
lkcl(where did you get that idea from?)12:45
lkclyou just use it as the validator of whether you got the .py file right12:46
octaviusWell the code that adds pinmux's needs to know which functions go to which mux banks12:46
lkclthat's not part of *this* goal - that's a different one12:46
octaviusThe code that *will* add pinmux's (as it's not written yet). Ah ok12:46
lkclall this task is, is to *define* the pinsets12:47
lkclcall it ls212:47
octaviusWhat does ls2 stand for? Libre-SOC2?12:47
octaviusI already have ngi_router.py from previous work I did, so I'll look at it (but make a copy of ls180.py)12:48
lkclif you keep the pinsets exactly the same as ls180 then you should also be able to view the svg file!12:48
lkcldon't put SDRAM onto pinmux banks btw12:49
* lkcl ponders...12:49
lkclactually it should be ok12:49
octaviusWell for this tasks there are no mux's at all, right?12:50
octaviusso the banks don't matter?12:50
octaviusOr does LS180 have hard-coded pinmux's in the design?12:51
lkclweeeelll... let's add RGMII onto the N side first12:51
lkclsee how that goes12:51
lkclthere shouuuld be enough pins but you'll need to split them12:51
lkclwhich, like ps.pwm(), will involve setting a start and count parameter, calling ps.rgmii() twice12:52
lkclcommit cut/paste src/spec/ls180.py src/spec/ls2.py first as one commit12:53
lkclthen and *only* then start messing about adding ps.rgmii12:53
octaviusDone, needed to fix the git url12:57
lkclok 1 sec i need to fix an import for you..12:59
octaviusYeah, forgot to add spec type12:59
lkcloh wait... hang on...13:00
lkclyou'd already added this as ngi_router.13:00
lkcldoh let's go with that13:00
octaviusthat was back in Nov though13:00
lkclsorry :)13:00
octaviusNo worries ;)13:00
lkclerr there's quite a lot of modifications13:01
octaviusThat's why ls2 might be a better way for now13:01
lkclyehyeh agreed13:01
octaviusOnce we get that working, I can take some of the changes from ngi_router13:01
lkclno totally13:01
lkcloctavius, you're on the case for src/spec/__init__.py ?13:06
lkcl            'ls180': ls180,13:06
lkcl+           'ls2': ls2,13:06
lkcl            'ngi_router': ngi_router13:06
lkcli leave it with you13:06
octaviusNah, I was waiting for you. If you're done, I can add the spec type13:07
octaviusMay I proceed?13:07
octaviusI'll proceed13:10
* lkcl dealing with a monster headache13:13
octaviushave a nap13:13
octaviusWe've got a meeting later today too :P13:14
lkcli knoow13:14
lkclkylel, ping been trying to get in touch for several days, there's EUR for you from NLnet grant tasks completed months ago!13:15
octaviuslkcl, I can fit RGMII on the N bank, but I needed to move the power pins (see the commit, svg can be generated now).13:30
octaviusWe're going to have a different package, but do we want to preserve the pinout (somewhat?)13:31
octaviusI could make an rgmii2 function (like you have sdram/2/3) to split the pins13:31
lkcloctavius, hooray13:36
lkclok the power pins must not be on the edge13:37
lkclso split the rgmii into two13:37
lkclbut put...13:37
lkclRXD0-3 onto pins 0-313:38
lkclps.rgmii((N,0), 0, 0, 4) should do it13:38
lkclthen VSSE/D/I_6 on pins... 5-813:38
lkclps.rgmii((N,9), 0, 4, 13) should do the second batch.  you'll need to calculate it so that you don't miss out the last pin ETXERR13:39
octaviusAlso when you say "power pins must not be on the edge", do you mean the edge of the die, or the package?13:40
octaviuswill do13:40
lkcli'm going to add a second rgmii interface ok?13:42
lkclit won't conflict with what you're doing13:43
lkclok done, do take a look13:54
octaviusSo the ps.rgmii is clever enough to know when to stop/start (continue existing part)?13:57
octaviusI thought we needed an rgmii2 to allow splitting up13:57
lkclthe reason for the sdram2/3 is because the pins are much more complex14:00
lkclthere's address-extension, data-extension and bank-extension14:00
lkclfrom the "lowly" 2-bank 8-bit (sdram)14:00
lkclto faster 16-bit (and more address lines)14:01
lkclto 32-bit and 6 bank address lines14:01
lkcltrying to split that up manually would be a pain in the ass14:01
octaviusI split the rgmii on N side, but I noticed an issue14:03
octaviusthe rgmii resets the data pins14:03
octaviusLook at the mdwn file, the RXD0-3 start again14:04
octaviusOn both the N and E sides14:04
lkcl1 sec14:08
lkclthat's because you asked it to14:10
lkcl-    ps.rgmii("0", ('N', 8), 0, 0, 14)14:10
lkcl+    ps.rgmii("0", ('N', 8), 0, 4, 14)14:10
lkclok just for fits and giggles how about adding an 18-long GPIO "N" bank and moving rgmii_0 to Mux column 1?14:11
lkclmaking really good progress here14:11
octaviusAh yeah14:11
octaviusI'll do that now14:12
lkcli'll do South14:12
lkclyou do North14:12
octaviusWait, bit the git commits will clash!14:12
octaviusI haven't merged before14:13
lkclgit pull now14:13
lkcli fixed the rgmii 0/4 already14:13
octaviusYeah I have14:13
lkclif i'm editing S and you're editing N there's no clash14:14
lkclgit is intelligent enough to spot line numbers14:14
octaviusBut if I make modifications to ls2, when git pulling I'd have to merge, no?14:14
lkclit's automatic14:15
octaviusok, added gpios14:19
lkcl1 sec nearly done here14:20
lkclgit pull14:20
octaviusYou moved the sram eh?14:21
lkclto Mux column 1, yes14:21
lkclcan you do the same trick with bank W?14:22
lkclTWI SDA/SCL needs moving too14:22
octaviusno prob14:22
* lkcl counting pins....14:22
lkcl96-101  614:22
lkcl106-123 1514:23
lkclmmmm... it'll do14:23
lkcli might as well make GPIO E 19 pins long in that case14:24
octaviuserror: Your local changes to the following files would be overwritten by merge:14:28
octaviusPlease commit your changes or stash them before you merge.14:28
octaviusI made the changes to W, just need to merge somehow14:28
lkclyep. commit first. git pull second14:28
lkcldo "git diff" it will show you what haven't committed14:29
octaviusBut then I get a Merge message, is that correct14:29
lkclok what did you modify, why, and where?14:29
octaviusI added the GPIOs to W side in ls2.py14:30
lkcland nothing else?14:30
octaviusIs this something to do with the "git config" settings?14:30
lkcldo git push please14:30
octavius ! [rejected]        master -> master (non-fast-forward)14:31
octaviuserror: failed to push some refs to 'git.libre-soc.org:pinmux.git'14:31
octaviushint: Updates were rejected because the tip of your current branch is behind14:31
octaviushint: its remote counterpart. Integrate the remote changes (e.g.14:31
octaviushint: 'git pull ...') before pushing again.14:31
lkclthen do "git pull" as instructed14:31
lkclfollowed again by "git push"14:31
octaviuserror: You have not concluded your merge (MERGE_HEAD exists).14:31
octaviushint: Please, commit your changes before merging.14:31
octaviusfatal: Exiting because of unfinished merge.14:31
lkclngggh ok please look at the ls2.py file14:32
lkclyou've edited in an area outside of where you said you were going to do, and there's now a merge conflict14:32
lkclyou should see14:32
lkclin the file14:32
octaviusNow, this has always happened to me14:33
octaviusnot just in this case14:33
lkcldo "git diff", what does it say14:34
octaviusSo my steps were:14:34
lkclwhat on earth have you managed to do :)14:34
octavius-git add src/spec/ls2.py14:34
octavius-git commit -m "blah blah"14:34
octaviusgit pull14:34
octaviusFrom there nano opened, asking why I want to merge14:35
octaviusI deleted the message and quit (cancelled the merge)14:35
octaviusthis is where I am now14:35
lkclwhat a load of bullshit "why you want to merge"??14:35
lkclthis is a bullshit question14:35
octaviusI'm telling what happened, I only ever used git with one user edits at a time, so don't really know anything else14:36
octaviusOh, so that is *NOT* meant to happen?14:36
lkclplease use "git pull --rebase"14:36
lkclit's bullshit14:36
octaviuserror: You have not concluded your merge (MERGE_HEAD exists).14:37
octaviushint: Please, commit your changes before merging.14:37
octaviusfatal: Exiting because of unfinished merge.14:37
octaviusIt's easier to just copy the changes, git reset, and add them in at this point14:37
lkcltotal bullshit.  and it's because linus torvalds got fed up of the auto-messaging14:37
lkclno don't do that14:37
lkclyou should have saved and exited14:38
octaviusThat's why I got annoyed when worked on one file at the same time XD14:38
lkcluse rebase in future14:38
lkcli automatically configure *everything* to be rebase14:38
octaviusSo what do I do then?14:38
lkclwhich is why i never see this14:38
lkcli have no idea i'm looking it up14:38
octaviusAh, I think I remember why14:38
octaviusgit throws a warning message when I do "git pull" for the first time14:39
octaviusand suggests I set git config rebase=false, something like that14:39
lkclrm -rf .git/MERGE*14:39
lkcldo that14:39
lkclit will get rid of the bullshit14:39
octaviusI never understood why, so I just set it false14:39
lkclyes, set rebase14:39
lkclit avoids all the bullshit14:39
lkclmakes life slightly awkward, you can't have un-committed changes in your local repo when you do a "git pull" but hey14:40
lkcl---->>>>>> rm -rf .git/MERGE* <<<<<---14:40
lkclthen git pull and git push14:40
octaviusgit config pull.rebase false14:41
octaviusthis is what I did before14:41
lkclor "git merge --continue" apparently14:41
octaviusok will do14:41
lkclplease let's sort out the merge first14:41
octaviusI deleted MERGE*14:41
lkclok now set rebase to true14:41
lkcland git pull then git push14:42
octaviusafter doing git pull:14:43
octaviuserror: cannot pull with rebase: Your index contains uncommitted changes.14:43
octaviuserror: please commit or stash them.14:43
octaviusAaaaah XD14:43
lkclok do git diff again14:44
lkcland git reset --hard14:44
octaviusIf I do --hard I'll lose my edits14:44
lkclthen copy the file!14:44
octaviusI guess copy them to another file14:44
lkclyou shouldn't have any because you said "git diff" returns nothing14:44
octaviusBecause I added ls2.py with "git add"14:45
octaviusso the diff won't return anymore14:45
lkclyou'd already done the commit so there is nothing that can be lost14:45
lkcljust do git reset --hard14:45
lkclno need to "copy" the file because it is already committed14:46
octaviusok rest --hard, added the changes back in, pulled, should see them now14:47
octaviusNow, what I'm to do next time?14:47
octaviusif we work in tandem?14:47
lkcl<lkcl> ok now set rebase to true14:47
lkclno more bullshit14:48
lkclok i'm good with that14:49
octaviusSo (for next time), if I make a change, and one commit behind you:14:49
octaviusgit add ls2.py14:49
octaviusgit commit -m "blah"14:49
octaviusgit pull14:49
octaviusgit push14:49
octaviusShould work? (with rebase=true)14:49
octaviusI'll be sure to let you know ;)14:50
octaviusSo what now?14:50
lkcllocal modifications *without* a commit will *not* be permitted, that's all14:50
lkclok drop ls2.mdwn into the wiki14:50
octaviusThe folder we have is "crypto_router_asic" in the wiki. Shall I make a separate ls2 folder for now?14:52
lkclahh can you investigate this14:53
lkcl* GPIOE_E14 : E16/0 E26/014:53
lkcl* GPIOE_E15 : E17/0 E27/014:53
lkclwait that was me14:54
lkcli'll do it14:54
lkclgot it14:55
lkclerr did you move the West power pins?14:59
lkcl| 124 | W VSSI_1    |             |             |             |14:59
lkcl| 125 | W VDDI_1    |             |             |             |14:59
lkcl| 126 | W VSSE_1    |             |             |             |14:59
lkcl| 127 | W VDDE_1    |             |             |             |14:59
lkclJean-Paul's told us that's unacceptable15:00
lkclthey have to be about 4-6 pins in from the end15:00
octaviusI didn't move power pins15:00
lkclotherwise the load on the IO Ring becomes too large15:00
lkcli'll sort it15:00
octaviusI copied from ls180.py, did anyone make changes to that? I don't remember modifying the power pins on that one15:01
lkcli got it15:03
octaviusSo what was the issue?15:03
lkclno idea. too long ago15:03
octaviusOr when was it changed?15:03
octaviusAh ok, cause ls180 has it as well15:04
lkcland i don't know why15:04
lkclok so git pull redo ls2.mdwn and copy it to the crypto_router_asic directory15:04
lkclcommit and we're done15:04
octaviusAlso fixed a typo you had on gpio W15:08
lkclalso there should be an SVG image generated as well15:08
octaviusAre we done? I thought we'll have a different package?15:09
octaviusYeah, will add it now15:09
lkclnot enough time15:09
lkcl2 Gigabit Ethernet interfaces is enough to prove the concept15:09
lkcland also give enough for the muxing when we get to it15:10
octaviusAdded the svg15:10
octaviuswill link the IRC chat and commits on bug15:10
octaviusOh, you beat me to it XD15:10
lkclwe'll need to get you added to the NGI POINTER grant for this one15:13
octaviusSo I should remove the image on https://libre-soc.org/crypto_router_asic/crypto_router_pinspec/?15:13
octaviusCause that page currently has the ambitious pinout15:13
lkclnext one - https://bugs.libre-soc.org/show_bug.cgi?id=75815:15
octaviusYep, how shall I proceed?15:21
octaviusI'll be back, going to have my lunch15:34
lkclthe main one to focus on is the mp3_0.sh15:57
lkclpypowersim runs the ISACaller python-based simulator15:57
lkclit executes instructions.  that's its job.15:57
lkclof course, you have to load data into memory15:58
lkcla program to execute15:58
lkclsome initial SPRs15:58
lkcland some GPRs15:58
lkcl   6         -l data/audio/mp3/mp3_0_data/buf${1}:0x600000 \15:58
lkclsee audio/Makefile because to download the data to be tested you'll need that15:59
lkclbasically there's a small trail here16:07
lkclwhich you'll have to track back through the Makefile(s) and .sh scripts16:07
lkclyou can't just go "i'll run stuff with no arguments and expect something to magically happen"16:07
lkclso with a little patience, you'll need to start from "known-good", examine each of the files, and work through it16:16
lkclbasically this is running the ISACaller simulator on (very small) Power ISA bare-metal binaries16:16
octaviusAh ok thanks luke, I'll make my way through it then :)16:23
lkcli removed qemu from the basic pypowersim test16:24
lkclthere's no GUI and no console here16:24
lkclno UART, absolutely nothing16:24
lkclso the only way to find out if the "program" did the right thing is to dump the memory contents and inspect it16:25
lkcl(hence the --dump option)16:25
lkclbtw all these things should be in the notes you write!16:25
octaviusYes XD16:25
lkclhttps://libre-soc.org/crypto_router_asic/ls2/ wha-hey! looks really good16:41
lkcland the image too https://libre-soc.org/crypto_router_asic/ls2.svg16:41
octaviusYes :)16:48
octaviusAfter running running make wget to get the data, and make tests, I get a bunch of unrecognised opcode errors:16:55
octaviusaudio/mp3/mp3_0_apply_window_float_basicsv.s.sv:63: Error: unrecognized opcode: `sv.lfs/els'16:55
octaviusthis is just one of many16:56
lkcloctavius, make sure to git pull openpower-isa17:19
lkcland re-run pywriter17:19
octaviusOh yes! Of course XD17:20
lkcli'm running ./audio/mp3/mp3_0.sh 0 out0 and it's perfectly fine17:20
lkclthat said i need to re-run the binary make to check17:21
lkclghostmansd changed how pysvp64asm works17:21
octaviusHuh, still fails17:22
octaviusOh wait17:22
lkclgrr ghostmansd you broke the media tests17:22
octaviusUsing make tests it caused an error with unknown opcodes. However calling "./audio/mp3/mp3_0.sh 0 out0" works lkcl17:25
lkclghostmansd, you'd removed all "sv." instruction processing from pysvp64asm17:29
lkcloctavius, git pull17:30
lkclyou probably have run this before17:32
lkcland there are .bin files in audio/media/*.bin17:32
lkclwhich if you delete, you won't be able to re-make (without a git pull)17:33
lkclld mem @ 0x900078 rem 0 : 0xac58b31d2d037ca817:33
lkclRead 0xa87c032d1db358ac from addr 0x90007817:33
lkcl+ cmp out0 data/audio/mp3/mp3_0_data/samples017:33
lkclall good17:33
octavius"ld mem @ 0x900078 rem 0 : 0xac58b31d2d037ca8" how do I run this?17:42
octaviusOh, this is in the log17:43
octaviusrerunning to get the debug out in a file, already 60mib...17:45
lkclyyep, that's normal. export SILENCELOG=1 if you don't want to see it18:02
octaviusSo if I see 0xa87c032d1db358ac, does that mean the test was successful?18:07
lkcldo an xdiff on the two files18:12
lkclhmmm where the hell is xdiff18:13
lkcl   man cmp18:13
lkcl       cmp - compare two files byte by byte18:14
lkclremember what i said about examining the scripts? :)18:14
octaviuswhich files, the .gpr files?18:14
octaviusAh yes18:14
octaviusfound it18:14
lkclyou need to get into the habit of going "this command calls this command which calls this command, let me look them up individually"18:14
lkclat the moment you're seeing output and going "i can ignore that"18:15
lkclthen asking "why isn't this working" or "what does this mean"18:15
octaviusIt's one of the ways to keep sane XD, but you're right18:15
lkcl--> cmp ${2} data/audio/mp3/mp3_0_data/samples${1}18:16
octaviusYes I saw that one18:16
lkcltherefore, rather than ignore that command, you should ask, "what does it do?"18:16
lkcland the easiest way to do that is, "man cmp"18:16
lkclonce you've read the top line of the man page, you now know that ${2} and samples${1} must be being compared18:17
lkclwhere ${2} is the 2nd argument of this script18:17
lkcland ${1} is the first18:17
lkclyou can go back to the Makefile (or, if you ran mp3_0.sh manually, the 1st and 2nd args)18:17
lkcl... you get the idea18:18
lkclso from that you can *deduce* that pypowersim is running the simulation18:18
lkcl--dump is outputting to a file18:18
lkcland data/audio/mp3/mp3_0_data/samples${1} would, logically, be the "expected results"18:18
lkclas a UNIX-philosophy command, if cmp is silent, it must have succeeded18:19
lkcltherefore, if you get *no response* from the cmp command, you can *deduce* that pypowersim must have successfully produced the correct output18:19
lkcl-d option not --dump option sorry18:20
lkcl    -d ${2}:0x900000:128 \18:20
lkclthe ${2} occurs there again18:20
lkclso that must be the output which is compared against in the cmp ${2}18:20
lkclfollow the trail follow the trail18:20
lkclchain chain chain chain18:21
ghostmansd[m]lkcl, I assumed you ran all tests :-)21:08
ghostmansd[m]I mean, the only reason I merged it to master is because we had this long iteration where you ran tests and Ionly rebased this branch21:09
ghostmansd[m]I'll re-check it next time, I simply assumed you checked them all...21:10
ghostmansd[m]I'd have used CUSTOM_INSNS["sv."] = sv (with sv being a function which does the remap).21:12
ghostmansd[m]But this is for the later operation.21:12
ghostmansd[m]Still. Which is a full set of tests which cover changes in svp64.py?21:13
octaviusMeeting in 25min lkcl, programmerjake, ghostmansd, cesar, toshywoshy21:35
ghostmansd[m]I won't be able to attend today.22:08
ghostmansd[m]Also, how comes? I thought there are meetings on Tuesday and Thursday.22:09
octaviusTuesday every week is the informal one22:10
octaviusWednesday every two weeks is the OpenPOW related one22:10
octaviusOh yeah, I keep forgetting your timezone22:10
octaviusit is Tuesday and Thursday for you22:10
programmerjakeuuh, they're 24hr apart, so it would be wed and thu, you couldn't get 2 days apart unless your timezone changed in between22:35
octaviusOh yeah, you're right jake22:36

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