OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [PCIe/] [sim/] [src/] [RIFFA/] [s_riffa_rp_tx_api.svh] - Blame information for rev 50

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 50 qaztronic
// --------------------------------------------------------------------
2
class s_riffa_rp_tx_api extends uvm_sequence #(riffa_sequence_item);
3
  `uvm_object_utils(s_riffa_rp_tx_api)
4
 
5
  // --------------------------------------------------------------------
6
  riffa_sequence_item item;
7
  int dwidth;
8
  // mailbox #(riffa_sequence_item) q;
9
 
10
  // --------------------------------------------------------------------
11
  uvm_sequencer_base o_seqr;
12
  uvm_sequence_base o_parent;
13
 
14
  function void init(uvm_sequencer_base o_seqr, uvm_sequence_base o_parent, int dwidth);
15
    this.o_seqr   = o_seqr;
16
    this.o_parent = o_parent;
17
    this.dwidth   = dwidth;
18
  endfunction : init
19
 
20
  // --------------------------------------------------------------------
21
  task counting(bit [31:0] len, bit [30:0] off, bit last=1);
22
    item = riffa_sequence_item::type_id::create("riffa_sequence_item");
23
    item.tr = RIFFA_RX_PAYLOAD;
24
    item.init(dwidth, len, off, last);
25
 
26
    foreach(item.data[i])
27
      item.data[i] = i + 1;
28
 
29
    this.start(o_seqr, o_parent);
30
  endtask
31
 
32
  // --------------------------------------------------------------------
33
  task binary_file
34
    ( string file_name
35
    , bit [31:0] len
36
    , bit [30:0] off
37
    , bit last=1);
38
 
39
    integer fd;
40
    integer code;
41
    item = riffa_sequence_item::type_id::create("riffa_sequence_item");
42
    item.tr = RIFFA_RX_PAYLOAD;
43
    item.init(dwidth, len, off, last);
44
 
45
    fd = $fopen(file_name, "rb");
46
    code = $fread(item.data, fd);
47
    $display("##### code = %x #####", code);
48
    $fclose(fd);
49
 
50
    this.start(o_seqr, o_parent);
51
  endtask
52
 
53
  // --------------------------------------------------------------------
54
  task body();
55
    start_item(item);
56
    finish_item(item);
57
  endtask
58
 
59
  // --------------------------------------------------------------------
60
  function new(string name = "s_riffa_rp_tx_api");
61
    super.new(name);
62
    // q = new;
63
  endfunction
64
 
65
// --------------------------------------------------------------------
66
endclass

powered by: WebSVN 2.1.0

© copyright 1999-2020 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.