Analysis Components & Techniques(从MetricAnalyzers开始)

上一篇 / 下一篇  2018-12-27 19:46:37

   MetricAnalyzers

  Overview  

       度量分析器监视和记录非功能行为,如延迟,功率利用率和其他与性能相关的测量。

  Construction

       度量分析仪通常是标准analysis components。它们以一种方式来实现它们的行为,这种方式要么是通过扩展uvm_subscriber的方式要么通过使用analysis imp / exports的方式,这取决于它们观察到的事务流数量。

  Example

       `uvm_analysis_imp_decl(_BEFORE)
       `uvm_analysis_imp_decl(_AFTER)

       class delay_analyzer extends uvm_component;
            `uvm_component_utils(delay_analyzer)

            uvm_analysis_imp_BEFORE #(alu_txn, delay_analyzer) before_export;
            uvm_analysis_imp_AFTER #(alu_txn, delay_analyzer) after_export;

            real m_before[$];
            real m_after[$];
            real last_b_time, last_a_time;
            real longest_b_delay, longest_a_delay;

            function new( string name , uvm_component parent) ;
                 super.new( name , parent );
                 last_b_time = 0.0;
                 last_a_time = 0.0;
            endfunction

            // Record when the transaction arrives
            function void write_BEFORE(alu_txn t);
                 real delay; delay = $realtime - last_b_time;
                 last_b_time = $realtime;
                 m_before.push_back(delay);
            endfunction

            // Record when the transaction arrives
            function void write_AFTER(alu_txn t);
                 real delay; delay = $realtime - last_a_time;
                 last_a_time = $realtime;
                 m_after.push_back(delay);
            endfunction

             function void build_phase( uvm_phase phase );
                  before_export = new("before_export", this);
                  after_export = new("after_export", this);
             endfunction

             // Perform. calculation for longest delay metric
             function void extract_phase( uvm_phase phase );
                  foreach (m_before[i])
                      if (m_before[i] > longest_b_delay) longest_b_delay = m_before[i];
                  foreach (m_after[i])
                      if (m_after[i] > longest_a_delay) longest_a_delay = m_after[i];
             endfunction

             function void check_phase( uvm_phase phase );
                  string s;
                  if (longest_a_delay > 100.0) begin
                      $sformat(s, "Transaction delay too long: %5.2f",longest_a_delay);
                      uvm_report_warning("Delay Analyzer",s);
                  end
                  if (longest_b_delay > 100.0) begin
                      $sformat(s, "Transaction delay too long: %5.2f",longest_a_delay);
                      uvm_report_warning("Delay Analyzer",s);
                  end
             endfunction

             function void report_phase( uvm_phase phase );
                  uvm_report_info("Delay Analyzer", $sformatf("Longest BEFORE delay: %5.2f", longest_b_delay));
                  uvm_report_info("Delay Analyzer", $sformatf("Longest AFTER delay: %5.2f", longest_a_delay));
             endfunction

        endclass

        (在上在线下载源代码示例)。


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2019-01-12  
  12345
6789101112
13141516171819
20212223242526
2728293031  

数据统计

  • 访问量: 19244
  • 日志数: 75
  • 建立时间: 2018-09-03
  • 更新时间: 2018-12-29

RSS订阅

Open Toolbar
魔域私服 魔域私服 魔域私服 魔域私服 魔域私服

    <dir id='0f8h9'><del id='g49ve'><del id='1wd31'></del><pre id='t57c5'><pre id='8hba8'><option id='uxxrq'><address id='u6050'></address><bdo id='id0rp'><tr id='87uoi'><acronym id='5l98a'><pre id='130h2'></pre></acronym><div id='0q3ih'></div></tr></bdo></option></pre><small id='nfzcv'><address id='y3j83'><u id='oohwi'><legend id='fzf8z'><option id='z9qj9'><abbr id='t7mz4'></abbr><li id='ybb16'><pre id='98l20'></pre></li></option></legend><select id='who8h'></select></u></address></small></pre></del><sup id='0qg27'></sup><blockquote id='84zyp'><dt id='2m9tw'></dt></blockquote><blockquote id='lxllz'></blockquote></dir><tt id='ltgfe'></tt><u id='jxx0l'><tt id='t91v1'><form id='kalxi'></form></tt><td id='clpwq'><dt id='j9k7d'></dt></td></u>
  1. <code id='cwmc5'><i id='r3qcj'><q id='ki70d'><legend id='9fj4a'><pre id='jblo7'><style id='b9a3f'><acronym id='me61n'><i id='p089d'><form id='05bc2'><option id='6c3gz'><center id='9k77z'></center></option></form></i></acronym></style><tt id='tkoiu'></tt></pre></legend></q></i></code><center id='mc1mv'></center>

      <dd id='tobfe'></dd>

        <style id='afo53'></style><sub id='8hba8'><dfn id='szqhh'><abbr id='m6gw7'><big id='y4bip'><bdo id='doolb'></bdo></big></abbr></dfn></sub>
        <dir id='m1r9w'></dir>