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
Wanda[cis] has quit [Quit: Idle timeout reached: 172800s]
<mcc111[m]> Under what circumstances would any() and bool() return different results?
<whitequark[cis]> [False] for example
<mcc111[m]> That's a Python value not a Amaranth value though, right?
<whitequark[cis]> ohh! so the difference between the two is the Verilog code it gets converted to
<whitequark[cis]> that's it
<mcc111[m]> okay. so it produces the same results but the implementation is meaningfully different
<mcc111[m]> So there's this code I've got from a sample by Catherine... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/vbWUPtMMldGKQLgVOhRfGUnC>)
<whitequark[cis]> it sounds like the direction for whatever dbg_key_led is connected to is wrong
<mcc111[m]> at "my" end or at the "other" end?
Degi has quit [Ping timeout: 240 seconds]
<mcc111[m]> core_top.v *does* ahve though... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/LIwICHSeyKuiwVuRGmGUVZfC>)
Degi has joined #amaranth-lang
<mcc111[m]> I was supposed to remove those. okay.
<whitequark[cis]> yeo
<whitequark[cis]> * yep
<mcc111[m]> …also now that I'm looking at it… an LED on the… back of the device… is not really all that useful
<mcc111[m]> i usually look at the front of a device, while i am using it
sporniket has joined #amaranth-lang
<sporniket> Hello, I am starting to use Component and Signature.
<sporniket> Writing my first component, is there a mean to use the signature to generate the content of the ports() method ?
sporniket has quit [Quit: Client closed]
<whitequark[cis]> ports() method?
<whitequark[cis]> are you talking about verilog.convert?
sporniket has joined #amaranth-lang
<sporniket> hum, since the beginning when I learned about amaranth, there was that method called "ports()" to add in the elaboratable to return a list of Signal. I know it is needed to see those signal in vcd files
<sporniket> (e.g. in counterexample generated by formal verification)
<sporniket> so I kind of thought of that port method as a must have.
<galibert[m]> IIRC you get all signals in vcd files
<galibert[m]> By default
<whitequark[cis]> method? I'm very confused what are you talking about
<whitequark[cis]> can you show an example?
<whitequark[cis]> this is not a part of Amaranth and never has been
<whitequark[cis]> it's just a thing some people chose to put in their elaboratables
<whitequark[cis]> but yes, signatures can be introspected (there's a branch with the manual that shows how to do this... I'll post a link in a sec) so you can replace that of course
<galibert[m]> You don’t usually need to though
<sporniket> I think i took this habits from https://github.com/RobertBaruch/amaranth-tutorial/blob/main/7_simulating.md, as in my first tries with Amaranth I was doing simulation.
<sporniket> Also I effectively use that now with rtlil.convert()
<whitequark[cis]> rtlil.convert now knows about the signature
<whitequark[cis]> (but you have to give it the elaboratable before it becomes a fragment)
<galibert[m]> If dut has a signature just put a bare “dut” in there
<sporniket> I see... thanks
<sporniket> will work on that.
sporniket has quit [Quit: Client closed]
bob_twinkles[m] has quit [Quit: Idle timeout reached: 172800s]
Wolfvak has quit [Ping timeout: 255 seconds]
Wolfvak has joined #amaranth-lang
<zyp[m]> I'm looking into simulator mechanics and I wonder if there's a convenient way to model e.g. a DDR primitive that's responding to both edges of a clock signal that's passed in. I see Tick is based on self.add_trigger(domain.clk, trigger=1 if domain.clk_edge == "pos" else 0), so AIUI it's possible to wait for arbitrary edges, but it doesn't look like that's exposed to the testbench coroutines
<zyp[m]> I'm not sure I have the full picture yet, but it seems to me like it'd be useful to have a sibling of Tick that instead of taking a domain, takes an arbitrary signal and optionally trigger level that gets passed directly to add_trigger()
<zyp[m]> I picture a testbench would then look something like this: ```python... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/XEUGhoCCaCAmyEqrDjDgwVgC>)
<zyp[m]> * I picture a testbench would then look something like this: ```... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/LbvRLRzXhrHPjXIDfTzkndUN>)
<zyp[m]> * I picture a testbench would then look something like this:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/qVzuMMSnfiJoujFnbOHDfoNI>)
<zyp[m]> * I picture a testbench would then look something like this:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/VsmDxpxBUicqsvGyHOQCcLbp>)
mindw0rk has quit [Quit: ZNC 1.8.2 - https://znc.in]
mindw0rk has joined #amaranth-lang
<galibert[m]> Aren't you going to have two domains or a double-speed single domain in the amaranth side anyway?
<zyp[m]> I could for simulation, that's how I've worked around it in migen's simulator before, but the actual primitives act on both edges of a single clock
<zyp[m]> FWIW I did a proof of concept
<zyp[m]> if I haven't missed another obvious way to do this, this seems like a useful addition to me, that I can write a RFC for
<whitequark[cis]> the reason this isn't currently implemented is that it's unclear that the yield Tick() style interface is particularly great and deserves expansion unmodified. the capability is obviously there.
<zyp[m]> I see
<zyp[m]> what sort of modification do you have in mind?
<whitequark[cis]> I'm not actually sure (hence why it's not made or proposed yet) but it could be useful to watch on complex expressions rather than individual signals, and avoid new names in favor of using combinators of some kind
<whitequark[cis]> I don't know, `await s.posedge()`? I'm quite unsure
_whitelogger has joined #amaranth-lang
GenTooMan has quit [Ping timeout: 246 seconds]
gatin00b[m] has quit [Quit: Idle timeout reached: 172800s]
Chips4MakersakaS has quit [Quit: Idle timeout reached: 172800s]
GenTooMan has joined #amaranth-lang
coltonp has joined #amaranth-lang
jjsuperpower has joined #amaranth-lang
coltonp has quit [Client Quit]
coltonp has joined #amaranth-lang
_whitelogger has joined #amaranth-lang
coltonp has quit [Quit: Client closed]
<cr1901> whitequark[cis]: Would you possibly have time to look at this later today? https://libera.irclog.whitequark.org/amaranth-lang/2023-10-07#1696708633-1696710343; It's not time-sensitive, just "would be nice to figure out what's wrong" while I'm doing related refactorings
<whitequark[cis]> nope
<whitequark[cis]> but the answer is the same, the code was probably never supposed to work
<cr1901> I see. I think I see the problem now too/can answer my own question (I was wrong in my linked comment; flipped(Signature({
<cr1901> "my_flag": Out(1),
<cr1901> }).flip() _should_ return Out() for "ctrl")
<cr1901> "ctrl": Out(ControlSignature)
jjsuperpower_ has joined #amaranth-lang
<cr1901> I will need to reevaluate how I'm connect()ing interfaces
jjsuperpower has quit [Ping timeout: 258 seconds]
<cr1901> Okay yea, you are correct, I understand now. https://github.com/whitequark/amaranth/blob/dfa5b5a414e1fbe3761cebc6b100241fdffd63a4/amaranth/lib/wiring.py#L525 Can this line be removed (since it gets overridden a few lines later)? If so, I'll make a PR when I get the chance
<whitequark[cis]> oh yeah sure
jjsuperpower_ has quit [Ping timeout: 240 seconds]
lf has quit [Ping timeout: 245 seconds]
lf has joined #amaranth-lang
jjsuperpower has joined #amaranth-lang