aboutsummaryrefslogtreecommitdiff
path: root/hw/chibi/chibi_2024/rcalc.py
diff options
context:
space:
mode:
Diffstat (limited to 'hw/chibi/chibi_2024/rcalc.py')
-rw-r--r--hw/chibi/chibi_2024/rcalc.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/hw/chibi/chibi_2024/rcalc.py b/hw/chibi/chibi_2024/rcalc.py
index 3bba342..2c5473d 100644
--- a/hw/chibi/chibi_2024/rcalc.py
+++ b/hw/chibi/chibi_2024/rcalc.py
@@ -125,3 +125,33 @@ for i in range(stages-2, -1, -1):
print_var('Itot_{}'.format(stages-i), Itot_n, 'A', end='\t')
print_var('Ptot_{}'.format(stages-i), Ptot_n, 'W')
+l = [ (1, [1/2, 1/4, 1/8, 1/16,
+ 1/32, 1/64, 1/128, 1/256,
+ 1/512, 1/1024, 1/2048, 1/4096]),
+ (1/16, [1/2, 1/4, 1/8, 1/16,
+ 1/32, 1/64, 1/128, 1/256,
+ 1/512, 1/1024, 1/2048, 1/4096]),
+ (1/256, [1/2, 1/4, 1/8, 1/16,
+ 1/32, 1/64, 1/128, 1/256,
+ 1/512, 1/1024, 1/2048, 1/4096])
+ ]
+for v, ls in l:
+ for e in ls:
+ print('{:> 12.10f} {:.0f}'.format(e*v, 0.5/(e*v)))
+
+print('\033[93m---\033[0m')
+l = [ (1/2**0, [1/2, 1/4, 1/8, 1/16,
+ 1/32, 1/64, 1/128, 1/256,
+ 1/512, 1/1024, 1/2048, 1/4096]),
+ (1/2**7, [1/32, 1/64, 1/128, 1/256,
+ 1/512, 1/1024, 1/2048, 1/4096]),
+ (1/2**14, [1/32, 1/64, 1/128, 1/256,
+ 1/512, 1/1024, 1/2048, 1/4096])
+ ]
+for v, ls in l:
+ for e in ls:
+ print('{:> 5.0f} {:> 12.10f} {:.0f}'.format(0.5/e, e*v, 0.5/(e*v)))
+plain = sum(l[0][1])
+optimized = sum([e for v, ls in l for e in ls])
+overhead_percent = (optimized/plain-1)*100
+print(plain, optimized, overhead_percent)