fpga: sim: Check for empty packet in clear_unused_bytes

Original-commit: 2615547a82bc4e06ff5fcb79c5c1efed76b058c7
This commit is contained in:
Wade Fife
2021-06-17 08:16:59 -05:00
parent 77a66a4de4
commit 29ac752be0
+4
View File
@@ -557,6 +557,10 @@ package PkgEthernet;
// clear bytes that aren't marked as valid by keep
function void clear_unused_bytes();
keep_t last_tkeep;
// check for empty packet, in which case there's nothing to clear
if (this.data.size() == 0) return;
last_tkeep = this.keep[$];
// check that the last user is the same as the last keep
assert (this.keep[$] == calc_last_tkeep(this.user[$])) else