Skip to content

Commit

Permalink
Merge branch 'cabal_uvm_improve' into 'devel'
Browse files Browse the repository at this point in the history
CORE-APP-UVM: [FEATURE] Improve print of MVB transaction for APP-UVM verifications

See merge request ndk/ndk-fpga!83
  • Loading branch information
radek-isa committed Oct 18, 2024
2 parents f3b5108 + f94d6d6 commit 98e104b
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions core/comp/app/app_uvm/env/scoreboard_cmp.sv
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,28 @@ class scoreboard_cmp_header #(type MODEL_ITEM, type DUT_ITEM, int unsigned META_

virtual function string model_item2string(MODEL_ITEM tr);
string msg; //ETH [%0d] header
logic [8-1:0] hdr_len;
logic [4-1:0] hdr_id;

{hdr_id, hdr_len} = tr.meta;

msg = tr.time2string();
msg = {msg, $sformatf("\n\t\tdiscard %b", tr.discard)};
msg = {msg, $sformatf("\n\t\tchannel %0d", tr.channel)};
msg = {msg, $sformatf("\n\t\tmeta 0x%h", tr.meta)};
msg = {msg, $sformatf("\n\t\tpacket_size %0d", tr.data.size())};
msg = {msg, $sformatf("\n\t\tDiscard : %b", tr.discard)};
msg = {msg, $sformatf("\n\t\tChannel : %0d", tr.channel)};
msg = {msg, $sformatf("\n\t\tDMA META : 0x%h", tr.meta)};
msg = {msg, $sformatf("\n\t\t - HDR ID : 0x%h (%0d)", hdr_id, hdr_id)};
msg = {msg, $sformatf("\n\t\t - HDR LEN : 0x%h (%0d)", hdr_len, hdr_len)};
msg = {msg, $sformatf("\n\t\tDMA packet size : %0d", tr.data.size())};
msg = {msg, $sformatf("\n\t\t - Payload size : %0d", (tr.data.size() - hdr_len))};

return msg;
endfunction

virtual function string dut_item2string(DUT_ITEM tr);
string error_msg; //ETH [%0d] header
logic [META_WIDTH-1:0]meta = 'x;
logic [8-1:0] hdr_len = 'x;
logic [4-1:0] hdr_id = 'x;
logic [$clog2(CHANNELS)-1:0] channel;
logic [$clog2(PKT_MTU+1)] packet_size;
logic discard;
Expand All @@ -55,13 +65,17 @@ class scoreboard_cmp_header #(type MODEL_ITEM, type DUT_ITEM, int unsigned META_
{discard, channel, packet_size} = tr.data;
end else begin
{discard, channel, meta, packet_size} = tr.data;
{hdr_id, hdr_len} = meta;
end

error_msg = tr.time2string();
error_msg = {error_msg, $sformatf("\n\t\tdiscard %b", discard)};
error_msg = {error_msg, $sformatf("\n\t\tchannel %0d", channel)};
error_msg = {error_msg, $sformatf("\n\t\tmeta 0x%h", meta)};
error_msg = {error_msg, $sformatf("\n\t\tpacket_size %0d", packet_size)};
error_msg = {error_msg, $sformatf("\n\t\tDiscard : %b", discard)};
error_msg = {error_msg, $sformatf("\n\t\tChannel : %0d", channel)};
error_msg = {error_msg, $sformatf("\n\t\tDMA META : 0x%h", meta)};
error_msg = {error_msg, $sformatf("\n\t\t - HDR ID : 0x%h (%0d)", hdr_id, hdr_id)};
error_msg = {error_msg, $sformatf("\n\t\t - HDR LEN : 0x%h (%0d)", hdr_len, hdr_len)};
error_msg = {error_msg, $sformatf("\n\t\tDMA packet size : %0d", packet_size)};
error_msg = {error_msg, $sformatf("\n\t\t - Payload size : %0d", (packet_size-hdr_len))};

return error_msg;
endfunction
Expand Down

0 comments on commit 98e104b

Please sign in to comment.