Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise code gen for DpContainer #386

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,13 @@ case class ComponentDataProducts (
| sizeof(FwDpIdType) +
| $typeSize;
|Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
|if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
|if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
| const FwDpIdType id = this->baseId + RecordId::$name;
| status = this->dataBuffer.serialize(id);
| status = this->m_dataBuffer.serialize(id);
| FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
| status = this->dataBuffer.serialize(elt);
| status = this->m_dataBuffer.serialize(elt);
| FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
| this->dataSize += sizeDelta;
| this->m_dataSize += sizeDelta;
|}
|else {
| status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand Down Expand Up @@ -425,11 +425,11 @@ case class ComponentDataProducts (
// Optimize the U8 case
case Type.U8 =>
"""| const bool omitSerializedLength = true;
| status = this->dataBuffer.serialize(array, size, omitSerializedLength);
| status = this->m_dataBuffer.serialize(array, size, omitSerializedLength);
| FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);"""
case _ =>
"""| for (FwSizeType i = 0; i < size; i++) {
| status = this->dataBuffer.serialize(array[i]);
| status = this->m_dataBuffer.serialize(array[i]);
| FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
| }"""
}).stripMargin
Expand All @@ -440,14 +440,14 @@ case class ComponentDataProducts (
| sizeof(FwSizeType) +
| size * $eltSize;
|Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
|if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
|if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
| const FwDpIdType id = this->baseId + RecordId::$name;
| status = this->dataBuffer.serialize(id);
| status = this->m_dataBuffer.serialize(id);
| FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
| status = this->dataBuffer.serialize(size);
| status = this->m_dataBuffer.serialize(size);
| FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
|$serializeElts
| this->dataSize += sizeDelta;
| this->m_dataSize += sizeDelta;
|}
|else {
| status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * ActiveAsyncProducts_Data::SERIALIZED_SIZE;
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::DataArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
for (FwSizeType i = 0; i < size; i++) {
status = this->dataBuffer.serialize(array[i]);
status = this->m_dataBuffer.serialize(array[i]);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
}
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -130,13 +130,13 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer ::
sizeof(FwDpIdType) +
ActiveAsyncProducts_Data::SERIALIZED_SIZE;
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::DataRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(elt);
status = this->m_dataBuffer.serialize(elt);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -156,17 +156,17 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * sizeof(U32);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
for (FwSizeType i = 0; i < size; i++) {
status = this->dataBuffer.serialize(array[i]);
status = this->m_dataBuffer.serialize(array[i]);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
}
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -181,13 +181,13 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer ::
sizeof(FwDpIdType) +
sizeof(U32);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U32Record;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(elt);
status = this->m_dataBuffer.serialize(elt);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -207,16 +207,16 @@ Fw::SerializeStatus ActiveAsyncProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * sizeof(U8);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
const bool omitSerializedLength = true;
status = this->dataBuffer.serialize(array, size, omitSerializedLength);
status = this->m_dataBuffer.serialize(array, size, omitSerializedLength);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * ActiveGetProducts_Data::SERIALIZED_SIZE;
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::DataArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
for (FwSizeType i = 0; i < size; i++) {
status = this->dataBuffer.serialize(array[i]);
status = this->m_dataBuffer.serialize(array[i]);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
}
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -128,13 +128,13 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer ::
sizeof(FwDpIdType) +
ActiveGetProducts_Data::SERIALIZED_SIZE;
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::DataRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(elt);
status = this->m_dataBuffer.serialize(elt);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -154,17 +154,17 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * sizeof(U32);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
for (FwSizeType i = 0; i < size; i++) {
status = this->dataBuffer.serialize(array[i]);
status = this->m_dataBuffer.serialize(array[i]);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
}
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -179,13 +179,13 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer ::
sizeof(FwDpIdType) +
sizeof(U32);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U32Record;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(elt);
status = this->m_dataBuffer.serialize(elt);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -205,16 +205,16 @@ Fw::SerializeStatus ActiveGetProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * sizeof(U8);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
const bool omitSerializedLength = true;
status = this->dataBuffer.serialize(array, size, omitSerializedLength);
status = this->m_dataBuffer.serialize(array, size, omitSerializedLength);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * ActiveGuardedProducts_Data::SERIALIZED_SIZE;
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::DataArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
for (FwSizeType i = 0; i < size; i++) {
status = this->dataBuffer.serialize(array[i]);
status = this->m_dataBuffer.serialize(array[i]);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
}
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -128,13 +128,13 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer ::
sizeof(FwDpIdType) +
ActiveGuardedProducts_Data::SERIALIZED_SIZE;
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::DataRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(elt);
status = this->m_dataBuffer.serialize(elt);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -154,17 +154,17 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * sizeof(U32);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U32ArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
for (FwSizeType i = 0; i < size; i++) {
status = this->dataBuffer.serialize(array[i]);
status = this->m_dataBuffer.serialize(array[i]);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
}
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -179,13 +179,13 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer ::
sizeof(FwDpIdType) +
sizeof(U32);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U32Record;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(elt);
status = this->m_dataBuffer.serialize(elt);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand All @@ -205,16 +205,16 @@ Fw::SerializeStatus ActiveGuardedProductsComponentBase::DpContainer ::
sizeof(FwSizeType) +
size * sizeof(U8);
Fw::SerializeStatus status = Fw::FW_SERIALIZE_OK;
if (this->dataBuffer.getBuffLength() + sizeDelta <= this->dataBuffer.getBuffCapacity()) {
if (this->m_dataBuffer.getBuffLength() + sizeDelta <= this->m_dataBuffer.getBuffCapacity()) {
const FwDpIdType id = this->baseId + RecordId::U8ArrayRecord;
status = this->dataBuffer.serialize(id);
status = this->m_dataBuffer.serialize(id);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
status = this->dataBuffer.serialize(size);
status = this->m_dataBuffer.serialize(size);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
const bool omitSerializedLength = true;
status = this->dataBuffer.serialize(array, size, omitSerializedLength);
status = this->m_dataBuffer.serialize(array, size, omitSerializedLength);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
this->dataSize += sizeDelta;
this->m_dataSize += sizeDelta;
}
else {
status = Fw::FW_SERIALIZE_NO_ROOM_LEFT;
Expand Down
Loading
Loading