aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/examples/const_wire
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-02-25 10:22:45 +0000
committerGitHub <noreply@github.com>2021-02-25 10:22:45 +0000
commitab8dfcfba4544c6733d074b24b0529d431b66d29 (patch)
treeaf212992fee7cd0a8fb27d19d0137587402fdc1b /fpga_interchange/examples/const_wire
parente2cdaa653c805f9bfb6f0ab36295858e5dd3179d (diff)
parenta30043c8da1b1cc46a2dcfb90aa3a06d4f4ed4e9 (diff)
downloadnextpnr-ab8dfcfba4544c6733d074b24b0529d431b66d29.tar.gz
nextpnr-ab8dfcfba4544c6733d074b24b0529d431b66d29.tar.bz2
nextpnr-ab8dfcfba4544c6733d074b24b0529d431b66d29.zip
Merge pull request #591 from litghost/add_constant_network
Add constant network support to FPGA interchange arch
Diffstat (limited to 'fpga_interchange/examples/const_wire')
-rw-r--r--fpga_interchange/examples/const_wire/Makefile8
-rw-r--r--fpga_interchange/examples/const_wire/run.tcl14
-rw-r--r--fpga_interchange/examples/const_wire/wire.v8
-rw-r--r--fpga_interchange/examples/const_wire/wire.xdc9
4 files changed, 39 insertions, 0 deletions
diff --git a/fpga_interchange/examples/const_wire/Makefile b/fpga_interchange/examples/const_wire/Makefile
new file mode 100644
index 00000000..49194f53
--- /dev/null
+++ b/fpga_interchange/examples/const_wire/Makefile
@@ -0,0 +1,8 @@
+DESIGN := wire
+DESIGN_TOP := top
+PACKAGE := csg324
+
+include ../template.mk
+
+build/wire.json: wire.v | build
+ yosys -c run.tcl
diff --git a/fpga_interchange/examples/const_wire/run.tcl b/fpga_interchange/examples/const_wire/run.tcl
new file mode 100644
index 00000000..9127be20
--- /dev/null
+++ b/fpga_interchange/examples/const_wire/run.tcl
@@ -0,0 +1,14 @@
+yosys -import
+
+read_verilog wire.v
+
+synth_xilinx -nolutram -nowidelut -nosrl -nocarry -nodsp
+
+# opt_expr -undriven makes sure all nets are driven, if only by the $undef
+# net.
+opt_expr -undriven
+opt_clean
+
+setundef -zero -params
+
+write_json build/wire.json
diff --git a/fpga_interchange/examples/const_wire/wire.v b/fpga_interchange/examples/const_wire/wire.v
new file mode 100644
index 00000000..5b1ab692
--- /dev/null
+++ b/fpga_interchange/examples/const_wire/wire.v
@@ -0,0 +1,8 @@
+module top(output o, output o2, output o3, output o4);
+
+assign o = 1'b0;
+assign o2 = 1'b1;
+assign o3 = 1'b0;
+assign o4 = 1'b1;
+
+endmodule
diff --git a/fpga_interchange/examples/const_wire/wire.xdc b/fpga_interchange/examples/const_wire/wire.xdc
new file mode 100644
index 00000000..0d96fc45
--- /dev/null
+++ b/fpga_interchange/examples/const_wire/wire.xdc
@@ -0,0 +1,9 @@
+set_property PACKAGE_PIN N15 [get_ports o]
+set_property PACKAGE_PIN N16 [get_ports o2]
+set_property PACKAGE_PIN P17 [get_ports o3]
+set_property PACKAGE_PIN R17 [get_ports o4]
+
+set_property IOSTANDARD LVCMOS33 [get_ports o]
+set_property IOSTANDARD LVCMOS33 [get_ports o2]
+set_property IOSTANDARD LVCMOS33 [get_ports o3]
+set_property IOSTANDARD LVCMOS33 [get_ports o4]