amaranth
amaranth copied to clipboard
`stream.Signature` should allow setting the init value for the payload
This for example does not work:
class BitSerializer(wiring.Component):
def __init__(self, *, width, length):
self._length = length
super().__init__({
"shift": In(1),
"stream": In(stream.Signature(data.StructLayout({
"o": data.ArrayLayout(width, length),
"oe": 1
})), init={"payload": {"oe": 1}}),
"buffer": Out(io.FFBuffer.Signature("o", width)),
})
but could be valuable for the same reason io.Buffer.Signature's oe member has init=1.
doing it with the proposed syntax is not possible with current lib.wiring (a member of signature type with init will be rejected)
what do you think about stream.Signature(..., payload_init={"oe": 1}) instead?
doing it with the proposed syntax is not possible with current
lib.wiring(a member of signature type withinitwill be rejected)what do you think about
stream.Signature(..., payload_init={"oe": 1})instead?
Yeah, I was thinking of just init= since it would not make any sense to have ready/valid have init IMO.
Let's bikeshed payload_init= vs init= on the next meeting.
We have discussed this issue on the 2024-07-01 weekly meeting. We have decided to go with payload_init=.