whitequark[m] changed the topic of #nmigen to: nMigen hardware description language · code https://github.com/nmigen · logs https://freenode.irclog.whitequark.org/nmigen
Evidlo has quit [Ping timeout: 246 seconds]
vmedea[m] has quit [Ping timeout: 246 seconds]
vmedea[m] has joined #nmigen
Evidlo has joined #nmigen
<_whitenotifier-5> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±2] https://git.io/JqJ4R
<_whitenotifier-5> [YoWASP/yosys] whitequark 53ba7a7 - Update dependencies.
lf has quit [Ping timeout: 258 seconds]
lf has joined #nmigen
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
pftbest has quit [Ping timeout: 276 seconds]
vmedea[m] has quit [Ping timeout: 240 seconds]
jfng has quit [Ping timeout: 240 seconds]
cesar[m]1 has quit [Ping timeout: 240 seconds]
whitequark[m] has quit [Ping timeout: 240 seconds]
Evidlo has quit [Ping timeout: 244 seconds]
vmedea[m] has joined #nmigen
jfng has joined #nmigen
cesar[m]1 has joined #nmigen
nickoe has quit [Ping timeout: 260 seconds]
nickoe has joined #nmigen
whitequark[m] has joined #nmigen
Evidlo has joined #nmigen
FFY00_ has quit [Ping timeout: 264 seconds]
FFY00_ has joined #nmigen
FFY00_ has quit [Remote host closed the connection]
FFY00_ has joined #nmigen
Degi_ has joined #nmigen
Degi has quit [Ping timeout: 276 seconds]
Degi_ is now known as Degi
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
loxodes has quit [Quit: WeeChat 1.4]
PyroPeter_ has joined #nmigen
PyroPeter has quit [Ping timeout: 276 seconds]
PyroPeter_ is now known as PyroPeter
_whitelogger has joined #nmigen
Bertl is now known as Bertl_zZ
jjeanthom has joined #nmigen
jjeanthom has quit [Ping timeout: 256 seconds]
emeb_mac has quit [Quit: Leaving.]
lsneff has quit [Ping timeout: 240 seconds]
lsneff has joined #nmigen
pftbest has joined #nmigen
jjeanthom has joined #nmigen
chipmuenk has joined #nmigen
jjeanthom has quit [Ping timeout: 245 seconds]
lambda has quit [Ping timeout: 272 seconds]
chipmuenk has quit [Quit: chipmuenk]
lambda has joined #nmigen
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
peeps[zen] has joined #nmigen
peepsalot has quit [Ping timeout: 265 seconds]
<_whitenotifier-5> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JqJjQ
<_whitenotifier-5> [YoWASP/yosys] whitequark 1067225 - Inject local part into version when packaging dirty work tree.
<_whitenotifier-5> [YoWASP/nextpnr] whitequark pushed 2 commits to develop [+0/-0/±5] https://git.io/JqUeB
<_whitenotifier-5> [YoWASP/nextpnr] whitequark a95c5db - Fix variable names. NFC.
<_whitenotifier-5> [YoWASP/nextpnr] whitequark 9f5acd4 - Inject local part into version when packaging dirty work tree.
<_whitenotifier-5> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JqUvf
<_whitenotifier-5> [YoWASP/yosys] whitequark eeb09ae - Allow overriding WASM cache directory via YOWASP_CACHE_DIR env var.
<_whitenotifier-5> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±2] https://git.io/JqUvq
<_whitenotifier-5> [YoWASP/nextpnr] whitequark 5986fa5 - Allow overriding WASM cache directory via YOWASP_CACHE_DIR env var.
<_whitenotifier-5> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JqUUP
<_whitenotifier-5> [YoWASP/yosys] whitequark 03a3ee3 - Update dependencies.
<_whitenotifier-5> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±2] https://git.io/JqUUh
<_whitenotifier-5> [YoWASP/nextpnr] whitequark 584304e - Allow overriding WASM cache directory via YOWASP_CACHE_DIR env var.
Bertl_zZ is now known as Bertl
peepsalot has joined #nmigen
peeps[zen] has quit [Ping timeout: 276 seconds]
chipmuenk has joined #nmigen
jeanthom has joined #nmigen
emeb_mac has joined #nmigen
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
bvernoux has quit [Quit: Leaving]
jeanthom has quit [Ping timeout: 264 seconds]
chipmuenk has quit [Quit: chipmuenk]
pftbest has quit [Remote host closed the connection]
FFY00_ has quit [Remote host closed the connection]
pftbest has joined #nmigen
pftbest has quit [Ping timeout: 245 seconds]
<d1b2> <benzn> abs(...) is a real operator in nmigen, correct?
<d1b2> <benzn> i have some code that does ixor.eq(abs(ipsum - insum))
<whitequark[m]> yes
<d1b2> <benzn> signal is ixor = Signal(unsigned(20))
<d1b2> <benzn> but gtkwave is showing me twos complimented values that are sometimes negative
<whitequark[m]> what are ipsum and insum?
<d1b2> <benzn> 20 bit signals
<whitequark[m]> Signal(unsigned(20)) ?
<d1b2> <benzn> right
<d1b2> <286Tech> Isn't gtkwave just interpreting them as signed?
<whitequark[m]> >>> abs((ipsum - insum)).shape()
<whitequark[m]> unsigned(21)
<d1b2> <benzn> the ipsum and insum are also very small, both less than 20 (so i should really have range(20), but brain fart)
<whitequark[m]> hang on.
<d1b2> <benzn> ah... let me fiddle with the width
<whitequark[m]> can you show values of ipsum, insum and ixor for the case that you think is wrong?
<whitequark[m]> maybe a gtkwave screenshot or something
<d1b2> <benzn> yep, give me a sec
<d1b2> <benzn> abs
<d1b2> <286Tech> @whitequark[m]: I've actually never paid attention to it, but when writing the vcd file, does nMigen actually annotate that a signal is unsigned so that gtkwave displays it as unsigned?
<whitequark[m]> you cannot describe signedness in VCD
<d1b2> <286Tech> Ah ok, didn't know that.
<whitequark[m]> if this sounds ridiculous, that's because it is
<d1b2> <benzn> hehe
<whitequark[m]> @benzn right, so you're observing correct but unexpected behavior
<d1b2> <286Tech> It's just the interpretation of the bits.
<whitequark[m]> nmigen integers (just like most other fixed integers, really) always have the same behavior for +/- regardless of signedness
<d1b2> <benzn> hmm, so that is to say ipsum - insum is a signed value
<whitequark[m]> it is not
<d1b2> <benzn> ah gotcha
<whitequark[m]> try: (ipsum - insum).shape()
<d1b2> <benzn> so it's overflowing
<whitequark[m]> yes.
<d1b2> <benzn> then abs is doing nothing
<whitequark[m]> yes.
<d1b2> <benzn> because it's unsigned
<d1b2> <benzn> makes sense
<d1b2> <benzn> thanks for the help!
<d1b2> <benzn> is there a convenient way to coerce the subtraction into a signed value?
<d1b2> <benzn> let's try with ipsum and insum signed
<d1b2> <286Tech> I assume the abs() function performs a two's complement operation based on the sign bit?
<whitequark[m]> but yes, declaring ipsum and insum in your case might be more appropriate
<whitequark[m]> not sure what the domain is
<whitequark[m]> 286Tech: abs on signed values is defined as `Mux(self >= 0, self, -self)`
<d1b2> <benzn> cool, making them signed does what i want (I'm just counting ones masked against another binary pattern, but it's a low number of bits so can deal with the extra sign bit)
<d1b2> <286Tech> Isn't that a bit (haha) inefficient though? You only need the sign bit.
<whitequark[m]> benzn: counting ones as in popcnt?
<d1b2> <benzn> yep
<d1b2> <286Tech> I don't even know how you'd perform subtraction or abs() on unsigned numbers tbh.
<whitequark[m]> subtraction of unsigned numbers adds 2's complement and keeps the result unsigned
<d1b2> <benzn> ipsum.eq(sum(self.oscillatorI.output & self.input))
<whitequark[m]> yeah that's how you'd do it
<d1b2> <benzn> (this is for a 1-bit radio mixer)
<d1b2> <286Tech> @whitequark[m] Oh ok, I see.
<d1b2> <286Tech> I was interested in how nMigen dealt with that, because I was doing stuff like this for a paper of mine.
<d1b2> <286Tech> I implemented a sign-magnitude / 2's complement hybrid FFT unit for automotive radar systems, where we save a bunch of power.
<d1b2> <286Tech> Ah, gotcha. I'll take a look.
pftbest has joined #nmigen
pftbest has quit [Ping timeout: 276 seconds]
pftbest has joined #nmigen