seabeam / yuu_ahb

UVM AHB VIP
MIT License
76 stars 19 forks source link

AHB slave monitor unable to ouput last transaction #6

Open LitchiKnight opened 4 months ago

LitchiKnight commented 4 months ago

您好,我在使用yuu_ahb_master_monitor的analysis port获取transaction时遇到了一个问题:ahb在执行完最后一笔读/写后不再执行ahb操作,此时最后一个transaction无法从analysis port输出,波形如下所示。是否analysis port的输出依赖于下一笔ahb传输?

image
seabeam commented 4 months ago

hi,

并没有复现你的case, 请检查是否master发出trans后直接就结束了,为了证实这一点在case中简单的添加set_drain_time(xxx)可以看出来

LitchiKnight commented 3 months ago

抱歉,之前提供的信息有误。应该是slave的monitor没有发出最后一个trans。图上地址为0x2000_0534的trans,是发给ahb slave的,DUT发完后直到仿真结束都不再操作ahb,slave monitor到仿真结束前都没有输出该trans

LitchiKnight commented 3 months ago

目前我在yuu_ahb_slave_monitor::data_phase()最后加上assembling_and_send()就可以正常输出了

image
seabeam commented 3 months ago

抱歉,之前提供的信息有误。应该是slave的monitor没有发出最后一个trans。图上地址为0x2000_0534的trans,是发给ahb slave的,DUT发完后直到仿真结束都不再操作ahb,slave monitor到仿真结束前都没有输出该trans

还是之前说的,我无法复现你提到的情况。在这里我做了一个简易的seq, 一次INCR一次INCR4:

    wr_req = yuu_ahb_master_item::type_id::create("wr_req");
    wr_req.cfg = cfg;
    wr_req.randomize() with {start_address == 32'h80000100;
                             len == 3;
                             size == SIZE32;
                             burst == INCR;
                             foreach(data[i]) {
                               data[i] == (i+'h1)<<i*8;
                               busy_delay[i] inside {[0:2]};
                             }
                             direction == WRITE;};
    start_item(wr_req);
    finish_item(wr_req);
    get_response(rsp);

    rd_req = yuu_ahb_master_item::type_id::create("rd_req");
    rd_req.cfg = cfg;

    rd_req.randomize() with {start_address == 32'h80000100;
                             len == 3;
                             size == SIZE32;
                             burst == INCR4;
                             foreach(data[i]) {
                               busy_delay[i] inside {[0:2]};
                             }
                             direction == READ;};
    start_item(rd_req);
    finish_item(rd_req);
    get_response(rsp);

并在case中加入打印:

  function void connect_phase(uvm_phase phase);
    super.connect_phase(phase);
    slave.out_monitor_port.connect(in_case_export);
  endfunction : connect_phase

  function void write(yuu_ahb_item t);
    $display(">>> write start ");
    t.print();
    $display(">>> write end ");
  endfunction

这是波形: image

这是log节选: image image

请提交一个最小化的复现case以便复现你遇到的情况。

LitchiKnight commented 3 months ago

我大概描述下场景。首先,DUT不是burst发送trans,而是单个trans依次发送。我在env的run_phase中forever执行slave sequence。可能出现问题的地方是,DUT ahb master在发完最后一笔trans后把ahb slave的hsel拉低了,而slave monitor的cmd_phase是只有在hsel拉高时才会把前一笔trans发出去。如果之后slave的hsel一直不拉高,则没有机会把最后一笔trans通过monitor发出去。对于ahb vip slave来说是合理的吗?

image