// ========== Copyright Header Begin ========================================== // // OpenSPARC T2 Processor File: fc_top.vr // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved // 4150 Network Circle, Santa Clara, California 95054, U.S.A. // // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // For the avoidance of doubt, and except that if any non-GPL license // choice is available it will apply instead, Sun elects to use only // the General Public License version 2 (GPLv2) at this time for any // software where a choice of GPL license versions is made // available with the language indicating that GPLv2 or any later version // may be used, or where a choice of which version of the GPL is applied is // otherwise unspecified. // // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, // CA 95054 USA or visit www.sun.com if you need additional information or // have any questions. // // ========== Copyright Header End ============================================ #define PROG_FILE #include // standard header file from Vera #include // standard header file from Vera #include // standard header file from Vera #include "cpu.h" // constant definitions for CPU rtl at :/design/cpu/rtl/ // added this #ifndef for excluding code for NIU in Opensparc T2 #ifndef FC_NO_NIU_T2 #include "mbox_class.vrh" #include "get_mbox_id.vrh" #include "niu_verilog_tasks.vri" //IP PacketGen related #include "pcg_defines.vri" #include "pcg_types.vri" #include "pack_db.vrh" #include "flow_db.vrh" #include "flow_db_tasks.vrh" #include "pg_top_pp.vrh" #include "pc_top_pp.vrh" #include "mac_pio_class.vrh" #include "pio_driver.vrh" #include "bmac_util.vrh" #include "pcs_util.vrh" #include "xpcs_util.vrh" #include "fflp_util.vrh" #include "txc_util.vrh" #include "niu_gen_pio.vrh" // New code for pktconfig and RDMC MOdel #include "pktConfig.vrh" #include "niu_rxdmc.vrh" #include "rand_packet.vrh" #ifndef GATESIM #ifndef NIU_SYSTEMC_T2 #include "niu_rx_coverage.vrh" #endif #endif #ifndef RXC_SAT #ifndef MAC_SAT #include "niu_rxdma_wr_chk.vrh" #endif #endif #ifndef MAC_SAT #ifndef NIU_SYSTEMC_T2 #include "control_fifo_mon.vrh" #include "control_fifo_chkr.vrh" #include "rdmc_mon.vrh" #endif #include "mac_mon.vrh" #endif #include "hostRdCbMgr.vrh" #endif // #ifndef FC_NO_NIU_T2 // interfaces & binds #include #include #include #include "asmEventsToVera.if.vrh" #include "errorCountTasks.if.vrh" #include "sparcBenchUtils_if.vrh" #ifndef GATESIM #include "fc_jtpor.if.vrh" #endif // defines #include "defines.vri" #include #include "plusArgMacros.vri" #include "std_display_defines.vri" // classes refered to in this file #include "std_display_class.vrh" #include "baseUtilsClass.vrh" #include "sparcBenchUtils.vrh" #include "utilsClass.vrh" #include "ssi.if.vrh" #include "ssi.vrh" #include "baseParamsClass.vrh" #include "sparcParams.vrh" #include "asmEvent.vrh" #include "baseAsmToVeraIntf.vrh" #include "asmEventsToVera.vrh" #ifndef FC_NO_NIU_T2 #include "asmToVeraIntf.vrh" #include "niu_tx_descp.vrh" #include "niu_tx_port.vrh" #endif #include "generic_ev_packet.vrh" // packet for generic user event /***************************** * TCU Driver classes * *****************************/ #include "tcu_tasks.vrh" #include "sys_reset.vrh" #ifndef GATESIM #include "fcShadowScanClass.vrh" #endif #ifndef FC_NO_NIU_T2 #ifndef RXC_SAT #include "rxc_class.vrh" #include "ip_ingress_classes.vrh" #include "ip_ingress_db.vrh" #include "ip_util.vrh" #endif // Interrupt #include "niu_int_qmgr.vrh" #include "niu_int_mgr.vrh" #include "niu_dma_bind.vrh" #ifndef NIU_SYSTEMC_T2 #include "niu_intr_mon.vrh" #endif #endif //#ifndef FC_NO_NIU_T2 #ifdef USE_JTAG_DRIVER #ifdef FC_JTAG_DEBUG_COVERAGE #include "ncu_coverage.vrh" #include "ncu_rtl_cov.vrh" #endif //------- Run TCU along with SPARC diag ------------ extern function integer tcu_diag(StandardDisplay gDbg); #endif // verilog tasks/functions that vera is going to call #include #include "seedingVerilogTasks.vri" // PEU Integration #ifndef FC_NO_PEU_VERA #include "report_verilog_tasks.vrh" #include "cReport.vrh" #include "Testbench.vrh" #include "peu_verilog_tasks.vri" #include "FNXPCIEXactorExports.vri" // dma checker #ifndef GATESIM hdl_task mem_check ( bit [39:0] pa, bit [(64*8)-1:0] data ) "tb_top.ldst_sync.ldst_l2.mem_check"; #endif #include "top_defines.vrh" #include "ios_l2_stub.vrh" #include "fc_l2_sio_stub.vrh" #include "niu_sig.if.vrh" #include "niu_checker.vrh" #else #ifdef USE_BOBO hdl_task bobo_write_64bit (bit [39:0] pa, bit [63:0] data64 ) "tb_top.bobo_write_64bit"; #else #ifndef FC_NO_PEU_T2 hdl_task pep_write_32bit (bit [39:0] pa, bit [31:0] data32 ) "tb_top.ept.pci_dma.dma.pio.pep_write_32bit"; #endif // FC_NO_PEU_T2 #endif // USE_BOBO #endif // FC_NO_PEU_VERA // Mcu Mon for Rx checker added here #include "FcMcuMon.vrh" #include "FcMcuMonPort.if.vrh" // ras #ifndef GATESIM #include #endif #include "ios_injerr.vrh" #include "../../ios/vera/include/ios_verilog_tasks.vri" #ifndef FC_NO_NIU_T2 #include "sioniu_err_mon.vrh" #endif #include "siodmu_err_mon.vrh" #ifndef GATESIM #include "ios_err_interrupt.vrh" #endif // extern FcMcuMon fcmcumon[4] #ifndef FC_NO_PEU_VERA //// extern class PEUTestBase {} extern class N2fcCtx {} #endif // events. Note: these are macro, so no ';' at the end MakeVeraList(string) MakeVeraList(EventClass) // FOR TXC hdl_task write_sys_mem ( bit [63:0] addr, bit [63:0] data, bit [7:0] be ) "tb_top.write_sys_mem"; hdl_task read_sys_mem ( bit [63:0] addr, var bit [63:0] rd_data ) "tb_top.read_sys_mem" ; #ifndef FC_NO_NIU_T2 hdl_task force_tcam_entry (bit [7:0] tcam_index, bit [199:0] tcam_key) "tb_top.force_tcam_entry" ; hdl_task backdoor_init_tcam () "tb_top.backdoor_init_tcam" ; #endif hdl_task force_pkg_pin_TRIGIN(bit is_forcing, bit value) "tb_top.force_pkg_pin_TRIGIN"; hdl_task force_tcu_clk_stop_at_tcu(bit is_forcing, bit value) "tb_top.force_tcu_clk_stop_at_tcu"; hdl_task force_tcu_siu_L2_write(bit [39:0] addr, bit [63:0] wr_data) "tb_top.force_tcu_siu_L2_write"; hdl_task force_tcu_siu_L2_read(bit [39:0] addr, var bit [63:0] rd_data) "tb_top.force_tcu_siu_L2_read"; // for tlr glitch enable hdl_task force_tlrState() "`TOP.force_tlrState"; hdl_task release_tlrState() "`TOP.release_tlrState"; // // include interface coverages #ifdef FC_COVERAGE #include "ncu_coverage.vrh" #include "ncu_rtl_cov.vrh" #include "l2sat_coverage.vrh" #include "l2sat_misc_cov.vrh" #include "mcusat_coverage.vri" #include "dmu_coverage.vri" #ifndef FC_NO_PEU_VERA #include "ilu_peu_coverage.vrh" #endif #ifndef GATESIM #include "siu_coverage.vrh" #endif #include "fc_coverage.vrh" #endif // #ifdef FC_JTAG_DEBUG_COVERAGE #include "ncu_coverage.vrh" #include "ncu_rtl_cov.vrh" #endif //SIU monitors/checkers #ifndef FC_NO_NIU_T2 #include "siu_niu_mon.vrh" #endif #include "siu_dmu_mon.vrh" #include "siu_l2_mon.vrh" #include "siu_order_checker.vrh" #include "siu_err_mask.vrh" //L2 monitors/checkers #ifndef GATESIM #include #include #endif #include #include #include "siu_ncu_mondo.if.vrh" #include "siu_ncu_mondo_ports_binds.vrh" #include "siu_ncu_mondo_checker.vrh" extern task MonitorCPX(); #ifndef GATESIM extern task CheckJbiInvBeforeAck(); #endif #include "fc_top_defines.vri" // common definitions for fc bench at /verif/env/common/vera/include/ #include "ucb_top.vri" // constants/port/if/bind definitions for UCB at :/verif/env/tcu/vera/include/ #include "ucb___packet.vrh" // UCB pkt definition at :/verif/env/tcu/vera/packets/ #include "ucb_monitor.vrh" // UCB protocol monitor at :/verif/env/tcu/vera/classes/ #ifndef GATESIM #include "ccu_top.vri" // constants/port/if/bind definitions for CCU at :/verif/env/tcu/vera/include/ #include "cluster_hdr_top.vri" // constants/port/if/bind definitions for cluster hdrs at :/verif/env/tcu/vera/include/ #include "ccu_clk_packet.vrh" // ccu/clk pkt definition at :/verif/env/tcu/vera/packets/ #include "ccu_clks_states.vrh" // ccu/clk state at :/verif/env/tcu/vera/classes/ #include "ccu_checker.vrh" // ccu checker at :/verif/env/tcu/vera/classes/ #include "cluster_hdr_chkr.vrh" // cluster header checkers at :/verif/env/tcu/vera/classes/ #include "ccu_clk_chkr_4fc.vrh" // ccu and cluster header checkers at :/verif/env/tcu/vera/classes/ #endif // #ifndef GATESIM //===================================================================== //================ main vera program ================================= //===================================================================== program fc_test { // This is where the global 'extern declerations' are. Typedefs too. // Other files needing globals include this. #define STORAGE_CLASS #include "globals.vri" #ifndef FC_NO_NIU_T2 #include "global_variable.vri" #endif string dispmonScope = "vera_top"; // display scope for dispmon (ie. gDbg and dbg) integer verbose = (get_plus_arg(CHECK, "fc_vera_top_verbose"))? 1 : 0; // non-zero: print out info for debugging fc_top.vr integer generic_ev_mbox; // mailbox for generic user event SSI bootrom; reg asmDiagRun; reg asmDiagDone; integer ipp_config0[4]; integer ipp_config1[4]; integer opp_config0[4]; integer opp_config1[4]; integer mac_config0[4]; integer mac_config1[4]; integer ntx_config[2]; integer bif_config[2]; integer RX_TEST_REACHED_END = 0; //Block detection integer port_type_flag[9]; // Port Types bit [8:0] active_port=0; // Active ports on fedx #ifndef FC_NO_NIU_T2 bit [3:0] rtl_mac; // For each rtl level mac the bit is set to 1 bit [3:0] gate_mac=0; // For each gate level mac the bit is set to 1 bit [3:0] active_mac=0; // For each active mac the bit is set to 1 bit [3:0] fake_mac=0; // For each fake level mac the bit is set to 1 #endif //Block detection IPP bit [3:0] rtl_ipp=0; // For each rtl level ipp the bit is set to 1 bit [3:0] gate_ipp=0; // For each gate level ipp the bit is set to 1 bit [3:0] active_ipp=0; // For each active ipp the bit is set to 1 bit [3:0] fake_ipp=0; // For each fake level ipp the bit is set to 1 //Block detection OPP bit [3:0] rtl_opp=0; // For each rtl level opp the bit is set to 1 bit [3:0] gate_opp=0; // For each gate level opp the bit is set to 1 bit [3:0] active_opp=0; // For each active opp the bit is set to 1 bit [3:0] fake_opp=0; // For each fake level opp the bit is set to 1 //Block detection BIF bit rtl_mif=0; // For rtl level bif the bit is set to 1 bit gate_mif=0; // For gate level bif the bit is set to 1 bit active_mif=0; // For active bif the bit is set to 1 bit fake_mif=0; // For fake level bif the bit is set to 1 #ifndef FC_NO_NIU_T2 //Setting Multiple Mac Port bit[31:0] get_mac_port; integer mac_speed0,mac_speed1,mac_speed2,mac_speed3; bit [2047:0] bit_str; string init_mac_ports,temp_port; integer port_no[]; #endif integer i; string str; bit [39:0] address; // MAQ_Tx bit [511:0] wri_data; // MAQ_Tx FcMcuMon fcmcumon[4]; bit [63:0] FCMemoryAddress_A[4]; bit [63:0] FCMemoryAddress_B[4]; bit [63:0] FCMemoryAddress_C[4]; event FCMemorySync_A[4]; event FCMemorySync_B[4]; event FCMemorySync_C[4]; #ifndef GATESIM ios_err_interrupt_mon ras_interrupt; #endif // #ifndef GATESIM ios_ras_inj ras_injector; #ifndef FC_NO_NIU_T2 sioniu_err_mon sioniu_errmon; #endif siodmu_err_mon siodmu_errmon; //SIU monitors #ifndef FC_NO_NIU_T2 siu_niu_monitor siuniu_mon; #endif siu_dmu_monitor siudmu_mon; siu_l2_monitor siul2_mon[]; siu_order_checker order_chk; #ifndef FC_NO_NIU_T2 integer niu_snd_mbox, niu_rec_mbox; #endif integer dmu_snd_mbox, dmu_rec_mbox, ncu_rec_mbox; integer l2_snd_mbox[], l2_rec_mbox[]; siu_ncu_mondo_checker siu_ncu_mondo_chk; // ************************************************** // ***Variables for Checker tasks // ************************************************** bit VERIF_RESET=0; // reset for the verification environment. bit token_debug=1; // for comments concerning the token flow. bit TCU_DONE=1; // indicate when the TCU is done default is 1 // when TCU is run will be set to 0 & 1 bit TCU_Test_En=0; bit jtag_reset_done = 0; // when USE_JTAG_DRIVER, set it to 1 after reseting jtag completed integer numberOfCores = 0; // Keep track of how many cores available reg [63:0] bootedThreads; // to store which threads booted #ifndef FC_NO_NIU_T2 //Checker Interface enable bit mac_ipp_interface_ena =1; bit mac_opp_interface_ena =1; //Checker Protocol Check Enable bit mac_ipp_proto_ena =1; bit mac_opp_proto_ena =1; //Checker Data Check Enable bit mac_ipp_data_ena =1; bit mac_opp_data_ena =1; #endif // interface coverages. StandardDisplay dbg; bit coverage_on; event dmu_diag_done; #ifdef FC_JTAG_DEBUG_COVERAGE ncu_intf_cov ncu_intf_cov_obj; ncu_rtl_cov ncu_rtl_cov_obj; #endif #ifdef FC_COVERAGE ncu_intf_cov ncu_intf_cov_obj; ncu_rtl_cov ncu_rtl_cov_obj; l2sat_intf_coverage_class Interface_coverage; dram_coverage dram_coverage_obj; dmu_coverage dmu_coverage_obj; #ifndef FC_NO_PEU_VERA ilu_peu_intf_coverage ilu_peu_intf_coverage_obj; #endif siu_intf_coverage siu_intf_coverage_obj; siu_intf_schmoo_coverage siu_schmoo_coverage_obj; siu_ipcs_coverage siu_ipcs_coverage_obj; siu_opcs_coverage siu_opcs_coverage_obj; fc_cov fc_cov_obj; fc_modes_cov fc_modes_cov_obj; //Modes coverage object fc_ncu_internal_coverage fc_ncu_internal_coverage_obj; fc_siu_internal_coverage fc_siu_internal_coverage_obj; fc_l2_internal_coverage fc_l2_internal_coverage_obj; fc_siu_ras_coverage fc_siu_ras_coverage_obj; #ifndef FC_NO_NIU_T2 fc_niu_coverage fc_niu_coverage_obj; #endif fc_mcu_ras_coverage fc_mcu_ras_coverage_obj; #endif #ifndef FC_NO_NIU_T2 mbox_class mbox_id; Mesg be_msg; #endif integer pack_db_lock; integer flow_db_lock; integer pack_db_index = 0; integer flow_num = 0; integer quiet_on = 0; integer n; integer tcuerrorcount = 0; integer flow_mb; integer config_mb; integer config0_mb; integer config1_mb; #ifndef FC_NO_NIU_T2 CSparseMem SparseMem; CHostErrInjTab HostErrInj; CHostRdCbMgr hostRdCbMgr; pg pack_gen[16]; // Allocate pointers for 4 packet generators pg ptr_to_first_pg; pc pack_check[4]; pack_db_entry pack_db[]; flow_db_entry flow_db[]; node_db node[32]; tup_descr tud[32]; fr_cl fr[8]; DMAChannel dma[32]; #ifndef MAC_SAT #ifndef NIU_SYSTEMC_T2 control_fifo_mon control_fifo_monitor; control_fifo_chkr control_fifo_checker; RdmcMonitor rdmc_mon; #endif MacMonitor mac_mon_rx; // 02/16/06 MacMonitor mac_mon_tx; #endif pio_drv pio_driver_class; mac_pio_cl mac_pio_class; mac_util_class mac_util; bmac_util_class bmac_util; pcs_util_class pcs_util; xpcs_util_class xpcs_util; fflp_util_class fflp_util; CNiuDMABind NiuDMABind; niu_gen_pio gen_pio_drv; event RX_chk_done; event mac_init_done; event TX_rvcd_allpkts[4]; txc_util_class txc_util; CpktConfig pktConfig; CRDMC rdmc; rand_packet rx_rand_packet; #ifndef GATESIM #ifndef NIU_SYSTEMC_T2 niu_intf_coverage niu_rx_intf_coverage; #endif #endif #ifndef RXC_SAT #ifndef MAC_SAT Cniu_rxdma_wr_chkr niu_rxdma_wrchk; #endif #endif #ifndef MAC_SAT RxDMAChannel rx_dma[32]; #ifndef RXC_SAT Crxc rxc_cl; #endif #endif /* Interrupt Related variables*/ CNiuIntrQMgr NiuIntrQ; CNiuIntrMgr NiuIntrMgr; #ifndef GATESIM #ifndef NIU_SYSTEMC_T2 CNiuIntMonitor NiuIntMon; #endif #endif #ifndef FC_NO_PEU_VERA ReportClass MyReport; N2fcCtx peutest; integer non_posted_read_cmpl_outstanding; integer non_posted_write_cmpl_outstanding; bit PEU_Test_En = 0; event e_StartPEUTest; integer asm2peu_mbox; N2fcPiuShadowRegs PiuCsrs; bit [63:0] IOSMemoryAddress[8]; event IOSMemorySync[8]; integer fc_peu_dma_ptr=0; fc_l2_sio_stub l2sio_stub; ios_l2_stub l2_stub[]; VeraList_l2_packet l2_list0; VeraList_l2_packet l2_list1; VeraList_l2_packet l2_list2; VeraList_l2_packet l2_list3; VeraList_l2_packet l2_list4; VeraList_l2_packet l2_list5; VeraList_l2_packet l2_list6; VeraList_l2_packet l2_list7; niu_checker niuchk; #endif // #ifndef FC_NO_PEU_VERA #endif // #ifndef FC_NO_NIU_T2 bit vera_top_debug = 0; bit reset_complete = 0; #ifndef GATESIM //CCU_clk_chkr_4fc ccu_clk_chkr_4fc; // ccu and clock checkers #endif /***************************************************************** * TCU Driver * *****************************************************************/ SystemTap dft; SystemReset reset; tcu_siu_packet tcu_siu_pkt; // for L2 access reg [39:0] jtagDoneMemAddr; // indicate JTAG done to ASM #ifndef GATESIM fcShadowScanClass shScanCapture; // capture the shadow scan bits #endif event e_StartJtag; // review // VeraListIterator_EventClass event_it; // VeraList_EventClass vera_tasks[]; // VeraList_string str_list = new; // vera tasks that verilog calls, if any //#include "vera_tasks.vrh" //======================================================= //====== end of variable declarations =================== //======================================================= //----------------------------------------------------------------------------- // You must seed the RNG from *top* *BEFORE* class instantiations and forks. // YES, this matters in vera > V5, see vera docs. If you don't seed before // instantiating a class, that class ALWAYS repeats random numbers which is // NOT what you want. //----------------------------------------------------------------------------- #define HDNLNAME gSeedFileHndl #define SEEDNAME gSeed #include "seeding.vri" gDbg = new(); dbg = gDbg; // gDbg and dbg are the same #ifndef GATESIM //ccu_clk_chkr_4fc = new(dbg); // ccu and cluster header checkers. By default, they're disable #endif generic_ev_mbox = alloc(MAILBOX, 0, 1); #ifndef FC_NO_NIU_T2 flow_db_init(); mbox_id = new; ptr_to_first_pg = null; be_msg = new(e_mesg_debug2); SparseMem = new(); HostErrInj = new(); hostRdCbMgr = new(0); flow_mb = alloc(MAILBOX, 0, 1); config_mb = alloc(MAILBOX, 0, 1); config0_mb = alloc(MAILBOX, 0, 1); config1_mb = alloc(MAILBOX, 0, 1); NiuIntrQ = new(); NiuIntrMgr = new(); NiuDMABind = new(); #ifndef GATESIM #ifndef NIU_SYSTEMC_T2 NiuIntMon = new(); #endif #endif mac_pio_class = new( ); mac_util = new(); bmac_util = new(); pcs_util = new(); xpcs_util = new(); fflp_util = new; gen_pio_drv = new(); pktConfig = new(); rdmc = new(); txc_util = new(); // For Rx checker fcmcumon[0] = new(DramWriteMCU0, 2'b00); fcmcumon[1] = new(DramWriteMCU1, 2'b01); fcmcumon[2] = new(DramWriteMCU2, 2'b10); fcmcumon[3] = new(DramWriteMCU3, 2'b11); trigger(OFF,FCMemorySync_A[0]); trigger(OFF,FCMemorySync_A[1]); trigger(OFF,FCMemorySync_A[2]); trigger(OFF,FCMemorySync_A[3]); trigger(OFF,FCMemorySync_B[0]); trigger(OFF,FCMemorySync_B[1]); trigger(OFF,FCMemorySync_B[2]); trigger(OFF,FCMemorySync_B[3]); trigger(OFF,FCMemorySync_C[0]); trigger(OFF,FCMemorySync_C[1]); trigger(OFF,FCMemorySync_C[2]); trigger(OFF,FCMemorySync_C[3]); trigger(OFF,RX_chk_done); if (get_plus_arg(CHECK, "ENABLE_RANDOM_LAYER")) { rx_rand_packet = new(); } else { printf("\n Random Layer disabled \n"); } if (get_plus_arg(CHECK, "ENABLE_COV_OBJECT")) { #ifndef GATESIM #ifndef NIU_SYSTEMC_T2 niu_rx_intf_coverage = new(); #endif #endif } else { printf("\n coverage objects disabled \n"); } #endif // FC_NO_NIU_T2 #ifndef FC_NO_PEU_VERA if ( get_plus_arg(CHECK, "PEU_TEST") ) { l2_list0 = new(); l2_list1 = new(); l2_list2 = new(); l2_list3 = new(); l2_list4 = new(); l2_list5 = new(); l2_list6 = new(); l2_list7 = new(); printf("Time before L2 %0d\n", get_time(LO)); l2sio_stub = new(dbg); l2_stub[0] = new(l2_stub_bind0, 0, dbg, l2_list0); l2_stub[1] = new(l2_stub_bind1, 1, dbg, l2_list1); l2_stub[2] = new(l2_stub_bind2, 2, dbg, l2_list2); l2_stub[3] = new(l2_stub_bind3, 3, dbg, l2_list3); l2_stub[4] = new(l2_stub_bind4, 4, dbg, l2_list4); l2_stub[5] = new(l2_stub_bind5, 5, dbg, l2_list5); l2_stub[6] = new(l2_stub_bind6, 6, dbg, l2_list6); l2_stub[7] = new(l2_stub_bind7, 7, dbg, l2_list7); trigger(OFF,IOSMemorySync[0]); trigger(OFF,IOSMemorySync[1]); trigger(OFF,IOSMemorySync[2]); trigger(OFF,IOSMemorySync[3]); trigger(OFF,IOSMemorySync[4]); trigger(OFF,IOSMemorySync[5]); trigger(OFF,IOSMemorySync[6]); trigger(OFF,IOSMemorySync[7]); niuchk = new(dbg); PEU_Test_En = 1; //printf(" DENALI= %s \n", get_env("DENALI")); // now this is printed by sims printf(" PATH= %s \n", get_env("PATH")); //printf(" LM_LICENSE_FILE= %s \n", get_env("LM_LICENSE_FILE")); // now this is printed by sims MyReport = new; asm2peu_mbox = alloc(MAILBOX, 0, 1); } #endif // FC_NO_PEU_VERA #ifndef FC_NO_NIU_T2 mac_config0[0] = 1; // config1 config0 mac_config0[1] = 1; // 0 1 RTL mac_config0[2] = 1; // 1 1 DUmmy mac_config0[3] = 1; mac_config1[0] =1 ; mac_config1[1] =1 ; mac_config1[2] =1 ; mac_config1[3] =1 ; if( get_plus_arg( CHECK, "GET_MAC_PORTS=")) get_mac_port = get_plus_arg( STR, "GET_MAC_PORTS="); printf("The val of get_mac_port is %h\n",get_mac_port); init_mac_ports.bittostr(get_mac_port); for (i=0; i 0! repeat (2) @(posedge probe_if.clk); if (asmDiagRun) @(probe_if.sim_status); // verilog half is done asmDiagDone = 1; // indicate Assembly diag done PR_NORMAL(dispmonScope, MON_NORMAL,"DEBUG : Assembly Diag Has Completed"); #ifndef FC_NO_PEU_VERA // check whether the peu transations have completed if (PEU_Test_En == 1) peutest.CheckIfDone(); #endif } } join all // JOIN ALL this may require assembly code to run and finish! //========================================================================== //============= end of big testcase fork/join ============================== //========================================================================== #ifndef FC_NO_NIU_T2 // All final wrapup messages etc. here. Assumes an assembly diag // ran and passed. If an assembly diag ran and failed this is a don't care. if (probe_if.sim_status[ASM_PASS]) { // wait for all packets in flight to be checked if ( get_plus_arg(CHECK, "RX_TEST") ) { sync (ALL, RX_chk_done); PR_NORMAL(dispmonScope, MON_NORMAL,"Synced on Event RX_chk_done"); } } #endif if (TCU_Test_En == 1) { gDbg.errors += tcuerrorcount; // error count from running tcu diag } #ifndef FC_NO_PEU_VERA if (PEU_Test_En == 1) { gDbg.errors += be_msg.get_error_count(); gDbg.warnings += be_msg.get_warning_count(); MyReport.report_test_complete(); PR_NORMAL(dispmonScope, MON_NORMAL,"DEBUG : A PEU diag ran.\n"); } #endif // let vera check for errors, print pass/fail only if // verilog did not see an error!!! if (probe_if.sim_status[ASM_ERR]) // have verilog error so tell exitBench gUtil.exitBench(*,*,1,1); // (scope, message, noPrint, externalFail) else // will check gDbg.errors & gDbg.warnings gUtil.exitBench(); } // end of main vera program (ie. program fc_test)