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