Explicit packing of Command/Status - #57
Conversation
|
Thanks Lucian -- you didn't change the internal representation of the objects, doesn't that mean that they will still not be tightly packed in the HLS code? I was thinking something like this: class Status {
Status(ap_uint<4> tag, ap_uint<1> internalError, ap_uint<1> decodeError, ap_uint<1> slaveError,
ap_uint<1> okay, ap_uint<23> bytesReceived, ap_uint<1> endOfPacket) {
data_(3,0) = tag;
data_(4,4) = internalError;
data_(5,5) = decodeError;
data_(6,6) = slaveError;
data_(7,7) = okay;
data_(30,8) = bytesReceived;
data_(31,31) = endOfPacket;
}
ap_uint<4> tag() const {
return data_(3, 0);
}
// Repeat for all fields...
private:
ap_uint<32> data_;
}Wouldn't this guarantee tight packing? |
|
I didn't think of changing the underlying storage tbh. The way i used the code in this PR is to have ap_uint streams on interfaces and convert to and from Status/Command for internal use. Something like: The result is tightly packed because ap_uint is what's streamed. But your solution is better because it allows the Status/Command to be carried directly on the stream. I can give it a try in a few days, unless you want to make the change yourself. |
|
Then I like my solution more, if it works. But the critical thing to check is that the size of the struct containing the |
This PR has two changes: