Skip to content
Merged
10 changes: 10 additions & 0 deletions backend/etc/devices/mpw1/acpu.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,15 @@
{ "name": "ACPU_LOW_LOAD_FACTOR" , "value": 6.22030740524698E-06 },
{ "name": "ACPU_MEDIUM_LOAD_FACTOR", "value": 7.03786731129023E-06 },
{ "name": "ACPU_HIGH_LOAD_FACTOR" , "value": 0.0000105978995482262 }
],
"static_power": [
{
"rail_type": "Vcc_core (A45)",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.00000000000008, -0.000000000004, 0.0000000004, 0.00000003, 0.000002, 0.00008], "factor": 1.0 },
{ "type": "typical", "coeffs": [0.000000000006, -0.000000000006, -0.000000005, 0.0000007, 0.00002], "factor": 1.0 }
]
}
]
}
10 changes: 10 additions & 0 deletions backend/etc/devices/mpw1/bcpu.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,15 @@
{ "name": "BCPU_LOW_LOAD_FACTOR" , "value": 6.22030740524698E-06 },
{ "name": "BCPU_MEDIUM_LOAD_FACTOR", "value": 7.03786731129023E-06 },
{ "name": "BCPU_HIGH_LOAD_FACTOR" , "value": 0.0000105978995482262 }
],
"static_power": [
{
"rail_type": "Vcc_core (Config)",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.0000000001, -0.000000002, 0.000000004, 0.00002, 0.0007], "factor": 1.0 },
{ "type": "typical", "coeffs": [0.0000000000005, -0.00000000002, 0.000000003, 0.0000002, 0.00001, 0.0013], "factor": 1.0 }
]
}
]
}
10 changes: 10 additions & 0 deletions backend/etc/devices/mpw1/bram.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,15 @@
{ "name": "BRAM_WRITE_CAP", "value": 0.000002 },
{ "name": "BRAM_READ_CAP" , "value": 0.0000025 },
{ "name": "BRAM_FIFO_CAP" , "value": 0.0000007 }
],
"static_power": [
{
"rail_type": "Vcc_core (BRAM)",
"domain": "Core",
"scenarios": [
{ "type": "worse", "coeffs": [0.000000000001, -0.00000000003, 0.00000000006, 0.0000004, 0.00001], "factor": 1.0 },
{ "type": "typical", "coeffs": [0.000000000001, -0.00000000006, 0.0000000005, 0.0000002, 0.000003], "factor": 1.0 }
]
}
]
}
18 changes: 18 additions & 0 deletions backend/etc/devices/mpw1/ddr.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,23 @@
{ "name": "DDR_ACLK_FACTOR" , "value": 0.0000688892039916618 },
{ "name": "DDR_WRITE_FACTOR", "value": 0.0000421054185139638 },
{ "name": "DDR_READ_FACTOR" , "value": 0.0000397024214264236 }
],
"static_power": [
{
"rail_type": "Vcc_core (Mem_SS)",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.0000000001, -0.000000003, 0.000000005, 0.00003, 0.0009], "factor": 1.0 },
{ "type": "typical", "coeffs": [0.0000000001, -0.000000006, 0.00000005, 0.00002, 0.0003], "factor": 1.0 }
]
},
{
"rail_type": "VCC_DDR_IO",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.000000000001, -0.00000000003, 0.00000000006, 0.0000003, 0.000009], "factor": 1.25 },
{ "type": "typical", "coeffs": [0.000000000001, -0.00000000006, 0.0000000005, 0.0000002, 0.000003], "factor": 1.25 }
]
}
]
}
10 changes: 10 additions & 0 deletions backend/etc/devices/mpw1/dsp.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@
{ "name": "DSP_MULT_CAP" , "value": 0.0000015 },
{ "name": "DSP_MULT_CAP2", "value": 0.00000007 },
{ "name": "DSP_INT_CAP" , "value": 0.0000001 }
],
"static_power": [
{
"rail_type": "Vcc_core (DSP)",
"domain": "Core",
"scenarios": [
{ "type": "worse", "coeffs": [0.000000000002, -0.00000000004, 0.00000000008, 0.0000005, 0.00001], "factor": 1.0 },
{ "type": "typical", "coeffs": [0.000000000002, -0.00000000008, 0.0000000007, 0.0000003, 0.000004], "factor": 1.0 }
]
}
]
}
10 changes: 10 additions & 0 deletions backend/etc/devices/mpw1/fabric_le.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,15 @@
{ "name": "FF_CLK_CAP" , "value": 2.91375291375291E-09 },
{ "name": "LUT_INT_CAP", "value": 0.00000002 },
{ "name": "FF_INT_CAP" , "value": 0.00000004 }
],
"static_power": [
{
"rail_type": "Vcc_core (CLB)",
"domain": "Core",
"scenarios": [
{ "type": "worse", "coeffs": [0.000000000000002, -0.0000000000001, 0.00000000001, 0.0000000008, 0.00000006, 0.000002], "factor": 1.0 },
{ "type": "typical", "coeffs": [0.0000000000003, -0.00000000001, 0.0000000001, 0.00000006, 0.0000007], "factor": 1.0 }
]
}
]
}
18 changes: 18 additions & 0 deletions backend/etc/devices/mpw1/gige.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,23 @@
{ "name": "GIGE_CLK_FACTOR" , "value": 0.000124771586466165 },
{ "name": "GIGE_SWITCHING_FACTOR", "value": 0.00504040314066422 },
{ "name": "GIGE_IO_FACTOR" , "value": 0.000071487696 }
],
"static_power": [
{
"rail_type": "VCC_GIGE_IO",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.000000000001, -0.00000000003, 0.00000000006, 0.0000003, 0.000009], "factor": 1.25 },
{ "type": "typical", "coeffs": [0.000000000001, -0.00000000006, 0.0000000005, 0.0000002, 0.000003], "factor": 1.25 }
]
},
{
"rail_type": "VCC_GIGE_AUX",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.0000000008, 0.0000002, 0.00001, 0.007], "factor": 0.555555555555556 },
{ "type": "typical", "coeffs": [0.0000000008, 0.0000002, 0.00001, 0.007], "factor": 0.444444444444445 }
]
}
]
}
34 changes: 34 additions & 0 deletions backend/etc/devices/mpw1/gpio.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,39 @@
{ "name": "GPIO_CLK_FACTOR" , "value": 0.0000773683364661654 },
{ "name": "GPIO_SWITCHING_FACTOR", "value": 5.89015486234265E-06 },
{ "name": "GPIO_IO_FACTOR" , "value": 0.0000001688475 }
],
"static_power": [
{
"rail_type": "VCC_BOOT_IO",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.000000000001, -0.00000000003, 0.00000000006, 0.0000003, 0.000009], "factor": 1.25 },
{ "type": "typical", "coeffs": [0.000000000001, -0.00000000006, 0.0000000005, 0.0000002, 0.000003], "factor": 1.25 }
]
},
{
"rail_type": "VCC_SOC_IO",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.000000000001, -0.00000000003, 0.00000000006, 0.0000003, 0.000009], "factor": 1.25 },
{ "type": "typical", "coeffs": [0.000000000001, -0.00000000006, 0.0000000005, 0.0000002, 0.000003], "factor": 1.25 }
]
},
{
"rail_type": "VCC_BOOT_AUX",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.0000000008, 0.0000002, 0.00001, 0.007], "factor": 0.555555555555556 },
{ "type": "typical", "coeffs": [0.0000000008, 0.0000002, 0.00001, 0.007], "factor": 0.44444444444445 }
]
},
{
"rail_type": "VCC_SOC_AUX",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.0000000008, 0.0000002, 0.00001, 0.007], "factor": 0.555555555555556 },
{ "type": "typical", "coeffs": [0.0000000008, 0.0000002, 0.00001, 0.007], "factor": 0.44444444444445 }
]
}
]
}
10 changes: 10 additions & 0 deletions backend/etc/devices/mpw1/noc.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,15 @@
{ "name": "dma.ocm", "value": 4.64649E-06 },
{ "name": "dma.ocm", "value": 4.74549E-06 },
{ "name": "dma.ocm", "value": 4.69132E-06 }
],
"static_power": [
{
"rail_type": "Vcc_core (NOC)",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.00000000005, -0.000000001, 0.000000002, 0.00001, 0.0003], "factor": 1.0 },
{ "type": "typical", "coeffs": [0.00000000003, -0.000000001, 0.00000001, 0.000005, 0.00006], "factor": 1.0 }
]
}
]
}
5 changes: 2 additions & 3 deletions backend/etc/devices/mpw1/power_data.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"static": {
"$ref": "static_power_data.json"
},
"components": [
{ "$ref": "clocking.json" },
{ "$ref": "dsp.json" },
Expand All @@ -21,6 +18,8 @@
{ "$ref": "sram.json" },
{ "$ref": "pwm.json" },
{ "$ref": "noc.json" },
{ "$ref": "puffcc.json" },
{ "$ref": "rc_osc.json" },
{ "$ref": "regulator.json" }
]
}
13 changes: 13 additions & 0 deletions backend/etc/devices/mpw1/puffcc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "puffcc",
"static_power": [
{
"rail_type": "VCC_PUF",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.001], "factor": 0.555555555555556 },
{ "type": "typical", "coeffs": [0.0005], "factor": 0.555555555555556 }
]
}
]
}
13 changes: 13 additions & 0 deletions backend/etc/devices/mpw1/rc_osc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "rc_osc",
"static_power": [
{
"rail_type": "VCC_RC_OSC",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.0005], "factor": 0.555555555555556 },
{ "type": "typical", "coeffs": [0.0001], "factor": 0.555555555555556 }
]
}
]
}
12 changes: 6 additions & 6 deletions backend/etc/devices/mpw1/regulator.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
{ "name": "VCC_CORE" , "value": 0.8 },
{ "name": "VCC_AUX" , "value": 1.8 },
{ "name": "VCC_BOOT_IO" , "value": 1.8 },
{ "name": "VCC_DDR_IO" , "value": 0.0 },
{ "name": "VCC_DDR_IO" , "value": 0.8 },
{ "name": "VCC_SOC_IO" , "value": 1.8 },
{ "name": "VCC_GBE_IO" , "value": 0.0 },
{ "name": "VCC_USB_IO" , "value": 0.0 },
{ "name": "VCC_GBE_IO" , "value": 0.8 },
{ "name": "VCC_USB_IO" , "value": 0.8 },
{ "name": "VCC_BOOT_AUX", "value": 1.8 },
{ "name": "VCC_SOC_AUX" , "value": 1.8 },
{ "name": "VCC_GBE_AUX" , "value": 0.0 },
{ "name": "VCC_USB_AUX" , "value": 0.0 },
{ "name": "VCC_GBE_AUX" , "value": 1.8 },
{ "name": "VCC_USB_AUX" , "value": 1.8 },
{ "name": "VCC_PUF" , "value": 1.8 },
{ "name": "VCC_RC_OSC" , "value": 0.0 }
{ "name": "VCC_RC_OSC" , "value": 1.8 }
]
}
18 changes: 18 additions & 0 deletions backend/etc/devices/mpw1/usb2.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,23 @@
{ "name": "USB2_CLK_FACTOR" , "value": 0.0000261772947994987 },
{ "name": "USB2_SWITCHING_FACTOR", "value": 0.0000440759304744493 },
{ "name": "USB2_IO_FACTOR" , "value": 0.00166056666666667 }
],
"static_power": [
{
"rail_type": "VCC_USB_IO",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.000000000001, -0.00000000003, 0.00000000006, 0.0000003, 0.000009], "factor": 1.25 },
{ "type": "typical", "coeffs": [0.000000000001, -0.00000000006, 0.0000000005, 0.0000002, 0.000003], "factor": 1.25 }
]
},
{
"rail_type": "VCC_USB_AUX",
"domain": "SOC",
"scenarios": [
{ "type": "worse", "coeffs": [0.0000000008, 0.0000002, 0.00001, 0.007], "factor": 0.555555555555556 },
{ "type": "typical", "coeffs": [0.000000001, 0.0000002, 0.00021, 0.0003], "factor": 0.555555555555556 }
]
}
]
}
30 changes: 28 additions & 2 deletions backend/submodule/bram.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
#
from dataclasses import dataclass, field
from typing import List
import numpy as np
from utilities.common_utils import RsEnum, update_attributes
from .rs_device_resources import BramNotFoundException
from .rs_power_config import ElementType, PowerValue, ScenarioType
from .rs_device_resources import BramNotFoundException, RsDeviceResources
from .rs_message import RsMessage, RsMessageManager
from .rs_logger import RsLogLevel, log

class BRAM_Type(RsEnum):
BRAM_18K_SDP = 0, "18k SDP"
Expand Down Expand Up @@ -175,7 +178,7 @@

class BRAM_SubModule:

def __init__(self, resources, itemlist: List[BRAM] = None):
def __init__(self, resources: RsDeviceResources, itemlist: List[BRAM] = None):
self.resources = resources
self.total_18k_bram_available = resources.get_num_18K_BRAM()
self.total_36k_bram_available = resources.get_num_36K_BRAM()
Expand Down Expand Up @@ -249,3 +252,26 @@
total_power = self.total_block_power + self.total_interconnect_power
for item in self.itemlist:
item.compute_percentage(total_power)

def compute_static_power(self, temperature: float, scenario: ScenarioType) -> float:
NUM_36K_BRAM = self.resources.get_num_36K_BRAM()
mylist = []

Check warning on line 258 in backend/submodule/bram.py

View check run for this annotation

Codecov / codecov/patch

backend/submodule/bram.py#L257-L258

Added lines #L257 - L258 were not covered by tests

for rail_type, scene_list in self.resources.powercfg.get_polynomial(ElementType.BRAM, scenario):
total_power = 0.0
for s in scene_list:
power = np.polyval(s.coeffs, temperature) * s.factor
power = power * NUM_36K_BRAM
total_power += power

Check warning on line 265 in backend/submodule/bram.py

View check run for this annotation

Codecov / codecov/patch

backend/submodule/bram.py#L260-L265

Added lines #L260 - L265 were not covered by tests
# debug info
log(f'[BRAM] {rail_type = }', RsLogLevel.DEBUG)
log(f'[BRAM] {temperature = }', RsLogLevel.DEBUG)
log(f'[BRAM] {scenario = }', RsLogLevel.DEBUG)
log(f'[BRAM] {s.coeffs = }', RsLogLevel.DEBUG)
log(f'[BRAM] {s.factor = }', RsLogLevel.DEBUG)
log(f'[BRAM] {NUM_36K_BRAM = }', RsLogLevel.DEBUG)
log(f'[BRAM] {power = }', RsLogLevel.DEBUG)
log(f'[BRAM] {total_power = }', RsLogLevel.DEBUG)
mylist.append(PowerValue(type=rail_type, value=total_power))

Check warning on line 275 in backend/submodule/bram.py

View check run for this annotation

Codecov / codecov/patch

backend/submodule/bram.py#L267-L275

Added lines #L267 - L275 were not covered by tests

return mylist

Check warning on line 277 in backend/submodule/bram.py

View check run for this annotation

Codecov / codecov/patch

backend/submodule/bram.py#L277

Added line #L277 was not covered by tests
30 changes: 28 additions & 2 deletions backend/submodule/dsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
# Copyright (C) 2024 RapidSilicon
# Authorized use only
#
import numpy as np
from dataclasses import dataclass, field
from typing import List
from utilities.common_utils import RsEnum, update_attributes
from .rs_device_resources import DspNotFoundException
from .rs_device_resources import DspNotFoundException, RsDeviceResources
from .rs_message import RsMessage, RsMessageManager
from .rs_power_config import ElementType, PowerValue, ScenarioType
from .rs_logger import RsLogLevel, log

class Pipelining(RsEnum):
INPUT_AND_OUTPUT = 0, "Input and Output"
Expand Down Expand Up @@ -103,7 +106,7 @@

class DSP_SubModule:

def __init__(self, resources, itemlist: List[DSP] = None):
def __init__(self, resources: RsDeviceResources, itemlist: List[DSP] = None):
self.resources = resources
self.total_dsp_blocks_available = resources.get_num_DSP_BLOCKs()
self.total_interconnect_power = 0.0
Expand Down Expand Up @@ -173,3 +176,26 @@
total_power = self.total_block_power + self.total_interconnect_power
for item in self.itemlist:
item.compute_percentage(total_power)

def compute_static_power(self, temperature: float, scenario: ScenarioType) -> List[PowerValue]:
DSP_BlOCKS = self.resources.get_num_DSP_BLOCKs()
mylist = []

Check warning on line 182 in backend/submodule/dsp.py

View check run for this annotation

Codecov / codecov/patch

backend/submodule/dsp.py#L181-L182

Added lines #L181 - L182 were not covered by tests

for rail_type, scene_list in self.resources.powercfg.get_polynomial(ElementType.DSP, scenario):
total_power = 0.0
for s in scene_list:
power = np.polyval(s.coeffs, temperature) * s.factor
power = power * DSP_BlOCKS
total_power += power

Check warning on line 189 in backend/submodule/dsp.py

View check run for this annotation

Codecov / codecov/patch

backend/submodule/dsp.py#L184-L189

Added lines #L184 - L189 were not covered by tests
# debug info
log(f'[DSP] {rail_type = }', RsLogLevel.DEBUG)
log(f'[DSP] {temperature = }', RsLogLevel.DEBUG)
log(f'[DSP] {scenario = }', RsLogLevel.DEBUG)
log(f'[DSP] {s.coeffs = }', RsLogLevel.DEBUG)
log(f'[DSP] {s.factor = }', RsLogLevel.DEBUG)
log(f'[DSP] {DSP_BlOCKS = }', RsLogLevel.DEBUG)
log(f'[DSP] {power = }', RsLogLevel.DEBUG)
log(f'[DSP] {total_power = }', RsLogLevel.DEBUG)
mylist.append(PowerValue(type=rail_type, value=total_power))

Check warning on line 199 in backend/submodule/dsp.py

View check run for this annotation

Codecov / codecov/patch

backend/submodule/dsp.py#L191-L199

Added lines #L191 - L199 were not covered by tests

return mylist

Check warning on line 201 in backend/submodule/dsp.py

View check run for this annotation

Codecov / codecov/patch

backend/submodule/dsp.py#L201

Added line #L201 was not covered by tests
Loading
Loading