All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WatchDogAndLoad.h
Go to the documentation of this file.
1 /*
2  * WatchDogAndLoad.h
3  *
4  * Created on: Feb 11, 2015
5  * Author: root
6  */
7 
8 #pragma once
9 
10 #include <cvmx.h>
11 #include <cvmx-version.h>
12 #include <cvmx-coremask.h>
13 #include "coremask.h"
14 
16 {
17 
18 public:
19 
20  void Init (void);
21  void Process (bool bPacketReceived);
22 
23  static int8_t GetLoad (int iCore);
24  static bool GetAlive (int iCore);
25  static int64_t GetMaxPacketCycles(int iCore, bool bReset);
26  int64_t GetMaxPacketTime(int iCore);
27 
28  // Added coremask function to prevent common depending on sirius stack
29  void CoreMaskSet (void);
30  void CoreMaskBarrierSync(void);
31  bool CoreMaskIsMember(int iCore);
32 
33 private:
34 
35  void AliveCheck (void);
36 
37  unsigned int m_uiCurrentCore;
38  CCoremask m_cCoreMask;
39 // uint32_t m_ulCoreMask;
40 
41 /*
42 #if OCTEON_SDK_VERSION_NUM < 301000000ull // SDK 3.1.0 build 000
43  uint16_t m_uiCoremask;
44 #else
45  cvmx_coremask m_tCoremask;
46 #endif
47 */
48  uint64_t m_uxLoadCycleStart;
49  uint64_t m_uxLoadCyclesBusy;
50  uint64_t m_uxLoadMeasureStart;
51  uint64_t m_uxOneSecond;
52 
53  CVMX_SHARED static int64_t m_xLoad[CVMX_MAX_CORES];
54  CVMX_SHARED static int64_t m_xWatchDogCycle[CVMX_MAX_CORES];
55  CVMX_SHARED static uint64_t m_uxWatchDogCoreNotResponsing[CVMX_MAX_CORES];
56  CVMX_SHARED static int64_t m_xMaxPacketTime[CVMX_MAX_CORES];
57 };
void Process(bool bPacketReceived)
void CoreMaskSet(void)
static bool GetAlive(int iCore)
void Init(void)
bool CoreMaskIsMember(int iCore)
static int64_t GetMaxPacketCycles(int iCore, bool bReset)
int64_t GetMaxPacketTime(int iCore)
static int8_t GetLoad(int iCore)
void CoreMaskBarrierSync(void)