hwcomponents-library 1.1.0.dev21__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hwcomponents_library/__init__.py +12 -0
- hwcomponents_library/_version.py +34 -0
- hwcomponents_library/_version_scheme.py +43 -0
- hwcomponents_library/base.py +12 -0
- hwcomponents_library/library/__init__.py +0 -0
- hwcomponents_library/library/aladdin.py +409 -0
- hwcomponents_library/library/atomlayer.py +204 -0
- hwcomponents_library/library/brahms.py +85 -0
- hwcomponents_library/library/dummy.py +172 -0
- hwcomponents_library/library/forms.py +80 -0
- hwcomponents_library/library/isaac.py +602 -0
- hwcomponents_library/library/jia.py +232 -0
- hwcomponents_library/library/misc.py +199 -0
- hwcomponents_library/library/newton.py +127 -0
- hwcomponents_library/library/raella.py +89 -0
- hwcomponents_library/library/timely.py +437 -0
- hwcomponents_library/library/wan.py +288 -0
- hwcomponents_library-1.1.0.dev21.dist-info/METADATA +57 -0
- hwcomponents_library-1.1.0.dev21.dist-info/RECORD +21 -0
- hwcomponents_library-1.1.0.dev21.dist-info/WHEEL +5 -0
- hwcomponents_library-1.1.0.dev21.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"""
|
|
2
|
+
@article{wan2022compute,
|
|
3
|
+
title={A compute-in-memory chip based on resistive random-access memory},
|
|
4
|
+
author={Wan, Weier and Kubendran, Rajkumar and Schaefer, Clemens and Eryilmaz, Sukru Burc and Zhang, Wenqiang and Wu, Dabin and Deiss, Stephen and Raina, Priyanka and Qian, He and Gao, Bin and others},
|
|
5
|
+
journal={Nature},
|
|
6
|
+
volume={608},
|
|
7
|
+
number={7923},
|
|
8
|
+
pages={504--512},
|
|
9
|
+
year={2022},
|
|
10
|
+
publisher={Nature Publishing Group UK London}
|
|
11
|
+
}
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from hwcomponents_library.base import LibraryEstimatorClassBase
|
|
15
|
+
from hwcomponents.scaling import *
|
|
16
|
+
from hwcomponents import actionDynamicEnergy
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Original CSV contents:
|
|
20
|
+
# tech_node,n_repeats,global_cycle_period,resolution, voltage,energy,area, action
|
|
21
|
+
# 130nm, 1, 1e-6, 8, 1.8, 0.1, 170, read
|
|
22
|
+
# 130nm, 1, 1e-6, 8, 1.8, 0.1, 170, write|update
|
|
23
|
+
# 130nm, 1, 1e-6, 8, 1.8, 0.1, 170, leak
|
|
24
|
+
class WanShiftAdd(LibraryEstimatorClassBase):
|
|
25
|
+
"""
|
|
26
|
+
The shift-and-add unit from the Wan et al. Nature 2022 paper. This unit will sum and
|
|
27
|
+
accumulate values in a register, while also shifting the register contents to accept
|
|
28
|
+
various power-of-two scaling factors for the summed values.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
tech_node: float
|
|
33
|
+
Technology node in meters.
|
|
34
|
+
n_repeats: int
|
|
35
|
+
Number of times to repeat the shift-and-add operation.
|
|
36
|
+
resolution: int
|
|
37
|
+
Resolution of the shift-and-add unit in bits. This is the number of bits of each
|
|
38
|
+
input value that is added to the register.
|
|
39
|
+
voltage: float
|
|
40
|
+
Voltage of the shift-and-add unit in volts.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
component_name = "wan_shift_add"
|
|
44
|
+
priority = 0.9
|
|
45
|
+
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
tech_node: float,
|
|
49
|
+
n_repeats: int = 1,
|
|
50
|
+
resolution: int = 8,
|
|
51
|
+
voltage: float = 1.8,
|
|
52
|
+
):
|
|
53
|
+
super().__init__(leak_power=1.00e-7, area=170.0e-12)
|
|
54
|
+
self.tech_node: float = self.scale(
|
|
55
|
+
"tech_node",
|
|
56
|
+
tech_node,
|
|
57
|
+
130e-9,
|
|
58
|
+
tech_node_energy,
|
|
59
|
+
tech_node_area,
|
|
60
|
+
tech_node_leak,
|
|
61
|
+
)
|
|
62
|
+
self.n_repeats: int = self.scale(
|
|
63
|
+
"n_repeats", n_repeats, 1, linear, linear, linear
|
|
64
|
+
)
|
|
65
|
+
self.resolution: int = self.scale(
|
|
66
|
+
"resolution", resolution, 8, pow_base(2), pow_base(2), pow_base(2)
|
|
67
|
+
)
|
|
68
|
+
self.voltage: float = self.scale("voltage", voltage, 1.8, noscale, quadratic, 1)
|
|
69
|
+
|
|
70
|
+
@actionDynamicEnergy
|
|
71
|
+
def read(self) -> float:
|
|
72
|
+
"""
|
|
73
|
+
Returns zero Joules.
|
|
74
|
+
|
|
75
|
+
Returns
|
|
76
|
+
-------
|
|
77
|
+
float
|
|
78
|
+
Zero Joules.
|
|
79
|
+
"""
|
|
80
|
+
return 0
|
|
81
|
+
|
|
82
|
+
@actionDynamicEnergy
|
|
83
|
+
def write(self) -> float:
|
|
84
|
+
"""
|
|
85
|
+
Returns the energy used to perform a shift-and-add operation in Joules.
|
|
86
|
+
|
|
87
|
+
Returns
|
|
88
|
+
-------
|
|
89
|
+
float
|
|
90
|
+
The energy used to perform a shift-and-add operation in Joules.
|
|
91
|
+
"""
|
|
92
|
+
return self.shift_and_add()
|
|
93
|
+
|
|
94
|
+
@actionDynamicEnergy
|
|
95
|
+
def shift_and_add(self) -> float:
|
|
96
|
+
"""
|
|
97
|
+
Returns the energy used to perform a shift-and-add operation in Joules.
|
|
98
|
+
|
|
99
|
+
Returns
|
|
100
|
+
-------
|
|
101
|
+
float
|
|
102
|
+
The energy used to perform a shift-and-add operation in Joules.
|
|
103
|
+
"""
|
|
104
|
+
return 0.1e-12
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# Original CSV contents:
|
|
108
|
+
# tech_node,n_repeats,global_cycle_period,voltage,energy,area, action
|
|
109
|
+
# 130nm, 1, 1e-6, 1.8, 0.3, 400, read
|
|
110
|
+
# 130nm, 1, 1e-6, 1.8, 0, 400, leak
|
|
111
|
+
# 130nm, 1, 1e-6, 1.8, 0, 400, write|update
|
|
112
|
+
class WanVariablePrecisionADC(LibraryEstimatorClassBase):
|
|
113
|
+
"""
|
|
114
|
+
The variable precision ADC from the Wan et al. Nature 2022 paper. This unit will
|
|
115
|
+
convert a voltage to a digital value.
|
|
116
|
+
|
|
117
|
+
Parameters
|
|
118
|
+
----------
|
|
119
|
+
tech_node: float
|
|
120
|
+
Technology node in meters.
|
|
121
|
+
n_repeats: int
|
|
122
|
+
Number of times to repeat the ADC operation.
|
|
123
|
+
voltage: float
|
|
124
|
+
Voltage of the ADC unit in volts.
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
component_name = "wan_variable_precision_adc"
|
|
128
|
+
priority = 0.9
|
|
129
|
+
|
|
130
|
+
def __init__(self, tech_node: float, n_repeats: int = 1, voltage: float = 1.8):
|
|
131
|
+
super().__init__(leak_power=0.0, area=400.0e-12)
|
|
132
|
+
self.tech_node: float = self.scale(
|
|
133
|
+
"tech_node",
|
|
134
|
+
tech_node,
|
|
135
|
+
130e-9,
|
|
136
|
+
tech_node_energy,
|
|
137
|
+
tech_node_area,
|
|
138
|
+
tech_node_leak,
|
|
139
|
+
)
|
|
140
|
+
self.n_repeats: int = self.scale(
|
|
141
|
+
"n_repeats", n_repeats, 1, linear, linear, linear
|
|
142
|
+
)
|
|
143
|
+
self.voltage: float = self.scale("voltage", voltage, 1.8, noscale, quadratic, 1)
|
|
144
|
+
|
|
145
|
+
@actionDynamicEnergy
|
|
146
|
+
def convert(self) -> float:
|
|
147
|
+
"""
|
|
148
|
+
Returns the energy used to convert a voltage to a digital value in Joules.
|
|
149
|
+
|
|
150
|
+
Returns
|
|
151
|
+
-------
|
|
152
|
+
float
|
|
153
|
+
The energy used to convert a voltage to a digital value in Joules.
|
|
154
|
+
"""
|
|
155
|
+
return 0.3e-12
|
|
156
|
+
|
|
157
|
+
@actionDynamicEnergy
|
|
158
|
+
def read(self) -> float:
|
|
159
|
+
"""
|
|
160
|
+
Returns the energy used to convert a voltage to a digital value in Joules.
|
|
161
|
+
|
|
162
|
+
Returns
|
|
163
|
+
-------
|
|
164
|
+
float
|
|
165
|
+
The energy used to convert a voltage to a digital value in Joules.
|
|
166
|
+
"""
|
|
167
|
+
return self.convert()
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
# Original CSV contents:
|
|
171
|
+
# tech_node,global_cycle_period,voltage,energy,area, action
|
|
172
|
+
# 130nm, 1e-6, 1.8, 1.2, 350, read
|
|
173
|
+
# 130nm, 1e-6, 1.8, 0, 350, leak
|
|
174
|
+
# 130nm, 1e-6, 1.8, 0, 350, write|update
|
|
175
|
+
class WanAnalogSample(LibraryEstimatorClassBase):
|
|
176
|
+
"""
|
|
177
|
+
The analog sample unit from the Wan et al. Nature 2022 paper. This unit will sample
|
|
178
|
+
an analog charge and add it to an analog integrator.
|
|
179
|
+
|
|
180
|
+
Parameters
|
|
181
|
+
----------
|
|
182
|
+
tech_node: float
|
|
183
|
+
Technology node in meters.
|
|
184
|
+
voltage: float
|
|
185
|
+
Voltage of the analog sample unit in volts.
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
component_name = "wan_analog_sample"
|
|
189
|
+
priority = 0.9
|
|
190
|
+
|
|
191
|
+
def __init__(self, tech_node: float, voltage: float = 1.8):
|
|
192
|
+
super().__init__(leak_power=0.0, area=350.0e-12)
|
|
193
|
+
self.tech_node: float = self.scale(
|
|
194
|
+
"tech_node",
|
|
195
|
+
tech_node,
|
|
196
|
+
130e-9,
|
|
197
|
+
tech_node_energy,
|
|
198
|
+
tech_node_area,
|
|
199
|
+
tech_node_leak,
|
|
200
|
+
)
|
|
201
|
+
self.voltage: float = self.scale("voltage", voltage, 1.8, noscale, quadratic, 1)
|
|
202
|
+
|
|
203
|
+
@actionDynamicEnergy
|
|
204
|
+
def read(self) -> float:
|
|
205
|
+
"""
|
|
206
|
+
Returns the energy used to sample an analog voltage in Joules.
|
|
207
|
+
|
|
208
|
+
Returns
|
|
209
|
+
-------
|
|
210
|
+
float
|
|
211
|
+
The energy used to sample an analog voltage in Joules.
|
|
212
|
+
"""
|
|
213
|
+
return self.sample()
|
|
214
|
+
|
|
215
|
+
@actionDynamicEnergy
|
|
216
|
+
def sample(self) -> float:
|
|
217
|
+
"""
|
|
218
|
+
Returns the energy used to sample an analog voltage in Joules.
|
|
219
|
+
|
|
220
|
+
Returns
|
|
221
|
+
-------
|
|
222
|
+
float
|
|
223
|
+
The energy used to sample an analog voltage in Joules.
|
|
224
|
+
"""
|
|
225
|
+
return 1.2e-12
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
# Original CSV contents:
|
|
229
|
+
# tech_node,n_repeats,global_cycle_period,voltage,energy,area, action
|
|
230
|
+
# 130nm, 1, 1e-6, 1.8, 0.25, 350, read
|
|
231
|
+
# 130nm, 1, 1e-6, 1.8, 0, 350, leak
|
|
232
|
+
# 130nm, 1, 1e-6, 1.8, 0, 350, write|update
|
|
233
|
+
class WanAnalogIntegrator(LibraryEstimatorClassBase):
|
|
234
|
+
"""
|
|
235
|
+
The analog integrator unit from the Wan et al. Nature 2022 paper. This unit will
|
|
236
|
+
integrate charge over multiple samples.
|
|
237
|
+
|
|
238
|
+
Parameters
|
|
239
|
+
----------
|
|
240
|
+
tech_node: float
|
|
241
|
+
Technology node in meters.
|
|
242
|
+
n_repeats: int
|
|
243
|
+
Number of times to repeat the analog integration operation.
|
|
244
|
+
voltage: float
|
|
245
|
+
Voltage of the analog integrator unit in volts.
|
|
246
|
+
"""
|
|
247
|
+
|
|
248
|
+
component_name = "wan_analog_integrator"
|
|
249
|
+
priority = 0.9
|
|
250
|
+
|
|
251
|
+
def __init__(self, tech_node: float, n_repeats: int = 1, voltage: float = 1.8):
|
|
252
|
+
super().__init__(leak_power=0.0, area=350.0e-12)
|
|
253
|
+
self.tech_node: float = self.scale(
|
|
254
|
+
"tech_node",
|
|
255
|
+
tech_node,
|
|
256
|
+
130e-9,
|
|
257
|
+
tech_node_energy,
|
|
258
|
+
tech_node_area,
|
|
259
|
+
tech_node_leak,
|
|
260
|
+
)
|
|
261
|
+
self.n_repeats: int = self.scale(
|
|
262
|
+
"n_repeats", n_repeats, 1, linear, linear, linear
|
|
263
|
+
)
|
|
264
|
+
self.voltage: float = self.scale("voltage", voltage, 1.8, noscale, quadratic, 1)
|
|
265
|
+
|
|
266
|
+
@actionDynamicEnergy
|
|
267
|
+
def integrate(self) -> float:
|
|
268
|
+
"""
|
|
269
|
+
Returns the energy used to integrate charge for a sample in Joules.
|
|
270
|
+
|
|
271
|
+
Returns
|
|
272
|
+
-------
|
|
273
|
+
float
|
|
274
|
+
The energy used to integrate charge for a sample in Joules.
|
|
275
|
+
"""
|
|
276
|
+
return 0.25e-12
|
|
277
|
+
|
|
278
|
+
@actionDynamicEnergy
|
|
279
|
+
def read(self) -> float:
|
|
280
|
+
"""
|
|
281
|
+
Returns the energy used to integrate charge for a sample in Joules.
|
|
282
|
+
|
|
283
|
+
Returns
|
|
284
|
+
-------
|
|
285
|
+
float
|
|
286
|
+
The energy used to integrate charge for a sample in Joules.
|
|
287
|
+
"""
|
|
288
|
+
return self.integrate()
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hwcomponents_library
|
|
3
|
+
Version: 1.1.0.dev21
|
|
4
|
+
Summary: A library of hardware components for energy estimation.
|
|
5
|
+
Author-email: Tanner Andrulis <Andrulis@Mit.edu>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: hardware,components,energy,estimation
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: hwcomponents
|
|
14
|
+
Requires-Dist: hwcomponents-cacti
|
|
15
|
+
|
|
16
|
+
# HWComponents-Library
|
|
17
|
+
HWComponents-Library contains a library of components from published works. It is
|
|
18
|
+
intended to be used to rapidly model prior works and to provide a common set of
|
|
19
|
+
components for comparison.
|
|
20
|
+
|
|
21
|
+
These models are for use with the HWComponents package, found at
|
|
22
|
+
https://accelergy-project.github.io/hwcomponents/.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Install from PyPI:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install hwcomponents-library
|
|
30
|
+
|
|
31
|
+
# Check that the installation is successful
|
|
32
|
+
hwc --list | grep adder
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Contributing: Adding or Updating Numbers from Your Work
|
|
36
|
+
We would be happy to update these models given a pull request. Please see
|
|
37
|
+
"Creating Library Entries" and format your entries to match the existing
|
|
38
|
+
entries. If you have any questions, we would be happy to help.
|
|
39
|
+
|
|
40
|
+
Note that we will only accept entries that are published or backed by public
|
|
41
|
+
data. Citations are required for all entries.
|
|
42
|
+
|
|
43
|
+
## Citation
|
|
44
|
+
|
|
45
|
+
If you use this library in your work, please cite the following:
|
|
46
|
+
|
|
47
|
+
```bibtex
|
|
48
|
+
@misc{andrulis2024modelinganalogdigitalconverterenergyarea,
|
|
49
|
+
title={Modeling Analog-Digital-Converter Energy and Area for Compute-In-Memory Accelerator Design},
|
|
50
|
+
author={Tanner Andrulis and Ruicong Chen and Hae-Seung Lee and Joel S. Emer and Vivienne Sze},
|
|
51
|
+
year={2024},
|
|
52
|
+
eprint={2404.06553},
|
|
53
|
+
archivePrefix={arXiv},
|
|
54
|
+
primaryClass={cs.AR},
|
|
55
|
+
url={https://arxiv.org/abs/2404.06553},
|
|
56
|
+
}
|
|
57
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
hwcomponents_library/__init__.py,sha256=u6UkOPO0DVX5BOhZRFE3V3GmG1iR38G_ARRx8PziRAs,593
|
|
2
|
+
hwcomponents_library/_version.py,sha256=W7W7CpPjreycTcPcYldRm4gQscL8PkctLexBsfP2ICY,719
|
|
3
|
+
hwcomponents_library/_version_scheme.py,sha256=xq7gKERwEfxj6gv8HwXde0V_vnst8fCQOVNhfEQhgpU,1365
|
|
4
|
+
hwcomponents_library/base.py,sha256=ZdhNGsrAt2SsUMimgbvDm01VW2XnxuNfqGRb_MZmTDs,293
|
|
5
|
+
hwcomponents_library/library/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
hwcomponents_library/library/aladdin.py,sha256=plhnSUJApvHKZtAwCmbBmuxmPNmzRbqFTCUmWpZkMEw,11959
|
|
7
|
+
hwcomponents_library/library/atomlayer.py,sha256=SuvGowY6biqNVKXJicDmcZKsbLtTs4kT_2nRqZdbc_w,5988
|
|
8
|
+
hwcomponents_library/library/brahms.py,sha256=wdGmmJ0y-jOyk9ZUdVJqNJMWcXDuCWXTLfbg_ZHURIA,2585
|
|
9
|
+
hwcomponents_library/library/dummy.py,sha256=FZS9fC3jyY0EQZcy9bB_gpXR98UWtQyyGX3G4-2pOSs,4428
|
|
10
|
+
hwcomponents_library/library/forms.py,sha256=HFB4ssLPtkzUF7Pv_qasI6wTXXdx2Nrf1YOvwOf0OsU,2389
|
|
11
|
+
hwcomponents_library/library/isaac.py,sha256=1NGZQ9S-qjWWCfUv-lkGZrLB9K2JRJ2eiIyE5JDYEtc,18594
|
|
12
|
+
hwcomponents_library/library/jia.py,sha256=J2wAqJY6nPHesuQQfj4sezNu6pw-pIOaJJ3at6Hfa3M,7154
|
|
13
|
+
hwcomponents_library/library/misc.py,sha256=qxsVPLLSls0pN3VU5rUdDvr4DQmQVrD6rBhobj3BR44,6658
|
|
14
|
+
hwcomponents_library/library/newton.py,sha256=n4qtEPw_SZ0vy8G1FGB3GV_qXuVrAQRmXYpqIYBHMWw,3321
|
|
15
|
+
hwcomponents_library/library/raella.py,sha256=LYQHKdKHOUXI1C6fWndPnGUfQtyXnU0hvnh9nO9slKY,4188
|
|
16
|
+
hwcomponents_library/library/timely.py,sha256=3-jwuZ7Bl8kMa2-3naPOTvZ4R3bcBZk9-LtaaKcRG4I,12123
|
|
17
|
+
hwcomponents_library/library/wan.py,sha256=xFVqN0L7NI6001__IgZeL_1lCnQL-FLimZ7W9DJPpnU,8981
|
|
18
|
+
hwcomponents_library-1.1.0.dev21.dist-info/METADATA,sha256=8iopf0zDWzaZEoQcmpo5SfKrWvaQd-6WMBgFGaRYgVU,1944
|
|
19
|
+
hwcomponents_library-1.1.0.dev21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
20
|
+
hwcomponents_library-1.1.0.dev21.dist-info/top_level.txt,sha256=FtRd1D0A21SWFGssHxfLzv4-ZGWqcBRlWn6S9c6fCYM,21
|
|
21
|
+
hwcomponents_library-1.1.0.dev21.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hwcomponents_library
|