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
<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.