Ana içeriğe geç

UVM'de Konfigürasyon Sınıfları Kullanımı

· loading · loading · ·
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Konfigürasyon Sınıfları Randomizasyon
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 22: This Article

📡 UVM Subscriber (uvm_subscriber)
#

🔍 Giriş
#

uvm_subscriber, analysis port’lardan gelen verileri alan ve işleyen/raporlayan bir UVM bileşenidir. Subscriber’lar genellikle coverage (örneğin fonksiyonel coverage) toplamak veya testbench’te akan veriler üzerinde istatistiksel analiz yapmak için kullanılır.


🤔 Neden uvm_subscriber Kullanılır?
#

Analysis Port ile Entegrasyon uvm_subscriber, uvm_analysis_port veya uvm_analysis_export bağlantılarından doğrudan veri almak için tasarlanmıştır.

Coverage veya Raporlama Genellikle şu amaçlarla kullanılır:

  • Coverage metriklerini toplamak ve raporlamak.
  • Transaction istatistiklerini takip etmek ve raporlamak.

Kolay Bağlantı uvm_analysis_export portu sayesinde, analysis verisi üreten monitor veya scoreboard’lara kolayca bağlanabilir.


🏗️ uvm_subscriber Temel Kullanımı
#

📦 Basit Subscriber Örneği
#

virtual class uvm_subscriber #(type T=int) extends uvm_component;

  typedef uvm_subscriber #(T) this_type;
  uvm_analysis_imp #(T, this_type) analysis_export;
  
  function new (string name, uvm_component parent);
    super.new(name, parent);
    analysis_export = new("analysis_imp", this);
  endfunction
  
  pure virtual function void write(T t);
endclass
 
// Fonksiyonel Coverage için Subscriber
class adder_subscriber extends uvm_subscriber #(adder_transaction);
  adder_transaction t;
  covergroup adder_cg;
    option.per_instance = 1;
    num1_cov: coverpoint t.num1 {
      bins low = {[0:100]};
      bins mid = {[101:200]};
      bins high = {[201:300]};
      bins very_high = {[300:400]};
    }
    num2_cov: coverpoint t.num2 {
      bins low = {[0:100]};
      bins mid = {[101:200]};
      bins high = {[201:300]};
    }
  endgroup

  function new(string name = "adder_subscriber", uvm_component parent);
    super.new(name, parent);
    t = new("t");
    adder_cg = new();
  endfunction

  `uvm_component_utils(adder_subscriber)

  function void write(adder_transaction t);
    this.t = t;
    adder_cg.sample(); // Coverage örneklemesi
    `uvm_info("SUBSCRIBER", $sformatf("Monitored: num1=%0d, num2=%0d, result=%0d",
              t.num1, t.num2, t.result), UVM_MEDIUM)
  endfunction

  function void report_phase(uvm_phase phase);
    super.report_phase(phase);
    `uvm_info("COVERAGE", $sformatf("Coverage Summary: TOTAL=%.2f%%, num1=%.2f%%, num2=%.2f%%",
              adder_cg.get_inst_coverage(),
              adder_cg.num1_cov.get_inst_coverage(),
              adder_cg.num2_cov.get_inst_coverage()), UVM_NONE)
  endfunction

endclass

⚙️ Nasıl Çalışır?
#

1️⃣ Veri Alımı Analysis port’lardan write() fonksiyonu üzerinden veri alınır.

2️⃣ Analiz veya İşleme Subscriber içinde bu veri coverage için analiz edilir, sayılır veya istatistiksel olarak işlenir.

3️⃣ Raporlama Test sonunda report_phase() veya benzeri mekanizmalarla sonuçlar raporlanabilir.


🔗 Bağlantı Nasıl Yapılır?
#

Genellikle, subscriber bir monitor’un analysis port’una bağlanır:

agent.monitor.adder_send.connect(subscriber.analysis_export);

Bu şekilde, monitor tarafından gönderilen her adder_packet nesnesi subscriber’a ulaşır.


🚀 Temel Özellikler
#

ÖzellikAçıklama
Generic THer tip için genel çalışır (uvm_subscriber#(T))
write()Analysis port’lardan veri alır ve işler
report_phase()Test sonunda işlenen sonuçları raporlar

🎯 Sonuç
#

uvm_subscriber kullanımı:

  • Testbench’ten veri toplamayı ve işlemeyi kolaylaştırır.
  • Coverage veya istatistik toplamayı sağlar.
  • UVM’in analysis port altyapısı ile sorunsuz çalışarak testbench’inizi daha modüler ve güçlü hale getirir.

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

Related

UVM'de uvm_subscriber Kullanımı
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Uvm_subscriber Coverage Toplama
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
UVM'de Factory Kullanımı
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Factory Pattern
Eğitim UVM Doğrulama
UVM'de Phase'lar: Testbench Yaşam Döngüsü
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Phase Yönetimi
Eğitim UVM Doğrulama
UVM'de Sequence Başlatma Yöntemleri
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Sequence Başlatma Objection Kullanımı
Eğitim UVM Doğrulama
UVM'de uvm_object Sınıfı
· loading · loading
Eğitim UVM Doğrulama UVM Doğrulama SystemVerilog Uvm_object
Eğitim UVM Doğrulama