OpenCores
URL https://opencores.org/ocsvn/apb2spi/apb2spi/trunk

Subversion Repositories apb2spi

[/] [apb2spi/] [trunk/] [tb/] [env/] [spi_agent/] [spi_agent.sv] - Blame information for rev 15

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 vlnaran
 
2
class spi_agent extends uvm_agent;
3
 
4
spi_sequencer spi_sqr;
5
spi_driver spi_drvr;
6
spi_monitor spi_mntr;
7
//spi_env_config spi_env_cfg;
8
uvm_analysis_port #(spi_seq_item) spi_agent_ap;
9
 
10
        `uvm_component_utils(spi_agent)
11
 
12
//uvm_active_passive_enum spi_is_active=UVM_ACTIVE;
13
 
14
function new(string name="spi_agent", uvm_component parent=null);
15
        super.new(name,parent);
16
endfunction
17
 
18
 
19
function void build_phase(uvm_phase phase);
20
        super.build_phase(phase);
21
//      if(spi_is_active==UVM_ACTIVE)begin
22
                spi_sqr = spi_sequencer::type_id::create("spi_sqr",this);
23
                spi_drvr = spi_driver::type_id::create("spi_drvr",this);
24
//      end
25
        spi_agent_ap = new("spi_agent_ap",this);
26
        spi_mntr = spi_monitor::type_id::create("spi_mntr",this);
27
endfunction
28
 
29
function void connect_phase(uvm_phase phase);
30
//      if(spi_is_active==UVM_ACTIVE)begin
31
                spi_drvr.seq_item_port.connect(spi_sqr.seq_item_export);
32
//      end
33
        spi_mntr.spi_ap.connect(spi_agent_ap);
34
endfunction
35
 
36
endclass
37
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.