forked from letitbe0201/AXI-DMA-master-verification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
axi_payload.svh
52 lines (45 loc) · 1.33 KB
/
axi_payload.svh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
`ifndef AXI_PAYLOAD_SVH
`define AXI_PAYLOAD_SVH
class axi_payload;
axi_item item;
local axi_data data[$];
local axi_strobe strobe[$];
local axi_response response[$];
static function axi_payload create(axi_item item);
axi_payload payload_store = new;
payload_store.item = item;
return payload_store;
endfunction : create
function void store_write_data(axi_data data, axi_strobe strobe);
if (item.is_write()) begin
this.data.push_back(data);
this.strobe.push_back(strobe);
end
endfunction : store_write_data
function void store_response(axi_response response, axi_data data);
this.response.push_back(response);
if (item.is_read()) begin
this.data.push_back(data);
end
endfunction : store_response
function void pack_write_data();
item.put_data(data);
item.put_strobe(strobe);
endfunction : pack_write_data
function void pack_response();
item.put_response(response);
if (item.is_read()) begin
item.put_data(data);
end
endfunction : pack_response
function int get_stored_write_data_count();
if (item.is_write())
return data.size();
else
return 0;
endfunction : get_stored_write_data_count
function int get_stored_response_count();
return response.size();
endfunction : get_stored_response_count
endclass : axi_payload
`endif