From 1de388c61b5fcc0c597638b8ddb3f899d5af6d67 Mon Sep 17 00:00:00 2001 From: Wade Fife Date: Wed, 29 Apr 2020 16:57:27 -0500 Subject: [PATCH] fpga: sim: Don't affect packet arguments in chdr_to_axis This updates the chdr_to_axis method so that it doesn't change the input chdr_packet object. This is useful in case there are other references to that object in use. Not modifying the object means that you don't always have to copy the object before passing it to this method. Original-commit: 259506c4993834d9ef8ccb48635623552b075237 --- sim/rfnoc/PkgChdrBfm.sv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sim/rfnoc/PkgChdrBfm.sv b/sim/rfnoc/PkgChdrBfm.sv index a485eca..96bfbd3 100644 --- a/sim/rfnoc/PkgChdrBfm.sv +++ b/sim/rfnoc/PkgChdrBfm.sv @@ -789,14 +789,14 @@ package PkgChdrBfm; end // Insert metadata - while (chdr_packet.metadata.size() > 0) begin - bus_word = chdr_packet.metadata.pop_front(); + foreach (chdr_packet.metadata[i]) begin + bus_word = chdr_packet.metadata[i]; axis_packet.data.push_back(bus_word); end // Insert payload - while (chdr_packet.data.size() > 0) begin - bus_word = chdr_packet.data.pop_front(); + foreach (chdr_packet.data[i]) begin + bus_word = chdr_packet.data[i]; axis_packet.data.push_back(bus_word); end