Wednesday, 2020-01-01

*** tpb has joined #tomu00:00
*** alon_ has joined #tomu00:09
*** alon has quit IRC00:12
*** CarlFK has quit IRC00:33
*** alon_ has quit IRC01:33
*** alon_ has joined #tomu01:34
*** alon_ has quit IRC02:00
xobsvesim: what if you place it in ram?02:32
futarisIRCcloudvesim: V (vector) extensions?03:02
xobsIt'd be nice if we added -M03:17
*** alon has joined #tomu03:34
*** alon has quit IRC03:52
*** rohitksingh has joined #tomu04:08
*** buZz__ has quit IRC06:45
*** buZz__ has joined #tomu06:45
*** buZz__ is now known as buZz06:45
*** CarlFK has joined #tomu10:13
mithroHappy new year!11:32
xobsHappy New Year!11:40
vesimxobs: i don't think that's going to change a lot, the lack of m exetnsion is killing the performance12:29
xobsvesim: let me see how much a multiply unit adds.12:29
vesimi've tried to enable m extension and it is working fine, but the USB stack changed12:31
vesimfrom eptri to epfifo12:31
vesimand tinyusb doesn't work with that12:31
vesimi don't want to mess too much with foboot because i don't have jtag jig for fomu12:32
xobsvesim: You can always load top.bin, then load your program on top of it.  That's not permanent.12:33
vesimso, only the booster is overriding it?12:34
xobsCorrect!12:34
vesimnice, thx12:35
vesimbtw, having https://github.com/pulp-platform/ariane would be awesome :D12:35
tpbTitle: GitHub - pulp-platform/ariane: Ariane is a 6-stage RISC-V CPU capable of booting Linux (at github.com)12:35
xobsNow I'm trying various vexriscv configurations to see what'll fit for you.12:56
xobsIf only it were slightly larger.12:56
vesimfor now i just increased the timeouts to 2 minutes in u2f host library13:07
xobsThat does seem like an unreasonable amount of time.13:28
vesimit is like 20-40 seconds but i've set it to 2 minutes just to be safe14:02
vesimthe default timeout is 2 seconds14:02
xobsI'm having to patch vexriscv to let the multiplier and divider work with our short pipeline.14:03
vesimi wonder if there is a way to get good source of entropy  on fomu14:07
vesimbecause without that getting u2f on fomu is kinda useless14:12
xobsSo I can get the multiply unit to fit if I disable debug, which actually might be fine for you.14:14
xobsSure you can't debug it anymore, but you have a workable solution for debug already, with the default firmware.14:15
xobsFor entropy, we can try creating a Random block based on something like this: https://github.com/dpiegdon/verilog-buildingblocks/tree/4f19cbaf35c7f3fee21b497a8f0ca2b3bf252950/lattice_ice4014:16
tpbTitle: verilog-buildingblocks/lattice_ice40 at 4f19cbaf35c7f3fee21b497a8f0ca2b3bf252950 · dpiegdon/verilog-buildingblocks · GitHub (at github.com)14:16
vesimis there space for that and m extension? :D14:17
xobsThe ring oscillator is super tiny.  With M (but without an MMU or USB Debug), we're at 93%.14:18
xobs`ICESTORM_LC:  4944/ 5280    93%` (with a full single-cycle multiply + divide)14:19
vesimnice14:21
xobsAlso: `ICESTORM_DSP:     4/    8    50%` (so it's actually using the DSP, yay)14:22
vesimdid you change something else than cpu_variant in foboot-bitstream.py?14:27
xobsI mean, I replaced the CPU.  I need to get some changes merged back up to vexriscv to get the multiply and divide plugins to work with a two-stage pipeline.14:29
xobsI can generate a trial .bin file for you if you'd like to experiment some.  I haven't had a chance to test the multiply unit yet.14:35
xobsYou should be able to load it onto your Fomu, then it will show up as "2.0.3-[something]", then you can load your program recompiled with -M.14:36
xobsWhen you unplug it, it will go back to 2.0.3.14:36
vesimwhich usb stack you used? eptrio?14:36
xobsYeah, eptri14:36
vesimbecause tinyusb is not working with epfifo14:36
xobsRight, tinyusb only works with eptri.14:37
vesimwhich one is better/newer?14:37
xobseptri is newer -- it supports more software (because of tinyusb), and supports up to 32 USB endpoints (as opposed to ~3)14:37
* xobs posted a file: top.bin (102KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/kvWgIlPCjyfpybgQECgogJyE >14:38
xobseptri is documented at https://rm.fomu.im/usb.html14:38
tpbTitle: USB Fomu Bootloader documentation (at rm.fomu.im)14:38
vesimunfortunately tinyusb is not working with -march=rv32im and yours top.bin14:47
vesimbut it is working fine w/o m14:47
vesimon your top.bin14:47
xobsGuess "m" is broken somehow.14:47
vesim121280.118519] usbhid 1-2:1.0: can't add hid device: -110 [121280.118549] probe of 1-2:1.0 returned 0 after 20738188 usecs14:47
vesimbut it recoginzed the usb device14:48
vesim[121259.374291] usb 1-2: Product: TinyUSB Device14:48
xobsSo it enumerated, but isn't working?14:48
vesimyep14:48
vesimi've tried stock hid_composite example14:50
vesimafter commenting out hid_task(); it is working(the led is blinking)14:51
vesimok, i narrowed down the issue, board_delay() is not working for some reasons14:53
vesimit is stuck at that function14:53
xobsThat probably does a multiply.14:56
vesimnope, just subtraction14:57
xobsOops.  I don't know how to Git.  I pulled "master", but it didn't get merged.14:57
vesimit more looks like issue with the interrupt controller14:58
vesimafter commenting ot tud_task(); in board_delay() it is working but "sleeping" less than specified amount of time14:58
vesimhttps://github.com/hathach/tinyusb/blob/master/hw/bsp/board.h#L10514:59
tpbTitle: tinyusb/board.h at master · hathach/tinyusb · GitHub (at github.com)14:59
xobsHmm... I need to run for the night.  But you can try this to see if it helps -- it's based on upstream vex, which seems to have fixed the pipeline issues in a different way:15:05
* xobs posted a file: top.bin (102KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/yjfrqtdREsTEuPVwNcJJSlFB >15:05
xobsAnyway, goodnight!15:05
vesimthx for the help15:06
vesimit is working :D15:07
vesimit went down from 53 seconds to 8 seconds15:14
vesimit went down from 53 seconds to 8 seconds15:44
vesim5.96s i think i won't be able to get lower15:49
vesimso... it is time to learn risc-v assembler15:49
CarlFKvesim: it=256 mul ?16:30
vesimCarlFK: what do you mean?16:31
CarlFKvesim: wondering what it is that is now working16:32
vesimCarlFK: standard m extension for risc-v16:33
CarlFKI remember discussion about multiplying 256 bits16:33
vesimit is just mul/div/mod on 32-bit registers16:33
vesimso, i need to get some fast 256 bit intiger multiplication for risc-v16:34
vesimthat's necessary to get u2f working on fomu16:35
CarlFKI didn't realize it was at 50 seconds16:42
vesimat 50s was the whole registration process needed by u2f16:43
vesimit is calculation of p256r1 public key, calculating sha256, and p256r1 signing of that sha256 hash16:45
CarlFKah.  I was thinking that was just for the mul instruction (or whatever the mnemonic is)16:46
vesimcalculating p256r1 public key is taking around 1.5s16:46
vesimbut that's really hacky, it varies between 1.5s and 4s16:47
vesimrecompiling the code is enough to double the execution time16:47
CarlFKSounds like a good catalyst to attract optimization efforts ;)16:49
CarlFKa few months ago someone was talking to me about the various ways of doing math with gates...16:50
vesimi don't think we have enough space for doing 256bit multiplication that way :P16:51
vesimhttps://github.com/gl-sergei/u2f-token/blob/master/src/muladd_256.h i just need to port this to risc-v16:51
tpbTitle: u2f-token/muladd_256.h at master · gl-sergei/u2f-token · GitHub (at github.com)16:51
vesimdid someone tried to increase the clock? :D17:07
*** emeb has joined #tomu17:23
*** Vercas has quit IRC19:02
*** Vercas has joined #tomu19:10
*** Dan_au has quit IRC19:16
*** Dan_au has joined #tomu19:23
*** rohitksingh has quit IRC19:24
vesim2.76s for whole u2f registration process... i think that's the limit of compiler optimizations21:45
futarisIRCcloudhttps://twitter.com/jonoxer/status/121223663013362892822:33
*** Vercas has quit IRC23:16
*** Vercas has joined #tomu23:22

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!