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.
@@ -0,0 +1,437 @@
1
+ """
2
+ @INPROCEEDINGS{9138916,
3
+ author={Li, Weitao and Xu, Pengfei and Zhao, Yang and Li, Haitong and Xie, Yuan and Lin, Yingyan},
4
+ booktitle={2020 ACM/IEEE 47th Annual International Symposium on Computer Architecture (ISCA)},
5
+ title={Timely: Pushing Data Movements And Interfaces In Pim Accelerators Towards Local And In Time Domain},
6
+ year={2020},
7
+ volume={},
8
+ number={},
9
+ pages={832-845},
10
+ doi={10.1109/ISCA45697.2020.00073}}
11
+ """
12
+
13
+ from hwcomponents_library.base import LibraryEstimatorClassBase
14
+ from hwcomponents.scaling import *
15
+ from hwcomponents import actionDynamicEnergy
16
+ from .isaac import IsaacChip2ChipLink
17
+
18
+
19
+ # Original CSV contents:
20
+ # tech_node,global_cycle_period,energy,area,action
21
+ # 65nm,1e-9,0.0368,40,read|add
22
+ # 65nm,1e-9,0,40,write|update|leak
23
+ # # TIMELY says these don't contribute to area
24
+ # # Numbers from paper table II
25
+ class TimelyIAdder(LibraryEstimatorClassBase):
26
+ """
27
+ The current adder from the TIMELY paper. This unit will sum multiple currents into
28
+ one.
29
+
30
+ Parameters
31
+ ----------
32
+ tech_node: float
33
+ Technology node in meters.
34
+ """
35
+
36
+ component_name = "timely_iadder"
37
+ priority = 0.9
38
+
39
+ def __init__(self, tech_node: float):
40
+ super().__init__(leak_power=0.0, area=40.0e-12)
41
+ self.tech_node: float = self.scale(
42
+ "tech_node",
43
+ tech_node,
44
+ 65e-9,
45
+ tech_node_energy,
46
+ tech_node_area,
47
+ tech_node_leak,
48
+ )
49
+
50
+ @actionDynamicEnergy
51
+ def read(self) -> float:
52
+ """
53
+ Returns the energy used to sum two currents in Joules.
54
+
55
+ Returns
56
+ -------
57
+ float
58
+ The energy used to sum two currents in Joules.
59
+ """
60
+
61
+ return 0.0368e-12
62
+
63
+ @actionDynamicEnergy
64
+ def add(self) -> float:
65
+ """
66
+ Returns the energy used to sum two currents in Joules.
67
+
68
+ Returns
69
+ -------
70
+ float
71
+ The energy used to sum two currents in Joules.
72
+ """
73
+
74
+ return 0.0368e-12
75
+
76
+
77
+ # Original CSV contents:
78
+ # tech_node,global_cycle_period,n_instances,energy,area,action
79
+ # 65nm,1e-9,1,0.0023,5,drive|read|convert
80
+ # 65nm,1e-9,1,0,5,leak|update|write
81
+ # # Numbers from paper table II
82
+ class TimelyPSubBuf(LibraryEstimatorClassBase):
83
+ """
84
+ PSubBuf from the TIMELY paper. This unit will repeat & amplify an input voltage
85
+ value.
86
+
87
+ Parameters
88
+ ----------
89
+ tech_node: float
90
+ Technology node in meters.
91
+ """
92
+ component_name = "timely_psubBuf"
93
+ priority = 0.9
94
+
95
+ def __init__(self, tech_node: float):
96
+ super().__init__(leak_power=0.0, area=5.0e-12)
97
+ self.tech_node: float = self.scale(
98
+ "tech_node",
99
+ tech_node,
100
+ 65e-9,
101
+ tech_node_energy,
102
+ tech_node_area,
103
+ tech_node_leak,
104
+ )
105
+
106
+ @actionDynamicEnergy
107
+ def drive(self) -> float:
108
+ """
109
+ Returns the energy used to drive a voltage in Joules.
110
+
111
+ Returns
112
+ -------
113
+ float
114
+ The energy used to drive a voltage in Joules.
115
+ """
116
+ return 0.0023e-12
117
+
118
+ @actionDynamicEnergy
119
+ def read(self) -> float:
120
+ """
121
+ Returns the energy used to drive a voltage in Joules.
122
+
123
+ Returns
124
+ -------
125
+ float
126
+ The energy used to drive a voltage in Joules.
127
+ """
128
+ return 0.0023e-12
129
+
130
+
131
+ # Original CSV contents:
132
+ # tech_node,global_cycle_period,resolution,energy,area,action
133
+ # 65nm,1e-9,8,0.0375,240,convert|read
134
+ # 65nm,1e-9,8,0,240,write|leak|update
135
+ # # Numbers from paper table II
136
+ class TimelyDTC(LibraryEstimatorClassBase):
137
+ """
138
+ The digital-to-time converter (DTC) from the TIMELY paper. This unit will convert
139
+ a digital value into a pulse width modulated (PWM) signal.
140
+
141
+ Parameters
142
+ ----------
143
+ tech_node: float
144
+ Technology node in meters.
145
+ resolution: int
146
+ Resolution of the DTC in bits.
147
+ """
148
+ component_name = "timely_dtc"
149
+ priority = 0.9
150
+
151
+ def __init__(self, tech_node: float, resolution: int = 8):
152
+ super().__init__(leak_power=0.0, area=240.0e-12)
153
+ self.tech_node: float = self.scale(
154
+ "tech_node",
155
+ tech_node,
156
+ 65e-9,
157
+ tech_node_energy,
158
+ tech_node_area,
159
+ tech_node_leak,
160
+ )
161
+ self.resolution: int = self.scale(
162
+ "resolution", resolution, 8, pow_base(2), pow_base(2), pow_base(2)
163
+ )
164
+
165
+ @actionDynamicEnergy
166
+ def convert(self) -> float:
167
+ """
168
+ Returns the energy used to convert a digital value into a PWM signal in Joules.
169
+
170
+ Returns
171
+ -------
172
+ float
173
+ The energy used to convert a digital value into a PWM signal in Joules.
174
+ """
175
+ return 0.0375e-12
176
+
177
+ @actionDynamicEnergy
178
+ def read(self) -> float:
179
+ """
180
+ Returns the energy used to convert a digital value into a PWM signal in Joules.
181
+
182
+ Returns
183
+ -------
184
+ float
185
+ The energy used to convert a digital value into a PWM signal in Joules.
186
+ """
187
+ return 0.0375e-12
188
+
189
+
190
+ # Original CSV contents:
191
+ # tech_node,global_cycle_period,resolution,energy,area,action
192
+ # 65nm,1e-9,8,0.145,310,convert|read
193
+ # 65nm,1e-9,8,0,310,leak|write|update
194
+ class TimelyTDC(LibraryEstimatorClassBase):
195
+ """
196
+ The time-to-digital converter (TDC) from the TIMELY paper. This unit will convert
197
+ a pulse width modulated (PWM) signal into a digital value.
198
+
199
+ Parameters
200
+ ----------
201
+ tech_node: float
202
+ Technology node in meters.
203
+ resolution: int
204
+ Resolution of the TDC in bits.
205
+ """
206
+
207
+ component_name = "timely_tdc"
208
+ priority = 0.9
209
+
210
+ def __init__(self, tech_node: float, resolution: int = 8):
211
+ super().__init__(leak_power=0.0, area=310.0e-12)
212
+ self.tech_node: float = self.scale(
213
+ "tech_node",
214
+ tech_node,
215
+ 65e-9,
216
+ tech_node_energy,
217
+ tech_node_area,
218
+ tech_node_leak,
219
+ )
220
+ self.resolution: int = self.scale(
221
+ "resolution", resolution, 8, pow_base(2), pow_base(2), pow_base(2)
222
+ )
223
+
224
+ @actionDynamicEnergy
225
+ def convert(self) -> float:
226
+ """
227
+ Returns the energy used to convert a PWM signal into a digital value in Joules.
228
+
229
+ Returns
230
+ -------
231
+ float
232
+ The energy used to convert a PWM signal into a digital value in Joules.
233
+ """
234
+ return 0.145e-12
235
+
236
+ @actionDynamicEnergy
237
+ def read(self) -> float:
238
+ """
239
+ Returns the energy used to convert a PWM signal into a digital value in Joules.
240
+
241
+ Returns
242
+ -------
243
+ float
244
+ The energy used to convert a PWM signal into a digital value in Joules.
245
+ """
246
+ return 0.145e-12
247
+
248
+
249
+ # Original CSV contents:
250
+ # tech_node,global_cycle_period,rows,energy,area,action
251
+ # 65nm,1e-9,1,0.00062,5,read|drive|buffer
252
+ # 65nm,1e-9,1,0,5,leak|write|update
253
+ # # Numbers from paper table II
254
+ class TimelyXSubBuf(LibraryEstimatorClassBase):
255
+ """
256
+ The XSubBuf from the TIMELY paper. This unit will repeat & amplify an input current
257
+ value.
258
+
259
+ Parameters
260
+ ----------
261
+ tech_node: float
262
+ Technology node in meters.
263
+ rows: int
264
+ Number of rows of the CiM array that are applying current to the XSubBuf. Power
265
+ will increase with more rows.
266
+ """
267
+
268
+ component_name = "timely_xsubBuf"
269
+ priority = 0.9
270
+
271
+ def __init__(self, tech_node: float, rows: int = 1):
272
+ super().__init__(leak_power=0.0, area=5.0e-12)
273
+ self.tech_node: float = self.scale(
274
+ "tech_node",
275
+ tech_node,
276
+ 65e-9,
277
+ tech_node_energy,
278
+ tech_node_area,
279
+ tech_node_leak,
280
+ )
281
+ self.rows: int = self.scale("rows", rows, 1, linear, noscale, noscale)
282
+
283
+ @actionDynamicEnergy
284
+ def read(self) -> float:
285
+ """
286
+ Returns the energy used to repeat & amplify an input current in Joules.
287
+
288
+ Returns
289
+ -------
290
+ float
291
+ The energy used to repeat & amplify an input current in Joules.
292
+ """
293
+ return 0.00062e-12
294
+
295
+ @actionDynamicEnergy
296
+ def drive(self) -> float:
297
+ """
298
+ Returns the energy used to repeat & amplify an input current in Joules.
299
+
300
+ Returns
301
+ -------
302
+ float
303
+ The energy used to repeat & amplify an input current in Joules.
304
+ """
305
+ return 0.00062e-12
306
+
307
+
308
+ # Original CSV contents:
309
+ # tech_node,global_cycle_period,energy,area,action
310
+ # 65nm,1e-9,0.0417,40,compare|read
311
+ # 65nm,1e-9,0,40,write|update|leak
312
+ # # Numbers from paper table II
313
+ class TimelyChargingComparator(LibraryEstimatorClassBase):
314
+ """
315
+ The charging comparator from the TIMELY paper. This unit will accumulate charge on a
316
+ capacitor and trigger a singal once it exceed a reference charge.
317
+
318
+ Parameters
319
+ ----------
320
+ tech_node: float
321
+ Technology node in meters.
322
+ """
323
+
324
+ component_name = "timely_charging_comparator"
325
+ priority = 0.9
326
+
327
+ def __init__(self, tech_node: float):
328
+ super().__init__(leak_power=0.0, area=40.0e-12)
329
+ self.tech_node: float = self.scale(
330
+ "tech_node",
331
+ tech_node,
332
+ 65e-9,
333
+ tech_node_energy,
334
+ tech_node_area,
335
+ tech_node_leak,
336
+ )
337
+
338
+ @actionDynamicEnergy
339
+ def compare(self) -> float:
340
+ """
341
+ Returns the energy used to compare an input to the reference.
342
+
343
+ Returns
344
+ -------
345
+ float
346
+ The energy used to compare an input current to the reference.
347
+ """
348
+ return 0.0417e-12
349
+
350
+ @actionDynamicEnergy
351
+ def read(self) -> float:
352
+ """
353
+ Returns the energy used to compare an input to the reference.
354
+
355
+ Returns
356
+ -------
357
+ float
358
+ The energy used to compare an input current to the reference.
359
+ """
360
+ return 0.0417e-12
361
+
362
+
363
+ # Original CSV contents:
364
+ # tech_node,global_cycle_period,width|datawidth,depth,energy,area,action
365
+ # 65nm,1e-9,128,128,203.776,40,read
366
+ # 65nm,1e-9,128,128,496.624,40,write|update
367
+ # 65nm,1e-9,128,128,0,40,leak
368
+ class TimelyInputOutputBuffer(LibraryEstimatorClassBase):
369
+ """
370
+ The input/output buffers from the TIMELY paper. These digital buffers store inputs and outputs to the CiM arrays.
371
+
372
+ Parameters
373
+ ----------
374
+ tech_node: float
375
+ Technology node in meters.
376
+ width : int, optional
377
+ The width of the read/write port of the buffer in bits. Total size = width * depth.
378
+ depth: int
379
+ The number of entries in the buffer, each with `width` bits. Total size = width
380
+ * depth.
381
+ """
382
+
383
+ component_name = "timely_input_output_buffer"
384
+ priority = 0.9
385
+
386
+ def __init__(self, tech_node: float, width: int = 128, depth: int = 128):
387
+ super().__init__(leak_power=0.0, area=40.0e-12)
388
+ self.tech_node: float = self.scale(
389
+ "tech_node",
390
+ tech_node,
391
+ 65e-9,
392
+ tech_node_energy,
393
+ tech_node_area,
394
+ tech_node_leak,
395
+ )
396
+ self.width: int = self.scale("width", width, 128, linear, linear, linear)
397
+ self.depth: int = self.scale(
398
+ "depth", depth, 128, linear, cacti_depth_energy, cacti_depth_energy
399
+ )
400
+
401
+ @actionDynamicEnergy(bits_per_action="width")
402
+ def read(self) -> float:
403
+ """
404
+ Returns the energy used to read from the buffer in Joules.
405
+
406
+ Parameters
407
+ ----------
408
+ bits_per_action: int
409
+ The number of bits to read.
410
+
411
+ Returns
412
+ -------
413
+ float
414
+ The energy used to read from the buffer in Joules.
415
+ """
416
+ return 203.776e-12
417
+
418
+ @actionDynamicEnergy(bits_per_action="width")
419
+ def write(self) -> float:
420
+ """
421
+ Returns the energy used to write to the buffer in Joules.
422
+
423
+ Parameters
424
+ ----------
425
+ bits_per_action: int
426
+ The number of bits to write.
427
+
428
+ Returns
429
+ -------
430
+ float
431
+ The energy used to write to the buffer in Joules.
432
+ """
433
+ return 496.624e-12
434
+
435
+
436
+ class TimelyChip2ChipLink(IsaacChip2ChipLink):
437
+ pass