Open sporniket opened 2 years ago
enum HalfCellMode:
TAG_FROM_VALUE,
VALUE_FROM_TAG
enum HiReadLoWrite:
WRITE,
READ
class HalfCell(Elaboratable):
__init__(self, valueShape: Shape, tag:Signal (?), mode:HalfCellMode ):
self.value = Signal(valueShape)
self.tag = tag
self.mode = mode
self.Matches = Signal(1)
self.DataOut = mode == TAG_FROM_VALUE ? Signal(tag.shape) : Signal(valueShape)
self DataIn = mode == VALUE_FROM_TAG ? Signal(tag.shape) : Signal(valueShape)
ports:
return [self.DataIn, self.RxW, self.DataOut, self.Matches]
The principles :
V
:V
is already bound to a tag, THEN that tag is returnedV
to a free tag that is returnedV
and returned