From 7fb8c0916a3dfd31d19c8ea594e4e2700a5a2843 Mon Sep 17 00:00:00 2001 From: Jock Tanner Date: Thu, 19 Mar 2020 22:03:35 +0000 Subject: [PATCH] Clarify unit conversion. --- experiments7/doAlu16.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/experiments7/doAlu16.py b/experiments7/doAlu16.py index 64beb07..2fae8c6 100755 --- a/experiments7/doAlu16.py +++ b/experiments7/doAlu16.py @@ -34,9 +34,19 @@ def get_layer(name, layer_cache={}): def to_DbU(l): + """ + Convert lambdas to database units. (See Hurricane+Python Manual 3.4.) + """ return DbU.fromLambda(l) +def from_DbU(ph): + """ + Convert database units to lambdas. (See Hurricane+Python Manual 3.4.) + """ + return DbU.toLambda(ph) + + def create_pins(cell, net, name, direction, status=Pin.PlacementStatus.FIXED, layer=None, x=0.0, y=0.0, width=2.0, height=2.0, @@ -330,7 +340,7 @@ def alu16(**kwargs): create_pins(cell, 'b({})', 'b({}).0', Pin.Direction.SOUTH, x=80.0, y=0.0, delta=60.0, repeat=BIT_WIDTH) create_pins(cell, 'o({})', 'o({}).0', Pin.Direction.NORTH, - x=50.0, y=y_north/l(1), # converting back to lambdas? + x=50.0, y=from_DbU(y_north), delta=60.0, repeat=BIT_WIDTH) create_pins(cell, 'rst', 'rst.0', Pin.Direction.WEST, layer=METAL2, x=0.0, y=140.0) -- 2.30.2