UVM
[UVM] uvm 자주사용하는 매크로 정리 | uvm_do_on_with, start_item, uvm_object_utils ...
wolleyneerg
2025. 4. 7. 23:38
반응형
✅ 1. 시퀀스 실행 관련 매크로
매크로 | 설명 | 예제 |
uvm_do(seq) | 시퀀스를 생성하고 실행 | uvm_do(my_seq); |
uvm_do_with(seq, { ... }) | 시퀀스를 constraint 조건으로 랜덤화 후 실행 | uvm_do_with(my_seq, { mode == 1; }); |
uvm_do_on(seq, sequencer) | 특정 시퀀서 위에서 실행 | uvm_do_on(my_seq, p_sequencer); |
uvm_do_on_with(seq, sequencer, { ... }) | 시퀀서 + constraint 지정 | uvm_do_on_with(my_seq, p_sequencer, { addr == 32'h1000; }); |
📌 이 매크로들은 내부적으로:
- create()
- randomize()
- start() 을 자동으로 처리해 줌.
✅ 2. 아이템 전송 매크로
매크로 | 설명 |
uvm_create(item) | item 생성 (randomize, start 안 함) |
uvm_rand_send(item) | randomize + start_item + finish_item |
uvm_send(item) | start_item + finish_item (randomize 없이) |
📌 주로 body() 내에서 트랜잭션 전송 시 사용
uvm_create(req);
req.randomize();
uvm_send(req);
✅ 3. 시퀀스 선언 관련 매크로
매크로 | 설명 |
uvm_object_utils(class_name) | 시퀀스, 아이템, 오브젝트 등록용 |
uvm_component_utils(class_name) | 컴포넌트 (env, agent 등) 등록용 |
class my_seq extends uvm_sequence;
`uvm_object_utils(my_seq)
endclass
✅ 4. 메시지 출력 매크로
매크로 | 설명 |
uvm_info(ID, MSG, VERBOSITY) | 정보 로그 |
uvm_warning(ID, MSG) | 경고 |
uvm_error(ID, MSG) | 오류 (sim은 계속 진행) |
uvm_fatal(ID, MSG) | 치명적 오류 (sim 종료) |
`uvm_info("SEQ", "payload started", UVM_LOW)
`uvm_fatal("CFG", "Missing config!")
✅ 5. phase objection 매크로
매크로 | 설명 |
phase.raise_objection(this) | 시뮬레이션 종료 방지 |
phase.drop_objection(this) | objection 감소, 모두 drop되면 종료 가능 |
task run_phase(uvm_phase phase);
phase.raise_objection(this);
// 시퀀스 실행
phase.drop_objection(this);
endtask
✅ 전체 요약표
분류 | 매크로 |
시퀀스 실행 | uvm_do, uvm_do_with, uvm_do_on, uvm_do_on_with |
아이템 실행 | uvm_create, uvm_send, uvm_rand_send |
등록용 | uvm_object_utils, uvm_component_utils |
메시지 | uvm_info, uvm_warning, uvm_error, uvm_fatal |
phase 제어 | raise_objection, drop_objection |
반응형