Code Browser Pages:
| // by gopi@testbench.in `ifndef HOST_DRIVER_CLASS `define HOST_DRIVER_CLASS class host_driver extends vmm_xactor ; virtual host_intf h_if; extern function new(string name,virtual host_intf h_if); extern function bit read_CPU_init_end (); extern function bit read_Rx_mac_ra (); extern function bit [31:0] read_Rx_mac_data (); extern function bit [1:0] read_Rx_mac_BE (); extern function bit read_Rx_mac_pa (); extern function bit read_Rx_mac_sop (); extern function bit read_Rx_mac_eop (); extern function bit read_Tx_mac_wa (); extern task drive_Reset (bit Reset ) ; extern task drive_Rx_mac_rd (bit Rx_mac_rd ) ; extern task drive_Tx_mac_wr (bit Tx_mac_wr ) ; extern task drive_Tx_mac_data(bit[31:0] Tx_mac_data) ; extern task drive_Tx_mac_BE (bit [1:0] Tx_mac_BE ) ; extern task drive_Tx_mac_sop (bit Tx_mac_sop ) ; extern task drive_Tx_mac_eop (bit Tx_mac_eop ) ; extern task posedge_clk(); endclass function host_driver::new(string name,virtual host_intf h_if); super.new("driver",name); this.h_if = h_if; endfunction function bit host_driver::read_CPU_init_end () ; read_CPU_init_end = h_if.CPU_init_end ; endfunction function bit host_driver::read_Rx_mac_ra () ; read_Rx_mac_ra = h_if.Rx_mac_ra ; endfunction function bit [31:0] host_driver::read_Rx_mac_data () ; read_Rx_mac_data = h_if.Rx_mac_data ; endfunction function bit [1:0] host_driver::read_Rx_mac_BE () ; read_Rx_mac_BE = h_if.Rx_mac_BE ; endfunction function bit host_driver::read_Rx_mac_pa () ; read_Rx_mac_pa = h_if.Rx_mac_pa ; endfunction function bit host_driver::read_Rx_mac_sop () ; read_Rx_mac_sop = h_if.Rx_mac_sop ; endfunction function bit host_driver::read_Rx_mac_eop () ; read_Rx_mac_eop = h_if.Rx_mac_eop ; endfunction function bit host_driver::read_Tx_mac_wa () ; read_Tx_mac_wa = h_if.Tx_mac_wa ; endfunction task host_driver::drive_Reset (bit Reset ) ; h_if.Reset = Reset ; endtask task host_driver::drive_Rx_mac_rd (bit Rx_mac_rd ) ; h_if.Rx_mac_rd = Rx_mac_rd ; endtask task host_driver::drive_Tx_mac_wr (bit Tx_mac_wr ) ; h_if.Tx_mac_wr = Tx_mac_wr ; endtask task host_driver::drive_Tx_mac_data(bit[31:0] Tx_mac_data) ; h_if.Tx_mac_data = Tx_mac_data; endtask task host_driver::drive_Tx_mac_BE (bit [1:0] Tx_mac_BE ) ; h_if.Tx_mac_BE = Tx_mac_BE ; endtask task host_driver::drive_Tx_mac_sop (bit Tx_mac_sop ) ; h_if.Tx_mac_sop = Tx_mac_sop ; endtask task host_driver::drive_Tx_mac_eop (bit Tx_mac_eop ) ; h_if.Tx_mac_eop = Tx_mac_eop ; endtask task host_driver::posedge_clk ( ) ; @(posedge h_if.clk); endtask `endif |