whitequark[m] changed the topic of #nmigen to: nMigen hardware description language · code https://github.com/nmigen · logs https://freenode.irclog.whitequark.org/nmigen
Degi_ has joined #nmigen
Degi has quit [Ping timeout: 265 seconds]
Degi_ is now known as Degi
<_whitenotifier-3> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/J35dT
<_whitenotifier-3> [YoWASP/yosys] whitequark 11eb591 - Update dependencies.
revolve has quit [Ping timeout: 246 seconds]
revolve has joined #nmigen
Bertl_oO is now known as Bertl_zZ
Degi_ has joined #nmigen
Degi has quit [Ping timeout: 268 seconds]
Degi_ is now known as Degi
vnksnkr has joined #nmigen
vnksnkr has quit [Ping timeout: 250 seconds]
pftbest has quit [Quit: Leaving...]
revolve has quit [Ping timeout: 246 seconds]
bvernoux has joined #nmigen
revolve has joined #nmigen
pftbest has joined #nmigen
pftbest has quit [Quit: Leaving...]
pftbest has joined #nmigen
Bertl_zZ is now known as Bertl
<FL4SHK> how does `with m.If(...):` work?
<FL4SHK> If you do just `with m.If(...):` without `as whatever`
<FL4SHK> I'm now implementing a similar thing
<whitequark[m]> it mutates the state of `m`, which is later referenced via `m.d.<domain> += ...`
<FL4SHK> I see
<FL4SHK> Is `with` used just to force Python to allow a new amount of leading whitespace?
<FL4SHK> i.e. it has nothing to do with the state of `m`
<FL4SHK> oh wait
<FL4SHK> that can't be right
<FL4SHK> I'm confused
<FL4SHK> miek: thanks
<FL4SHK> this part of Python is new to me
<FL4SHK> kind of new, anyway...
revolve has quit [Ping timeout: 252 seconds]
revolve has joined #nmigen
GenTooMan has quit [Ping timeout: 250 seconds]
<FL4SHK> okay, so there's something I'm stuck on
<FL4SHK> I *think* I just solved it.
GenTooMan has joined #nmigen
<FL4SHK> Do I simply need to make a context manager that `m.If()` returns?
<FL4SHK> that seems to be it!
jfng has quit [Quit: Idle for 30+ days]
nelgau_ has joined #nmigen
nelgau_ has quit [Remote host closed the connection]
nelgau has quit [Read error: Connection reset by peer]
nelgau has joined #nmigen
<DaKnig_> nick DaKnig
DaKnig_ is now known as DaKnig
<DaKnig> FL4SHK: why are you using the `as` part? what does it even do?
<FL4SHK> DaKnig: it gives you an object to work with
<FL4SHK> with open(...) as f:
<FL4SHK> for example
<FL4SHK> will create a file is context-managed
<DaKnig> yes but in the case of m.If in nmigen
<FL4SHK> called f
<DaKnig> I know about the python context manager
<FL4SHK> for clarity, I was wondering how nMigen works without using `as`
<FL4SHK> I thought you'd need to work with the object
<FL4SHK> but it turns out that `m.If()` updates the state of `m`
<whitequark[m]> a very early prototype used something like `with m.If(...) as m:`
<DaKnig> ah. in python you use `as` to catch some temporary object and give it a name, like in `with ... as ...` or `except Exception as e`
<whitequark[m]> but it had no actual benefit
<whitequark[m]> just confusing rebinding
<DaKnig> not the sae thing, but they use the same word for a reason
<FL4SHK> I've decided to follow nMigen's lead on this
<FL4SHK> at least, regarding syntax
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
roamingr1 has joined #nmigen
<FL4SHK> I think it's going to be really cool if I can set up sharing custom types between nMigen code and pyhdlgen code.
<FL4SHK> at *least* for ports
<whitequark[m]> ValueCastable is intentionally very lightweight to allow for that kind of thing
<FL4SHK> I doubt you imagined another DSL-based HDL in Python
<whitequark[m]> i did, one on top of nMigen
<FL4SHK> ah
<FL4SHK> when you say "on top of", do you mean it spits out nMigen?
<whitequark[m]> no
<whitequark[m]> no code generation
<FL4SHK> Okay
<FL4SHK> Can you explain what you mean?
<whitequark[m]> wrapping nmigen as a library, essentially
<FL4SHK> ah
roamingr1 has quit [Ping timeout: 246 seconds]
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
revolve has quit [Ping timeout: 260 seconds]
revolve has joined #nmigen
Bertl is now known as Bertl_zZ
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
lf has quit [Ping timeout: 245 seconds]
lf has joined #nmigen
Cerpin has joined #nmigen
roamingr1 has joined #nmigen
bvernoux has quit [Quit: Leaving]