sb0 changed the topic of #m-labs to: https://m-labs.hk :: Mattermost https://chat.m-labs.hk :: Logs http://irclog.whitequark.org/m-labs
<_whitenotifier-a> [nmigen] whitequark commented on issue #184: ASIC support tracking issue - https://git.io/fjNnA
_whitelogger has joined #m-labs
whitequark has joined #m-labs
_whitenotifier has joined #m-labs
<_whitenotifier> [nmigen] programmerjake commented on issue #183: Signal(reset=x) should be equivalent to Signal(reset=x, max=x+1) - https://git.io/fjNcP
<_whitenotifier> [nmigen] programmerjake commented on issue #184: ASIC support tracking issue - https://git.io/fjNc1
<_whitenotifier> [nmigen] whitequark commented on issue #183: Signal(reset=x) should be equivalent to Signal(reset=x, max=x+1) - https://git.io/fjNcM
<_whitenotifier> [nmigen] Success. The Travis CI build passed - https://travis-ci.org/m-labs/nmigen/builds/575621321?utm_source=github_status&utm_medium=notification
<_whitenotifier> [nmigen] programmerjake commented on issue #183: Signal(reset=x) should be equivalent to Signal(reset=x, max=x+1) - https://git.io/fjNch
<_whitenotifier> [nmigen] Failure. 80.47% (-0.16%) compared to b0ef53e - https://codecov.io/gh/m-labs/nmigen/commit/c77274c1ad96ca92b844dba76f4ed46266d5d017
<_whitenotifier> [nmigen] Failure. 80.47% (-0.16%) compared to b0ef53e - https://codecov.io/gh/m-labs/nmigen/commit/c77274c1ad96ca92b844dba76f4ed46266d5d017
<_whitenotifier> [nmigen] Failure. 80.47% (-0.16%) compared to b0ef53e - https://codecov.io/gh/m-labs/nmigen/commit/c77274c1ad96ca92b844dba76f4ed46266d5d017
<_whitenotifier> [nmigen] Success. Coverage not affected when comparing b0ef53e...c77274c - https://codecov.io/gh/m-labs/nmigen/commit/c77274c1ad96ca92b844dba76f4ed46266d5d017
<_whitenotifier> [nmigen] Success. Coverage not affected when comparing b0ef53e...c77274c - https://codecov.io/gh/m-labs/nmigen/commit/c77274c1ad96ca92b844dba76f4ed46266d5d017
<_whitenotifier> [nmigen] Success. Coverage not affected when comparing b0ef53e...c77274c - https://codecov.io/gh/m-labs/nmigen/commit/c77274c1ad96ca92b844dba76f4ed46266d5d017
<_whitenotifier> [nmigen] programmerjake commented on issue #183: Signal(reset=x) should be equivalent to Signal(reset=x, max=x+1) - https://git.io/fjNCv
<_whitenotifier> [nmigen] whitequark commented on issue #183: Signal(reset=x) should be equivalent to Signal(reset=x, max=x+1) - https://git.io/fjNCJ
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
sb0 has joined #m-labs
futarisIRCcloud has joined #m-labs
<sb0> the ramda/toolz stuff...
<whitequark> I'm not sure I understand what's happening
<whitequark> it seems like someone is trying to write point-free code in python?
sb0 has quit [Quit: Leaving]
jaeckel has quit [Ping timeout: 245 seconds]
jaeckel has joined #m-labs
<whitequark> yeah, looking closer, i don't think there's anything super interesting going on, it's just a somewhat obfuscated way to write code
mumptai has joined #m-labs
Ultrasauce has quit [Quit: Ultrasauce]
Ultrasauce has joined #m-labs
sb0 has joined #m-labs
<sb0> yeah, that was also my impression
<_whitenotifier> [nmigen] programmerjake commented on issue #183: Signal(n, reset=x) silently drops any bits in x past the n-th bit - https://git.io/fjNlh
<zignig> woohoo ! , finally got the serial bootloader to bootload ! , line endings in python serial SUCK!
<zignig> now for some cleanup.
<_whitenotifier> [nmigen] whitequark commented on issue #183: Signal(n, reset=x) silently drops any bits in x past the n-th bit - https://git.io/fjN8q
<whitequark> zignig: don't forget to turn off XON/XOFF
<whitequark> this can mangle your data badly
mumptai has quit [Quit: Verlassend]
<zignig> did that ;) , it was that the \r as not getting encoded and sent as two char.
<whitequark> yeah also a problem.
<whitequark> i should be able to look at directives soon-ish maybe.
<zignig> but managed to upload and run blinky via the bootloader.. :)-|-< :0-/-< :)-\-< (happydance)
<whitequark> nice.
<zignig> whitequark: that would be grand.
<whitequark> btw... i had this idea about reusing the logic in boneless to stuff the (eg) SPRAM full of bytes
<whitequark> sort of like a debug port
<whitequark> so you could in the future maybe connect it directly to UART.
<zignig> like JTAG , will it be able to set/put memory whilst the processor is running ?
<whitequark> actually a JTAG core for Boneless is something I also want to do but later.
<zignig> speaking of which , I have a WARMBOOT that is attached to external address in the boneless.
<zignig> how would I go about having another signal _also_ driving it ?
<whitequark> mux?
* zignig is thinking reduce(_or,[signals...]) but i'm not sure.
<whitequark> reduce(or) works but has different behavior.
<whitequark> uh. I forget how WARMBOOT works.
<zignig> I want to have a wrapper around the uart that issues the warmboot, so if the program crashes , remote recovery is possible.
<_whitenotifier> [nmigen] whitequark opened issue #185: Negedge clock domains - https://git.io/fjN8B
<whitequark> makes sense
<zignig> whitequark: just three signals. https://github.com/zignig/gizmotron/blob/master/cores/warm.py
<whitequark> so you want the BOOT signal to be triggered by something else?
<whitequark> what about S0/S1?
<zignig> need all three , I'll need an FSM because it needs to be sequenced.
* zignig investigates mux driving
<zignig> whitequark: thanks :)
<lkcl> whitewuark: ping. do you remember that add_clock exception that occurred in run_simulation, last week? i encountered another scenario, this time nothing to do with run_simulation. it's a combinatorial block that causes the issue. solution: "if "sync" in sim._domains: sim.add_clock(...)"
<lkcl> clearly, that's not really a "solution" as it bypasses the API (underscore)
<whitequark> lkcl: hm, interesting
<lkcl> versions of nmigen from... 2 months ago (appx?) this was fine
<lkcl> the problem for us is: we've got auto-generated code that will be comb or sync depending on parameters, in the unit tests.
<lkcl> yeh.
<whitequark> so you have a purely combinatorial circuit and it fails sim?
<lkcl> it doesn't fail sim, the add_clock that was added into run_simulation fails with a key exception
<lkcl> sim._domains 'key "sync" not found'
<whitequark> you know you shouldn't use nmigen.compat for new code right?
<lkcl> because... it's a combinatorial block.
<whitequark> or are you not using it
<lkcl> i waited until i found a unit test that wasn't
<lkcl> https://git.libre-riscv.org/?p=ieee754fpu.git;a=blob;f=src/ieee754/part_mul_add/test/test_multiply.py;h=78f75011e1cea2346f04babffa3a692f7e6541a7;hb=ff145f44cc90306662de30e7efe351c8a7d95ce0
<lkcl> that's using nmigen.back.pysim - that's not the "compat" layer is it?
* lkcl checks
<whitequark> no, that's not compat
<whitequark> hmm, let's see
<lkcl> it doesn't.
<whitequark> can you extract an MCVE from your code?
<lkcl> line 238.
<lkcl> what's an MCVE?
<lkcl> https://git.libre-riscv.org/?p=ieee754fpu.git;a=blob;f=src/ieee754/part_mul_add/test/test_multiply.py;h=78f75011e1cea2346f04babffa3a692f7e6541a7;hb=ff145f44cc90306662de30e7efe351c8a7d95ce0#l238
<whitequark> "Minimal, Complete and Verifiable Example"
<lkcl> got it .
<lkcl> found it :)
<whitequark> if you provide it, the chances of the bug being fixed promptly rise tenfold.
<lkcl> probably. it's almost trivial
<lkcl> leave it with me
<lkcl> it's only... what... 8 lines of code
<whitequark> ah i see!
<lkcl> :)
<whitequark> ok, so i feel like this isn't a bug, but there's an easy workaround.
<whitequark> let me check if it works
<lkcl> this used to work... about... 2-3 months ago (appx)
<whitequark> the problem is... you're trying to drive a clock domain that doesn't exist
<whitequark> maybe you have a typo?
<whitequark> pysim doesn't know.
<lkcl> it's not a typo. we have code that auto-generates the block
<whitequark> nono
<whitequark> actually, wait
<lkcl> and depending on the unit test parameters, we get either a comb or a sync block created.
<whitequark> that code works for me?
<lkcl> moo?
<whitequark> i can run it against nmigen master just fine
<lkcl> 1 sec, let me do a git pull then
<lkcl> haven't done one in about a week
<lkcl> yep, you're right: something since august 8th has "fixed" it :)
<whitequark> i'm not sure it actually *should* work tbh
<whitequark> but i don't plan on changing that part of pysim in near future anyway
<lkcl> err... argh, we have another issue
<whitequark> yeah?
<lkcl> File "/home/lkcl/src/libreriscv/nmigen/nmigen/back/pysim.py", line 458, in clk_process
<lkcl> NameError: free variable 'clk' referenced before assignment in enclosing scope
<lkcl> yield clk.eq(1)
<lkcl> let me just put that "if "sync" in sim._domains: sim.add_clock(...)" back in...
<lkcl> ok yes, if i put that test back in, it's fine
<lkcl> so... let me see if i can modify the MCVE to repro it...
<whitequark> oh yeah that's a bug.
<_whitenotifier> [m-labs/nmigen] whitequark pushed 1 commit to master [+0/-0/±2] https://git.io/fjNBc
<_whitenotifier> [m-labs/nmigen] whitequark 906385c - back.pysim: don't crash when trying to drive a nonexistent domain clock.
<_whitenotifier> [nmigen] Success. The Travis CI build passed - https://travis-ci.org/m-labs/nmigen/builds/575727917?utm_source=github_status&utm_medium=notification
<_whitenotifier> [nmigen] Success. 80.45% (+0.1%) compared to 9350620 - https://codecov.io/gh/m-labs/nmigen/commit/906385c7f8d648f140a5bc1693dd09a013e34023
<_whitenotifier> [nmigen] Success. 100% of diff hit (target 80.35%) - https://codecov.io/gh/m-labs/nmigen/commit/906385c7f8d648f140a5bc1693dd09a013e34023
<_whitenotifier> [nmigen] Success. Absolute coverage decreased by -0.04% but relative coverage increased by +19.64% compared to 9350620 - https://codecov.io/gh/m-labs/nmigen/commit/906385c7f8d648f140a5bc1693dd09a013e34023
<_whitenotifier> [nmigen] Success. The Travis CI build passed - https://travis-ci.org/m-labs/nmigen/builds/575727917?utm_source=github_status&utm_medium=notification
<lkcl> that's interesting. the "add_clock" exception is back
<lkcl> File "/home/lkcl/src/libreriscv/ieee754fpu/src/ieee754/part_mul_add/test/test_multiply.py", line 635, in subtest_file
<lkcl> sim.add_clock(2e-6)
<lkcl> File "/home/lkcl/src/libreriscv/nmigen/nmigen/back/pysim.py", line 457, in add_clock
<lkcl> .format(domain))
<lkcl> ValueError: Domain 'sync' is not present in simulation
<whitequark> yes.
<lkcl> argh.
<whitequark> that's what it was *supposed* to do.
<whitequark> now...
<lkcl> ok that doesn't really help, as we need to be able to run simulations on combinatorial blocks... *and we don't know whether the code generated will be combinatorial or synchronous*
<lkcl> or... we can, but it'll be a pain in the neck to find out
<lkcl> what did you have in mind?
<lkcl> btw the code that jacob wrote (that this applies to) is absolutely awesome - it's a dynamic (runtime) partitionable SIMD multiply engine.
<lkcl> and we'll be putting in "transparent latches" that actually change the length of the pipeline *at runtime*
<lkcl> utterly cool :)
<whitequark> so you could do two things
<whitequark> one, you could add `except ValueError: pass`.
<whitequark> other, you could do `f = Fragment.get(module, platform=None)` and then do `"sync" in f.drivers`
<whitequark> which is a way to do the same thing via the public API as you're doing right now.
<lkcl> ok. yeah that'd do the trick.
<lkcl> the first is a hack. the second's pretty clean.
<lkcl> yeah that does the trick - nice. thanks
<whitequark> you might have to recurse through submodules for a hierarchical design though
<lkcl> we've a huge tree, it seems to work fine.
<whitequark> if you don't have any m.d.sync at toplevel it will falsely report there's no clock
<lkcl> i'm slightly fearful (for my high-resource laptop) of what happens when we start putting together an actual CPU from all these blocks :)
<lkcl> ah ok.
<whitequark> well... this actually is a good enough reason to add first-class support for this.
<whitequark> hang on.
<lkcl> hm i'll let one of the other unit tests run, just to check
<_whitenotifier> [m-labs/nmigen] whitequark pushed 1 commit to master [+0/-0/±2] https://git.io/fjNBr
<_whitenotifier> [m-labs/nmigen] whitequark 72cf4ca - back.pysim: implement sim.add_clock(if_exists=True).
<lkcl> ok got it. if_exists
<_whitenotifier> [nmigen] Success. The Travis CI build passed - https://travis-ci.org/m-labs/nmigen/builds/575733535?utm_source=github_status&utm_medium=notification
<_whitenotifier> [nmigen] Success. 80.51% (+0.21%) compared to 906385c - https://codecov.io/gh/m-labs/nmigen/commit/72cf4ca9914be49ccd14e18d40425838f476dbb6
<_whitenotifier> [nmigen] Success. 100% of diff hit (target 80.3%) - https://codecov.io/gh/m-labs/nmigen/commit/72cf4ca9914be49ccd14e18d40425838f476dbb6
<whitequark> as for the speed, well, you've heard me before. i have planned improvements to pysim but there are higher priority things.
<_whitenotifier> [nmigen] Success. The Travis CI build passed - https://travis-ci.org/m-labs/nmigen/builds/575733535?utm_source=github_status&utm_medium=notification
<lkcl> test_empty (ieee754.part_mul_add.test.test_multiply.TestMul8_16_32_64) ... ok
<lkcl> passes fine
<lkcl> yeah, it's not a problem - just a source of amusement for me.
<lkcl> - if "sync" in f.drivers:
<lkcl> - sim.add_clock(2e-6)
<lkcl> + sim.add_clock(2e-6, if_exists=True)
<lkcl> works great.
<lkcl> thx whitequark
<_whitenotifier> [nmigen] Success. 80.36% (+0.06%) compared to 906385c - https://codecov.io/gh/m-labs/nmigen/commit/72cf4ca9914be49ccd14e18d40425838f476dbb6
linzhi-sonia has quit [Quit: leaving]
linzhi-sonia has joined #m-labs
Getorix has joined #m-labs
linzhi-sonia has quit [Quit: leaving]
linzhi-sonia has joined #m-labs
lynxis has quit [Ping timeout: 250 seconds]
lynxis has joined #m-labs
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
sb0 has quit [Quit: Leaving]
sb0 has joined #m-labs
davidc__ has joined #m-labs
mumptai has joined #m-labs
mumptai has quit [Quit: Verlassend]
lkcl has quit [Ping timeout: 244 seconds]
lkcl has joined #m-labs
oter has joined #m-labs
oter has quit [Quit: Textual IRC Client: www.textualapp.com]