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 · play https://amaranth-lang.org/play/ · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 264 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 272 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 255 seconds]
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 255 seconds]
Degi_ is now known as Degi
Stary has quit [Quit: ZNC - http://znc.in]
Stary has joined #amaranth-lang
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 255 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 276 seconds]
frgo has joined #amaranth-lang
FFY00 has quit [Remote host closed the connection]
FFY00 has joined #amaranth-lang
frgo_ has joined #amaranth-lang
frgo has quit [Read error: Connection reset by peer]
oter has quit [Remote host closed the connection]
oter has joined #amaranth-lang
Darius has quit [Quit: Bye]
Darius has joined #amaranth-lang
frgo has joined #amaranth-lang
frgo_ has quit [Read error: Connection reset by peer]
Darius has quit [Quit: Bye]
Darius has joined #amaranth-lang
frgo has quit [Read error: Connection reset by peer]
frgo has joined #amaranth-lang
Psentee has quit [Quit: Off]
Psentee has joined #amaranth-lang
PatD has joined #amaranth-lang
Psentee has quit [Client Quit]
Psentee has joined #amaranth-lang
Wanda[cis] has quit [Quit: Idle timeout reached: 172800s]
<PatD> Greetings, a question about inout pins.
<PatD> I'm integrating with a set of 3rd party verilog/ilang modules. I've created numerous wrappers using m.submodules.instance = Instance(...) without issue, but this particular one uses some inout pins, which internally, eventually get used as SB_IO PACKAGE_PINs.
<PatD> I tried many things to no avail and cannot figure out how to pass in an io_pin = ... to the Instance.
<PatD> Closest I've come comes down to
<PatD>   io_inoutpin = IOPort(1, name="my_pin")
<PatD> but it dies with cryptic errors.
<PatD> Here, "my_pin" is defined as a resource in the platform
<PatD>         Resource("my_pin", 0, Pins("19", dir="io"), Attrs(IO_STANDARD="SB_LVCMOS")),
<PatD> Not certain what else to try at this point.
<PatD> Can anyone provide a link to any examples of using Instance with bidir/inout pins or even just a complete example of IOPort usage using arbitrary pins, mapped for the platform, as above?
<whitequark[cis]> PatD: do I understand it correctly that you want to connect an FPGA pin directly to some Verilog module, which instantiates `SB_IO` itself?
<PatD> Yeah, looks that way.  Just want to pass it the raw pin, or use the equivalent of a pcf or somesuch.
<PatD> Thought I found the way with the IOPort stuff, but can't seem to grok what it wants.
<whitequark[cis]> use this: Instance("your_thing", io_whatever=platform.request("pin", dir="-").io)
<whitequark[cis]> re: cryptic errors, could you file that as a usability issue please?
<PatD> Oh!  Damn, should have pinged here sooner, stayed up way too long debugging this.  Works for one pin, will try out the whole design.
<whitequark[cis]> and I guess the overall thing is a documentation issue, since I don't think we have any place where integration with Verilog is explained
<whitequark[cis]> technically this is documented
<whitequark[cis]> but the documentation requires you to understand the whole system in depth in a way that's not really reasonable to expect
<whitequark[cis]> I mean, in order to answer this question
<PatD> Yes, I'll submit that today.  Many thanks.
<whitequark[cis]> like you could theoretically look at https://amaranth-lang.org/docs/amaranth/latest/guide.html#i-o-values and then at attributes section in https://amaranth-lang.org/docs/amaranth/latest/stdlib/io.html#amaranth.lib.io.SingleEndedPort and conclude that this is the way to go
<whitequark[cis]> but it's not good enough
<whitequark[cis]> I think for the time being we could probably just stick it into lib.io docs
<PatD> Yeah, had found my way to the first, and reviewed many times, and some parts of the second but never figured it out. The fact the .io attrib gags with "'Pin' object has no attribute 'io'." unless you have the dir="-" had me mystified.  Not certain that's anywhere in there.  In any case, will try and summarize/put the issue up.
<PatD> Seems to have solved all my issues, module works great.  Thanks again.
<whitequark[cis]> the dir="-" thing is something that's in the middle of a major deprecation/redesign cycle, which is why it's confusing
<whitequark[cis]> we're making it less confusing, but that takes a lot of time and effort
<whitequark[cis]> lib.io itself is the culmination of a major design effort we've had a few months ago that covers most of the issues, though not all
frgo has quit [Quit: Leaving...]
frgo has joined #amaranth-lang
frgo has quit [Remote host closed the connection]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 276 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 255 seconds]
pie_ has quit []
bl0x[m] has quit [Quit: Idle timeout reached: 172800s]
<_whitenotifier-3> [playground] purdeaandrei opened pull request #3: Fix broken link to RTLIL documentation. - https://github.com/amaranth-lang/playground/pull/3
frgo has joined #amaranth-lang
<_whitenotifier-3> [playground] whitequark closed pull request #3: Fix broken link to RTLIL documentation. - https://github.com/amaranth-lang/playground/pull/3
<_whitenotifier-3> [amaranth-lang/playground] whitequark pushed 1 commit to main [+0/-0/±1] https://github.com/amaranth-lang/playground/compare/503df5b3cc29...2ff1cc76747b
<_whitenotifier-3> [amaranth-lang/playground] purdeaandrei 2ff1cc7 - Fix broken link to RTLIL documentation.