Tuesday, 2020-01-28

*** tpb has joined #tomu00:00
*** GNUtoo has joined #tomu00:03
*** andi- has quit IRC00:20
*** andi- has joined #tomu00:25
*** st-gourichon-fid has quit IRC00:58
*** emeb has quit IRC01:20
*** st-gourichon-fid has joined #tomu01:29
mithroesden: I think you have made it! -> https://www.aliexpress.com/item/4000260409783.html02:21
tpbTitle: iCEBreaker 1.0e FPGA Development Board RISC V Development Board Core Board on AliExpress (at www.aliexpress.com)02:21
esdenyeah someone told me about it at the congress... trying not to think about it to be honest.02:23
esdenEspecially I hate the fact that they just copied all the assets from CrowdSupply :(02:24
esdenhow lazy can you be...02:24
mithroesden: It means that the icebreaker is successful enough for that to happen02:45
esdenYeah I hear people say that... :D02:46
daurnimatoryou really... broke the ice02:55
*** rohitksingh has joined #tomu03:00
*** im-tomu has left #tomu03:17
*** im-tomu has joined #tomu03:17
*** rohitksingh has quit IRC04:10
mithroesden: have you looked at the Fomu workshop recently?04:17
esdenI went through it about a week ago until my Fomu broke. I will play more soon. Fortunately I have more than one Fomu :)04:18
mithroIt has a lot of the stuff you where talking about on your Twitter thread04:24
mithroesden: I think it would be pretty easy to do a version for the icebreaker04:24
mithroesden: the new UART support xobs did in wishbone tool means you could have the power of it via the UART and still have a terminal04:26
esdenyeah xobs04:29
esdenhe told me that he added UART support04:29
esdenI was planning to start with your fomu stuff anyways... :)04:30
esdenThe poll was mainly because of my twitch streams. This inspired me to ask and see what people are most interested in regarding toolkit/programming environment/language...04:30
esdenAnd that too, I will definitely want to "port" the fomu workshop to the icebreaker when we have all the underlying things working on it.04:31
xobsdaurnimator: okay for me to merge zig support?05:40
daurnimatorxobs: sure.05:42
daurnimatorxobs: did you manage to replicate it for yourself?05:42
daurnimatorxobs: there is the open comment there asking if I need clobbers..... I don't know05:43
xobsI'm not sure if you need clobbers.  I mean, it does clobber $a0 and $a1, but those are the argument registers, and it's a pure asm function.05:44
daurnimatordocumentation for clobbers for riscv is a TODO in llvm docs >.<05:44
kevans91pure asm inlined into C, or pure non-inline asm?05:53
daurnimatorkevans91: non-volatile inline asm into zig05:54
kevans91I guess the latter probablt doesn't do clobbees05:54
daurnimatorkevans91: https://github.com/im-tomu/fomu-workshop/pull/140/files#r37127664305:54
tpbTitle: Add zig example by daurnimator · Pull Request #140 · im-tomu/fomu-workshop · GitHub (at github.com)05:54
kevans91the real question is whether there's a chance the compiler will try to do some shady optimization around it, but I would think the answer's a no given the context05:56
xobsdaurnimator: I checked in an attempted fix for the stairstep pattern you see in messible output.07:16
*** rohitksingh has joined #tomu12:38
*** futarisIRCcloud has quit IRC13:29
*** futarisIRCcloud has joined #tomu13:29
*** spacekookie_ is now known as spacekookie13:51
st-gourichon-fidHi.  Just to notify xobs and others: upgrading bootloader from 1.7.3 to 2.0.3 fixed the wishbone tool not working.14:02
st-gourichon-fidOn FOMU.14:02
xobsOh good.  Yay!14:03
st-gourichon-fidIt's a FOMU hacker, experimenting with default CPU.  It looks like running code (added to riscv-blink) is slow.14:06
st-gourichon-fidCould it be slow because code runs from flash without any cache?  Would it run much faster from RAM?14:07
st-gourichon-fidTo run it from RAM, I'm considering adjusting the linker scripts, and maybe I have to adjust the crt0, too.14:08
st-gourichon-fidCould it be slow because code runs from flash without any cache?  Would it run much faster from RAM?14:08
xobsIt definitely would.  You can place code in ram by adding `__attribute__((section(".ramtext")))` to functions.14:08
st-gourichon-fidGreat! Much simpler than I expected!14:08
st-gourichon-fidAnd more flexible, too.14:09
st-gourichon-fidThanks xobs!14:09
xobsFor example: https://github.com/im-tomu/foboot/blob/57f7a8bb95eec058efe2a748f46d3fd44983b3d0/booster/src/usb-dev.c#L7314:10
tpbTitle: foboot/usb-dev.c at 57f7a8bb95eec058efe2a748f46d3fd44983b3d0 · im-tomu/foboot · GitHub (at github.com)14:10
st-gourichon-fidThanks a lot!14:11
st-gourichon-fidBut... it means the crt0 has to support it.14:11
xobsThe linker script puts .ramtext in the .data section, so it'll get copied along with the rest of .data.14:12
st-gourichon-fidI found what you're explaining in linker.ld, yet am not faimilar with this syntax.  Anyway it compiles.  Let's run now.14:14
st-gourichon-fidHm, have to fix other things first.14:26
st-gourichon-fidA question was asked last week: wish to be able to send different code on FOMU without physically unplugging/replugging it on the USB.14:27
xobsWrite `0xac` to `0xe0006000`14:27
st-gourichon-fidYes, but "wishbone-tool 0xe0006000 0xac" retries forever, which is not good for a script.14:28
st-gourichon-fidI can add scripting magick to kill it, but14:28
st-gourichon-fidis there an option to have it not retry? Could not find in args.14:28
st-gourichon-fidI use this now: wishbone-tool 0xe0006000 0xac & sleep 1 ; kill $!14:30
xobsI fixed that last week.  Wtih v0.6.5 I think?  Give a newer version a try.14:31
st-gourichon-fidAh14:32
st-gourichon-fidwill look, thanks.14:32
st-gourichon-fidI used wishbone-tool 0.6.0 . Trying to find a newer one, https://github.com/im-tomu/fomu-toolchain/releases/download/v1.5.3/fomu-toolchain-linux_x86_64-v1.5.3.tar.gz provides 0.4.7 .14:59
daurnimatorst-gourichon-fid: what distro are you on?14:59
st-gourichon-fidXubuntu 19.10.14:59
st-gourichon-fidI prefer to compile software rather than get binaries, maybe I compiled it.15:00
daurnimatorst-gourichon-fid: you can download from https://github.com/litex-hub/wishbone-utils/releases15:00
tpbTitle: Releases · litex-hub/wishbone-utils · GitHub (at github.com)15:00
st-gourichon-fidAh I got it there: <get -S https://github.com/litex-hub/wishbone-utils/releases/download/v0.6.1/wishbone-tool-v0.6.1-x86_64-unknown-linux-gnu.tar.gz15:00
st-gourichon-fidAh I got it there: wget -S https://github.com/litex-hub/wishbone-utils/releases/download/v0.6.1/wishbone-tool-v0.6.1-x86_64-unknown-linux-gnu.tar.gz15:00
st-gourichon-fidJust compiled from master on https://github.com/litex-hub/wishbone-utils/ it's 0.6.0 .15:03
tpbTitle: GitHub - litex-hub/wishbone-utils: Utilities for working with a Wishbone bus in an embedded device (at github.com)15:03
st-gourichon-fidOh sorry forgot git merge --ff-only. Now 0.6.7 .15:04
st-gourichon-fidIt's not better "wishbone-tool  0xe0006000 0xac" still loops forever.15:06
st-gourichon-fidI use this now: wishbone-tool 0xe0006000 0xac & sleep 1 ; kill $!15:08
xobsWhat does `wishbone-tool --version` show?15:09
st-gourichon-fidWishbone Tool 0.6.715:09
xobsStrange that it's doing that on your system.15:09
st-gourichon-fidNot important for me.  It works, just does not quit.  Script-based workaround is inelegant but I can move on.15:10
st-gourichon-fidWilling to send you logs or test another one later as you wish.15:10
xobsWhat do you get when you run `RUST_LOG=debug wishbone-tool 0xe0006000 0xac`?15:16
xobsAmong other things, I get the message "USB device disconnected, forcing early return"15:19
xobsOr maybe you get a different "Poke failed, trying again" message.15:20
st-gourichon-fidhttps://gist.github.com/fidergo-stephane-gourichon/049156c7856477f44ddfe58fc97d7def15:21
tpbTitle: Wishbone Tool 0.6.7 FOMU reset log. · GitHub (at gist.github.com)15:21
st-gourichon-fidThe FOMU is reset as expected.15:21
st-gourichon-fidThe problem is just wishbone-tool not returing.15:22
st-gourichon-fidNot existing.15:22
st-gourichon-fidNot *exiting*. ;-)15:25
st-gourichon-fidI'm trying to measure code execution time. Looking in riscv-blink I look at timer.c then csr.h https://github.com/im-tomu/fomu-workshop/blob/master/riscv-blink/include/generated/csr.h#L19215:28
tpbTitle: fomu-workshop/csr.h at master · im-tomu/fomu-workshop · GitHub (at github.com)15:28
st-gourichon-fidWhere can I find documentation for the timer used.  In theory I should start with getting the source code for this gateware.15:29
st-gourichon-fid?15:29
xobshttps://rm.fomu.im/timer0.html15:30
tpbTitle: TIMER0 Fomu Bootloader documentation (at rm.fomu.im)15:30
* st-gourichon-fid is looking, thanks xobs .15:30
xobsAh, Linux gives a different error than Windows.15:30
xobsI'll fix that tomorrow, then!15:35
*** futarisIRCcloud has quit IRC15:39
st-gourichon-fidHappy to help.  You helped me more I feel.15:40
kevans91yeah, I think FreeBSD returns a different error as well, but I suspect that should be fixed on the FreeBSD side if it's feasible15:54
*** daveshah has quit IRC16:08
*** daveshah has joined #tomu16:08
*** feklee has quit IRC16:12
*** feklee has joined #tomu16:12
*** vesim has quit IRC16:23
*** vesim has joined #tomu16:24
*** rohitksingh has quit IRC16:25
*** GrOoVe has joined #tomu16:26
GrOoVecan w e pay less than a 30 buck for a or two tomu?????16:26
*** GrOoVe has left #tomu16:30
*** LWK has quit IRC16:50
*** LWK has joined #tomu16:50
st-gourichon-fidxobs, I gain a speedup of a factor 7 by just adding the attribute __attribute__((section(".ramtext"))) to a computation-heavy function.16:52
st-gourichon-fidThis is good.  But I feel it can be faster.16:52
st-gourichon-fidFunction does multiplications. The generated ASM calls "call__mulsi3".16:53
st-gourichon-fidI'm not sure how to make sure the intrinsics __mulsi3 is in RAM, too. It's out of my source code.16:54
st-gourichon-fidI tried gcc --save-temps and also have added a rule to Makefile to write out generated ASM.  All this refers to __mulsi3 but does not show its implementation.16:58
*** im-tomu has left #tomu17:00
st-gourichon-fidOk used objdump to disassemble generated elf. It shows __mulsi3 is in 0x20040f40 which is in flash.17:00
*** im-tomu has joined #tomu17:00
*** rohitksingh has joined #tomu17:00
st-gourichon-fidHow to get intrinsics like __mulsi3 to be written to RAM instead of flash?17:01
*** CarlFK has joined #tomu17:03
*** ukembedded has quit IRC17:03
*** ukembedded has joined #tomu17:04
* st-gourichon-fid reads linker script documentation 17:11
* st-gourichon-fid reads linker script documentation https://sourceware.org/binutils/docs/ld/Scripts.html17:11
st-gourichon-fidI'll try to put all sections to sram and see how it goes. :-)17:15
*** rohitksingh has quit IRC17:22
*** rohitksingh has joined #tomu17:31
*** AnimaInvicta has joined #tomu17:43
st-gourichon-fidBricked?17:43
st-gourichon-fidHmm strange. The toolchain generated an elf 268MBytes in size, which dfu-tool tried to send to flash and ... it looks like the FOMU hacker is bricked.17:43
st-gourichon-fidNo light at all when plugging it in.17:44
st-gourichon-fidThe change that produced it was to change "> rom" into "> sram" in ld/linker.ld in the .rodata stanza.17:45
st-gourichon-fidAren't there sanity checks in the flash process?17:53
st-gourichon-fidMy coworker is trying to low-level reflash the bootloader by soldering wires to the flash.17:59
mithrost-gourichon-fid: Please log a bug18:07
mithrost-gourichon-fid: I don't know if anyone thought to check about wrapping around the end of flash?18:07
st-gourichon-fidmithro, thanks for the suggestion.18:08
mithrost-gourichon-fid: Seems like something that is easy to forget :-)18:08
st-gourichon-fidThere are several strange things. (1) making a huge output binary (2) flashing that binary bricks the FOMU.18:08
st-gourichon-fidA good bug report is reproducible.  I don't want to generate too much work to my coworker who is soldering wires to revive the FOMU right now.18:11
st-gourichon-fidI'll try to make a simplest repro case.18:11
*** rohitksingh has quit IRC18:20
st-gourichon-fidThanks my coworker acathla who just revived the FOMU by low-level flashing.18:21
st-gourichon-fidShould the bug report go on https://github.com/im-tomu/fomu-workshop/issues ?18:23
tpbTitle: Issues · im-tomu/fomu-workshop · GitHub (at github.com)18:23
*** rohitksingh has joined #tomu18:32
st-gourichon-fidI pushed the offending situation in https://github.com/fidergo-stephane-gourichon/fomu-workshop/tree/all_code_in_ram_huge_dfu_bricks_fomu18:53
tpbTitle: GitHub - fidergo-stephane-gourichon/fomu-workshop at all_code_in_ram_huge_dfu_bricks_fomu (at github.com)18:53
st-gourichon-fidOnly one line changed in linker script https://github.com/im-tomu/fomu-workshop/compare/master...fidergo-stephane-gourichon:all_code_in_ram_huge_dfu_bricks_fomu18:54
tpbTitle: Comparing im-tomu:master...fidergo-stephane-gourichon:all_code_in_ram_huge_dfu_bricks_fomu · im-tomu/fomu-workshop · GitHub (at github.com)18:54
*** im-tomu has left #tomu18:54
*** im-tomu has joined #tomu18:54
st-gourichon-fidobjdump output seems reasonable, elf is okay but bin and dfu are huge.18:54
*** rohitksingh has quit IRC18:57
st-gourichon-fidIs there an option of objcopy that can show why the generated binary is so huge?19:00
st-gourichon-fid268698356 bytes or 0x100402F4 bytes.19:00
*** rohitksingh has joined #tomu19:01
daveshahreadelf or something might help19:02
daveshahIt's usually because you have far apart sections with "progbits" set19:02
st-gourichon-fiddaveshah, makes sense.19:04
st-gourichon-fidOkay, so I guess just asking the linker to put all .text to RAM is breaking some basic logic of the linker script. https://github.com/im-tomu/fomu-workshop/compare/master...fidergo-stephane-gourichon:all_code_in_ram_huge_dfu_bricks_fomu19:05
tpbTitle: Comparing im-tomu:master...fidergo-stephane-gourichon:all_code_in_ram_huge_dfu_bricks_fomu · im-tomu/fomu-workshop · GitHub (at github.com)19:05
*** im-tomu has left #tomu19:05
*** im-tomu has joined #tomu19:06
daveshahYeah, you'll probably end up with something that tries to make a flat binary that covers the address space of both ROM and RAM19:06
st-gourichon-fiddaveshah, yes.19:07
st-gourichon-fidsize 0x1004xxxx = 0x2004xxxx (adresse inside flash) - 0x10000000 (address of ram)19:08
*** rohitksingh has quit IRC19:48
st-gourichon-fidStill could not figure out.  How to ensure that symbol __mulsi3 is stored in RAM by the linker?19:48
*** benno has quit IRC19:54
*** benno has joined #tomu19:54
*** rohitksingh has joined #tomu20:30
*** TheJJ has quit IRC21:00
*** TheJJ has joined #tomu21:01
*** rohitksingh has quit IRC21:36
*** rohitksingh has joined #tomu21:39
*** futarisIRCcloud has joined #tomu21:49
futarisIRCcloudmithro: Was it you, or someone else who got python running on icebreaker? https://github.com/timvideos/litex-buildenv/wiki/HowTo-FuPy-on-iCE40-Boards21:50
tpbTitle: HowTo FuPy on iCE40 Boards · timvideos/litex-buildenv Wiki · GitHub (at github.com)21:50
mithrofutarisIRCcloud: I'm pretty sure multiple people have got it working21:51
futarisIRCcloudedbordin said something about it on the #icebreaker discord21:51
daveshahMiodrag (mmicko) has done micropython on iCE40 too21:54
*** rohitksingh has quit IRC22:36
*** rohitksingh has joined #tomu22:37
*** rohitksingh has quit IRC22:45
gurke_mithro: I think I'm done from my side for https://github.com/im-tomu/fomu-workshop/pull/124 and https://github.com/im-tomu/fomu-workshop/pull/14122:45
tpbTitle: Fix Verilog examples by mainini · Pull Request #124 · im-tomu/fomu-workshop · GitHub (at github.com)22:45
gurke_mithro: would be happy if they could get merged - or if you could point out if there's something blocking from my side22:45
mithrogurke_: I think it's block on me having enough time to look at the tab where I have that pull request open22:46
gurke_ok :-)22:46
gurke_I'm also currently cleaning up tabs...22:46
*** rohitksingh has joined #tomu22:54
*** ppisati has quit IRC23:15
*** ppisati has joined #tomu23:16

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