Wednesday, 2019-06-19

*** tpb has joined #tomu00:00
*** AmosSam has left #tomu01:07
*** AmosSam has joined #tomu01:11
*** xkapastel has quit IRC02:14
*** AmosSam has left #tomu02:14
*** AmosSam has joined #tomu02:21
*** AmosSam has left #tomu02:58
*** AmosSam has joined #tomu03:06
*** AmosSam has left #tomu03:21
*** AmosSam has joined #tomu03:26
*** emeb has quit IRC04:11
*** ppisati has quit IRC04:28
*** ppisati has joined #tomu04:35
*** rohitksingh_work has joined #tomu04:55
*** _stew__ has joined #tomu05:36
*** Kitlith_ has quit IRC05:36
*** _stew_ has quit IRC05:36
*** Kitlith_ has joined #tomu05:37
*** AmosSam has left #tomu05:52
*** AmosSam has joined #tomu05:52
*** AmosSam has left #tomu07:37
*** AmosSam has joined #tomu07:41
*** rohitksingh_work has quit IRC07:46
*** rohitksingh_work has joined #tomu08:05
*** rohitksingh_work has quit IRC08:05
*** AmosSam has left #tomu09:09
*** AmosSam has joined #tomu09:09
*** xkapastel has joined #tomu11:04
*** cdmatter has joined #tomu11:19
*** AmosSam has left #tomu12:42
*** AmosSam has joined #tomu12:48
*** xkapastel has quit IRC13:33
*** cdmatter has quit IRC13:41
xobsDoes anyone here have a Mac?  I'm looking for a precompiled version of dfu-util13:46
xobsI mean, precompiled versions of nextpnr-ice40 would be nice too.  But one step at a time.13:47
tntI guess a Mac running linux won't help you :p13:53
xobsNot so much.  I was considering looking into cross-compiling to darwin, though.13:54
tntfor dfu-util that might work.  nextpnr would be a pain with all the Qt/Python stuff.13:58
xobsI got the wishbone stuff to auto-build from Travis to a bunch of platforms, so I've got that covered:
tpbTitle: Release Initial Release · xobs/wishbone-utils · GitHub (at
*** xkapastel has joined #tomu14:03
*** alexhw has quit IRC14:11
MadHackerxobs: Me. What do you need?14:16
MadHackerI have the ice40 toolchain running on it, and dfu-util etc.14:16
MadHackerI can just zip the lot up for you if you want.14:17
xobsMadHacker: I'm putting together a workshop, and I can produce binaries for building on Windows and Linux, but not on Mac.14:17
xobsThat would be very helpful, thank you!14:18
MadHackerNo worries, I'll do that.14:18
*** rohitksingh has joined #tomu14:18
MadHackerdfu-util is in brew, BTW.14:19
auscompgeekhomebrew has a binary package for dfu-util if th--14:19
MadHacker <-- instructions here work.14:19
tpbTitle: Duo/ at master · redbear/Duo · GitHub (at
xobshomebrew has a binary package? That's interesting! I thought homebrew was just source packages.14:19
auscompgeekthey have a buildbot which then inserts metadata for binary packages into their manifests14:20
auscompgeekthey call the binary packages bottles, because of course they do14:20
xobsI knew dfu-util was there, but I thought homebrew was like macports or emerge, where it was a tool to download source files and build it locally.  Hence the "brew" moniker.14:21
MadHackerIt can do that, I think, but it's not the only mode.14:21
auscompgeekit originally only did that14:21
MadHackerala apt-get.14:21
MadHackerOK, my icetools build tree is 691M. I don't think you want it.14:21
auscompgeekanyway, looks like they have bottles for mavericks through to mojave
MadHackerI wonder if I can get it to install to another folder to package up?14:22
tpbTitle: homebrew-core/dfu-util.rb at master · Homebrew/homebrew-core · GitHub (at
MadHackerxobs: knows how to build + install on OS X for a relatively all-in-one process, although it takes a while.14:23
tpbTitle: GitHub - ddm/icetools: Open FPGA Toolchain by Clifford Wolf et al. (at
MadHackerThat gets you icestorm+yosys+iverilog+verilator but arachepnr instead of nextpnr.14:24
xobsI know there's by esden14:24
tpbTitle: GitHub - esden/summon-fpga-tools: A simple script to build open-source FPGA tools. (at
xobsSimilarly, there's but again no nextpnr14:25
tpbTitle: Releases · FPGAwars/toolchain-icestorm · GitHub (at
MadHackerI'll stick my tarball of doom up for you.14:25
MadHackerI don't know which bits to extract but I guess a quick make install will take care of actual install.14:25
*** cdmatter has joined #tomu14:26
MadHacker(I basically have that package plus nextpnr)14:26
xobsThat's very helpful, thank you!14:27
MadHackerStill much quicker than starting from scratch. :)14:27
xobsRight now the rough plan of the workshop is to divide it into 3 parts following a brief intro: Python, RISC-V, and low-level.  Python is easy, since it just requires dfu-util to upload the .dfu file.14:28
xobsRISC-V gets a little bit fuzzier, but I have the SiFive RISC-V toolchain.14:28
xobsThe HDL portion is a complete unknown at this point.14:28
MadHackerSounds good, though.14:28
xobsPlus giving away reworked EVT1 boards.  Everyone loves free hardware!14:29
MadHackerFor myself, just blue-sky pondering here, I'd like to see how to mix the first two with custom hardwarey bits in HDL.14:29
MadHackerMore than I'd be interested in "here's how to do HDL" in the abstract.14:29
MadHackerGuess that's a big ask for time for any sane workshop tho.14:30
MadHacker(I have no idea what the workshop is for, I'm not a participant, just putting the thought out there)14:30
MadHackerEveryone loves free hardware indeed. :D14:30
xobsMadHacker: That's a really good idea.  And I wonder if I have enough time to introduce litex.14:30
MadHackerWaiting on this tarball transferring, I'll /msg you the url in a mo.14:31
xobsMadHacker: For the record, here's the elevator pitch for how you do that.14:31
xobsYou create a CSRStorage() (for writing to hardware) or a CSRStatus() (for reading from hardware to the CPU), and then you assign signals to either or csr.status.14:33
xobsThen litex will go about assigning it a memory-mapped address, and you can read/write to it in RAM.14:33
xobsSee for how I did it with the ICE40 LEDD block14:33
tpbTitle: foboot/ at master · im-tomu/foboot · GitHub (at
MadHackerOK, that sounds good. How about interrupts (or callbacks or similar)?14:33
MadHackerI can see how to use memory-mapped stuff for polling but no sane way to wake on it while doing other things.14:34
xobsInterrupts are, I believe, created by adding a csr_eventmanager.  But that's a good point.  I should read up on that.14:36
xobsWhat version of python3 does OS X have now?14:36
MadHackerNone "natively".14:36
MadHacker2.7 only.14:36
MadHackerLatest betas remove that too.14:36
MadHackerFor 3, it's and 3.7.3 as you'd expect.14:37
*** emeb has joined #tomu14:47
auscompgeekI guess macOS will now be the odd one out with no builtin python command14:50
xobsauscompgeek: yeah, but the Windows "python" command by default will just open a link to the Store.14:51
xobsStill, what a strange world we live in now.14:51
MadHackerAnd the OS X one was horribly horribly out of date, so this way it's at least going to be updatable rather than always having a "python" command pointing at a crappy old build.14:51
xobsStrange that the homebrew bottles are different for every major release of OS X>15:01
MadHackerEspecially since it's not like binary compatibility isn't good between releases.15:01
MadHackerOS X is happy running some really rather old binaries, in general.15:01
MadHacker(although the next release drops 32-bit support, so maybe not for long)15:02
xobspollo: I updated riscv-toolchain in the fomu repo so now it can build micropython.  The name changed from riscv32-unknown-elf-gcc to riscv64-unknown-elf-gcc, so I'll need to update foboot as well.  But I just tested, and it compiles.15:27
polloNeat, I'll test that when I get back home from work15:28
ovfxobs: another prebuilt ice40 toolchain is , but i have never used it (i see it also comes with arachnepnr instead of nextpnr)15:38
tpbTitle: GitHub - FPGAwars/apio: Open source ecosystem for open FPGA boards (at
ovfoh, you've already mentioned it15:39
tntmithro: ping ?15:40
xobsovf: they're missing nextpnr, instead favouring arachne.  And I've had enough trouble with arachne's lack of timing-driven routing that I'd rather use the closed-source tools over arachne.15:40
mithrotnt: pong?15:43
mithrotnt: sheet of Fomu should be on the way15:45
mithrotnt: I was actually think about how your stuff and valentyusb could share USB integration tests on the plane back from Europe15:48
tntmithro: yup, testing would definitely be an area where efforts could be shared and I definitely need to improve that ... my testbenches are ... huh ... mostly non-existent.15:49
mithroHave you used cocotb at all?15:50
tntI did run the official USB spec testing suite, but that tests more the usb software stack compliance than anything else.15:50
tntNope, I only even learned of it recently.15:50
xobsactually, I have a no-cpu implementation that I've been meaing to test.15:51
xobsI did use some of your testbench, tnt, but having more of one would be very nice.15:51
ovfxobs: apparently there is an (older) toolchain with nextpnr?
tpbTitle: Releases · FPGAwars/toolchain-ice40 · GitHub (at
ovfi'm sure at some point fpgawars and/or symbiflow will converge on a nice standalone toolchain15:56
tntyou really want something recent though for nextpnr ...15:56
xobsovf: that's a very nice find! It's missing the HeAP placer, but it's the best there is so far.16:05
tntxobs: do you know the githash it's based on ?16:07
tntnextpnr-ice40 -V16:07
xobstnt: cadbf4216:08
tntxobs: Most annoying thing I see is it doesn't support SB_SPI/SB_I2C.  It also has a bug if you use shared clock_enable in/out clk on IOBs, that might build an invalid bistream.16:11
tntthe other bugs aren't really applicable to the up5k or can be worked around.16:13
xobsI'm realizing just how much boilerplate is required to get a basic Fomu hardware project running in litex :-/17:10
xobsSPRAM, SPI flash, CPU, USB, clock...17:11
ovflooking forward to a "platinum" edition of fomu with a usb uart on board. :-P i don't think ft232rq would fit?17:15
tntDon't think so ...17:16
tntmaybe a second ice40 :p17:17
*** cdmatter has quit IRC17:37
emebcue "beowulf cluster of ice40s" comment17:42
xobsIt's looking like a dummy USB with no CPU weighs in at about 39% of the FPGA (2081 LCs)17:52
*** rohitksingh has quit IRC17:57
ovfusing a second (similar) computer for io is a popular practice, it seems. e.g. greenarrays' evaluation board comes with two ga144s talking to each other, one "host" (io) and the other "target" (whatever you actually want to run)17:57
xobsThe C64 1541 disk drive had a second 6502 in it.17:58
tntxobs: what about brams ?18:05
xobstnt: 1 (i.e. 3%)18:06
ovfby the way, would usb3.1 dbc be any cheaper to implement than cdc-acm (if that's what foboot uses)?18:06
xobsovf: I'm not familiar with dbc, but what do you mean by "cheaper"?18:07
ovfcheaper as in requiring fewer LoCs/LCs. but it looks like dbc still requires a pretty complete usb stack, so it probably wouldn't.18:15
ovfi think i imagined dbc being something like uart over usb data lines, which appears to be rather delusional.18:17
xobscdc-acm is rather sane, except for the bit where it requires an endpoint that never actually gets used.18:22
*** rohitksingh has joined #tomu18:30
xobsWell cool.  Probably has some room for improvement, but it enumerates, gives me the appropriate strings, and takes up 2111 LCs.  And I can access the Wishbone bridge.18:35
xobsThat includes PicoRVSPI as well.18:36
*** awe00 has joined #tomu18:46
*** cdmatter has joined #tomu18:49
tpbTitle: valentyusb/ at master · im-tomu/valentyusb · GitHub (at
xobsIf you want to ensure your USB descriptors are perfect, try it on Windows.  It's got to be the pickiest there is.  Linux will allow most anything through.19:12
*** AmosSam has left #tomu19:36
*** AmosSam has joined #tomu19:36
*** rohitksingh has quit IRC19:47
xobsThere.  Fixed it so it enumerates on Windows.  The LC count is up to 2240 now, but I'm sure my descriptor lookup mess could be improved.19:49
xobsAnd I removed picorvspi, and it's down to 1631 LCs.19:57
ovfxobs: looks very neat!20:17
xobsAnd without the litex timer module, it's down to 1478.  That's not too bad.20:17
ovfdoes litex bring much to the table in this case? i'm still exploring verilog, so i guess it hasn't yet annoyed me to the point of wanting a programmable generator beyond verilog's macro and module systems20:53
xobsovf: in this configuration, no, litex brings nothing. it's all migen.20:54
xobsovf: however, once you want to do anything extra, then yes, litex gives you a ton of functionality.20:55
xobsFor example, if you want to monitor signals, you could connect them to a CSRStorage, and then read out the values via USB on the Wishbone bridge.20:55
xobsOr if you wanted something like ChipScope, you can add in litescope and get an internal logic analyzer.  That works with any Signal(), even one that's in raw Verilog.20:56
xobsAs an example, I expose the SB_WARMBOOT primitive as a CSR:
tpbTitle: foboot/ at master · im-tomu/foboot · GitHub (at
xobsSo you could reboot the FPGA by writing 0xac to the CSR (Which, according to csr.h, is 0xe0006000)20:58
ovfi see. so in the SB_WARMBOOT case, migen/litex allow you to describe the register within your design, and later automatically generate the full register file from all such mentions.21:08
xobsCorrect.  Further down ( you can see where we pull in picorv's spimemio.v directly and then wrap it around some CSRs.  We also memory-map it so the hardware turns memory accesses into SPI flash accesses.21:10
tpbTitle: foboot/ at master · im-tomu/foboot · GitHub (at
tntxobs: yup that's definitely pretty good.21:16
ovfoh, and the cpu core is actually scala/spinalhdl. for some reason i thought this would be python all the way down. fun.21:21
xobsvexriscv is scala/spinalhdl, yes.  There's the minerva core which is Python-based, but I'm not sure what its status is.21:22
*** AmosSam has left #tomu21:43
*** AmosSam has joined #tomu21:51
futarisIRCcloudxobs: Thanks for the link. I added a slide about rgb leds in micropython to the presentation, with that...22:03
xobsfutarisIRCcloud: I'm still not sure if I'll have time to add HID support to micropython. It ought to be possible without any gateware changes, though.22:04
xobsWhen is your presentation?22:10
futarisIRCcloudxobs: Tomorrow at 2:40pm AEST. I think I'm already very close to filling up 10 minutes ... I don't think I'll have time to present anything extra, unless it is in the networking sessions after.22:12
futarisIRCcloudHopefully this will drum up some interest for PyCon AU and the hackfest before lca2020.22:12
xobsOkay, then I'll focus on my workshop. It's almost finished. If completely untested.22:14
*** awe00 has quit IRC22:19
*** AmosSam has left #tomu22:28
*** mifune has joined #tomu22:29
*** AmosSam has joined #tomu22:36
*** AmosSam has left #tomu23:52
*** AmosSam has joined #tomu23:52

Generated by 2.13.1 by Marius Gedminas - find it at!