sim: Add ChdrIfaceBfm test

Original-commit: 6f42ab7c1c962bfc425b6790fe41b2c14769e561
This commit is contained in:
Wade Fife
2020-03-09 13:43:05 -05:00
parent faa360a0f9
commit 2711d7f618
5 changed files with 675 additions and 5 deletions
+3 -2
View File
@@ -569,8 +569,9 @@ package PkgChdrBfm;
$fatal(1, "ChdrPacket::update_lengths(): Calculated NumMData exceeds maximum size");
// Calculate the Length field
num_bytes = data.size() * BYTES_PER_CHDR_W; // Payload length
num_bytes = num_bytes + header_bytes() + mdata_bytes(); // Payload + header length
num_bytes = header_bytes() + // Header
num_mdata * BYTES_PER_CHDR_W + // Metadata
data.size() * BYTES_PER_CHDR_W; // Payload
assert(num_bytes < 2**$bits(chdr_length_t)) else
$fatal(1, "ChdrPacket::update_lengths(): Calculated Length exceeds maximum size");