Code Browser Pages:
| // 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 |