whitequark changed the topic of #glasgow to: glasgow debug tool · code https://github.com/GlasgowEmbedded/Glasgow · logs https://freenode.irclog.whitequark.org/glasgow
<marcan> whitequark: btw, I'm running a 143 LED strip off of the glasgow and it, like, works?
<marcan> I'm sure the voltage is sagging, but this is a good supply abuse test
<whitequark> :D
<marcan> whitequark: oh actually eventually all the LEDs turn red because the voltage sags too much for blue/green to light :p
<marcan> whitequark: https://mrcn.st/t/IMG_3768.JPG so it basically works
<_whitenotifier-3> [Glasgow] marcan created branch wip-applet.video.ws2812_output - https://git.io/fhhGp
<_whitenotifier-3> [GlasgowEmbedded/Glasgow] marcan pushed 1 commit to wip-applet.video.ws2812_output [+1/-0/±1] https://git.io/fj1O5
<_whitenotifier-3> [GlasgowEmbedded/Glasgow] marcan b573cee - applet.video.ws2812_output: new applet
<marcan> whitequark: feel free to take a look if you're bored. it's pretty dumb (there's no framing, it just assumes you're sending proper sized RGB blobs and that you're sending them fast enough for the LEDs not to time out)
<marcan> (data frequency is 100kB/s per string or so, up to 16 strings, so 1.6MB/s max, which should be easy to saturate at the source if your software isn't terribad)
<marcan> POV image player: while true; do for i in $(seq 0 34); do convert kiriya.png -brightness-contrast -60x-30 -crop 28x1+0+$i rgb:-; sleep 0.005; done ; done | nc -U /tmp/s
<marcan> (lol)
<whitequark> marcan: that looks basically okay tbh
<whitequark> i'm currently not feeling well and doing other things, so i'll take a closer look later, i think
<marcan> I'm annoyed by the len(pads) == 1 special case
<marcan> kk
<whitequark> but feel free to ping me until i merge
<marcan> yeah, zero rush
<marcan> I just needed to get this done for next week (and the week after, I'm killing two birds with one stone :p)
<whitequark> hm, that special case, mmm
<marcan> also I'm thinking on giving a talk about glasgow, or kicad, or both at Euskal Encounter next week
<marcan> (mostly to fill slots in our free software talk area, we can always use more stuff)
<whitequark> :D sounds awesome
<marcan> I assume that means you're okay with it :>
<whitequark> yeah
<whitequark> of course
<marcan> cool :D
<whitequark> regarding the special case, i think i found a bug
<whitequark> consider non power of 2 len(pads)
<whitequark> word_ctr will eventually go into an invalid value, since max is rounded up to the next POT
<whitequark> in Signal(max=...)
<marcan> NextValue(self.word_ctr, 0), in the RESET and SEND-WORD states
<whitequark> ohhh yeah
<whitequark> derp
<whitequark> so why can't you just remove that conditional then?
<gruetzkopf> *money-at-jlcpcb-throw-noise* now i have time for stuff again until boards show up
<marcan> whitequark: it explodes, I'm not entirely sure why
<whitequark> how does it explode? any symptoms?
<marcan> I get a strange warning and the output is borked
<marcan> let me try
<marcan> for one I needed self.word_ctr = Signal(max=max(2, len(pads))) because otherwise it's a zero-bit counter and that doesn't work
<marcan> but I thought otherwise it would work
<whitequark> yes, that max invocation is correct
<whitequark> it's somewhat unfortunate
<marcan> top.v:1096: Warning: Range select out of bounds on signal `\videows2812outputapplet_videows2812outputsubtarget_word': Setting 1 MSB bits to undef.
<marcan> so I get that
<whitequark> ohhhh
<whitequark> that's a migen bug basically
<whitequark> can you try um
<marcan> though the output seems correct-ish this time? I'm not sure
<marcan> ah not it isn't
<whitequark> replacing `self.word[24:]` with `self.word[24:] if len(pads) > 1 else Cat()` or something like that
<marcan> top.v:1096: ERROR: syntax error, unexpected '}'
<marcan> *nice*
<whitequark> ugh see this is why i wrote nmigen
<marcan> haha
<whitequark> like. literally this kinda shit
<whitequark> marcan: ok like then do the same but for the entire cat statement
<marcan> NextValue(self.word, Cat(self.word[24:] if len(pads) > 1 else self.word[:0], out_fifo.dout, self.r, self.g)),
<marcan> this is fugly but I think it works
<whitequark> disgusting lmao but ok
<marcan> oh this works
<marcan> NextValue(self.word, Cat(self.word[24:] if len(pads) > 1 else [], out_fifo.dout, self.r, self.g)),
<marcan> slightly less disgusting
<whitequark> marcan: ok, i've read the rest, it's ok. just add some newlines and merge it
<marcan> added newlines and removed the special case
<_whitenotifier-3> [GlasgowEmbedded/Glasgow] marcan pushed 1 commit to wip-applet.video.ws2812_output [+1/-0/±1] https://git.io/fj1OA
<_whitenotifier-3> [GlasgowEmbedded/Glasgow] marcan da553ad - applet.video.ws2812_output: new applet
<whitequark> lgtm
<_whitenotifier-3> [GlasgowEmbedded/Glasgow] marcan pushed 1 commit to master [+1/-0/±1] https://git.io/fj1Ox
<marcan> pushed to master then, thanks!
<whitequark> tweet about it so i can rt it or something :3
<marcan> hahaha ok
<_whitenotifier-3> [Glasgow] marcan deleted branch wip-applet.video.ws2812_output - https://git.io/fhhGp
<_whitenotifier-3> [GlasgowEmbedded/Glasgow] marcan deleted branch wip-applet.video.ws2812_output
<marcan> let me get a good photo
<whitequark> i guess it does fit "video" since you have multiple LED strings :D
<whitequark> taxonomies are evil but necessary
<marcan> yeah, and since it does animate
<marcan> I mean 1D video is still video, right?
<marcan> (and of course you can wrap around a single LED string, physical topology is irrelevant)
<whitequark> i've honestly never considered the case of 1d video in my life before
<whitequark> like the only time i've thought about 1d pixel data is in the case of spectrometers
<marcan> hah
<whitequark> and those don't exactly record time series data
<whitequark> but yeah i guess wrapping does that
<kc8apf> Flatbed scanners are just 1D video recorders
<marcan> heh
<whitequark> kc8apf:
<kc8apf> I'm just here to make poor observations
<whitequark> btw in case y'all wondering what am i doing, well, i'm annoyed by yosys' synthesis very much
<whitequark> so i am making it better
<whitequark> i want debug information. i want BDDs in decision tree to mux conversion. i want timing driven synthesis. i want whitebox optimizations during lut mapping
<whitequark> preferably at the same time
<kc8apf> Yes please
<whitequark> ironically most of these things are far easier if you don't touch abc
<kc8apf> Have you looked at https://github.com/masc-ucsc/lgraph
<whitequark> wow, never seen it before
<kc8apf> I've been thinking of synthesis and implementation as one big set of graph transformation passes
<kc8apf> Just couldn't get others to see it that way
<whitequark> implementation as in pnr?
<kc8apf> Yes
<whitequark> right
<whitequark> i see what you mean, but it is not a hill i want to die on, synthesis is hard enough on its own
<kc8apf> Agreed
<whitequark> i'm leaning heavily on RTLIL's strong sides in my work
<whitequark> e.g. coarse cells, rich set of primitives
<kc8apf> Yeah. I appreciate rtlil
<whitequark> so keeping everything in the RTLIL graph really pays off
<whitequark> going through AIG is very lossy
<whitequark> i think we (as in the yosys project) are only starting to discover the really important parts of doing synthesis in real world
<whitequark> for example, packing carry logic with its LUT
<whitequark> should be done during synthesis
<kc8apf> Won't that depend on target architecture?
<whitequark> "really important" as in "the 80% of work that gets you the last 20% of performance"
<whitequark> of course, but yosys already maps adders to SB_CARRY+SB_LUT4
<kc8apf> I've been assuming that decision information needs to be preserved to allow for backtracking
<whitequark> since mapping adders to simple cells and then extracting them back is kind of stupid
<whitequark> decision?
<kc8apf> Whatever info is needed to know when to undo a transform
<whitequark> oh, it's a whitebox
<whitequark> so you can techmap it
<kc8apf> Hmm
<whitequark> it has to be a whitebox so that e.g. the LUT mapper can constant-fold the carry logic if it sees it can do that
<whitequark> or, well, it doesn't have to be a LUT mapper, it can happen in several places
<whitequark> but in the LUT mapper is one of good ones
<kc8apf> I'm still disappointed I couldn't find a way to work on this stuff regularly
<kc8apf> I'll be lucky to get a rough, general-purpose binary format scanner working this year
<whitequark> that's one hell of a yak shave
<kc8apf> I'm doing so much binary protocol and file format RE that having a more concise way to build up a parser pays off on my day job
<whitequark> nom not good enough? or not using rust
<whitequark> ?
<kc8apf> Nom gets really ugly
<whitequark> right, thought so
<kc8apf> Kaitai is explicitly stateless which doesn't work for a few common formats I end up working on
<kc8apf> Most parser frameworks assume byte-level parsing
<ar> marcan: if there's 1d video, there's gotta be a 1d version of bad apple ;)
<marcan> get out of my head
m4ssi has joined #glasgow
<whitequark> hahaha
plaes has quit [Remote host closed the connection]
adamy has joined #glasgow
adamy has quit [Quit: Leaving]
gsuberland has quit [Ping timeout: 268 seconds]
<marcan> whitequark: I think I have a flow control issue though. I think the current implementation just greedily reads from the socket and buffers locally indefinitely?
<marcan> I need it to have some fixed-sized buffer and stop reading from the socket when full
gsuberland has joined #glasgow
<whitequark> marcan: ohhh
<whitequark> marcan: right, you want backpressure
<whitequark> i'm not totally sure the best way to implement that, feel free to suggest a change you think is good
m4ssi has quit [Remote host closed the connection]
<marcan> whitequark: I didn't realize this was a problem until 20GB later my computer crashed :p
<marcan> will think about this later, packing for a flight now
<marcan> aside: I just tested the ws2812 thing on a revB, works fine too
<marcan> (will probably use the revB for the actual project, since I might give a talk and show off the revCs
<tnt> marcan: one way is to explicitely wait for some feedback from the hw, this way you can control the latency 'end to end'.
<marcan> tnt: true, but there's plenty of use cases for "blast data out" where implicit flow control is useful
<marcan> and the FIFO already has that, there's no reason for the python side not to implement backpressure
<marcan> glasgow is about making writing applets simple, I shouldn't have to write my own flow control layer
<tnt> point taken
<whitequark> I absolutely agree the FIFO should do backpressure
<whitequark> this is an omission caused by my relative inexperience with distsys
<Ultrasauce> marcan are you taking these pictures by swinging your camera around
<Ultrasauce> i wonder if you could get the latency down enough on an eyeball tracking vision system to do POV with saccades
<Ultrasauce> maybe EMG would be a better approach
uberushaximus has quit [Remote host closed the connection]
<tnt> whitequark: did you ever fix your C1 btw ?
<whitequark> nope