@@ -66,7 +66,7 @@ def add(self) -> tuple[float, float]:
6666 -------
6767 (energy, latency): Tuple in (Joules, seconds).
6868 """
69- return 0.21e-12 , 0.0
69+ return 0.21e-12 , 1e-9
7070
7171 @action
7272 def read (self ) -> tuple [float , float ]:
@@ -77,7 +77,7 @@ def read(self) -> tuple[float, float]:
7777 -------
7878 (energy, latency): Tuple in (Joules, seconds).
7979 """
80- return 0.21e-12 , 0.0
80+ return 0.21e-12 , 1e-9
8181
8282
8383# Original CSV contents:
@@ -131,7 +131,7 @@ def read(self) -> tuple[float, float]:
131131 -------
132132 (energy, latency): Tuple in (Joules, seconds).
133133 """
134- return 0.009e-12 , 0.0
134+ return 0.009e-12 , 1e-9
135135
136136 @action (bits_per_action = "width" )
137137 def write (self ) -> tuple [float , float ]:
@@ -147,7 +147,7 @@ def write(self) -> tuple[float, float]:
147147 -------
148148 (energy, latency): Tuple in (Joules, seconds).
149149 """
150- return 0.009e-12 , 0.0
150+ return 0.009e-12 , 1e-9
151151
152152
153153# Original CSV contents:
@@ -195,7 +195,7 @@ def compare(self) -> tuple[float, float]:
195195 -------
196196 (energy, latency): Tuple in (Joules, seconds).
197197 """
198- return 0.02947e-12 , 0.0
198+ return 0.02947e-12 , 1e-9
199199
200200 @action
201201 def read (self ) -> tuple [float , float ]:
@@ -206,7 +206,7 @@ def read(self) -> tuple[float, float]:
206206 -------
207207 (energy, latency): Tuple in (Joules, seconds).
208208 """
209- return 0.02947e-12 , 0.0
209+ return 0.02947e-12 , 1e-9
210210
211211
212212# Original CSV contents:
@@ -283,7 +283,7 @@ def multiply(self) -> tuple[float, float]:
283283 -------
284284 (energy, latency): Tuple in (Joules, seconds).
285285 """
286- return 12.68e-12 , 0.0
286+ return 12.68e-12 , 1e-9
287287
288288 @action
289289 def read (self ) -> tuple [float , float ]:
@@ -294,7 +294,7 @@ def read(self) -> tuple[float, float]:
294294 -------
295295 (energy, latency): Tuple in (Joules, seconds).
296296 """
297- return 12.68e-12 , 0.0
297+ return 12.68e-12 , 1e-9
298298
299299
300300# Original CSV contents:
@@ -341,7 +341,7 @@ def count(self) -> tuple[float, float]:
341341 -------
342342 (energy, latency): Tuple in (Joules, seconds).
343343 """
344- return 0.25074e-12 , 0.0
344+ return 0.25074e-12 , 1e-9
345345
346346 @action
347347 def read (self ) -> tuple [float , float ]:
@@ -352,7 +352,7 @@ def read(self) -> tuple[float, float]:
352352 -------
353353 (energy, latency): Tuple in (Joules, seconds).
354354 """
355- return 0.25074e-12 , 0.0
355+ return 0.25074e-12 , 1e-9
356356
357357
358358class AladdinIntMAC (LibraryEstimatorClassBase ):
@@ -376,12 +376,9 @@ class AladdinIntMAC(LibraryEstimatorClassBase):
376376 def __init__ (self , tech_node : float , adder_width : int , multiplier_width : int ):
377377 self .adder = AladdinAdder (tech_node , adder_width )
378378 self .multiplier = AladdinMultiplier (tech_node , multiplier_width )
379- super ().__init__ (
380- area = self .adder .area + self .multiplier .area ,
381- leak_power = self .adder .leak_power + self .multiplier .leak_power ,
382- )
379+ super ().__init__ (subcomponents = [self .adder , self .multiplier ])
383380
384- @action
381+ @action ( pipelined_subcomponents = True )
385382 def mac (self ) -> tuple [float , float ]:
386383 """
387384 Returns the energy and latency for one multiply-accumulate operation.
@@ -390,9 +387,8 @@ def mac(self) -> tuple[float, float]:
390387 -------
391388 (energy, latency): Tuple in (Joules, seconds).
392389 """
393- ae , al = self .adder .add ()
394- me , ml = self .multiplier .multiply ()
395- return ae + me , max (al , ml )
390+ self .adder .add ()
391+ self .multiplier .multiply ()
396392
397393 @action
398394 def read (self ) -> tuple [float , float ]:
@@ -403,7 +399,7 @@ def read(self) -> tuple[float, float]:
403399 -------
404400 (energy, latency): Tuple in (Joules, seconds).
405401 """
406- return self .mac ()
402+ self .mac ()
407403
408404 @action
409405 def compute (self ) -> tuple [float , float ]:
@@ -414,4 +410,4 @@ def compute(self) -> tuple[float, float]:
414410 -------
415411 (energy, latency): Tuple in (Joules, seconds).
416412 """
417- return self .mac ()
413+ self .mac ()
0 commit comments