From: Cassie Jones Date: Thu, 12 Mar 2020 08:07:35 +0000 (-0400) Subject: Add paper X-Git-Url: https://git.witchoflight.com/sigbovik-nan-2020/commitdiff_plain?ds=sidebyside Add paper --- 7aa11a61e54e6e71ef30d9013b5058d9b543bcc2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a136337 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pdf diff --git a/binary5.jpg b/binary5.jpg new file mode 100644 index 0000000..c40a0c3 Binary files /dev/null and b/binary5.jpg differ diff --git a/figures/synthesis-pass.afdesign b/figures/synthesis-pass.afdesign new file mode 100644 index 0000000..446c531 Binary files /dev/null and b/figures/synthesis-pass.afdesign differ diff --git a/figures/synthesis-pass.svg b/figures/synthesis-pass.svg new file mode 100644 index 0000000..4c22760 --- /dev/null +++ b/figures/synthesis-pass.svg @@ -0,0 +1,2037 @@ + + + + + + + + + + clk + + + + + + C + + + + D + + + + $96 + + + $_DFF_P_ + + + + Q + + + + + + + + + + + + C + + + + D + + + + $97 + + + $_DFF_P_ + + + + Q + + + + + + + + + + C + + + + D + + + + $98 + + + $_DFF_P_ + + + + Q + + + + + + + + + + + + + + en + + + + + + A + + + + $61 + + + $b2f + + + + Y + + + + + + + + + + out + + + + + + A + + + + B + + + + $56 + + + $NaN + + + + Y + + + + + + A + + + + B + + + + $59 + + + $NaN + + + + Y + + + + + + + + + + A + + + + B + + + + $57 + + + $NaN + + + + Y + + + + + + A + + + + B + + + + $58 + + + $NaN + + + + Y + + + + + + + + + + A + + + + B + + + + $60 + + + $NaN + + + + Y + + + + + + + + + + + + + + + + + + + + + + + A + + + + $92 + + + $f2b + + + + Y + + + + + + + + + + 0:0 - 0:0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0:0 - 0:0 + + + + + + + + + + + + + 0:0 - 1:1 + + + + + + + + + + + + + 1:1 - 0:0 + + + + + + + + + + 0:0 - 2:2 + + + + + + + + + + + + + 2:2 - 0:0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0:0 - 0:0 + + + + + + + + + + + + 1:1 - 0:0 + + + + + + + + + + + + 2:2 - 0:0 + + + + + + + + + + clk + + + + + + C + + + + D + + + + $96 + + + $_DFF_P_ + + + + Q + + + + + + + + + + C + + + + D + + + + $97 + + + $_DFF_P_ + + + + Q + + + + + + + + + + C + + + + D + + + + $98 + + + $_DFF_P_ + + + + Q + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0:0 - 0:0 + + + + + + + + + + + 0:0 - 1:1 + + + + + + + + + + + 0:0 - 2:2 + + + + + + + + + + + en + + + + + + + + + + + + + + + + + + + + out + + + + + + + + A + + + + + + B + + + + $58 + + + $NaN + + + + Y + + + + + + + + A + + + + + + B + + + + $56 + + + $NaN + + + + Y + + + + + + + + A + + + + + + B + + + + $57 + + + $NaN + + + + Y + + + + + + + + A + + + + + + B + + + + $59 + + + $NaN + + + + Y + + + + + + + + A + + + + $74 + + + $f2b + + + + Y + + + + + + + + + + + + + + + + A + + + + $81 + + + $f2b + + + + Y + + + + + + + + A + + + + + + B + + + + $60 + + + $NaN + + + + Y + + + + + + + + A + + + + $88 + + + $f2b + + + + Y + + + + + + + + + + + + A + + + + $92 + + + $f2b + + + + Y + + + + + + + + + + + + + A + + + + + + $94 + + + $b2f + + + + Y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A + + + + $85 + + + $b2f + + + + Y + + + + + + + + + + + + A + + + + $72 + + + $b2f + + + + Y + + + + + + + + A + + + + $61 + + + $b2f + + + + Y + + + + + + + + A + + + + $66 + + + $b2f + + + + Y + + + + + + + + A + + + + $63 + + + $f2b + + + + Y + + + + + + + + A + + + + $78 + + + $b2f + + + + Y + + + + + + + + A + + + + $68 + + + $f2b + + + + Y + + + + + + + + A + + + + $86 + + + $b2f + + + + Y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A + + + + + + B + + + + $58 + + + $NaN + + + + Y + + + + + + + + A + + + + + + B + + + + $59 + + + $NaN + + + + Y + + + + + + + + A + + + + + + B + + + + $56 + + + $NaN + + + + Y + + + + + + + + A + + + + + + B + + + + $57 + + + $NaN + + + + Y + + + + + + + + A + + + + $74 + + + $f2b + + + + Y + + + + + + + + A + + + + $72 + + + $b2f + + + + Y + + + + + + + + A + + + + $66 + + + $b2f + + + + Y + + + + + + + + A + + + + $78 + + + $b2f + + + + Y + + + + + + + + A + + + + $61 + + + $b2f + + + + Y + + + + + + + + + + + + + + + + A + + + + $81 + + + $f2b + + + + Y + + + + + + + + A + + + + + + B + + + + $60 + + + $NaN + + + + Y + + + + + + + + A + + + + $88 + + + $f2b + + + + Y + + + + + + + + A + + + + $63 + + + $f2b + + + + Y + + + + + + + + A + + + + $68 + + + $f2b + + + + Y + + + + + + + + + + + + + + A + + + + $85 + + + $b2f + + + + Y + + + + + + + + + + + + A + + + + $86 + + + $b2f + + + + Y + + + + + + + + + + + + + + + + + + + + clk + + + + + + C + + + + D + + + + $52 + + + $_DFF_P_ + + + + Q + + + + + + + + + + en + + + + + + A + + + + $71 + + + $b2f + + + + Y + + + + + + + + + + + + + + + + + + out + + + + + + A + + + + $79 + + + $b2f + + + + Y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + clk + + + + + + C + + + + D + + + + $53 + + + $_DFF_P_ + + + + Q + + + + + + + + + + en + + + + + + + + + + + + + out + + + + + + + + + + + + + A + + + + $57 + + + $_NOT_ + + + + Y + + + + + + A + + + + B + + + + $60 + + + $_NAND_ + + + + Y + + + + + + + + + + A + + + + $58 + + + $_NOT_ + + + + Y + + + + + + A + + + + B + + + + $59 + + + $_NAND_ + + + + Y + + + + + + + + + + A + + + + B + + + + $61 + + + $_NAND_ + + + + Y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + clk + + + + + + CLK + + + + D + + + + $6 + + + $dff + + + + Q + + + + + + + + + + en + + + + + + A + + + + B + + + + S + + + + $4 + + + $mux + + + + Y + + + + + + + + + + out + + + + + + A + + + + $2 + + + $not + + + + Y + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + diff --git a/figures/toggle-base.dot b/figures/toggle-base.dot new file mode 100644 index 0000000..53f5604 --- /dev/null +++ b/figures/toggle-base.dot @@ -0,0 +1,18 @@ +digraph "toggle" { +label="toggle"; +rankdir="LR"; +remincross=true; +n3 [ shape=octagon, label="clk", color="black", fontcolor="black" ]; +n4 [ shape=octagon, label="en", color="black", fontcolor="black" ]; +n5 [ shape=octagon, label="out", color="black", fontcolor="black" ]; +c8 [ shape=record, label="{{ A}|$2\n$not|{ Y}}" ]; +c12 [ shape=record, label="{{ CLK| D}|$6\n$dff|{ Q}}" ]; +c15 [ shape=record, label="{{ A| B| S}|$4\n$mux|{ Y}}" ]; +c15:p7:e -> c12:p10:w [color="black", label=""]; +c8:p7:e -> c15:p13:w [color="black", label=""]; +n3:e -> c12:p9:w [color="black", label=""]; +n4:e -> c15:p14:w [color="black", label=""]; +c12:p11:e -> n5:w [color="black", label=""]; +n5:e -> c15:p6:w [color="black", label=""]; +n5:e -> c8:p6:w [color="black", label=""]; +} diff --git a/figures/toggle-base.svg b/figures/toggle-base.svg new file mode 100644 index 0000000..fcb6b00 --- /dev/null +++ b/figures/toggle-base.svg @@ -0,0 +1,113 @@ + + + + + + +toggle + +toggle + + +n3 + +clk + + + +c12 + +CLK + +D + +$6 +$dff + +Q + + + +n3:e->c12:w + + + + + +n4 + +en + + + +c15 + +A + +B + +S + +$4 +$mux + +Y + + + +n4:e->c15:w + + + + + +n5 + +out + + + +c8 + +A + +$2 +$not + +Y + + + +n5:e->c8:w + + + + + +n5:e->c15:w + + + + + +c8:e->c15:w + + + + + +c12:e->n5:w + + + + + +c15:s->c12:s + + + + + diff --git a/figures/toggle-nan3-1.dot b/figures/toggle-nan3-1.dot new file mode 100644 index 0000000..6e5a607 --- /dev/null +++ b/figures/toggle-nan3-1.dot @@ -0,0 +1,57 @@ +digraph "toggle" { +rankdir="LR"; +remincross=true; +n19 [ shape=octagon, label="clk", color="black", fontcolor="black" ]; +n20 [ shape=octagon, label="en", color="black", fontcolor="black" ]; +n21 [ shape=octagon, label="out", color="black", fontcolor="black" ]; +c25 [ shape=record, label="{{ A| B}|$56\n$NaN|{ Y}}" ]; +c26 [ shape=record, label="{{ A| B}|$57\n$NaN|{ Y}}" ]; +c27 [ shape=record, label="{{ A| B}|$58\n$NaN|{ Y}}" ]; +c28 [ shape=record, label="{{ A| B}|$59\n$NaN|{ Y}}" ]; +c29 [ shape=record, label="{{ A| B}|$60\n$NaN|{ Y}}" ]; +c30 [ shape=record, label="{{ A}|$71\n$b2f|{ Y}}" ]; +c31 [ shape=record, label="{{ A}|$78\n$b2f|{ Y}}" ]; +c32 [ shape=record, label="{{ A}|$85\n$b2f|{ Y}}" ]; +c33 [ shape=record, label="{{ A}|$72\n$b2f|{ Y}}" ]; +c34 [ shape=record, label="{{ A}|$79\n$b2f|{ Y}}" ]; +c35 [ shape=record, label="{{ A}|$86\n$b2f|{ Y}}" ]; +c36 [ shape=record, label="{{ A}|$74\n$f2b|{ Y}}" ]; +c37 [ shape=record, label="{{ A}|$81\n$f2b|{ Y}}" ]; +c38 [ shape=record, label="{{ A}|$88\n$f2b|{ Y}}" ]; +c39 [ shape=record, label="{{ A}|$61\n$b2f|{ Y}}" ]; +c40 [ shape=record, label="{{ A}|$66\n$b2f|{ Y}}" ]; +c41 [ shape=record, label="{{ A}|$63\n$f2b|{ Y}}" ]; +c42 [ shape=record, label="{{ A}|$68\n$f2b|{ Y}}" ]; +c46 [ shape=record, label="{{ C| D}|$52\n$_DFF_P_|{ Q}}" ]; +{rank=same; c30; c26; c25; c34}; +c38:p24:s -> c46:p44:s [color="black", label=""]; +c34:p24:e -> c28:p23:w [color="black", style="setlinewidth(3)", label=""]; +c35:p24:e -> c29:p23:w [color="black", style="setlinewidth(3)", label=""]; +c27:p24:e -> c36:p22:w [color="black", style="setlinewidth(3)", label=""]; +c28:p24:e -> c37:p22:w [color="black", style="setlinewidth(3)", label=""]; +c29:p24:e -> c38:p22:w [color="black", style="setlinewidth(3)", label=""]; +n15 [ shape=point ]; +c39:p24:e -> n15:w [color="black", style="setlinewidth(3)", label=""]; +n15:e -> c25:p22:w [color="black", style="setlinewidth(3)", label=""]; +n15:e -> c25:p23:w [color="black", style="setlinewidth(3)", label=""]; +n16 [ shape=point ]; +c40:p24:e -> n16:w [color="black", style="setlinewidth(3)", label=""]; +n16:e -> c26:p22:w [color="black", style="setlinewidth(3)", label=""]; +n16:e -> c26:p23:w [color="black", style="setlinewidth(3)", label=""]; +c25:p24:e -> c41:p22:w [color="black", style="setlinewidth(3)", label=""]; +c26:p24:e -> c42:p22:w [color="black", style="setlinewidth(3)", label=""]; +n19:e -> c46:p43:w [color="black", label=""]; +c41:p24:e -> c31:p22:w [color="black", label=""]; +n20:e -> c30:p22:w [color="black", label=""]; +n20:e -> c39:p22:w [color="black", label=""]; +c46:p45:e -> n21:w [color="black", label=""]; +n21:e -> c34:p22:w [color="black", label=""]; +n21:e -> c40:p22:w [color="black", label=""]; +c42:p24:e -> c33:p22:w [color="black", label=""]; +c36:p24:e -> c32:p22:w [color="black", label=""]; +c37:p24:e -> c35:p22:w [color="black", label=""]; +c30:p24:e -> c27:p22:w [color="black", style="setlinewidth(3)", label=""]; +c31:p24:e -> c28:p22:w [color="black", style="setlinewidth(3)", label=""]; +c32:p24:e -> c29:p22:w [color="black", style="setlinewidth(3)", label=""]; +c33:p24:e -> c27:p23:w [color="black", style="setlinewidth(3)", label=""]; +} diff --git a/figures/toggle-nan3-1.svg b/figures/toggle-nan3-1.svg new file mode 100644 index 0000000..a1bc7a5 --- /dev/null +++ b/figures/toggle-nan3-1.svg @@ -0,0 +1,430 @@ + + + + + + +toggle + + + +n19 + +clk + + + +c46 + +C + +D + +$52 +$_DFF_P_ + +Q + + + +n19:e->c46:w + + + + + +n20 + +en + + + +c30 + +A + +$71 +$b2f + +Y + + + +n20:e->c30:w + + + + + +c39 + +A + +$61 +$b2f + +Y + + + +n20:e->c39:w + + + + + +n21 + +out + + + +c34 + +A + +$79 +$b2f + +Y + + + +n21:e->c34:w + + + + + +c40 + +A + +$66 +$b2f + +Y + + + +n21:e->c40:w + + + + + +c25 + +A + +B + +$56 +$NaN + +Y + + + +c41 + +A + +$63 +$f2b + +Y + + + +c25:e->c41:w + + + + + +c26 + +A + +B + +$57 +$NaN + +Y + + + +c42 + +A + +$68 +$f2b + +Y + + + +c26:e->c42:w + + + + + +c27 + +A + +B + +$58 +$NaN + +Y + + + +c36 + +A + +$74 +$f2b + +Y + + + +c27:e->c36:w + + + + + +c28 + +A + +B + +$59 +$NaN + +Y + + + +c37 + +A + +$81 +$f2b + +Y + + + +c28:e->c37:w + + + + + +c29 + +A + +B + +$60 +$NaN + +Y + + + +c38 + +A + +$88 +$f2b + +Y + + + +c29:e->c38:w + + + + + +c30:e->c27:w + + + + + +c31 + +A + +$78 +$b2f + +Y + + + +c31:e->c28:w + + + + + +c32 + +A + +$85 +$b2f + +Y + + + +c32:e->c29:w + + + + + +c33 + +A + +$72 +$b2f + +Y + + + +c33:e->c27:w + + + + + +c34:e->c28:w + + + + + +c35 + +A + +$86 +$b2f + +Y + + + +c35:e->c29:w + + + + + +c36:e->c32:w + + + + + +c37:e->c35:w + + + + + +c38:s->c46:s + + + + + +n15 + + + + +c39:e->n15:w + + + + + +n16 + + + + +c40:e->n16:w + + + + + +c41:e->c31:w + + + + + +c42:e->c33:w + + + + + +c46:e->n21:w + + + + + +n15:e->c25:w + + + + + +n15:e->c25:w + + + + + +n16:e->c26:w + + + + + +n16:e->c26:w + + + + + diff --git a/figures/toggle-nan3-2.dot b/figures/toggle-nan3-2.dot new file mode 100644 index 0000000..6c11dec --- /dev/null +++ b/figures/toggle-nan3-2.dot @@ -0,0 +1,53 @@ +digraph "toggle" { +label="toggle"; +rankdir="LR"; +remincross=true; +n17 [ shape=octagon, label="clk", color="black", fontcolor="black" ]; +n18 [ shape=octagon, label="en", color="black", fontcolor="black" ]; +n19 [ shape=octagon, label="out", color="black", fontcolor="black" ]; +c23 [ shape=record, label="{{ A| B}|$56\n$NaN|{ Y}}" ]; +c24 [ shape=record, label="{{ A| B}|$57\n$NaN|{ Y}}" ]; +c25 [ shape=record, label="{{ A| B}|$58\n$NaN|{ Y}}" ]; +c26 [ shape=record, label="{{ A| B}|$59\n$NaN|{ Y}}" ]; +c27 [ shape=record, label="{{ A| B}|$60\n$NaN|{ Y}}" ]; +c28 [ shape=record, label="{{ A}|$78\n$b2f|{ Y}}" ]; +c29 [ shape=record, label="{{ A}|$85\n$b2f|{ Y}}" ]; +c30 [ shape=record, label="{{ A}|$72\n$b2f|{ Y}}" ]; +c31 [ shape=record, label="{{ A}|$86\n$b2f|{ Y}}" ]; +c32 [ shape=record, label="{{ A}|$74\n$f2b|{ Y}}" ]; +c33 [ shape=record, label="{{ A}|$81\n$f2b|{ Y}}" ]; +c34 [ shape=record, label="{{ A}|$88\n$f2b|{ Y}}" ]; +c35 [ shape=record, label="{{ A}|$61\n$b2f|{ Y}}" ]; +c36 [ shape=record, label="{{ A}|$66\n$b2f|{ Y}}" ]; +c37 [ shape=record, label="{{ A}|$63\n$f2b|{ Y}}" ]; +c38 [ shape=record, label="{{ A}|$68\n$f2b|{ Y}}" ]; +c42 [ shape=record, label="{{ C| D}|$52\n$_DFF_P_|{ Q}}" ]; +c34:p22:s -> c42:p40:s [color="black", label=""]; +n10 [ shape=point ]; +c36:p22:e -> n10:w [color="black", style="setlinewidth(3)", label=""]; +n10:e -> c24:p20:w [color="black", style="setlinewidth(3)", label=""]; +n10:e -> c24:p21:w [color="black", style="setlinewidth(3)", label=""]; +n10:e -> c26:p21:w [color="black", style="setlinewidth(3)", label=""]; +c31:p22:e -> c27:p21:w [color="black", style="setlinewidth(3)", label=""]; +c25:p22:e -> c32:p20:w [color="black", style="setlinewidth(3)", label=""]; +c26:p22:e -> c33:p20:w [color="black", style="setlinewidth(3)", label=""]; +c27:p22:e -> c34:p20:w [color="black", style="setlinewidth(3)", label=""]; +c23:p22:e -> c37:p20:w [color="black", style="setlinewidth(3)", label=""]; +c24:p22:e -> c38:p20:w [color="black", style="setlinewidth(3)", label=""]; +n17:e -> c42:p39:w [color="black", label=""]; +n18:e -> c35:p20:w [color="black", label=""]; +c42:p41:e -> n19:w [color="black", label=""]; +n19:e -> c36:p20:w [color="black", label=""]; +c37:p22:e -> c28:p20:w [color="black", label=""]; +c38:p22:e -> c30:p20:w [color="black", label=""]; +c32:p22:e -> c29:p20:w [color="black", label=""]; +c33:p22:e -> c31:p20:w [color="black", label=""]; +n6 [ shape=point ]; +c35:p22:e -> n6:w [color="black", style="setlinewidth(3)", label=""]; +n6:e -> c23:p20:w [color="black", style="setlinewidth(3)", label=""]; +n6:e -> c23:p21:w [color="black", style="setlinewidth(3)", label=""]; +n6:e -> c25:p20:w [color="black", style="setlinewidth(3)", label=""]; +c28:p22:e -> c26:p20:w [color="black", style="setlinewidth(3)", label=""]; +c29:p22:e -> c27:p20:w [color="black", style="setlinewidth(3)", label=""]; +c30:p22:e -> c25:p21:w [color="black", style="setlinewidth(3)", label=""]; +} diff --git a/figures/toggle-nan3-2.svg b/figures/toggle-nan3-2.svg new file mode 100644 index 0000000..1b87978 --- /dev/null +++ b/figures/toggle-nan3-2.svg @@ -0,0 +1,397 @@ + + + + + + +toggle + +toggle + + +n17 + +clk + + + +c42 + +C + +D + +$52 +$_DFF_P_ + +Q + + + +n17:e->c42:w + + + + + +n18 + +en + + + +c35 + +A + +$61 +$b2f + +Y + + + +n18:e->c35:w + + + + + +n19 + +out + + + +c36 + +A + +$66 +$b2f + +Y + + + +n19:e->c36:w + + + + + +c23 + +A + +B + +$56 +$NaN + +Y + + + +c37 + +A + +$63 +$f2b + +Y + + + +c23:e->c37:w + + + + + +c24 + +A + +B + +$57 +$NaN + +Y + + + +c38 + +A + +$68 +$f2b + +Y + + + +c24:e->c38:w + + + + + +c25 + +A + +B + +$58 +$NaN + +Y + + + +c32 + +A + +$74 +$f2b + +Y + + + +c25:e->c32:w + + + + + +c26 + +A + +B + +$59 +$NaN + +Y + + + +c33 + +A + +$81 +$f2b + +Y + + + +c26:e->c33:w + + + + + +c27 + +A + +B + +$60 +$NaN + +Y + + + +c34 + +A + +$88 +$f2b + +Y + + + +c27:e->c34:w + + + + + +c28 + +A + +$78 +$b2f + +Y + + + +c28:e->c26:w + + + + + +c29 + +A + +$85 +$b2f + +Y + + + +c29:e->c27:w + + + + + +c30 + +A + +$72 +$b2f + +Y + + + +c30:e->c25:w + + + + + +c31 + +A + +$86 +$b2f + +Y + + + +c31:e->c27:w + + + + + +c32:e->c29:w + + + + + +c33:e->c31:w + + + + + +c34:s->c42:s + + + + + +n6 + + + + +c35:e->n6:w + + + + + +n10 + + + + +c36:e->n10:w + + + + + +c37:e->c28:w + + + + + +c38:e->c30:w + + + + + +c42:e->n19:w + + + + + +n10:e->c24:w + + + + + +n10:e->c24:w + + + + + +n10:e->c26:w + + + + + +n6:e->c23:w + + + + + +n6:e->c23:w + + + + + +n6:e->c25:w + + + + + diff --git a/figures/toggle-nan3-3.dot b/figures/toggle-nan3-3.dot new file mode 100644 index 0000000..548e590 --- /dev/null +++ b/figures/toggle-nan3-3.dot @@ -0,0 +1,83 @@ +digraph "toggle" { +rankdir="LR"; +remincross=true; +n7; +{rank=same; n19; x0; x2; x4}; +{rank=same; c35; c36; c37}; +n19 [ shape=octagon, label="clk", color="black", fontcolor="black" ]; +n20 [ shape=octagon, label="en", color="black", fontcolor="black" ]; +n21 [ shape=octagon, label="out", color="black", fontcolor="black" ]; +c25 [ shape=record, label="{{ A| B}|$56\n$NaN|{ Y}}" ]; +c26 [ shape=record, label="{{ A| B}|$57\n$NaN|{ Y}}" ]; +c27 [ shape=record, label="{{ A| B}|$58\n$NaN|{ Y}}" ]; +c28 [ shape=record, label="{{ A| B}|$59\n$NaN|{ Y}}" ]; +c29 [ shape=record, label="{{ A| B}|$60\n$NaN|{ Y}}" ]; +c30 [ shape=record, label="{{ A}|$92\n$f2b|{ Y}}" ]; +c31 [ shape=record, label="{{ A}|$94\n$b2f|{ Y}}" ]; +c35 [ shape=record, label="{{ C| D}|$96\n$_DFF_P_|{ Q}}" ]; +x0 [ shape=record, style=rounded, label=" 0:0 - 0:0 " ]; +x0:e -> c35:p33:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x1 [ shape=record, style=rounded, label=" 0:0 - 0:0 " ]; +c35:p34:e -> x1:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c36 [ shape=record, label="{{ C| D}|$97\n$_DFF_P_|{ Q}}" ]; +x2 [ shape=record, style=rounded, label=" 1:1 - 0:0 " ]; +x2:e -> c36:p33:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x3 [ shape=record, style=rounded, label=" 0:0 - 1:1 " ]; +c36:p34:e -> x3:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c37 [ shape=record, label="{{ C| D}|$98\n$_DFF_P_|{ Q}}" ]; +x4 [ shape=record, style=rounded, label=" 2:2 - 0:0 " ]; +x4:e -> c37:p33:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x5 [ shape=record, style=rounded, label=" 0:0 - 2:2 " ]; +c37:p34:e -> x5:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c38 [ shape=record, label="{{ A}|$78\n$b2f|{ Y}}" ]; +c39 [ shape=record, label="{{ A}|$85\n$b2f|{ Y}}" ]; +c40 [ shape=record, label="{{ A}|$72\n$b2f|{ Y}}" ]; +c41 [ shape=record, label="{{ A}|$86\n$b2f|{ Y}}" ]; +c42 [ shape=record, label="{{ A}|$74\n$f2b|{ Y}}" ]; +c43 [ shape=record, label="{{ A}|$81\n$f2b|{ Y}}" ]; +c44 [ shape=record, label="{{ A}|$88\n$f2b|{ Y}}" ]; +c45 [ shape=record, label="{{ A}|$61\n$b2f|{ Y}}" ]; +c46 [ shape=record, label="{{ A}|$66\n$b2f|{ Y}}" ]; +c47 [ shape=record, label="{{ A}|$63\n$f2b|{ Y}}" ]; +c48 [ shape=record, label="{{ A}|$68\n$f2b|{ Y}}" ]; +c44:p24:e -> c31:p22:w [color="black", label=""]; +c39:p24:e -> c29:p22:w [color="black", style="setlinewidth(3)", label=""]; +c40:p24:e -> c27:p23:w [color="black", style="setlinewidth(3)", label=""]; +n12 [ shape=point ]; +c46:p24:e -> n12:w [color="black", style="setlinewidth(3)", label=""]; +n12:e -> c26:p22:w [color="black", style="setlinewidth(3)", label=""]; +n12:e -> c26:p23:w [color="black", style="setlinewidth(3)", label=""]; +n12:e -> c28:p23:w [color="black", style="setlinewidth(3)", label=""]; +c41:p24:e -> c29:p23:w [color="black", style="setlinewidth(3)", label=""]; +c27:p24:e -> c42:p22:w [color="black", style="setlinewidth(3)", label=""]; +c28:p24:e -> c43:p22:w [color="black", style="setlinewidth(3)", label=""]; +c29:p24:e -> c44:p22:w [color="black", style="setlinewidth(3)", label=""]; +c25:p24:e -> c47:p22:w [color="black", style="setlinewidth(3)", label=""]; +c26:p24:e -> c48:p22:w [color="black", style="setlinewidth(3)", label=""]; +n19:e -> c35:p32:w [color="black", label=""]; +n19:e -> c36:p32:w [color="black", label=""]; +n19:e -> c37:p32:w [color="black", label=""]; +c47:p24:e -> c38:p22:w [color="black", label=""]; +n20:e -> c45:p22:w [color="black", label=""]; +c30:p24:e -> n21:w [color="black", label=""]; +n21:e -> c46:p22:w [color="black", label=""]; +c48:p24:e -> c40:p22:w [color="black", label=""]; +c42:p24:e -> c39:p22:w [color="black", label=""]; +c43:p24:e -> c41:p22:w [color="black", label=""]; +n6 [ shape=point ]; +x1:s0:e -> n6:w [color="black", label=""]; +x3:s0:e -> n6:w [color="black", label=""]; +x5:s0:e -> n6:w [color="black", label=""]; +n6:e -> c30:p22:w [color="black", label=""]; +n7 [ shape=point ]; +c31:p24:e -> n7:w [color="black", label=""]; +n7:e -> x0:s0:w [color="black", label=""]; +n7:e -> x2:s0:w [color="black", label=""]; +n7:e -> x4:s0:w [color="black", label=""]; +n8 [ shape=point ]; +c45:p24:e -> n8:w [color="black", style="setlinewidth(3)", label=""]; +n8:e -> c25:p22:w [color="black", style="setlinewidth(3)", label=""]; +n8:e -> c25:p23:w [color="black", style="setlinewidth(3)", label=""]; +n8:e -> c27:p22:w [color="black", style="setlinewidth(3)", label=""]; +c38:p24:e -> c28:p22:w [color="black", style="setlinewidth(3)", label=""]; +} diff --git a/figures/toggle-nan3-3.svg b/figures/toggle-nan3-3.svg new file mode 100644 index 0000000..4e2ca3d --- /dev/null +++ b/figures/toggle-nan3-3.svg @@ -0,0 +1,592 @@ + + + + + + +toggle + + + +n7 + + + + +x0 + +0:0 - 0:0 + + + +n7:e->x0:w + + + + + +x2 + +1:1 - 0:0 + + + +n7:e->x2:w + + + + + +x4 + +2:2 - 0:0 + + + +n7:e->x4:w + + + + + +n19 + +clk + + + +c35 + +C + +D + +$96 +$_DFF_P_ + +Q + + + +n19:e->c35:w + + + + + +c36 + +C + +D + +$97 +$_DFF_P_ + +Q + + + +n19:e->c36:w + + + + + +c37 + +C + +D + +$98 +$_DFF_P_ + +Q + + + +n19:e->c37:w + + + + + +x0:e->c35:w + + + + + + +x2:e->c36:w + + + + + + +x4:e->c37:w + + + + + + +x1 + +0:0 - 0:0 + + + +c35:e->x1:w + + + + + + +x3 + +0:0 - 1:1 + + + +c36:e->x3:w + + + + + + +x5 + +0:0 - 2:2 + + + +c37:e->x5:w + + + + + + +n20 + +en + + + +c45 + +A + +$61 +$b2f + +Y + + + +n20:e->c45:w + + + + + +n21 + +out + + + +c46 + +A + +$66 +$b2f + +Y + + + +n21:e->c46:w + + + + + +c25 + +A + +B + +$56 +$NaN + +Y + + + +c47 + +A + +$63 +$f2b + +Y + + + +c25:e->c47:w + + + + + +c26 + +A + +B + +$57 +$NaN + +Y + + + +c48 + +A + +$68 +$f2b + +Y + + + +c26:e->c48:w + + + + + +c27 + +A + +B + +$58 +$NaN + +Y + + + +c42 + +A + +$74 +$f2b + +Y + + + +c27:e->c42:w + + + + + +c28 + +A + +B + +$59 +$NaN + +Y + + + +c43 + +A + +$81 +$f2b + +Y + + + +c28:e->c43:w + + + + + +c29 + +A + +B + +$60 +$NaN + +Y + + + +c44 + +A + +$88 +$f2b + +Y + + + +c29:e->c44:w + + + + + +c30 + +A + +$92 +$f2b + +Y + + + +c30:e->n21:w + + + + + +c31 + +A + +$94 +$b2f + +Y + + + +c31:e->n7:w + + + + + +n6 + + + + +x1:e->n6:w + + + + + +x3:e->n6:w + + + + + +x5:e->n6:w + + + + + +c38 + +A + +$78 +$b2f + +Y + + + +c38:e->c28:w + + + + + +c39 + +A + +$85 +$b2f + +Y + + + +c39:e->c29:w + + + + + +c40 + +A + +$72 +$b2f + +Y + + + +c40:e->c27:w + + + + + +c41 + +A + +$86 +$b2f + +Y + + + +c41:e->c29:w + + + + + +c42:e->c39:w + + + + + +c43:e->c41:w + + + + + +c44:e->c31:w + + + + + +n8 + + + + +c45:e->n8:w + + + + + +n12 + + + + +c46:e->n12:w + + + + + +c47:e->c38:w + + + + + +c48:e->c40:w + + + + + +n12:e->c26:w + + + + + +n12:e->c26:w + + + + + +n12:e->c28:w + + + + + +n6:e->c30:w + + + + + +n8:e->c25:w + + + + + +n8:e->c25:w + + + + + +n8:e->c27:w + + + + + diff --git a/figures/toggle-nan3-4.dot b/figures/toggle-nan3-4.dot new file mode 100644 index 0000000..ee4a41c --- /dev/null +++ b/figures/toggle-nan3-4.dot @@ -0,0 +1,60 @@ +digraph "toggle" { +label="toggle"; +rankdir="LR"; +remincross=true; +n2; +{rank=same; x0; x2; x4}; +{rank=same; c23; c24; c25}; +n8 [ shape=octagon, label="clk", color="black", fontcolor="black" ]; +n9 [ shape=octagon, label="en", color="black", fontcolor="black" ]; +n10 [ shape=octagon, label="out", color="black", fontcolor="black" ]; +c14 [ shape=record, label="{{ A| B}|$56\n$NaN|{ Y}}" ]; +c15 [ shape=record, label="{{ A| B}|$57\n$NaN|{ Y}}" ]; +c16 [ shape=record, label="{{ A| B}|$58\n$NaN|{ Y}}" ]; +c17 [ shape=record, label="{{ A| B}|$59\n$NaN|{ Y}}" ]; +c18 [ shape=record, label="{{ A| B}|$60\n$NaN|{ Y}}" ]; +c19 [ shape=record, label="{{ A}|$92\n$f2b|{ Y}}" ]; +c23 [ shape=record, label="{{ C| D}|$96\n$_DFF_P_|{ Q}}" ]; +x0 [ shape=record, style=rounded, label=" 0:0 - 0:0 " ]; +x0:e -> c23:p21:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x1 [ shape=record, style=rounded, label=" 0:0 - 0:0 " ]; +c23:p22:e -> x1:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c24 [ shape=record, label="{{ C| D}|$97\n$_DFF_P_|{ Q}}" ]; +x2 [ shape=record, style=rounded, label=" 1:1 - 0:0 " ]; +x2:e -> c24:p21:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x3 [ shape=record, style=rounded, label=" 0:0 - 1:1 " ]; +c24:p22:e -> x3:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c25 [ shape=record, label="{{ C| D}|$98\n$_DFF_P_|{ Q}}" ]; +x4 [ shape=record, style=rounded, label=" 2:2 - 0:0 " ]; +x4:e -> c25:p21:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x5 [ shape=record, style=rounded, label=" 0:0 - 2:2 " ]; +c25:p22:e -> x5:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c26 [ shape=record, label="{{ A}|$61\n$b2f|{ Y}}" ]; +n1 [ shape=point ]; +x1:s0:e -> n1:w [color="black", label=""]; +x3:s0:e -> n1:w [color="black", label=""]; +x5:s0:e -> n1:w [color="black", label=""]; +n1:e -> c15:p11:w [color="black", label=""]; +n1:e -> c15:p12:w [color="black", label=""]; +n1:e -> c17:p12:w [color="black", label=""]; +n1:e -> c19:p11:w [color="black", label=""]; +c19:p13:e -> n10:w [color="black", label=""]; +n2 [ shape=point ]; +c18:p13:e -> n2:w [color="black", label=""]; +n2:e -> x0:s0:w [color="black", label=""]; +n2:e -> x2:s0:w [color="black", label=""]; +n2:e -> x4:s0:w [color="black", label=""]; +n3 [ shape=point ]; +c26:p13:e -> n3:w [color="black", style="setlinewidth(3)", label=""]; +n3:e -> c14:p11:w [color="black", style="setlinewidth(3)", label=""]; +n3:e -> c14:p12:w [color="black", style="setlinewidth(3)", label=""]; +n3:e -> c16:p11:w [color="black", style="setlinewidth(3)", label=""]; +c14:p13:e -> c17:p11:w [color="black", style="setlinewidth(3)", label=""]; +c16:p13:e -> c18:p11:w [color="black", style="setlinewidth(3)", label=""]; +c15:p13:e -> c16:p12:w [color="black", style="setlinewidth(3)", label=""]; +c17:p13:e -> c18:p12:w [color="black", style="setlinewidth(3)", label=""]; +n8:e -> c23:p20:w [color="black", label=""]; +n8:e -> c24:p20:w [color="black", label=""]; +n8:e -> c25:p20:w [color="black", label=""]; +n9:e -> c26:p11:w [color="black", label=""]; +} diff --git a/figures/toggle-nan3-4.svg b/figures/toggle-nan3-4.svg new file mode 100644 index 0000000..73fcc27 --- /dev/null +++ b/figures/toggle-nan3-4.svg @@ -0,0 +1,395 @@ + + + + + + +toggle + +toggle + + +n2 + + + + +x0 + +0:0 - 0:0 + + + +n2:e->x0:w + + + + + +x2 + +1:1 - 0:0 + + + +n2:e->x2:w + + + + + +x4 + +2:2 - 0:0 + + + +n2:e->x4:w + + + + + +c23 + +C + +D + +$96 +$_DFF_P_ + +Q + + + +x0:e->c23:w + + + + + + +c24 + +C + +D + +$97 +$_DFF_P_ + +Q + + + +x2:e->c24:w + + + + + + +c25 + +C + +D + +$98 +$_DFF_P_ + +Q + + + +x4:e->c25:w + + + + + + +x1 + +0:0 - 0:0 + + + +c23:e->x1:w + + + + + + +x3 + +0:0 - 1:1 + + + +c24:e->x3:w + + + + + + +x5 + +0:0 - 2:2 + + + +c25:e->x5:w + + + + + + +n8 + +clk + + + +n8:e->c23:w + + + + + +n8:e->c24:w + + + + + +n8:e->c25:w + + + + + +n9 + +en + + + +c26 + +A + +$61 +$b2f + +Y + + + +n9:e->c26:w + + + + + +n10 + +out + + + +c14 + +A + +B + +$56 +$NaN + +Y + + + +c17 + +A + +B + +$59 +$NaN + +Y + + + +c14:e->c17:w + + + + + +c15 + +A + +B + +$57 +$NaN + +Y + + + +c16 + +A + +B + +$58 +$NaN + +Y + + + +c15:e->c16:w + + + + + +c18 + +A + +B + +$60 +$NaN + +Y + + + +c16:e->c18:w + + + + + +c17:e->c18:w + + + + + +c18:e->n2:w + + + + + +c19 + +A + +$92 +$f2b + +Y + + + +c19:e->n10:w + + + + + +n1 + + + + +x1:e->n1:w + + + + + +x3:e->n1:w + + + + + +x5:e->n1:w + + + + + +n3 + + + + +c26:e->n3:w + + + + + +n1:e->c15:w + + + + + +n1:e->c15:w + + + + + +n1:e->c17:w + + + + + +n1:e->c19:w + + + + + +n3:e->c14:w + + + + + +n3:e->c14:w + + + + + +n3:e->c16:w + + + + + diff --git a/figures/toggle-nan3.afdesign b/figures/toggle-nan3.afdesign new file mode 100644 index 0000000..47c55d5 Binary files /dev/null and b/figures/toggle-nan3.afdesign differ diff --git a/figures/toggle-nan3.dot b/figures/toggle-nan3.dot new file mode 100644 index 0000000..0be204b --- /dev/null +++ b/figures/toggle-nan3.dot @@ -0,0 +1,58 @@ +digraph "toggle" { +label="toggle"; +rankdir="LR"; +remincross=true; +n8 [ shape=octagon, label="clk", color="black", fontcolor="black" ]; +n9 [ shape=octagon, label="en", color="black", fontcolor="black" ]; +n10 [ shape=octagon, label="out", color="black", fontcolor="black" ]; +c14 [ shape=record, label="{{ A| B}|$56\n$NaN|{ Y}}" ]; +c15 [ shape=record, label="{{ A| B}|$57\n$NaN|{ Y}}" ]; +c16 [ shape=record, label="{{ A| B}|$58\n$NaN|{ Y}}" ]; +c17 [ shape=record, label="{{ A| B}|$59\n$NaN|{ Y}}" ]; +c18 [ shape=record, label="{{ A| B}|$60\n$NaN|{ Y}}" ]; +c19 [ shape=record, label="{{ A}|$92\n$f2b|{ Y}}" ]; +c23 [ shape=record, label="{{ C| D}|$96\n$_DFF_P_|{ Q}}" ]; +x0 [ shape=record, style=rounded, label=" 0:0 - 0:0 " ]; +x0:e -> c23:p21:s [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x1 [ shape=record, style=rounded, label=" 0:0 - 0:0 " ]; +c23:p22:e -> x1:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c24 [ shape=record, label="{{ C| D}|$97\n$_DFF_P_|{ Q}}" ]; +x2 [ shape=record, style=rounded, label=" 1:1 - 0:0 " ]; +x2:e -> c24:p21:s [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x3 [ shape=record, style=rounded, label=" 0:0 - 1:1 " ]; +c24:p22:e -> x3:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c25 [ shape=record, label="{{ C| D}|$98\n$_DFF_P_|{ Q}}" ]; +{rank=same; c23; c24; c25;}; +x4 [ shape=record, style=rounded, label=" 2:2 - 0:0 " ]; +x4:e -> c25:p21:s [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +x5 [ shape=record, style=rounded, label=" 0:0 - 2:2 " ]; +c25:p22:e -> x5:w [arrowhead=odiamond, arrowtail=odiamond, dir=both, color="black", label=""]; +c26 [ shape=record, label="{{ A}|$61\n$b2f|{ Y}}" ]; +n1 [ shape=point ]; +x1:s0:e -> n1:w [color="black", label=""]; +x3:s0:e -> n1:w [color="black", label=""]; +x5:s0:e -> n1:w [color="black", label=""]; +n1:e -> c15:p11:w [color="black", label=""]; +n1:e -> c15:p12:w [color="black", label=""]; +n1:e -> c17:p12:w [color="black", label=""]; +n1:e -> c19:p11:w [color="black", label=""]; +c19:p13:e -> n10:w [color="black", label=""]; +n2 [ shape=point ]; +c18:p13:e -> n2:w [color="black", label=""]; +n2:e -> x0:s0:w [color="black", label=""]; +n2:e -> x2:s0:w [color="black", label=""]; +n2:e -> x4:s0:w [color="black", label=""]; +n3 [ shape=point ]; +c26:p13:e -> n3:w [color="black", style="setlinewidth(3)", label=""]; +n3:e -> c14:p11:w [color="black", style="setlinewidth(3)", label=""]; +n3:e -> c14:p12:w [color="black", style="setlinewidth(3)", label=""]; +n3:e -> c16:p11:w [color="black", style="setlinewidth(3)", label=""]; +c14:p13:e -> c17:p11:w [color="black", style="setlinewidth(3)", label=""]; +c16:p13:e -> c18:p11:w [color="black", style="setlinewidth(3)", label=""]; +c15:p13:e -> c16:p12:w [color="black", style="setlinewidth(3)", label=""]; +c17:p13:e -> c18:p12:w [color="black", style="setlinewidth(3)", label=""]; +n8:e -> c23:p20:w [color="black", label=""]; +n8:e -> c24:p20:w [color="black", label=""]; +n8:e -> c25:p20:w [color="black", label=""]; +n9:e -> c26:p11:w [color="black", label=""]; +} diff --git a/figures/toggle-nan3.svg b/figures/toggle-nan3.svg new file mode 100644 index 0000000..e7245ba --- /dev/null +++ b/figures/toggle-nan3.svg @@ -0,0 +1,418 @@ + + + + + + + + + clk + + + + + + C + + + + D + + + + $96 + + + $_DFF_P_ + + + + Q + + + + + + + + + + + + C + + + + D + + + + $97 + + + $_DFF_P_ + + + + Q + + + + + + + + + + C + + + + D + + + + $98 + + + $_DFF_P_ + + + + Q + + + + + + + + + + + + + + en + + + + + + A + + + + $61 + + + $b2f + + + + Y + + + + + + + + + + out + + + + + + A + + + + B + + + + $56 + + + $NaN + + + + Y + + + + + + A + + + + B + + + + $59 + + + $NaN + + + + Y + + + + + + + + + + A + + + + B + + + + $57 + + + $NaN + + + + Y + + + + + + A + + + + B + + + + $58 + + + $NaN + + + + Y + + + + + + + + + + A + + + + B + + + + $60 + + + $NaN + + + + Y + + + + + + + + + + + + + + + + + + + + + + + A + + + + $92 + + + $f2b + + + + Y + + + + + + + + + + 0:0 - 0:0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0:0 - 0:0 + + + + + + + + + + + + + 0:0 - 1:1 + + + + + + + + + + + + + 1:1 - 0:0 + + + + + + + + + + 0:0 - 2:2 + + + + + + + + + + + + + 2:2 - 0:0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/figures/toggle-nand.dot b/figures/toggle-nand.dot new file mode 100644 index 0000000..8c7fb26 --- /dev/null +++ b/figures/toggle-nand.dot @@ -0,0 +1,28 @@ +digraph "toggle" { +rankdir="LR"; +remincross=true; +n9 [ shape=octagon, label="clk", color="black", fontcolor="black" ]; +n10 [ shape=octagon, label="en", color="black", fontcolor="black" ]; +n11 [ shape=octagon, label="out", color="black", fontcolor="black" ]; +c14 [ shape=record, label="{{ A}|$57\n$_NOT_|{ Y}}" ]; +c15 [ shape=record, label="{{ A}|$58\n$_NOT_|{ Y}}" ]; +c17 [ shape=record, label="{{ A| B}|$59\n$_NAND_|{ Y}}" ]; +c18 [ shape=record, label="{{ A| B}|$60\n$_NAND_|{ Y}}" ]; +c19 [ shape=record, label="{{ A| B}|$61\n$_NAND_|{ Y}}" ]; +c23 [ shape=record, label="{{ C| D}|$53\n$_DFF_P_|{ Q}}" ]; +n1 [ shape=point ]; +n1:e -> c14:p12:w [color="black", label=""]; +n1:e -> c17:p12:w [color="black", label=""]; +n10:e -> n1:w [color="black", label=""]; +c23:p22:e -> n11:w [color="black", label=""]; +n11:e -> n2:w [color="black", label=""]; +n2 [ shape=point ]; +n2:e -> c15:p12:w [color="black", label=""]; +n2:e -> c18:p16:w [color="black", label=""]; +c19:p13:s -> c23:p21:s [color="black", label=""]; +c14:p13:e -> c18:p12:w [color="black", label=""]; +c15:p13:e -> c17:p16:w [color="black", label=""]; +c17:p13:e -> c19:p12:w [color="black", label=""]; +c18:p13:e -> c19:p16:w [color="black", label=""]; +n9:e -> c23:p20:w [color="black", label=""]; +} diff --git a/figures/toggle-nand.svg b/figures/toggle-nand.svg new file mode 100644 index 0000000..91319ec --- /dev/null +++ b/figures/toggle-nand.svg @@ -0,0 +1,193 @@ + + + + + + +toggle + + + +n9 + +clk + + + +c23 + +C + +D + +$53 +$_DFF_P_ + +Q + + + +n9:e->c23:w + + + + + +n10 + +en + + + +n1 + + + + +n10:e->n1:w + + + + + +n11 + +out + + + +n2 + + + + +n11:e->n2:w + + + + + +c14 + +A + +$57 +$_NOT_ + +Y + + + +c18 + +A + +B + +$60 +$_NAND_ + +Y + + + +c14:e->c18:w + + + + + +c15 + +A + +$58 +$_NOT_ + +Y + + + +c17 + +A + +B + +$59 +$_NAND_ + +Y + + + +c15:e->c17:w + + + + + +c19 + +A + +B + +$61 +$_NAND_ + +Y + + + +c17:e->c19:w + + + + + +c18:e->c19:w + + + + + +c19:s->c23:s + + + + + +c23:e->n11:w + + + + + +n1:e->c14:w + + + + + +n1:e->c17:w + + + + + +n2:e->c15:w + + + + + +n2:e->c18:w + + + + + diff --git a/makefile b/makefile new file mode 100644 index 0000000..3745c43 --- /dev/null +++ b/makefile @@ -0,0 +1,2 @@ +CassieJones2020.pdf: nan-gates.md preamble.tex + pandoc --pdf-engine=xelatex -H preamble.tex nan-gates.md -o CassieJones2020.pdf diff --git a/nan-gates.md b/nan-gates.md new file mode 100644 index 0000000..8fe2d10 --- /dev/null +++ b/nan-gates.md @@ -0,0 +1,327 @@ +--- +title: "NaN-Gate Synthesis and Hardware Deceleration" +author: | + Cassie Jones + Witch of Light + list+sigbovik@witchoflight.com +date: "1 April 2020" +numbersections: true +documentclass: article +classoption: +- twocolumn +geometry: margin=1cm +--- + +# Abstract {-} + +In recent years there has been interest in the field of "hardware decelerators," which serve primarily to make computation more interesting rather than more efficient. +This builds off the work of "NaN-Gates and Flip-FLOPS" [9] to provide a hardware synthesis implementation of real-number computational logic using the Yosys Open Synthesis Suite [1] framework, and evaluates the impacts of different floating point formats. + +**ACH Reference Format:** +Cassie Jones. +2020. +NaN-Gate Synthesis and Hardware Deceleration. +In *Proceedings of SIGBOVIK 2020*, Pittsburgh, PA, USA, April 1, 2020. +(SIGBOVIK '20, ACH). + +# Introduction {-} + +Harware decelerators work on the principle of "stop and smell the roses." +There are some qualities that are more important than sheer efficiency, and often these improvements can often only be realized by taking the computer and slowing it down to a more leisurely pace. +The largest advancements in the field happen in the emulation space, since it's the most widely accessible. +It may be most familiar in the form of video-game computers, building computers out of redstone in Minecraft, Factorio combinators, or the like [7] [6]. + +> "But of course speed is not what we're after here. We're after just, beautiful computation going on inside the heart of this machine." --- Tom7 [10] + +The SIGBOVIK 2019 paper "NaN-Gates and Flip-FLOPS" decelerates computers in the name of elegance: it throws away the assumption of binary computers and builds ones based on real numbers, specifically IEEE-754 floating point numbers. +It aims towards "reboot computing using the beautiful foundation of real numbers," but it still leaves us with room for improvement in a few areas. +It leaves the logic gates in the domain of emulation, which limits the types of hardware that are easy to build, and it limits the elegance that can be achieved. +By using an existing CPU as the floating point processor, you still have a computer that's based on binary emulating your real number logic. + +Here, we attempt to remove this limitation by bringing NaN-gate computation to the domain of native hardware, via a custom Yosys synthesis pass. + +# NaN-Gate Synthesis + +The Yosys Open SYnthesis Suite [1] is a free and open source archicture-neutral logic synthesis framework. +It can synthesize Verilog into a variety of backend formats using a flexible and pluggable architecture of passes. +The Yosys manual has a chapter on how to write extensions [2, Ch. 6], which can be consulted for documentation and examples on how Yosys passes are built. +We provide a Yosys extension which synthesizes a circuit down to a network of small floating point units implementing the NaN-gate function. +This can be further synthesized to a final target, like a specific FPGA architecture. + +## Yosys Synthesis + +We will demonstrate all synthesis with the following toggle module, since it's small enough for all stages of synthesis results to be understandable and fit neatly on the page. + +```verilog +module toggle(input clk, input en, output out); + +always @(posedge clk) begin + if (en) out <= ~out; +end + +endmodule +``` + +Yosys will take a Verilog module like this and flatten the procedural blocks into circuits with memory elements. +Running sythesis gives us a circuit with a flip-flop, a toggle, and a multiplexer that's driven by the enable line. + +![The synthesized toggle circuit.](figures/toggle-base.svg) + +We can also ask yosys to synthesize this to exclusively NAND and NOT gates with a small synthesis script. + +```tcl +read_verilog toggle.v +synth +abc -g NAND +``` + +This particular design synthesizes to 1 D flip-flop, 3 NAND gates, and 2 NOT gates. + +![The circuit synthesized down to only NAND, NOT, and memory elements.](figures/toggle-nand.svg) + +## The Yosys `synth_nan` Pass + +Our `synth_nan` pass is implemented as a Yosys extension. +For convenience, we'll describe the behavior in terms of the 3-bit float synthesis. +It converts a module to NaN-gate logic. +It summarizes itself as running: + +```tcl +synth +abc -g NAND +nand_to_nan +share_nan +dff_nan +simplify_nan +clean +techmap_nan +``` + +The first two steps there are standard synthesis. +The `synth` pass will convert a module into coarsly optimized circuits, and `abc -g NAND` will remap the entire thing into optimized NAND logic. + +One complexity we have to deal with is external interfaces. +Despite the wonderful realms of pure real-number computation we want to interact with, when interacting with fixed hardware component interfaces, we have to convert between flots and bits. +In order to handle this, the NaN gate tech library has modules like `fp3_to_bit` and `bit_to_fp3` which perform this boundary conversion. +In order to deal with the chaotic diversity of real circuits, for robustness, the `nand_to_nan` pass converts each NAND gate to a `bit_to_fp3 -> NaN -> fp3_to_bit` chain. +Don't worry, these conversions will later be removed everywhere they don't turn out to be necessary. + +![The toggle circuits synthesized to NaN gates. Note that the external logic ports have floating point conversion modules, but the clock line doesn't.](figures/toggle-nan3.svg) + +The `share_nan` pass reduces the number of conversions by sharing ones that have the same inputs. +Then, the `dff_nan` pass can expand the flip-flops in the circuit into a set of enough flip-flops to store the floating point values. + +The `simplify_nan` pass converts any instance of `fp3_to_bit -> bit_to_fp3` to just a wire that passes the floats straight through. + +We do `clean` to remove dead wires and useless buffers, and then finally the `techmap_nan` pass replaces the opaque NaN-gate modules with actual modules so that further synthesis can properly make them realizable on real hardware. + +## Module Ports + +If you want your circuit to support external floating-point based interfaces, you can use the floating point conversion modules yourself. + +```verilog +module toggle( + input clk, input [2:0] en, output [2:0] out); + +wire en_b; +reg out_b; +fp3_to_bit en_cvt(en, en_b); +bit_to_fp3 out_cvt(out_b, out); +always @(posedge clk) begin + if (en_b) out_b = ~out_b; +end + +endmodule +``` + +The NaN synthesis will end up erasing the floating point conversions on either side of the interface since they connect to floating point units. +Future work could include automatically expanding ports using something like a `(* nan_port *)` attribute. + +# Floating Point Formats + +While tom7's work asserts that a **binary4** floating point format is "clearly allowed by the IEEE-754 standard," this doesn't seem to hold up under a close examination. +Brought to my attention by Steve Canon [8], there are two cases where these floating point formats fall down. +First, and most importantly in the case of **binary4**, you need to encode both quiet- and signaling-NaNs. +Section 3.3 of IEEE-754 says [5]: + +> "Within each format, the following floating-point data shall be represented: [...] Two NaNs, qNaN (quiet) and sNaN (signaling)." + +While **binary4** does have two separate NaN values (a positive and a negative), they are distinguished only by their sign bit, which isn't allowed to distinguish the two types of NaNs, as we can see in 6.2.1: + +> "When encoded, all NaNs have a sign bit and a pattern of bits necessary to identify the encoding as a NaN and which determines its kind (sNaN vs. qNaN)." + +\newpage +\begin{figure*} +\centering +\includegraphics[width=7in]{figures/synthesis-pass.pdf} +\caption{The full NaN-gate synthesis process for the toggle module. In step 1 we have the logical circuit after coarse synthesis. In step 2 it's synthesized to NAND and NOT gates. Step 3 converts the gates to NaN gates and adds conversion chains. Step 4 expands the flip-flops to store floats. Step 5 collapses redundant conversion chains to give the final NaN-synthesized module.} +\end{figure*} +\clearpage + +This means that we need at least two bits in the mantissa in order to represent the infinities (stored as a 0 mantissa with the maximum exponent) and the NaN values (stored with two distinct non-zero mantissas). + +![From Steve Canon's tweet [8]. As the cat says, since IEEE-754 requires $emax$ to be greater than $emin$, there must be two exponent bits, and since the mantissa must be used to distinguish sNaN, qNaN, and infinity, so it also needs at least two bits, leading to a minimum of 5-bit floats.](binary5.jpg) + +The **binary3** format is further disrupted in section 3.3, which rules-out the idea of having an empty range of $emin$ and $emax$, since they're used in an inequality and $emin \le emax$, and is elsewhere forced to be strictly less by other constraints: + +> "$q$ is any integer $emin \le q+p-1 \le emax$" 3.3 + +Still, the **binary3** format is very useful for efficient implementation of NaN gates, and is worth including in synthesis for people who aren't bothered by standards compliance. +For completeness, the `synth_nan` implementation supports synthesis to **binary3**, **binary4**, and the definitely-IEEE-754-compliant **binary5** format NaN-gates. +Furthermore, the architecture would support easy extensions to larger, more conventional floating point formats like **binary8**, or even larger, by simply loading your own libary of modules named `nan_fpN`, `bit_to_fpN`, and `fpN_to_bit`, for any value of `N` you want to synthesize with. + +## The binary5 Representation + +Here we document the representation in the **binary5** format, the smallest legal IEEE-754 compliant binary floating-point format. +It has a sign bit, a two bit exponent, and a two bit mantissa. +We include a table of all of the positive values here: + +s E T value +- -- -- ----- +0 00 00 +0.0 +0 00 01 +0.25 +0 00 10 +0.5 +0 00 11 +0.75 +0 01 00 +1.0 +0 01 01 +1.25 +0 01 10 +1.5 +0 01 11 +1.75 +0 10 00 +2.0 +0 10 01 +2.5 +0 10 10 +3.0 +0 10 11 +3.5 +0 11 00 +inf +0 11 01 sNaN +0 11 10 qNaN +0 11 11 qNaN + + +The positive values representable in the **binary5** format. Note that infinity, sNaN, and qNaN are all distinguished by the mantissa value when the exponent is all ones, so this is the smallest possible floating point format. The negative values for each are the same bit patterns but with a 1 in the sign bit. + +## Evaluation + +We compare the size (in both logic and memory elements) and clock speed of modules synthesized with the different floating points. +For the benchmark, we use a pipelined 32-bit multiplier, and the PicoRV32 processor [3] synthesized for the ECP5 architecture, and placed and routed using nextpnr [4]. +The numbers given for clock frequency are the best result of 10 runs of placement and routing. + + + +The "NAND" variant are synthesized to NAND gates before architecture-specific optimization, in order to obscure some of the higher-level modules that are present in the original design and prevent optimizations that won't be available to the NaN-gate synthesis. +This gives a clearer baseline for comparison with the NaN gates, and so this is used as the basis for relative numbers. +Times marked **DNP** are those that did not successfully place and route for timing analysis, so no frequency can be reported. + +Design Variant Cells Cell% DFFs DFF% (MHz) +------ ------- ------ ------ ------ ----- ------- +PicoRV Direct 1884 57% 888 48% 103.55 + NAND 3328 100% 1848 100% 47.30 + fp3 43739 1314% 5544 299% **DNP** + fp4 32853 987% 7392 400% **DNP** + fp5 65511 1968% 9240 500% **DNP** +Mult32 Direct 2879 104% 628 100% 143.04 + NAND 2773 100% 628 100% 154.37 + fp3 25349 880% 1884 300% 25.26 + fp4 19026 661% 2520 400% 21.88 + fp5 38001 1320% 3140 500% 21.18 + +It's interesting that fp4 is the smallest of the floating point variants in logic, even though not in memory. +It seems likely that this is because the ECP5 architecture is based on a "LUT4" architecture, 4-input lookup tables, which means the individual NaN-gates potentially happen to synthesize more efficiently with 4-bit inputs. + +## Flattening + +For this benchmark, we synthesize designs without flattening post NaN-gate synthesis, because the optimizer is too effective and eliminates most of the floating point logic. +When they are flattened, the optimzer can consider the logic involved in the individual NaN gates and re-combine them into and erase constant-value flip-flops. +Designs that are flattened before optimizing have no flip-flop overhead, and have on the order of 5% overhead in logic elements vs the reference NAND-gate versions. + +While synthesizing with post-NaN flattening substantially undermines the floating point logic and mostly demonstrates the impressive quality of Yosys's optimizations, it suggests as an option a sort of "homeopathic floating-point logic." +For users that require efficiency but still want *some* of the elegance benefits, they can flatten it and optimize it away, keeping some peace-of-mind in knowing that their final circuit is derived from an elegant real-number system, regardless of how it currently behaves. + +# Future Work + +Floating point synthesis still has many avenues for improvement and future work. + +The current synthesis approach used by `synth_nan` remains fragile in the face of flattening and pass-ordering. +It should be possible to make it harder to accidentally flatten the designs away into nothing, but they still do need to be eventually flattened since the `nextpnr` place-and-route flow is still not fully reliable in the presence of un-flattened designs. +Currently the `synth_nan` pass must be run before any device-specific passes, which can be fine but it prevents the utilization of resources such as distributed RAMs. + +Float synthesis tools should make it easier to define module ports that should be expanded to accomodate floating-point based signals, so that designs can operate fully in the glorious domain of the real numbers, without having to flatten all designs. + +More work could be done into ensuring that the individual gates are properly optimized for different architectures, since it seems unreasonable for fp4 to remain more efficient than fp3. +The system could also benefit from implementing a larger set of primitive gates, to avoid the blowup of using NAND gates to emulate everything, since they should be implementable in similar amounts of elementary logic. + +With **binary5** and larger, there looks like there could be potential in attempting to explore designs that work *purely* on NaN values, exploring the flexibility in the handling of signaling and quiet NaN values. + +The NaN-gate synthesis plugin for Yosys can be found at . +This paper and the examples materials in it can be found at . + +\begingroup +# References {-} +\setlength{\parindent}{-0.2in} +\setlength{\leftskip}{0.2in} +\setlength{\parskip}{8pt} + +\vspace{-20pt} +\indent{} +[1] Claire Wolf. + The Yosys Open SYnthesis Suite. + Online. +\noindent{} + http://www.clifford.at/yosys/ + +[2] Claire Wolf. + The Yosys Manual. + Online. +\noindent{} + http://www.clifford.at/yosys/files/yosys_manual.pdf + +[3] Claire Wolf. + PicoRV32 - A Size Optimized RISC-V CPU. + Online. + https://github.com/cliffordwolf/picorv32 + +[4] Claire Wolf, David Shah, Dan Gisselquist, Serge Bazanski, Miodrag Milanovic, and Eddie Hung. + NextPNR Portable FPGA Place and Route Tool. + 2018. + Online. +\noindent{} + https://github.com/YosysHQ/nextpnr + +[5] IEEE Standard for Floating-Point Artithmetic. + 2019. + In *IEEE Std 754-2019 (Revision of IEEE 754-2008).* + Pages 1--84. + DOI 10.1109/IEEESTD.2019.8766229. + +[6] justarandomgeek. + 2017. + justarandomgeek's Combinator Computer Mk5. + Online. +\noindent{} + https://github.com/justarandomgeek/factorio-computer + +[7] legomasta99. + 2018. + Minecraft Computer Engineering - Redstone Computers. + Online. + + https://www.youtube.com/watch?v=aj6IUuwLyOE + &list=PLwdt_GQ3o0Xe6pUS1vdzy0ZqXrApB2MNu + +[8] Stephen Canon. + 2017. + A Tweet About IEEE-754. + Tweet by \@stephentyrone on April 1, 2017. +\noindent{} + https://twitter.com/stephentyrone/status/848172687268687873 + +[9] Tom Murphy VII. + 2019. + NaN Gates and Flip FLOPS. + In *Proceedings of SIGBOVIK 2019*, Pittsburgh, PA, USA, April 1, 2019. + (SIGBOVIK '19, ACH). + Pages 98--102. + +[10] Tom Murphy VII. + 2019. + NaN Gates and Flip FLOPS. + Online. + http://tom7.org/nand/ diff --git a/preamble.tex b/preamble.tex new file mode 100644 index 0000000..f095140 --- /dev/null +++ b/preamble.tex @@ -0,0 +1,13 @@ +\usepackage{nopageno} +\usepackage{xtab} +\makeatletter +\def\longtable{\@ifnextchar[\newlongtable@i \newlongtable@ii} +\def\newlongtable@i[#1]{% +\renewcommand{\endhead}{\ignorespaces} +\begin{center} +\xtabular[#1]} +\def\newlongtable@ii{% +\renewcommand{\endhead}{\ignorespaces} +\xtabular} +\def\endlongtable{\endxtabular\end{center}} +\makeatother