aboutsummaryrefslogtreecommitdiffstats
path: root/examples/intel/MAX10
diff options
context:
space:
mode:
authordh73 <dh73_fpga@qq.com>2017-04-05 23:01:29 -0500
committerdh73 <dh73_fpga@qq.com>2017-04-05 23:01:29 -0500
commitc27dcc1e47fa00cd415893c9d3f637a5d5865988 (patch)
treef474149e35f09f18cc6ff701ec03c667bd76477c /examples/intel/MAX10
parentfcb274a5644016c4090cdfbfbd795f311a7e58f5 (diff)
downloadyosys-c27dcc1e47fa00cd415893c9d3f637a5d5865988.tar.gz
yosys-c27dcc1e47fa00cd415893c9d3f637a5d5865988.tar.bz2
yosys-c27dcc1e47fa00cd415893c9d3f637a5d5865988.zip
Add initial support for both MAX10 and Cyclone IV (E|GX) FPGAs
Diffstat (limited to 'examples/intel/MAX10')
-rw-r--r--examples/intel/MAX10/run_max101
-rw-r--r--examples/intel/MAX10/runme_postsynth5
-rw-r--r--examples/intel/MAX10/sevenseg.v25
-rw-r--r--examples/intel/MAX10/top.v15
4 files changed, 46 insertions, 0 deletions
diff --git a/examples/intel/MAX10/run_max10 b/examples/intel/MAX10/run_max10
new file mode 100644
index 000000000..ef7649afb
--- /dev/null
+++ b/examples/intel/MAX10/run_max10
@@ -0,0 +1 @@
+yosys -p "synth_intel -family max10 -top top -vout top.vqm" top.v sevenseg.v
diff --git a/examples/intel/MAX10/runme_postsynth b/examples/intel/MAX10/runme_postsynth
new file mode 100644
index 000000000..f16210540
--- /dev/null
+++ b/examples/intel/MAX10/runme_postsynth
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+iverilog -D POST_IMPL -o verif_post -s tb_top tb_top.v top.vqm $(yosys-config --datdir/altera_intel/max10/cells_comb_max10.v)
+vvp -N verif_post
+
diff --git a/examples/intel/MAX10/sevenseg.v b/examples/intel/MAX10/sevenseg.v
new file mode 100644
index 000000000..b845f5211
--- /dev/null
+++ b/examples/intel/MAX10/sevenseg.v
@@ -0,0 +1,25 @@
+module sevenseg ( output reg [6:0] HEX0,
+ input [3:0] SW );
+
+ always @(*) begin
+ case(SW)
+ 4'h1: HEX0 = 7'b1111001;
+ 4'h2: HEX0 = 7'b0100100;
+ 4'h3: HEX0 = 7'b0110000;
+ 4'h4: HEX0 = 7'b0011001;
+ 4'h5: HEX0 = 7'b0010010;
+ 4'h6: HEX0 = 7'b0000010;
+ 4'h7: HEX0 = 7'b1111000;
+ 4'h8: HEX0 = 7'b0000000;
+ 4'h9: HEX0 = 7'b0011000;
+ 4'ha: HEX0 = 7'b0001000;
+ 4'hb: HEX0 = 7'b0000011;
+ 4'hc: HEX0 = 7'b1000110;
+ 4'hd: HEX0 = 7'b0100001;
+ 4'he: HEX0 = 7'b0000110;
+ 4'hf: HEX0 = 7'b0001110;
+ 4'h0: HEX0 = 7'b1000000;
+ endcase // case (SW)
+ end
+
+endmodule
diff --git a/examples/intel/MAX10/top.v b/examples/intel/MAX10/top.v
new file mode 100644
index 000000000..75c778feb
--- /dev/null
+++ b/examples/intel/MAX10/top.v
@@ -0,0 +1,15 @@
+`default_nettype none
+module top ( output wire [6:0] HEX0, HEX1, HEX2, HEX3, HEX4, HEX5, HEX6, HEX7,
+ input wire [15:0] SW );
+
+
+ sevenseg UUD0 (.HEX0(HEX0), .SW(4'h7));
+ sevenseg UUD1 (.HEX0(HEX1), .SW(4'h1));
+ sevenseg UUD2 (.HEX0(HEX2), .SW(4'h0));
+ sevenseg UUD3 (.HEX0(HEX3), .SW(4'h2));
+ sevenseg UUD4 (.HEX0(HEX4), .SW(SW[3:0]));
+ sevenseg UUD5 (.HEX0(HEX5), .SW(SW[7:4]));
+ sevenseg UUD6 (.HEX0(HEX6), .SW(SW[11:8]));
+ sevenseg UUD7 (.HEX0(HEX7), .SW(SW[15:12]));
+
+endmodule