whitequark[m] changed the topic of #nmigen to: nMigen hardware description language · code https://github.com/nmigen · logs https://freenode.irclog.whitequark.org/nmigen
lf has quit [Ping timeout: 276 seconds]
lf has joined #nmigen
Degi_ has joined #nmigen
Degi has quit [Ping timeout: 252 seconds]
Degi_ is now known as Degi
fdsa has quit [Quit: Connection closed]
proteus-guy has quit [Remote host closed the connection]
lkcl has quit [Ping timeout: 240 seconds]
lkcl has joined #nmigen
Degi_ has joined #nmigen
Degi has quit [Ping timeout: 246 seconds]
Degi_ is now known as Degi
moony has quit [Quit: Bye!]
moony has joined #nmigen
revolve has quit [Read error: Connection reset by peer]
PyroPeter_ has joined #nmigen
PyroPeter has quit [Ping timeout: 252 seconds]
PyroPeter_ is now known as PyroPeter
revolve has joined #nmigen
cr1901_modern has joined #nmigen
moony has quit [Ping timeout: 252 seconds]
pftbest has joined #nmigen
moony has joined #nmigen
Bertl_oO is now known as Bertl_zZ
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
emeb_mac has quit [Quit: Leaving.]
* sensille is new to nmigen and tries to get a grip on the concepts. I can get board pins via 'platform', but during simulation there is no platform. what is the idea behind this? should i get all pins from top-level and pass them down the module hierarchy?
<sensille> it sounds a bit like i could just get the pins from the modules where i need them
<sensille> passing down tons of pins through several modules is something that really got on my nerves in verilog
<d1b2> <4o> is there a oneliner for splitting Signal(32) into Array(Signal(8) for _ in range(4))?
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
pftbest has quit [Ping timeout: 246 seconds]
jeanthom has joined #nmigen
jeanthom has quit [Ping timeout: 246 seconds]
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
peepsalot has quit [Ping timeout: 240 seconds]
peepsalot has joined #nmigen
<d1b2> <4o> do i have to have to have at least 1 sync domain for py sim to work? https://paste.debian.net/1191317/
<d1b2> <4o> yeah, looks like i do need a sync domain for add_sync_process to make sense. got an impression that add_process doesnt prevent the sim from terminating
pftbest has joined #nmigen
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
DaKnig has quit [Ping timeout: 260 seconds]
DaKnig has joined #nmigen
DaKnig has joined #nmigen
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
<d1b2> <icb> @4o Usual Python syntax tends to work, like s=Signal(32); l=[s[n:n+8] for n in range(0, len(s), 8)]
<d1b2> <dub_dub_11> @sensille#0000 you could declare the pin in your module header, then do if(platform != None) to decide if you are gonna request a platform pin to assign to it
<d1b2> <dub_dub_11> I usually get pins in top level and pass them down but I'm not sure if that's the intended methods. The difference in passing them down is that you can make the submodules public so to pass a pin through you just need to do something like submodule.spi_module.spi_pins = platform.request("spi")
<sensille> ok, i think i have to play a bit with both methods. a difference to verilog is also that it's easy to pass signals down, or even build records of them
<sensille> i think passing down is cleaner
<d1b2> <dub_dub_11> Yeah Oop makes it much nicer than every intermediate module needing to have ports
<sensille> another question i have is if it makes a difference if i instantiate signals in __init__ or in elaborate. build ports in __init__, internal state in elaborate?
pftbest_ has joined #nmigen
pftbest has quit [Ping timeout: 246 seconds]
<d1b2> <dub_dub_11> Yeah as you suggest. Ports need to be self.signalname too so they are visible
<d1b2> <4o> sorcery
<d1b2> <4o> thanks
<agg> 4o, the word_select method might be helpful, s.word_select(n, 8) and n can be a runtime signal, so you don't need to make an array at all
<agg> Or you can do like Array(s.word_select(n, 8) for n in range(4)) for a similar effect
<agg> In sim you don't need a sync domain, you can stimulate purely combinatorial logic, use add_process and yield Settle
<d1b2> <4o> i want a shift reg. so i believe static slicing is what i want. but thanks for reminding about word select, i keep forgetting it exists
<agg> The Array in your original question is for making dynamic selection
<agg> But yea if the selection is fixed, word_select or just regular bit slicing should be fine
<agg> In your example I think just using add_process should work fine?
<d1b2> <4o> yeah, the hint was in the name. add_proces worked. 99% bugs are in human brain
jeanthom has joined #nmigen
<vup> ltny
jeanthom has quit [Ping timeout: 240 seconds]
pftbest_ has quit [Remote host closed the connection]
pftbest has joined #nmigen
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
GenTooMan has quit [Ping timeout: 258 seconds]
GenTooMan has joined #nmigen
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
jeanthom has joined #nmigen
revolve has quit [Read error: Connection reset by peer]
blazra has quit [Quit: Idle for 30+ days]
revolve has joined #nmigen
jeanthom has quit [Ping timeout: 240 seconds]
Bertl_zZ is now known as Bertl
<d1b2> <twam> What's the proper way to create a resource, e.g. ULPIResource (https://github.com/nmigen/nmigen-boards/blob/master/nmigen_boards/resources/interface.py#L117) out of Pins available on a connector (e.g. https://github.com/nmigen/nmigen-boards/blob/master/nmigen_boards/ulx3s.py#L129). Especially if don't want to use the whole connector for a single resource.
<agg> twam: you can use platform.add_resources, and in each resource, use Pins("1 2 3 4", conn=("conn_name", 0))
<agg> you only use whichever pins you need, the rest remain unallocated and can be used by other resources
<agg> (as an alternative syntax you can use Pins("conn_name_0:1") but I don't think there's any reason to do so)
<d1b2> <twam> I don't want to copy the pin numbers from the original Connector definition but abstract that away. The Pins("conn_name_0:1") syntax sounds promising. I'll give that a try.
<agg> sorry, I probably wasn't clear
<agg> you don't need to copy the numbres from the original definition
<agg> Pins("1", conn=("pmod", 0)) would use "pin 1" from the pmod, which might be pin A7 on the FPGA or whatever is in connectors
<agg> using Pins("pmod_0:1") is the same as using Pins("1", conn=("pmod", 0))
<d1b2> <twam> And in something like DirectUSBResource(0, d_p="D15", d_n="E15", pullup="B12", attrs=Attrs(IO_TYPE="LVCMOS33") ) I can replace D15 then with Pins("pmod_0:!")?
jeanthom has joined #nmigen
<agg> in fact, DirectUSBResource takes a conn argument too
<agg> so you could use DirectUSBResource(d_p="1", d_n="2", pullup="3", conn=("pmod", 0))
<agg> [but yes, I think you could also write DirectUSBResource(d_p="pmod_0:1") etc, but I think using the conn argument is clearer and shorter)
pftbest_ has joined #nmigen
jeanthom has quit [Ping timeout: 246 seconds]
pftbest has quit [Ping timeout: 246 seconds]
pftbest_ has quit [Remote host closed the connection]
pftbest has joined #nmigen
jeanthom has joined #nmigen
cr1901_modern has quit [Quit: Leaving.]
AkechiShiro has quit [Quit: WeeChat 2.9]
cr1901_modern has joined #nmigen
AkechiShiro has joined #nmigen
<d1b2> <twam> Ah, cool. Didn't notice that. That looks very good.
<sensille> is it possible to add debug-prints to if-paths?
blazra has joined #nmigen
<vup> sensille: this is planned, see https://github.com/nmigen/nmigen/issues/432
<vup> I think there is a wip implementation in the pysim-display branch
<sensille> ah, ok
emeb_mac has joined #nmigen
nspaced has joined #nmigen
chipmuenk has joined #nmigen
chipmuenk has quit [Client Quit]
FFY00_ has quit [Remote host closed the connection]
jeanthom has quit [Ping timeout: 268 seconds]
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
pftbest has quit [Remote host closed the connection]
lf has quit [Ping timeout: 250 seconds]
lf has joined #nmigen
pftbest has joined #nmigen