qmod16_phyreg.h (3044B)
1 /*---------------------------------------------------------------------- 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * Broadcom Corporation 8 * Proprietary and Confidential information 9 * All rights reserved 10 * This source file is the property of Broadcom Corporation, and 11 * may not be copied or distributed in any isomorphic form without the 12 * prior written consent of Broadcom Corporation. 13 *---------------------------------------------------------------------- 14 * Description: Externization of all DPI functions needed by TEMod. 15 *---------------------------------------------------------------------*/ 16 17 /*! 18 \file qmod_phyreg.h Declares verilog interface functions. 19 This file contains declarations of functions that are necessary to 20 hook up TEMod to various verilog platforms. The drivers of TSCMod are 21 hooked to verilog tasks as a first level interface to the actual drivers in the 22 verilog testbench. These 'C' functions and verilog tasks are attached via 23 a mechanism called 'DPI' (direct programming interface) supported by all 24 verilog simulators. Note that C platforms need no special attachments. 25 */ 26 27 #ifndef _QMOD16_PHYREG_H_ 28 #define _QMOD16_PHYREG_H_ 29 30 #include "qmod16_main.h" 31 #include "qmod16_defines.h" 32 33 #if defined (_MDK_TEMOD_) 34 extern int cdk_xgs_miim_read(int u, uint32_t pa, uint32_t ra, uint32_t *val); 35 extern int cdk_xgs_miim_write(int u, uint32_t pa, uint32_t ra, uint32_t val); 36 #endif 37 38 #ifdef _DV_TB_ 39 /* normally the externs are generated by irun/vcs -dpiheader. */ 40 /* Manually typing this in to reduce header files. */ 41 #ifdef CADENCE 42 /* svdpi.h to be conditional to cadence (or irun). vcs does not have this. */ 43 #include "svdpi.h" 44 #endif /* CADENCE */ 45 #include "svdpi.h" 46 47 extern void qtc_dv_wait (int delay); 48 49 extern void dv_slam_read_reg (int core, int addr, int *data); 50 extern void dv_slam_write_reg (int core, int addr, int data); 51 extern void dv_slam_modify_reg(int core, int addr, int data, int m); 52 53 extern void qtc_dv_read_reg (int unit, int core, int addr, int *data); 54 extern void qtc_dv_write_reg (int unit, int core, int addr, int data); 55 extern void qtc_dv_modify_reg(int unit, int core, int addr, int data, int m); 56 57 #endif /* _DV_TB_ */ 58 59 extern int qmod16_reg_aer_read (uint32_t u,qmod16_st* w,uint32_t a,uint16_t *d); 60 extern int qmod16_reg_aer_write (uint32_t u,qmod16_st* w,uint32_t a,uint16_t d); 61 extern int qmod16_reg_aer_modify(uint32_t u,qmod16_st* w,uint32_t a,uint16_t d,uint16_t m); 62 extern int qmod16_tsc_iblk_read(qmod16_st *pc, uint32_t addr, uint32_t *data); 63 extern int qmod16_tsc_iblk_write(qmod16_st *pc, uint32_t addr, uint32_t data); 64 65 extern void qmod16_timeout_init(soc_timeout_t *to, uint32_t usec, int min_polls); 66 extern int qmod16_timeout_check(qmod16_st* ws,soc_timeout_t *to); 67 extern int qmod16_regbit_set_wait_check(qmod16_st* w,int r,int b,int bt,int to); 68 #endif /* _QMOD16_PHYREG_H_ */