ChanServ changed the topic of #nmigen to: nMigen hardware description language · code at https://github.com/nmigen · logs at https://freenode.irclog.whitequark.org/nmigen · IRC meetings each Monday at 1800 UTC · next meeting September 14th
jeanthom has quit [Ping timeout: 260 seconds]
<_whitenotifier-f> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JU2vT
<_whitenotifier-f> [YoWASP/nextpnr] whitequark 142a693 - Update dependencies.
emeb has quit [Quit: Leaving.]
emeb_mac has joined #nmigen
<_whitenotifier-f> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JU2v1
<_whitenotifier-f> [YoWASP/yosys] whitequark 63a0482 - Update dependencies.
jeanthom has joined #nmigen
jeanthom has quit [Ping timeout: 272 seconds]
<d1b2> <Suryo> Hi! I am just getting started with nmigen on the Orange Crab FPGA and Numato Labs Mimas v2. The Orange Crab is based on lattice ECP5, and the Mimas v2 is based on Spartan 6. I was wondering if someone could point me towards resources on how to define my board in nmigen, as in where I should look and how I should proceed with it. I am familiar with verilog and have worked a little bit with both ise and vivado, but I don't have a solid background in
<d1b2> electronics or vlsi. At the present moment I'm something like a hobbyist.
jaseg has quit [Ping timeout: 240 seconds]
jaseg has joined #nmigen
Degi has quit [Ping timeout: 260 seconds]
Degi has joined #nmigen
PyroPeter_ has joined #nmigen
PyroPeter has quit [Ping timeout: 246 seconds]
PyroPeter_ is now known as PyroPeter
electronic_eel has quit [Ping timeout: 260 seconds]
electronic_eel has joined #nmigen
<ktemkin> Suryo: if you're looking for how to come up with a platform file, there are quite a few examples in `nmigen_boards`: https://github.com/nmigen/nmigen-boards
<ktemkin> including for the OrangeCrab and Mimas (not sure if it's the v1 or v2)
<d1b2> <Suryo> Hi! Thanks for this. I've already taken a look at it. But right now, after some digging, all I'm trying to do is use the connectors defined in the Orange Crab board definition.
<ktemkin> ah, okay
<d1b2> <Suryo> Also, I'm not sure if I'm really talking to a BOT or not. But thanks!!
<d1b2> <esden> @Suryo this channel is tunneled to IRC
<ktemkin> the bot is just the IRC bridge
<d1b2> <esden> the "BOT" is just the IRC tunnel
<d1b2> <Suryo> Oh okay! Thanks for letting me know. I joined just yesterday and I don't yet know what 1bitsquared is all about haha. But thanks guys.
<d1b2> <esden> See channel descrpition 😉
<d1b2> <Kate Temkin> @Suryo same me, just over on IRC =P
<d1b2> <esden> wow TWO times KATE! WAAA
<d1b2> <Kate Temkin> I know, right?
<d1b2> <edbordin> You could call it mutipli-kate-ion
<d1b2> <esden> @edbordin LOL! You know you have to leave now right? 😛
<d1b2> <edbordin> @esden I will see myself out :D
<d1b2> <Suryo> @Kate Temkin could you point me to some resources from which I could understand how to use connectors? I'm sure that it isn't a big deal but I just can't figure it out. I spent the past two hours digging through nmigen's code on GitHub. Figured out where the connector class is defined but I haven't been able to figure out how to use the connector
<d1b2> <Kate Temkin> I'm not sure there are any resources
<d1b2> <Kate Temkin> but hold on, I'll type you up a quick thing
<d1b2> <Suryo> How are you so fast?
<d1b2> <Suryo> Like... You're typing at the speed of transmission or something.
<d1b2> <Suryo> Okay. Seems more human now.
<d1b2> <Kate Temkin> @Suryo you can refer to connectors when defining platform resources; so if you wanted to add a resource on Connector("my_connector", 0, "a1 b2 c3"), you could use "my_connector_0:0" in place of the pin name
<d1b2> <Kate Temkin> and you can dynamically add resources with platform.add_resources
<d1b2> <Suryo> Okay, and I use a platform.request to use them?
<d1b2> <Kate Temkin> yep
<d1b2> <Kate Temkin> so one simple way to grab a connector pin would be to use something like:
<d1b2> <Kate Temkin> platform.add_resources([Resource("my_resource", Pins('my_connector_0:0'), Attrs(<your attributes>))])
<d1b2> <Suryo> Ah! That just made sense.
<d1b2> <Kate Temkin> https://github.com/greatscottgadgets/luna/blob/master/luna/gateware/platform/nexys_video.py#L248 <-- here's an example of me adding some resources based on a connector definition
<d1b2> <Suryo> Wow thanks a lot!
<d1b2> <Suryo> It's getting late where I am and I have work in the morning. Thanks a lot to everyone for their help. I'll let y'all know how it goes! I'll get back to this during the day.
<d1b2> <edbordin> Ooh that's very succinct when used as intended
SpaceCoaster has quit [Ping timeout: 244 seconds]
SpaceCoaster has joined #nmigen
hitomi2508 has joined #nmigen
emeb_mac has quit [Quit: Leaving.]
m4ssi has joined #nmigen
jeanthom has joined #nmigen
sebinho has joined #nmigen
jeanthom has quit [Ping timeout: 260 seconds]
sebinho has quit [Remote host closed the connection]
jeanthom has joined #nmigen
jeanthom has quit [Ping timeout: 240 seconds]
<agg> Suryo/ ktemkin: you can use just use the connector numbers directly and then put conn="name" inside Pins which saves a lot of typing when you have multiple pins
Asu has joined #nmigen
<agg> as I discovered like two days ago :p
jeanthom has joined #nmigen
sebinho has joined #nmigen
<sebinho> Hi, is it still possible to have parameters for a module? The reason is integration with existing VHDL/verilog code and parameters have to be propagated as well. I understand that it is best to get rid of parameters but wanted to see whether that is an option
m4ssi has quit [Ping timeout: 260 seconds]
<agg> you can specify p_PARAMNAME="value" when instantiating, if that's what you mean
<agg> (alongside i_INPUTNAME and o_OUTPUTNAME)
<agg> (not sure if i understood your question correctly)
<jfng> sebinho: if you want to instantiate an nmigen module with parameters inside a verilog module, you can use the Yosys connect_rpc frontend
m4ssi has joined #nmigen
jeanthom has quit [Ping timeout: 240 seconds]
<jfng> which works by adding `connect_rpc -exec nmigen-rpc yosys <the full path of your Elaboratable>' to the yosys script
<sebinho> agg jfng thanks!
sebinho has quit [Ping timeout: 245 seconds]
Chips4Makers has quit [Quit: Leaving.]
jeanthom has joined #nmigen
Chips4Makers has joined #nmigen
<_whitenotifier-f> [nmigen] jfng opened issue #501: Document how to use connectors from platform definitions - https://git.io/JU20x
chipmuenk has joined #nmigen
<pepijndevos> uh... how do i request the pmod on the icebreaker? Or whatever it is you have to do to get the pins.
Asu has quit [Ping timeout: 240 seconds]
<agg> pepijndevos: platform.add_resources([Resource("my_pins", 0, Pins("4 2 47 45", dir="io", conn=("pmod", 0)), Attrs(...))]); pins = platform.request("my_pins");
<agg> uhhh
<agg> pepijndevos: platform.add_resources([Resource("my_pins", 0, Pins("0 1 2 3", dir="io", conn=("pmod", 0)), Attrs(...))]); pins = platform.request("my_pins");
<agg> ....
<agg> pepijndevos: platform.add_resources([Resource("my_pins", 0, Pins("1 2 3 4", dir="io", conn=("pmod", 0)), Attrs(...))]); pins = platform.request("my_pins");
<agg> you use the pin numbers of the connector, starting from 1
<pepijndevos> ahhhh ok
<pepijndevos> ty
<agg> so, you add a new resource to your platform, and its pin numbers could just be 4 2 47 45 to use platform numbers
<agg> but since the connector is defined, you can instead use 1 2 3 4 to use the connector pin numbers, and you add conn=("pmod", 0) to use pmod 0
<agg> once that resource is added, you request and use it as normal
<agg> the - in the connectors list in the platform means to skip that number, so the available pins on one of those pmod are 1 2 3 4 7 8 9 10
<pepijndevos> I sorta assumed the connector was a resource in itself or something. This makes sense
<agg> jfng literally just opened an issue to document this better a couple of hours ago, and Suryo asked about it last night here too
<agg> (and I only tried it for the first time a few days ago, after years of using nmigen...)
<agg> it's fair to say it could be more documented :p
<agg> but yea, it does work fairly neatly once you know the magic incantation
<pepijndevos> Thanks :)
feldim2425_ has quit [Ping timeout: 240 seconds]
emeb has joined #nmigen
<pepijndevos> heh, I doubt a motor driver is very happy to see 12MHz PDM
hitomi2508 has quit [Quit: Nettalk6 - www.ntalk.de]
<pepijndevos> so horribly confused by bit order in nmigen... I want to get the N MSB of a thing... so the last bit is MSB, right?? So... sig[:-N]?
<agg> sig[-1] gets the MSB, sig[-N] gets the Nth MSB
<agg> sig[:-N] gets bits 0, 1, 2, 3, ..., Nth MSB
<agg> (the colon implies a slice, and the missing left-hand argument implies the first item)
<agg> (similarly, sig[-N:] gets bits Nth MSB, N-1th MSB, ..., MSB, and sig[3:5] gets bits 3 and 4)
<pepijndevos> sig[-N:] is what I wanted yea, thanks :)
<agg> sorry, off by one there, the right-hand argument of the slice is exclusive, so sig[:-N] gets 0, 1, 2, 3, ..., N-1th MSB, but excludes the Nth MSB
<agg> sig[-N:] does as I described, Nth MSB, N-1th MSB, ..., MSB
<agg> (in a python shell you can always play around with this sort of thing since it's the same as normal lists)
<agg> (x = list(range(10)); x; x[-3:]; etc)
<pepijndevos> assuming you remember that 0=lsb
emeb has quit [Remote host closed the connection]
emeb has joined #nmigen
danfoster has quit [Ping timeout: 246 seconds]
m4ssi has quit [Remote host closed the connection]
danfoster has joined #nmigen
Asu has joined #nmigen
danfoster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
danfoster has joined #nmigen
feldim2425 has joined #nmigen
danfoster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
danfoster has joined #nmigen
danfoster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
danfoster has joined #nmigen
danfoster has quit [Client Quit]
danfoster has joined #nmigen
danfoster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
danfoster has joined #nmigen
danfoster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
danfoster has joined #nmigen
emeb_mac has joined #nmigen
chipmuenk has quit [Quit: chipmuenk]
chipmuenk has joined #nmigen
chipmuenk has quit [Client Quit]
ademski has joined #nmigen
Asu has quit [Quit: Konversation terminated!]
jeanthom has quit [Ping timeout: 240 seconds]
ademski has quit [Ping timeout: 258 seconds]
emeb has quit [Quit: Leaving.]
jimr has joined #nmigen