whitequark[cis] changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings: Amaranth each Mon 1700 UTC, Amaranth SoC each Fri 1700 UTC · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
frgo has quit [Quit: Leaving...]
<tpw_rules> if i assert r_en on an AsyncFIFO, then i get r_data populated the next cycle. but what about the subsequent cycles if r_en is only asserted for one? in simulation the value doesn't seem to stay which is strange to me
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #amaranth-lang
<iposthuman[m]> Yeah! I was able to create an Amaranth board definition and then synthesize *blinky* onto Machdyne's Keks iCE40 SBC 😌 . I know it isn't much but it took me 2 weeks to learn Python + 2 weeks to learn Amaranth (beginner level) and another week to create the board def file. Now I need to figure out how to use pmods. I am not sure what kind of object request() is returning ```pmod_a = platform.request( 'pmod', 0 )```. 🤔
<iposthuman[m]> Does anyone have an example of using a pmod to drive for example 8bit LED pmod board?
<iposthuman[m]> Would it be something like ```pmod_a.value.eq(0b00000001)``` to turn on the lower LED?
<adamgreig[m]> it depends on what 'pmod' is defined as in the platform, but perhaps you want m.d.comb += pmod_a.o.eq(1)
<adamgreig[m]> the .o is for "output"
<iposthuman[m]> Connector("pmod", 0, "A11 B13 A15 A16 - - B12 B14 B15 C14 - -"), # PMOD A
<iposthuman[m]> ]
<iposthuman[m]> Connector("pmod", 1, "M12 T16 R10 P10 - - R16 T15 P13 T11 - -"), # PMOD B
<adamgreig[m]> ah, if it's a connector rather than a "resource" then you can't request() it directly
<iposthuman[m]> It looks like Connector has a dictionary
<iposthuman[m]> Cool. I'll check it out. Thanks.
<adamgreig[m]> notably you need to first platform.add_resource() to add a resource that uses that connector, then you can platform.request() your new resource, and then you can drive it
<adamgreig[m]> if you're writing your own platform file anyway, you could also just put a resource on those same pins
<adamgreig[m]> like in resources=[] add Resource("pmod_led", 0, Pins("C14", dir="o")), then you can platform.request("pmod_led")
<iposthuman[m]> Ok. I don't know all what is possible with platform files. It was mostly a copy of icesugar board
<adamgreig[m]> but it's "neater" to make it a connector in the platform and then attach resources to it in the normal code, depending on what you've actually plugged in to it
<iposthuman[m]> Ok. i'll try that
<iposthuman[m]> That makes sense and is more flexible.
<adamgreig[m]> in principle a resource is for something that's permanently attached, like maybe an spi device, or some on-board LEDs or switches, or a clock, that sort of thing
<iposthuman[m]> So pmods are pretty much going to almost demand the add_resource() approach. Understood.
<iposthuman[m]> almost always
Degi has quit [Ping timeout: 256 seconds]
Degi has joined #amaranth-lang
jjsuperpower has joined #amaranth-lang
lethalbit|wut has joined #amaranth-lang
Bluefoxicy_ has joined #amaranth-lang
Xesxen_ has joined #amaranth-lang
leptonix_ has joined #amaranth-lang
TD--Linux has joined #amaranth-lang
Bluefoxicy has quit [*.net *.split]
TD-Linux has quit [*.net *.split]
leptonix has quit [*.net *.split]
lethalbit has quit [*.net *.split]
Xesxen has quit [*.net *.split]
Bluefoxicy_ is now known as Bluefoxicy
pie_ has quit []
pie_ has joined #amaranth-lang
pie_ has quit [Ping timeout: 252 seconds]
pie_ has joined #amaranth-lang
<cr1901> TIL (Amaranth used it in the most recent commit): https://github.com/asottile/pyupgrade
<anuejn> tpw_rules, jfng[m]: I would also be interested in an example
<anuejn> and maybe see how it could integrate with our downstream soc code
<iposthuman[m]> I took adamgreig (@_discord_614384955182678017:catircservices.org) 's suggestion and added my resources dynamically via: ```... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/nhbgwMLtbSPSiZiGzfEXzBgE>)
<iposthuman[m]> My board def has the Connectors defined as:```... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/dHTUCXxOwzLXGINIBSItkWBV>)
<adamgreig[m]> When you're adding a resource to the connector, you use connector pin numbers like 1 2 3..., not chip pin numbers like A11
<iposthuman[m]> However, when I try to request any pin from pmod B I get a nonexistence connector error
<adamgreig[m]> You could just add the resources directly with chip pins and omit the connector argument if you want
<iposthuman[m]> Ah!
<adamgreig[m]> Also you can put multiple pins in the string to get a multi bit resource, rather than adding one resource per pin
<iposthuman[m]> Ok. i'll try that
<iposthuman[m]> What would be the "pin numbers"?
<iposthuman[m]> nevermind, you said, connector pin numbers.
<iposthuman[m]> hmmm. I don't understand the connector pins definition. My board def has:
<iposthuman[m]> but when I try to request it i guess an error on pin 5:```... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/yJqJKcERYnHtOedDLQjmirbp>)
<iposthuman[m]> adamgreig (@_discord_614384955182678017:catircservices.org) is it because i have "-" dashes in my connector?
ravenslofty[m] has joined #amaranth-lang
<ravenslofty[m]> do you see the dashes? those are not-connected pins.
<ravenslofty[m]> so I think you need `"1 2 3 4 7 8 9 10"`
<iposthuman[m]> Ah. i though they meant power pins.
<ravenslofty[m]> whichever they are, the FPGA isn't connected to them
<iposthuman[m]> Understood. 😌
notgull has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
notgull has joined #amaranth-lang
key2 has quit [Quit: Connection closed for inactivity]
gruetzkopf has quit [Server closed connection]
gruetzkopf has joined #amaranth-lang
<iposthuman[m]> Thanks adamgreig (@_discord_614384955182678017:catircservices.org) , ravenslofty (@_discord_133122593044692992:catircservices.org) . It works! Much appreciated. 😉
adamgreig[m]1 has joined #amaranth-lang
<adamgreig[m]1> nice!
jjsuperpower has quit [Remote host closed the connection]
jjsuperpower has joined #amaranth-lang
notgull has quit [Ping timeout: 252 seconds]
notgull has joined #amaranth-lang