diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-12-12 19:57:25 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2016-12-12 19:57:25 +0100 |
commit | 7766cb056ffa242577524c55bfec51c046a7be47 (patch) | |
tree | 63c15168be8218a0fe40100bb2d4e64a3f15b5f4 /chip_design | |
parent | 011c56b0267a51f4c67e93c2fedbaa95782c484b (diff) | |
download | 2IMF25-AR-7766cb056ffa242577524c55bfec51c046a7be47.tar.gz |
ChipDesign: a bit more final?
Diffstat (limited to 'chip_design')
-rwxr-xr-x | chip_design/solution-to-latex.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chip_design/solution-to-latex.py b/chip_design/solution-to-latex.py index 6c74f4c..46cd838 100755 --- a/chip_design/solution-to-latex.py +++ b/chip_design/solution-to-latex.py @@ -8,6 +8,13 @@ import sys # Map component index to (x, y, width, height) boxes = {} +# Reads input, line-by-line. Ignore the first line that just says "sat". +# Other lines that are accepted: +# x0 -> 2.0 +# y0 -> (/ 7.0 5.0) +# w0 -> 3.0 +# h0 -> 4.0 +# Reads it into: boxes[0] = (x, y, width, height) = (2, 7/5, 3, 4) for line in sys.stdin: line = line.strip() if line == 'sat': @@ -89,7 +96,7 @@ def print_boxes(): x, y, w, h = component x2, y2 = x + w, y + h - # Draw number for debugging + # Draw number, coordinate and dimensions for debugging tx = x + w/2 ty = y + h/2 text = r"%s\\(%s,%s)\\(%s x %s)" % (i, x, y, w, h) |