aboutsummaryrefslogtreecommitdiffstats
path: root/manual/APPNOTE_011_Design_Investigation
diff options
context:
space:
mode:
Diffstat (limited to 'manual/APPNOTE_011_Design_Investigation')
-rw-r--r--manual/APPNOTE_011_Design_Investigation/.gitignore2
-rw-r--r--manual/APPNOTE_011_Design_Investigation/foobaraddsub.v8
-rw-r--r--manual/APPNOTE_011_Design_Investigation/make.sh6
-rw-r--r--manual/APPNOTE_011_Design_Investigation/sumprod.v12
4 files changed, 27 insertions, 1 deletions
diff --git a/manual/APPNOTE_011_Design_Investigation/.gitignore b/manual/APPNOTE_011_Design_Investigation/.gitignore
index 291bf0266..5626754fc 100644
--- a/manual/APPNOTE_011_Design_Investigation/.gitignore
+++ b/manual/APPNOTE_011_Design_Investigation/.gitignore
@@ -5,3 +5,5 @@ example_03.dot
cmos_00.dot
cmos_01.dot
splice.dot
+sumprod_00.dot
+sumprod_01.dot
diff --git a/manual/APPNOTE_011_Design_Investigation/foobaraddsub.v b/manual/APPNOTE_011_Design_Investigation/foobaraddsub.v
new file mode 100644
index 000000000..0f277211d
--- /dev/null
+++ b/manual/APPNOTE_011_Design_Investigation/foobaraddsub.v
@@ -0,0 +1,8 @@
+module foobaraddsub(a, b, c, d, fa, fs, ba, bs);
+ input [7:0] a, b, c, d;
+ output [7:0] fa, fs, ba, bs;
+ assign fa = a + (* foo *) b;
+ assign fs = a - (* foo *) b;
+ assign ba = c + (* bar *) d;
+ assign bs = c - (* bar *) d;
+endmodule
diff --git a/manual/APPNOTE_011_Design_Investigation/make.sh b/manual/APPNOTE_011_Design_Investigation/make.sh
index af08d990a..cbabdc8e3 100644
--- a/manual/APPNOTE_011_Design_Investigation/make.sh
+++ b/manual/APPNOTE_011_Design_Investigation/make.sh
@@ -3,7 +3,9 @@
../../yosys -p 'proc; opt; show -format dot -prefix splice' splice.v
../../yosys -p 'techmap; abc -liberty ../../techlibs/cmos/cmos_cells.lib;; show -format dot -prefix cmos_00' cmos.v
../../yosys -p 'techmap; splitnets -ports; abc -liberty ../../techlibs/cmos/cmos_cells.lib;; show -lib ../../techlibs/cmos/cmos_cells.v -format dot -prefix cmos_01' cmos.v
-sed -i '/^label=/ d;' example_*.dot splice.dot cmos_*.dot
+../../yosys -p 'opt; cd sumprod; select a:sumstuff; show -format dot -prefix sumprod_00' sumprod.v
+../../yosys -p 'opt; cd sumprod; select a:sumstuff %x; show -format dot -prefix sumprod_01' sumprod.v
+sed -i '/^label=/ d;' example_*.dot splice.dot cmos_*.dot sumprod_*.dot
dot -Tpdf -o example_00.pdf example_00.dot
dot -Tpdf -o example_01.pdf example_01.dot
dot -Tpdf -o example_02.pdf example_02.dot
@@ -11,3 +13,5 @@ dot -Tpdf -o example_03.pdf example_03.dot
dot -Tpdf -o splice.pdf splice.dot
dot -Tpdf -o cmos_00.pdf cmos_00.dot
dot -Tpdf -o cmos_01.pdf cmos_01.dot
+dot -Tpdf -o sumprod_00.pdf sumprod_00.dot
+dot -Tpdf -o sumprod_01.pdf sumprod_01.dot
diff --git a/manual/APPNOTE_011_Design_Investigation/sumprod.v b/manual/APPNOTE_011_Design_Investigation/sumprod.v
new file mode 100644
index 000000000..4091bf0a1
--- /dev/null
+++ b/manual/APPNOTE_011_Design_Investigation/sumprod.v
@@ -0,0 +1,12 @@
+module sumprod(a, b, c, sum, prod);
+
+ input [7:0] a, b, c;
+ output [7:0] sum, prod;
+
+ {* sumstuff *}
+ assign sum = a + b + c;
+ {* *}
+
+ assign prod = a * b * c;
+
+endmodule