같은 필드를 가진 다른 레지스터가 3 개 있습니다 : load_0
, load_1
및 load_2
입니다. 는 지금은 같은 기능은 모든 레지스터 3 번 중복되어 하나 개의 라인에서 차이가있다 : 동일한 기능을 복제보다 Specman : 일부 인덱스로 다른 변수에 액세스하는 방법이 있습니까? 내 검증 환경에서
duplicated_func_0() {
value = timer_regs.load_0; //This is the only different line (in duplicated_func_1 - load_1 is substituted
...
};
(즉 인덱스 만 다릅니다) 변수 이름을 액세스 할 수있는 더 나은 방법이 있나요 3 타임스? 이 같은 뭔가 :
not_duplicated_func(index : uint) {
value = timer_regs.load_%x; //Is there a way to put the input index in the variable name instead of %x?
};
난 당신이 제공 할 수있는 모든 도움을 주셔서 감사합니다.
extend TIMER_REGS vr_ad_reg_file {
loads[3] : list of TIMER_LOAD vr_ad_reg;
};
색인하여 각 레지스터에 액세스 할 수 있습니다이 방법 : timer_regs
내부
, 여기 게시물입니다 당신 유용하게 사용할 수 있습니다. http://blog.verificationgentleman.com/2014/11/experimental-cures-for-flattened-reg-defs.html –