Commit f3013290 authored by Dimitris Lampridis's avatar Dimitris Lampridis

sim: add function to peek into an HMQ without removing the message from it

parent 6beecf5a
......@@ -164,6 +164,10 @@ class MockTurtleDriver;
msg = hmq[msg.core].receive_message (msg.slot);
endtask // hmq_receive_message
task hmq_peek_message (ref MQueueMsg msg);
msg = hmq[msg.core].peek_message (msg.slot);
endtask // hmq_peek_message
task hmq_send_message (input MQueueMsg msg);
hmq[msg.core].send_message (msg.slot, msg);
endtask // hmq_send_message
......
......@@ -189,6 +189,11 @@ class MQueueHost;
return ret;
endfunction // receive_message
function MQueueMsg peek_message (int slot);
MQueueMsg ret = slots_in[slot][$];
return ret;
endfunction // peek_message
function void send_message (int slot, MQueueMsg msg);
slots_out[slot].push_front(msg);
endfunction // send_message
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment