2013-06-24 2 views
2

어떻게 그 핸들을 사용하여 메서드를 호출 할 수 있도록 커버 포인트 핸들을 얻을 수 있습니까? 먼저 핸들을 인스턴스화 할 수 있도록 커버 포인트 유형을 알아야합니다. 여기 커버 포인트를 처리하는 방법은 무엇입니까?

는 예입니다 : 내가 VCS 2013.06를 사용하여 위의를 실행하면

class my_coverage_class; 
    rand bit my_coverpoint; 
    covergroup my_covergroup; 
    option.per_instance = 1; 
    coverpoint my_coverpoint; 
    endgroup 
    function new; 
    my_covergroup = new; 
    endfunction 
endclass: my_coverage_class 

program automatic testbench; 
    initial begin 
    my_coverage_class inst = new(); 
    begin 
     var type(inst.my_covergroup.my_coverpoint) cp 
     = inst.my_covergroup.my_coverpoint; // BREAKS HERE 
     cp.get_inst_coverage(); 
    end 
    end 
endprogram // testbench 

, 내가 얻을 :

Error-[NYI] Not Yet Implemented 
testbench, 16 
Feature is not yet supported: Type operator not supported 

참고 : 나는 $display("%s", $typename(inst.my_covergroup.my_coverpoint))를 실행하면, 나는 <unknown>

답변

1

기반을 얻을 오류 메시지에서 시뮬레이터가 아직 type을 지원하지 않습니다. 그랬더라도 IEEE Std 1800-2012이 보이지 않아서 coverpoint에 대한 핸들이있을 수 있습니다. 당신의 시뮬레이터 covergorups에 대한 핸들을 지원하는 경우, 당신은 다음을 수행 할 수 있어야한다 :

package my_package; 
    covergroup my_cover_group(bit cp); 
    option.per_instance = 1; 
    coverpoint cp; 
    endgroup 
    class my_coverage_class; 
    rand bit my_coverpoint; 
    my_cover_group my_covergroup; 
    function new; 
     this.my_covergroup = new(this.my_coverpoint); 
    endfunction 
    endclass: my_coverage_class 
endpackage : my_package 

program automatic testbench; 
    import my_package::*; 
    my_cover_group covgrp_handle; 
    initial begin 
    my_coverage_class inst = new(); 
    begin 
     covgrp_handle = inst.my_covgrp; 
     covgrp_handle.cp.get_inst_coverage(); 
    end 
    end 
endprogram // testbench 

다른 옵션은 매크로 (: `define cp inst.my_covergroup.my_coverpoint 예)를 사용하는 것입니다. 이것은 제공된 테스트 케이스에서 작동하지만 많은 인스턴스 유형/커버 그룹/커버 포인트를 처리하려는 경우 매우 유연하지 않습니다.

관련 문제