在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 991|回复: 0

[求助] 为什么seq中config_db my_case0不成功呢

[复制链接]
发表于 2020-12-26 16:10:09 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
seq中设置config_db  b  在my_case0 get
seq
class my_rst_seq extends rst_seq_api;
        `uvm_object_utils(my_rst_seq)
   rst_agent_cfg my_rst_config;
        int a;
//        `uvm_declare_p_sequencer(my_sequencer)

        function new(string name="my_rst_seq");
                super.new(name);

        endfunction

        virtual task body();
     // if(starting_phase != null)
     //    starting_phase.raise_objection(this);
        `uvm_info("my_rst_seq","in body",UVM_MEDIUM)
                if(!uvm_config_db #(int)::get(null, get_full_name(), "a", a))
     begin
       `uvm_error("CONFIG", $sformatf("reg_seq_lib: global_pkt_config not found"));
     end
                else
                begin
                        $display("get_full_name = %d",a);
                end

                //rst_ctrl("RST_PULSE_CYCLES",3,10);
                `uvm_info("my_rst_seq","start.....",UVM_MEDIUM)
                rst_ctrl("RST_ASSERT",3,10);
                #100;
                rst_ctrl("RST_DEASSERT",3,10);
                `uvm_info("my_rst_seq","set b !!!!....",UVM_MEDIUM)
                uvm_config_db#(int)::set(uvm_root::get(),"uvm_test_top","b",1);
                uvm_config_db#(int)::set(null,"uvm_test_top","b",1);

                `uvm_info("my_rst_seq","end.....",UVM_MEDIUM)                //#100;       
        `uvm_info("my_rst_seq","out body",UVM_MEDIUM)
                //        if(starting_phase != null)
    //     starting_phase.drop_objection(this);
        endtask
endclass : my_rst_seq


my_caso0.sv
class my_case0 extends base_test;
   `uvm_component_utils(my_case0)
rst_agent_cfg my_rst_config;
        int b;
  function new(string name = "my_case0", uvm_component parent = null);
        //function new(string name, uvm_component parent);
      super.new(name,parent);
   endfunction
   extern virtual function void build_phase(uvm_phase phase);
   extern virtual function void connect_phase(uvm_phase phase);

task run_phase(uvm_phase phase);

        begin
                my_rst_seq my_seq= my_rst_seq::type_id::create("my_seq",this);
                phase.raise_objection(this,"rst_ctrl_seq active");
        `uvm_info("my_case0","in run_phase",UVM_MEDIUM)
                my_seq.start(env.i_agt.m_sqr);


                        $display("my_case0 get_full_name = %s",get_full_name());
                fork
        while(1)  begin
                                        uvm_config_db#(int)::wait_modified(this,"","b");
           // void`(uvm_config_db #(bit)::get(this,"","b",b));
          void'(uvm_config_db#(int)::get(this, "", "b", b));
             $display("get_b1 = %d",b);
        end
             $display("get_b2 = %d",b);
                join
        $display("get_b3 = %d",b);
        `uvm_info("my_case0","out run_phase",UVM_MEDIUM)
                phase.drop_objection(this,"rst_ctrl_seq finished");       
       
        end
endtask : run_phase       



endclass




您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-9-22 21:29 , Processed in 0.013011 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表