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 quit [Remote host closed the connection]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 255 seconds]
frgo has joined #amaranth-lang
frgo has quit [Remote host closed the connection]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 260 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 260 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
Degi has quit [Ping timeout: 252 seconds]
Degi has joined #amaranth-lang
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 272 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 276 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
d_olex has quit [Ping timeout: 260 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
d_olex has joined #amaranth-lang
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 248 seconds]
d_olex_ has joined #amaranth-lang
d_olex_ has quit [Remote host closed the connection]
d_olex has quit [Ping timeout: 252 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 265 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 276 seconds]
d_olex has joined #amaranth-lang
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 276 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 260 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
frgo has joined #amaranth-lang
John_K has joined #amaranth-lang
<John_K> for a Struct, is there a way to easily set all of its members at once from simulation, ie with ctx.set() instead of repeatedly calling that for each member?
<John_K> The only solution that I found was turning the struct into a union with the structure and a signal of the same size as members
<whitequark[cis]> a Struct is a ValueCastable, so you could use as_value() to do the same thing: https://amaranth-lang.org/docs/amaranth/latest/reference.html#amaranth.hdl.ValueCastable.as_value
<John_K> aha, so something like val = Value.cast(self.project.REG_STATUS)
<John_K>             ctx.set(val, 0xFC)
<John_K> for some reason Struct doesn't seem to have as_value()?
John_K has quit [Ping timeout: 256 seconds]
<whitequark[cis]> any value-castable would have .as_value()
<whitequark[cis]> what are you calling exactly?
John_K has joined #amaranth-lang
<John_K> not sure why it didn't work on my laptop, but on my linux machine, ctx.set(self.project.REG_STATUS.as_value(), 0xF5) appears to work just fine
<whitequark[cis]> that's very odd!
<John_K> indeed! I'll try to dig into it
zyp[m] has joined #amaranth-lang
<zyp[m]> you should also be able to pass a dict with member values to ctx.set()
<whitequark[cis]> oh yeah! i think we may not have that documented anywhere
<whitequark[cis]> afaict we don't