whitequark changed the topic of #amaranth-lang to: Amaranth hardware definition language · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang
lf has quit [Ping timeout: 252 seconds]
lf_ has joined #amaranth-lang
<_whitenotifier-e> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/yosys/compare/f8b58b705730...4c184284ad4f
<_whitenotifier-e> [YoWASP/yosys] whitequark 4c18428 - Update dependencies.
SimonSapin has quit [Read error: Connection reset by peer]
SimonSapin has joined #amaranth-lang
guan has quit [Ping timeout: 256 seconds]
guan has joined #amaranth-lang
<d1b2> <4o> it's been a while since i used the tool, and looks like i forgot something basic https://paste.debian.net/1229976/ why does it complain on elaborate interace?
<adamgreig[m]> 4o: you're passing the class `wrap` into SImulator which takes an instance of an Elaboratable
<adamgreig[m]> it might make it clearer to name class types with a camelcase name like Wrap and keep all-lowercase names for instances, `wrap = Wrap()`, then you can pass `wrap` into `Simulator(wrap)`
<adamgreig[m]> (also it's conventional to create the Module inside elaborate and therefore not need to bind it to self, but that's not related to your problem)
<d1b2> <4o> so the right thing to do is Simulator(wrap()), right?
<d1b2> <4o> aka pass instance, not the class
<adamgreig[m]> I think the "right" thing to do is name the class Wrap and then `Simulator(Wrap())` but sure
<adamgreig[m]> yea, you have to pass an instance
<adamgreig[m]> it's quite a bizarre error
<d1b2> <4o> thx for help
bl0x_ has quit [Ping timeout: 256 seconds]
<adamgreig[m]> also, your test bench method shouldn't take any arguments (so just plain `bar()`)
<adamgreig[m]> let it capture the uut as a closure (so you _will_ need to bind `wrap = Wrap(); s = Simulator(wrap); def bar(): yield wrap.i.eq(1)`)
bl0x_ has joined #amaranth-lang
<adamgreig[m]> and in your test you probably need some bare `yield` statements to drive any clock cycles, or you'll just print the initial value of `o`, since it's a synchronous assignment and you haven't run the sim for any time
<adamgreig[m]> but that means you'll also probably want s.add_sync_process(bar) and s.add_clock(1/10e6) etc
<adamgreig[m]> if it's helpful, here's a complete little example of a module and simulator, set up to run with `pytest counter.py`: https://github.com/adamgreig/amaranth-examples/blob/master/amaranth_examples/counter.py
<vup> I just read s.add_sync_process(bar) as s.add_sync_progressbar(), which would be pretty neat aswell^^
nak has quit [Ping timeout: 245 seconds]
nak has joined #amaranth-lang
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 250 seconds]
Degi_ is now known as Degi
peepsalot has quit [Quit: Connection reset by peep]
urja has quit [Read error: Connection reset by peer]
urja has joined #amaranth-lang
peepsalot has joined #amaranth-lang
<SimonSapin> agg: that makes a lot of sense, thanks!
<d1b2> <dave berkeley> I'm trying to use a Memory() where the writes to write_port() are in one class and the reads from read_port() in another class. Just a single clock domain. I'm getting the warning "DriverConflict: Memory 'mem' is accessed from multiple fragments, hierarchy will be flattened" but I'm not sure why. What should I look for?
<whitequark> this warning is emitted because you have write_port() and read_port() added to different modules
<d1b2> <dave berkeley> So if I want to write from a different module, I should have the calls to write_port() and read_port() in just one module, but can then access it from another? I'll experiment, thanks.
<whitequark> yeah
<d1b2> <dave berkeley> The warning has gone. Thanks.
<_whitenotifier-e> [amaranth-lang/amaranth-boards] whitequark pushed 1 commit to main [+0/-0/±1] https://github.com/amaranth-lang/amaranth-boards/compare/aaf18252e457...d3fb7331b2b1
<_whitenotifier-e> [amaranth-lang/amaranth-boards] whitequark d3fb733 - genesys2: don't pass strings as resource numbers.
andresmanelli has joined #amaranth-lang
andresmanelli has quit [Ping timeout: 256 seconds]
andresmanelli has joined #amaranth-lang
SpaceCoaster has quit [Quit: Bye]
SpaceCoaster has joined #amaranth-lang
chaoticryptidz has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
chaoticryptidz has joined #amaranth-lang
andresmanelli has quit [Ping timeout: 256 seconds]
andresmanelli has joined #amaranth-lang
andresmanelli has quit [Ping timeout: 256 seconds]
andresmanelli has joined #amaranth-lang
cr1901 has quit [Remote host closed the connection]
cr1901 has joined #amaranth-lang
cr1901 has quit [Remote host closed the connection]
cr1901 has joined #amaranth-lang
andresmanelli has quit []
cr1901 has quit [Remote host closed the connection]
emeb has joined #amaranth-lang
cr1901 has joined #amaranth-lang
Vonter has quit [Quit: WeeChat 3.4]
Bluefoxicy has quit [Ping timeout: 240 seconds]
Bluefoxicy has joined #amaranth-lang
duck2 has quit [Quit: Ping timeout (120 seconds)]
duck2 has joined #amaranth-lang
bvernoux has quit [Quit: Leaving]