Ana içeriğe geç

UVM'de uvm_agent Kullanımı ve Adder Örneği

· loading · loading · ·
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Uvm_agent Testbench Yapısı
Eğitim UVM Doğrulama
Axolot Logic
Yazar
Axolot Logic
Sayısal Tasarım Mühendisi
Table of Contents
UVM Serisi - This article is part of a series.
Part 16: This Article

🤖 UVM Agent Kullanımı ve Toplayıcı (Adder) Örneği
#

🚀 Giriş
#

UVM’de uvm_agent, testbench’in en temel yapı taşlarından biridir. Bir agent, driver, monitor ve sequencer bileşenlerini bir araya getirerek tek bir tekrar kullanılabilir birim oluşturur ve bu sayede bağımsız bir doğrulama alt ortamı sağlar. Bir agent, aktif modda (uyarıcı üretimi) veya pasif modda (sadece gözlem) çalışabilir.


🗂️ uvm_agent Nedir?
#

  • uvm_agent, driver, monitor ve sequencer bileşenlerini bir arada toplar.
  • Aktif modda (UVM_ACTIVE), sequencer ve driver stimulus üretir.
  • Pasif modda (UVM_PASSIVE), yalnızca monitor oluşturulur ve çalışır.
  • Bu yapı, tekrar kullanılabilirliği ve ölçeklenebilirliği artırır.
  • Agent’lar, tekrar kullanılabilir ve parametrik UVC’lerin temelidir.

📝 Toplayıcı Agent Örneği
#

Aşağıda basit bir adder_agent örneği yer alıyor. Aktif modda, driver ve sequencer oluşturulurken, monitor her zaman oluşturulur.

class adder_agent extends uvm_agent;
    adder_driver driver;
    adder_monitor monitor;
    uvm_sequencer #(adder_transaction) sequencer;
    adder_config cfg;

    `uvm_component_utils(adder_agent)

    function new(string name = "adder_agent", uvm_component parent);
      super.new(name, parent);
    endfunction

    virtual function void build_phase(uvm_phase phase);
      super.build_phase(phase);
      driver = adder_driver::type_id::create("driver", this);
      monitor = adder_monitor::type_id::create("monitor", this);
      sequencer = uvm_sequencer #(adder_transaction)::type_id::create("sequencer", this);
      if (!uvm_config_db #(adder_config)::get(this, "", "cfg", cfg))
        `uvm_fatal("AGENT", "Agent için config belirtilmedi!")
    endfunction

    virtual function void connect_phase(uvm_phase phase);
      super.connect_phase(phase);
      driver.seq_item_port.connect(sequencer.seq_item_export);
    endfunction
  endclass

🔍 Açıklamalar
#

  • monitor: DUT verilerini toplamak için her zaman oluşturulur.
  • driver ve sequencer: Yalnızca AKTİF modda (is_active == UVM_ACTIVE) stimulus üretmek için oluşturulur.
  • build_phase(): Tüm alt bileşenlerin örneklendirildiği aşamadır.
  • connect_phase(): Sequencer’ı driver’a TLM portu ile bağlar.
  • start_of_simulation_phase(): Simülasyon başında bilgilendirici bir mesaj yazdırır.

💡 Özet
#

🔹 uvm_agent, driver, sequencer ve monitor’ü modüler bir yapıda bir araya getirir. 🔹 Aktif ve pasif modları destekleyerek farklı kullanım senaryolarını mümkün kılar. 🔹 Bu toplayıcı örneğinde, agent stimulus üretir ve sonuçları gözlemler. 🔹 Agent yapısı, tekrar kullanılabilir ve ölçeklenebilir testbench mimarilerinin temelini oluşturur.


UVM Serisi - This article is part of a series.
Part 16: This Article

Related

UVM'de uvm_env Kullanımı ve adder_env Örneği
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Uvm_env Testbench Yapısı
Eğitim UVM Doğrulama
UVM'de uvm_monitor Kullanımı ve Adder Örneği
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Uvm_monitor Coverage
Eğitim UVM Doğrulama
UVM'de uvm_scoreboard Kullanımı ve Adder Örneği
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Uvm_scoreboard Test Sonuçları
Eğitim UVM Doğrulama
UVM'de uvm_sequence Kullanımı ve Adder Örneği
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Uvm_sequence Stimulus Generation
Eğitim UVM Doğrulama
UVM'de uvm_test Kullanımı ve base_test Örneği
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Uvm_test Test Senaryosu
Eğitim UVM Doğrulama
UVM Temel Sınıfları
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Sınıf Hiyerarşisi
Eğitim UVM Doğrulama