Code Browser Pages:
Files in
vmm_eth.tar



call_back.sv
Current file: cfg_intf.sv
cfg_xtor.sv
chan.sv
cov.sv
env.sv
file_list
host_driver.sv
host_intf.sv
host_xtor_rx.sv
host_xtor.sv
phy_driver.sv
phy_intf.sv
phy_xtor_rx.sv
phy_xtor.sv
pkt_generator_rx.sv
pkt_generator.sv
pkt.sv
pro.sv
run
rx_pkt.sv
sb.sv
tb_top.v
timescale.v
top.sv
verilog_top.v



// by gopi@testbench.in

`ifndef CFG_INTF_CLASS
`define CFG_INTF_CLASS


interface cfg_intf (input logic clk);

  wire  [15:0]   CD_out        ;
  wire           CSB           ;
  wire           WRB           ;
  wire           CPU_init_end  ;
  wire  [15:0]   CD_in         ;
  wire  [7:0]    CA            ;

  parameter SETUP_TIME = 1;
  parameter HOLD_TIME = 1;

  clocking cb@(posedge clk);
     default input #SETUP_TIME output #HOLD_TIME;

     input            CD_out        ;
     output           CSB           ;
     output           WRB           ;
     output           CPU_init_end  ;
     output           CD_in         ;
     output           CA            ;

   endclocking

endinterface



class cfg_driver ;
  string name ;
  virtual cfg_intf  c_if;

  extern function new(string name,virtual cfg_intf  c_if);
  extern function  bit [15:0]   read_CD_out  ();
  extern task drive_CSB          (bit          CSB          );
  extern task drive_WRB          (bit          WRB          );
  extern task drive_CPU_init_end (bit          CPU_init_end );
  extern task drive_CD_in        (bit [15:0]   CD_in        );
  extern task drive_CA           (bit [7:0]    CA           );
  extern task posedge_clk        (                          );
endclass

function cfg_driver::new(string name,virtual cfg_intf  c_if);
 this.name = name;
 this.c_if = c_if;
endfunction

function  bit [15:0]  cfg_driver::read_CD_out  ();read_CD_out  = c_if.CD_out ;  endfunction
task cfg_driver::drive_CSB          (bit          CSB          );c_if.CSB          = CSB         ; endtask
task cfg_driver::drive_WRB          (bit          WRB          );c_if.WRB          = WRB         ; endtask
task cfg_driver::drive_CPU_init_end (bit          CPU_init_end );c_if.CPU_init_end = CPU_init_end; endtask
task cfg_driver::drive_CD_in        (bit [15:0]   CD_in        );c_if.CD_in        = CD_in       ; endtask
task cfg_driver::drive_CA           (bit [7:0]    CA           );c_if.CA           = CA          ; endtask
task cfg_driver::posedge_clk        (                          ); @(posedge c_if.clk)            ; endtask


`endif