summaryrefslogtreecommitdiff
path: root/chip_design
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-12-12 01:00:43 +0100
committerPeter Wu <peter@lekensteyn.nl>2016-12-12 01:00:43 +0100
commitcc0345f766e2118421cad98daea91b087ab73dd6 (patch)
tree581a7378e8839a2b97cd76c9d344951fbf50d276 /chip_design
parentbf32a02e180a030307f7bc27896976abeaeb2c1a (diff)
download2IMF25-AR-cc0345f766e2118421cad98daea91b087ab73dd6.tar.gz
ChipDesign: Add text labels with size and number
Diffstat (limited to 'chip_design')
-rwxr-xr-xchip_design/solution-to-latex.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/chip_design/solution-to-latex.py b/chip_design/solution-to-latex.py
index 2028b1b..798267a 100755
--- a/chip_design/solution-to-latex.py
+++ b/chip_design/solution-to-latex.py
@@ -80,6 +80,12 @@ def print_boxes():
tpl = r"\draw[{attrs}] ({x}, {y}) rectangle ({x2}, {y2});"
print(tpl.strip().format(**vars()))
+ # Draw number for debugging
+ tx = x + w/2
+ ty = y + h/2
+ text = r"%s\\(%s x %s)" % (i, w, h)
+ print(r'\node[align=center] at (%f,%f) {%s};' % (tx, ty, text))
+
def print_grid():
# XXX currently hard-coding grid size
print(r'\draw[step=1,gray,very thin] (0, 0) grid (30, 30);')