Dasd
Dasd
Dasd
//---------------------------------------------------------------------------------
-----------------------------------
class eth802_3_agent extends uvm_agent;
dsadasdas
sd
_3_sequencer msa_seqduencer; // ETH802_3 Agent Sequencer
_monitr_txd; // ETH802_3 Agent Monitor (TX Port)sad; // Enable logging what
monitors see on interface to PCAP file.
da
//--------------------------as-------------------------------------
`uvm_component_utils(eth802_3d_agent)
sasa
//--------------------------sadasd---d-----------------------------------
// Methodssa-----------------------------------
exter function new (input strinasuvm_phase phase); dsadas // builds an
agent and all its components (analysis ports, driver, monitor)
extern vitual function void connsadect_phase(uvm_phase phase); // connects
function void enableMonitorRX(); // enables RX monito
extern virtual function void disableMonitorRX(); // disables RX
monitor
extern virtual task set_ifg(int ifg, string msg_id = ""); // sets interframe
gap for agen
extern task send_frame(eth802_3_frame tr);
extern task set_sideband_signals(eth802_3_speed_e an_speed = SPEED_1GBIT, bit
an_link_ok = 1'b0, bit an_full_duplex = 1'b0, logic [3:0] carrier_data = 4'b0,
set_error = 0'b0); // Set sideband signals
endclass: eth802_3_agent
//---------------------------------------------------------------------------------
------------------------------------
function eth802_3_agent::new(input string name, uvm_component parent);
super.new(name, parent);
ap_rx = new("m_analysids_port_rx", this);
ap_tx = new("m_analysis_port_tx", this);
pcap_log_enable = 0;
endfunction: newdase(uvm_pashase phase);
super.buildsasth802__ifc)::get(this, "", "vif", this.ifc))
`uvm_fatal("NOIF",{"virual indrface must be set for:
",get_full_name(),".vif"});
as, "", "eth802_3_agent_cfg", m_eth_ag_cfg))
`uvm_fatal
_coverage_rx", dasdas
// monitor d
d
dde == STANDARD_RGMII) m_gmii_monitor_tx=
et802_3_rgmii_monitor ::type_id::create("m_rgmii_monitor_tx", this);
else if (m_eth_ag_cfg.eth_modeaUnrecognized monitor ethernet mode")
if (m_eth_ag_cfg.has_coverage)
m_coverage_tx = eth802_3_coverage::type_id::create("m_coverage_tx", this);
m_gmii_monitor_tx.monitor_type = TXd
//---------------------sagent::connect_phe(uvm_padsase phase);
if (m_eth_ag_cfg.is_active) begin
//
if (m_eth_ag_cfg.has_cosadrage_rx.coverage_transaction_rx_imp);
m_cfg = m_eth_ag_cfg;
end
d
string speed_str = speed.name();dsd
$sformat(msg_id, "%s::set_speed()", get_name());
m_gmii_monitor_tx.m_cfg.speed = speed;
m_gmii_monitor_rx.m_cfg.speed = speed;
m_gmii_driver.m_cfg.speed = speed;
m_gmii_driver.set_speed(speed);
//---------------------------------------------------------------------------------
-----------------------------------
task eth802_3_agent::set_gmii_mode(eth_gmii_mode_e gmii_mode);
string msg_id;
string gmii_mode_str = gmii_mode.name();
$sformat(msg_id, "%s::set_speed()", get_name());
m_gmii_monitor_tx.m_cfg.gmii_mode = gmii_mode;
m_gmii_monitor_rx.m_cfg.gmii_mode = gmii_mode;
m_gmii_driver.m_cfg.gmii_mode = gmii_mode;
m_gmii_driver.set_gmii_mode(gmii_mode);
//---------------------------------------------------------------------------------
------------------------------------
task eth802_3_agent::enable_monitor(eth802_3_monitor_type_e mon_typ, bit enable);
string msg_id;
string enable_str = "ENABLED";
string mon_typ_str = "RX";
if (!enable) begin
enable_str = "DISABLED";
end
//---------------------------------------------------------------------------------
------------------------------------
function void eth802_3_agent::enableMonitorRX();
//m_gmii_monitor_tx.monitor_en = 1'b1;
m_gmii_monitor_rx.monitor_en = 1'b1;
endfunction : enableMonitorRX
//---------------------------------------------------------------------------------
------------------------------------
function void eth802_3_agent::disableMonitorRX();
//m_gmii_monitor_tx.monitor_en = 1'b0;
m_gmii_monitor_rx.monitor_en = 1'b0;
endfunction : disableMonitorRX
//---------------------------------------------------------------------------------
------------------------------------
task eth802_3_agent::set_ifg(int ifg, string msg_id = "");
m_gmii_driver.set_ifg(ifg);
`uvm_info(msg_id, $sformatf("%s : IFG was set to %d", get_name(), ifg),
UVM_LOW);
endtask: set_ifg
//---------------------------------------------------------------------------------
------------------------------------
task eth802_3_agent::send_frame(eth802_3_frame tr);
m_sequencer.inject_transaction(tr);
endtask: send_frame
//---------------------------------------------------------------------------------
------------------------------------
task eth802_3_agent::set_sideband_signals(eth802_3_speed_e an_speed = SPEED_1GBIT,
bit an_link_ok = 1'b0, bit an_full_duplex = 1'b0, logic [3:0] carrier_data = 4'b0,
set_error = 0'b0);
if(m_eth_ag_cfg.eth_mode == STANDARD_RGMII ) begin
set_speed(an_speed);
m_gmii_driver.set_sideband_signals_idle(an_speed, an_link_ok, an_full_duplex,
carrier_data, set_error);
end else begin
`uvm_fatal(get_type_name(), $sformatf("Sideband signals can only be set in
STANDARD_RGMII mode"));
end
endtask: set_sideband_signals
//---------------------------------------------------------------------------------
------------------------------------