TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
throttler.c File Reference
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/byteorder.h>
#include "throttler.h"
#include "aiclk_ppm.h"
#include "cm2dm_msg.h"
#include <zephyr/drivers/misc/bh_fwtable.h>
#include "telemetry_internal.h"
#include "telemetry.h"

Data Structures

struct  ThrottlerLimitRange
struct  ThrottlerParams
struct  Throttler

Macros

#define kThrottlerAiclkScaleFactor   500.0F
#define DEFAULT_BOARD_POWER_LIMIT   150

Enumerations

enum  ThrottlerId {
  kThrottlerTDP ,
  kThrottlerFastTDC ,
  kThrottlerTDC ,
  kThrottlerThm ,
  kThrottlerBoardPower ,
  kThrottlerGDDRThm ,
  kThrottlerCount
}

Functions

 LOG_MODULE_REGISTER (throttler)
static void SetThrottlerLimit (ThrottlerId id, float limit)
void InitThrottlers (void)
static void UpdateThrottler (ThrottlerId id, float value)
static void UpdateThrottlerArb (ThrottlerId id)
void CalculateThrottlers (void)
int32_t Dm2CmSetBoardPowerLimit (const uint8_t *data, uint8_t size)

Variables

static const struct device *const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))
static const ThrottlerLimitRange throttler_limit_ranges [kThrottlerCount]
static Throttler throttler [kThrottlerCount]

Macro Definition Documentation

◆ DEFAULT_BOARD_POWER_LIMIT

#define DEFAULT_BOARD_POWER_LIMIT   150

◆ kThrottlerAiclkScaleFactor

#define kThrottlerAiclkScaleFactor   500.0F

Enumeration Type Documentation

◆ ThrottlerId

Enumerator
kThrottlerTDP 
kThrottlerFastTDC 
kThrottlerTDC 
kThrottlerThm 
kThrottlerBoardPower 
kThrottlerGDDRThm 
kThrottlerCount 

Function Documentation

◆ CalculateThrottlers()

void CalculateThrottlers ( void )

◆ Dm2CmSetBoardPowerLimit()

int32_t Dm2CmSetBoardPowerLimit ( const uint8_t * data,
uint8_t size )

◆ InitThrottlers()

void InitThrottlers ( void )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( throttler )

◆ SetThrottlerLimit()

void SetThrottlerLimit ( ThrottlerId id,
float limit )
static

◆ UpdateThrottler()

void UpdateThrottler ( ThrottlerId id,
float value )
static

◆ UpdateThrottlerArb()

void UpdateThrottlerArb ( ThrottlerId id)
static

Variable Documentation

◆ fwtable_dev

const struct device* const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))
static

◆ throttler

Throttler throttler[kThrottlerCount]
static

◆ throttler_limit_ranges

const ThrottlerLimitRange throttler_limit_ranges[kThrottlerCount]
static
Initial value:
= {
.min = 50,
.max = 500,
},
.min = 50,
.max = 500,
},
.min = 50,
.max = 400,
},
.min = 50,
.max = 100,
},
.min = 50,
.max = 600,
},
.min = 50,
.max = 100,
}}
@ kThrottlerTDC
Definition throttler.c:27
@ kThrottlerGDDRThm
Definition throttler.c:30
@ kThrottlerFastTDC
Definition throttler.c:26
@ kThrottlerThm
Definition throttler.c:28
@ kThrottlerTDP
Definition throttler.c:25
@ kThrottlerBoardPower
Definition throttler.c:29