Monday, 2018-06-04

*** tpb has joined #timvideos00:00
*** Elwell_ has quit IRC01:49
*** Elwell has joined #timvideos01:54
*** Elwell has quit IRC02:27
*** Elwell has joined #timvideos02:55
*** Kripton has quit IRC03:00
*** Elwell has quit IRC03:03
*** Elwell has joined #timvideos03:03
*** Kripton has joined #timvideos03:04
*** Elwell has quit IRC03:30
*** rohitksingh_work has joined #timvideos03:33
*** Elwell has joined #timvideos03:34
*** Elwell has quit IRC03:49
*** Elwell has joined #timvideos03:50
*** futarisIRCcloud has joined #timvideos03:51
*** rohitksingh_work has quit IRC04:33
*** Elwell has quit IRC04:35
*** rohitksingh_work has joined #timvideos04:38
*** sb0 has quit IRC04:42
*** sb0 has joined #timvideos05:03
*** sb0 has quit IRC06:31
*** futarisIRCcloud has quit IRC06:41
*** sb0 has joined #timvideos07:23
*** Elwell has joined #timvideos08:06
xobsOkay, I've actually got a usecase for the FPGA stuff now.  I'd like to create a WS2812b signal integrity checker.  How's Icestick support in Litex?08:26
*** CarlFK has quit IRC08:31
cr1901_modernxobs: Works fine08:49
cr1901_modernI keep the icestorm stuff up to date, and have used icestick w/ migen for plenty of stuff08:50
cr1901_modernxobs: (just replace w/ litex.boards.platforms)08:59
tpbTitle: Migen IceStorm Code Sample · GitHub (at
xobscr1901_modern: Thanks!  Is the original repo?  I'm following the steps and am stuck on step 4 "...execute the target you want to build".  I don't have an "icestick" target.09:05
tpbTitle: GitHub - enjoy-digital/litex: Build your hardware, easily! (at
xobsI see an icestick platform, however.  What's the difference?09:05
cr1901_modernplatform is analogous to user-constraints file09:06
cr1901_moderntarget is analogous to a system-on-a-chip design09:06
cr1901_modernYou probably won't use litex.boards.targets often except maybe for testing09:06
_florent_xobs: go to litex.boards.targets and execute: python3 litex.boards.platforms.icestick09:07
cr1901_modern_florent_: That's not gonna git09:08
xobsSegfault trying to compile umodsi3.o09:08
* cr1901_modern has... never seen lm32-elf-gcc segfault before09:09
_florent_cr1901_modern: ah ok, yes lm32 is probably too big for it...09:09
_florent_cr1901_modern: btw, i still have to look at the arty a7 comments09:09
_florent_xobs: you probably have some lm32 toolchain issue09:10
cr1901_modernJust look at the arty s7 in migen09:10
_florent_xobs: what do you want to do, do you want a cpu? or just to be able to control the board from a computer? or just some simple logic?09:11
xobs_florent_: A combination of things.  I'd like to understand Litex more, and use this as an excuse.09:11
xobsThis particular project will be used to measure ws2812b LED timings.  I'd like to drive some pulses out and print the result over a UART.09:12
xobsThat seems like a good usecase for a softcore with a well-timed ws2812b block.09:12
cr1901_modernUnpopular opinion: I feel like litex.platform.targets and misoc.targets should be under their own "examples" directory rather than exposed as part of the package09:12
cr1901_modernYou almost never use them as-is without modification09:13
cr1901_modernxobs: For right now, I'd say forget about the targets directory09:13
cr1901_modernClone my gist, s/, and then run "python3"09:14
cr1901_modernif everything works, you will get a blinky on ice4009:15
xobscr1901_modern: it's trying to run yosys.  So that's a good sign.09:17
cr1901_modernDid it successfully run yosys?09:19
xobsI think so.  I'm still learning how to read the stack traces.09:20
_florent_xobs: in case you want to use another processor (if lm32 is too big), you can just add --cpu-type <processor> (processor can be: lm32, or1k, picorv32 or vexriscv)09:21
xobsYes, not it's trying to run arachne-pnr.09:21
cr1901_modernxobs: _florent_'s advice is good in general, but none of the current CPUs will fit on icestick09:21
cr1901_modernI've dabbled w/ creating a "femtorv32", but it's more trouble than it's worth09:22
xobsNow it says "Can't find iCE FTDI USB device".  Which I think means it's completed.09:22
cr1901_modernyes it completed. The programming step is optional09:22
xobsWould the lm32 fit?09:22
cr1901_modernZPU or navre would though09:23
_florent_cr1901_modern: is icestick smaller than the tinyfpga b2?09:23
cr1901_modern_florent_: Yes, icestick is 1k, tinyfpga b2 is 8k09:23
cr1901_modernxobs: Are you on windoze or lunix?09:23
xobscr1901_modern: I'm on bash-on-windows.09:24
xobsI'm trying to find documentation on the issue we had back in January with regards to statically compiled gcc...09:24
cr1901_modernxobs: to use iceprog, you need to install libusbk via Zadig09:24
xobscr1901_modern: easy enough!09:25
cr1901_modernexcept I don't remember which channel :P09:25
_florent_cr1901_modern: ah ok, icestick is indeed really small...09:25
cr1901_modern_florent_: But that's why I love it09:25
cr1901_modernI'm a huge proponent of smolFPGA09:25
_florent_That's a choice... but then you are a bit limited by what you can do with it :)09:26
xobsIs it possible to get the debug symbols from your lm32 gcc compiler?09:26
cr1901_modernIdk if I've ever tried it, tbh.09:28
xobsAh yes, your lm32 compiler is still using vsyscall, which isn't implemented on Windows.09:31
xobsHere's the thread on it:
tpbTitle: Due to glibc 2.12 limitation, static executables that use time(), cpuinfo() and maybe a few others cannot be run on systems that do not support or use `vsyscall=emulate` · Issue #8203 · ContinuumIO/anaconda-issues · GitHub (at
cr1901_modernOh I use mingw6409:32
xobsIf I do the "Quick start guide (For advanced users)" would that remove the need for Conda?09:33
cr1901_modernxobs: Yes. And well the advanced flow was at one time the only flow :P.09:35
cr1901_modernAlthough gcc not working is def a bug09:36
xobscr1901_modern: Good.  It seems easiest, because I'm not sure how to fix the lm32 issue, and the conda people don't seem interested in fixing it.09:36
cr1901_modernxobs: Afaik, conda for litex on Windows expects you to be using a command prompt09:39
cr1901_modernnot bash on Windows09:39
xobsBash-on-Windows actually works pretty well -- you just need an X server to install Vivado, but the entire Artix-7 flow works great.  At least it did when I tried in January:
tpbTitle: Bash On Windows · timvideos/litex-buildenv Wiki · GitHub (at
cr1901_modernWell, then it's a bug then :(09:39
*** DocJosh_ has joined #timvideos10:19
*** vys_ has joined #timvideos10:20
*** froztbyt1 has joined #timvideos10:20
*** medicalwei_ has joined #timvideos10:21
*** paddatrapper has quit IRC10:24
*** medicalwei has quit IRC10:24
*** froztbyte has quit IRC10:24
*** vys has quit IRC10:24
*** DocJosh has quit IRC10:24
*** paddatrapper has joined #timvideos10:32
xobsI couldn't build binutils, so I switched back to conda.  Now it's saying "ModuleNotFoundError: No module named 'litex'".  How can I troubleshoot that?10:53
cr1901_modernxobs: can't build binutils? That doesn't sound right10:57
cr1901_modernwhat error are you getting and what version?10:57
*** sb0 has quit IRC10:58
xobscr1901_modern: Let me re-clone binutils.  There were a few errors.  One was that makeinfo couldn't be run, but that it shouldn't break the build, and if it did it means my make was broken and I should use gnu make.  I'm using gnu make 4.1 on "Ubuntu 18.04", so I just installed texinfo and it continued.10:59
xobsThe actual error that I couldn't figure out was regarding m4, saying something along the lines of "executable not found".  m4 exists, so I'm not sure what it was talking about.11:00
xobsI'm building binutils from git, like the documentation says.11:00
cr1901_modernI am unfortunately unable to debug bash on windows issues.11:00
cr1901_modernI would need to see the error trace from configure and friends11:01
xobsI've almost finished with the pull.  I'll try building it again!11:02
cr1901_modern(I personally have never tried building directly from binutils git, fwiw)11:02
xobsHow do I troubleshoot "ModuleNotFoundError"?  Does Python have an equivalent of "-I" to add a directory to the include path?11:02
cr1901_modernI've never seen this error either ._. Did you do conda activate?11:03
xobsI did, my PS1 has "(litex)" at the start.11:03
xobsand CONDA_PYTHON_EXE is pointing to /opt/miniconda3/bin/python11:04
cr1901_modernThe equivalent of "-I" in Python is PYTHONPATH11:04
cr1901_moderntry "which python"11:04
cr1901_moderninvoke python, and then from the REPL "import litex"11:05
xobsYes, if I set PYTHONPATH=${path-to-litex} then it works.  That's good to know!11:06
cr1901_modernBut it shouldn't be like that at all ._.11:06
cr1901_modernlitex shouldn't been installed under the python that conda installed11:06
xobsHow can I tell what program it's trying to run as part of the build?  It says "Can't find iCE FTDI USB device".  What program is it calling, and how can I change that program?11:13
tpbTitle: Migen IceStorm Code Sample · GitHub (at
tpbTitle: litex/ at master · enjoy-digital/litex · GitHub (at
cr1901_modernPart III:
tpbTitle: litex/ at master · enjoy-digital/litex · GitHub (at
cr1901_modernxobs: To answer your question directly, the program being called is iceprog, and you need to create your own Programmer class with the methods flash (write to flash) and load_bitstream (just load bitstream into FPGA)11:20
xobsI see.  iceprog.  And the build sequence is defined as part of __main__11:20
cr1901_modernxobs: Well I just did that b/c it's a demo :P.11:21
cr1901_modernxobs: Shamless plug time11:21
tpbTitle: WDJ - migen-port (at
cr1901_modern>Lastly, the create_programmer function should return a vendor-specific programmer. Adding a programmer is beyond the scope of this article. If a board can support more than one programming tool, the convention is to return a programmer based on a programmer class variable for the given board. This function can be omitted if no programmer fits, or one can be created on-the-fly using GenericPlatform.create_programmer.11:21
xobsThanks.  I'm still trying to understand Python, too, so there's an additional issue there.11:23
cr1901_modernAll platforms subclass GenericPlatform11:23
cr1901_modernIn any case, I'm pretty sure iceprog is the only programmer meaningfully supported by icestick11:24
*** sb0 has joined #timvideos11:25
cr1901_modernxobs: Unfortunately, it's been a bit too long since I've learned Python to help w/ that. All I remember is that it was simpler than C++11:28
xobsWoo.  I got something.  The five LEDs (four red + one green) are kind of dim.  I'm guessing it's a cycle display, and it's just going really fast.11:29
cr1901_modernNo, it shouldn't be going that fast11:29
cr1901_modernit's prob programming11:29
cr1901_moderntakes a few seconds11:29
cr1901_modern(or programming stalled)11:29
xobsProgramming is almost instant.11:30
daveshahyeah, the LEDs will light dimly without drivers on the IO because of the built-in pullups11:30
daveshahsounds like either the bitstream is bad or the pin assignments are wrong11:30
cr1901_modern>the LEDs will light dimly without drivers on the IO because of the built-in pullups11:31
cr1901_modernAside: I just realized how contradictory this sounds at first glance. So much for "pulling up" lol11:31
xobsProbably very low-current pullups?11:31
cr1901_modernyes that's prob true11:31
cr1901_modernfrom what others have told me when I use the pullups wrong (tm)11:32
xobsI'm running iceprog.exe -S rot/rot_migen.bin and it's saying it's programming, followed by "Bye."11:32
xobsI'm running iceprog.exe -S rot/rot_migen.bin and it's saying it's programming, followed by "Bye."11:32
cr1901_modernThe green LED should be brightly lit w/ my bitstream. The red LEDs cycle one LED per second11:33
cr1901_modernDon't run "-S"11:33
cr1901_modernUnless you've modified your icestick to load directly from SPI bitbang, you don't want "-S"11:34
xobsOh, that works much better.  I was looking at, and thought the function load_bitstream() always added -S.11:34
xobsIs that not the case?11:35
cr1901_modernThe "-S" option assumes you've soldered a jumper (I _think_) to tell the FPGA to wait for a bitstream from the FTDI chip, instead of trying to load a bitstream from flash11:36
cr1901_modernload_bitstream is analogous to loading a bitstream via JTAG on Xilinx devices11:36
cr1901_modernflash() is analogous to programming the SPI flash11:36
cr1901_modernSince icestick requires a hardware mode to "load a bitstream via JTAG*", you probably want flash()11:37
cr1901_modern(*ice40 doesn't have JTAG, so maybe this is a bad analogy to Xilinx devices)11:37
xobsAh, okay.  load_bitstream() boots a bitstream onto the device, flash() reprograms nvram.  I see where you're coming from.11:38
cr1901_modernYes, that was my intent anyway :).11:38
cr1901_modernIn any case, congrats! Seems like you got your first bitstream loaded11:39
xobsYay!  This is an excellent start.  Thank you for your help.11:39
cr1901_modernYw :). Probably the next thing to do is make a UART. Or maybe find a use for the PMOD or IRDA11:40
cr1901_modernAt some point I want to buy a second icestick b/c my first one is lonely11:40
cr1901_modernso I can use the IRDA feature11:40
xobsI'm going to head home -- it's late here.  I'll work more on it tomorrow though.11:41
cr1901_modernhave fun!11:42
*** rohitksingh_work has quit IRC12:34
*** Elwell has quit IRC12:44
*** CarlFK has joined #timvideos12:59
*** ChanServ sets mode: +v CarlFK12:59
*** Sigyn has quit IRC13:11
*** Sigyn has joined #timvideos13:12
*** rohitksingh has joined #timvideos13:38
*** rohitksingh has quit IRC15:13
*** rohitksingh has joined #timvideos15:17
*** CarlFK has quit IRC15:21
*** rohitksingh has quit IRC15:28
*** CarlFK has joined #timvideos15:29
*** ChanServ sets mode: +v CarlFK15:29
*** CarlFK has quit IRC15:30
*** CarlFK has joined #timvideos15:30
*** ChanServ sets mode: +v CarlFK15:30
*** rohitksingh has joined #timvideos15:46
*** CarlFK has quit IRC16:31
*** CarlFK has joined #timvideos16:53
*** ChanServ sets mode: +v CarlFK16:53
*** CarlFK has quit IRC17:14
*** rohitksingh has quit IRC17:21
*** CarlFK has joined #timvideos17:35
*** ChanServ sets mode: +v CarlFK17:35
*** sb0 has quit IRC17:41
*** froztbyt1 is now known as froztbyte18:01
*** Kripton has quit IRC18:44
*** Kripton has joined #timvideos18:56
*** f15h has joined #timvideos18:57
*** f15h has quit IRC20:17
*** CarlFK has quit IRC22:21
*** Elwell_ has joined #timvideos22:40

Generated by 2.13.1 by Marius Gedminas - find it at!