Skip to content

Commit e07df98

Browse files
scale_tech_node function
1 parent f596f1b commit e07df98

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

hwcomponents/model.py

100644100755
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,36 @@ def scale(
364364

365365
return target
366366

367+
def scale_tech_node(self, target: float, default: float) -> float:
368+
"""
369+
Scales the tech node of the component to the given target.
370+
371+
Parameters
372+
----------
373+
target: float
374+
The target tech node.
375+
default: float
376+
The default tech node.
377+
378+
Returns
379+
-------
380+
The scaled tech node.
381+
"""
382+
from hwcomponents.scaling import (
383+
tech_node_area,
384+
tech_node_energy,
385+
tech_node_latency,
386+
tech_node_leak,
387+
)
388+
return self.scale(
389+
"tech_node",
390+
target, default,
391+
tech_node_area,
392+
tech_node_energy,
393+
tech_node_latency,
394+
tech_node_leak,
395+
)
396+
367397
@classmethod
368398
def get_action_names(cls) -> List[str]:
369399
"""

0 commit comments

Comments
 (0)