From 2e9f36985f1b320a8cf5d57fba40aa822cd0f6ab Mon Sep 17 00:00:00 2001 From: Juan Gonzalez-Gomez Date: Sat, 11 Feb 2017 10:55:40 +0100 Subject: Added a hello world example (led_on) for the icezum Alhambra board (#2) --- icezum/led_on/Makefile | 32 ++++++++++++++++++++++++++++++++ icezum/led_on/README.md | 16 ++++++++++++++++ icezum/led_on/led_on.pcf | 9 +++++++++ icezum/led_on/led_on.vhdl | 20 ++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 icezum/led_on/Makefile create mode 100644 icezum/led_on/README.md create mode 100644 icezum/led_on/led_on.pcf create mode 100644 icezum/led_on/led_on.vhdl (limited to 'icezum') diff --git a/icezum/led_on/Makefile b/icezum/led_on/Makefile new file mode 100644 index 0000000..8ef70dd --- /dev/null +++ b/icezum/led_on/Makefile @@ -0,0 +1,32 @@ +PROJ = led_on +PIN_DEF = led_on.pcf +DEVICE = hx1k + +all: $(PROJ).rpt $(PROJ).bin + +%.blif: %.vhdl + ghdl -a $(PROJ).vhdl + yosys -m ../../ghdl.so -p 'ghdl led_on; synth_ice40 -blif $@' + ##yosys -p 'synth_ice40 -top top -blif $@' $< + +%.asc: $(PIN_DEF) %.blif + arachne-pnr -d $(subst hx,,$(subst lp,,$(DEVICE))) -o $@ -p $^ + +%.bin: %.asc + icepack $< $@ + +%.rpt: %.asc + icetime -d $(DEVICE) -mtr $@ $< + +prog: $(PROJ).bin + iceprog $< + +sudo-prog: $(PROJ).bin + @echo 'Executing prog as root!!!' + sudo iceprog $< + +clean: + rm -f $(PROJ).blif $(PROJ).asc $(PROJ).rpt $(PROJ).bin work-obj93.cf + +.SECONDARY: +.PHONY: all prog clean diff --git a/icezum/led_on/README.md b/icezum/led_on/README.md new file mode 100644 index 0000000..9073c11 --- /dev/null +++ b/icezum/led_on/README.md @@ -0,0 +1,16 @@ +A hello world example for the **Icezum Alhambra board** +It just turn on the led0 and turn off the others + +Execute + +```sh +$ make +``` + +for synthesizing the example and + +```sh +$ make prog +``` + +for programing the board diff --git a/icezum/led_on/led_on.pcf b/icezum/led_on/led_on.pcf new file mode 100644 index 0000000..522e201 --- /dev/null +++ b/icezum/led_on/led_on.pcf @@ -0,0 +1,9 @@ +set_io led0 95 +set_io led1 96 +set_io led2 97 +set_io led3 98 +set_io led4 99 +set_io led5 101 +set_io led6 102 +set_io led7 104 + diff --git a/icezum/led_on/led_on.vhdl b/icezum/led_on/led_on.vhdl new file mode 100644 index 0000000..49a88ad --- /dev/null +++ b/icezum/led_on/led_on.vhdl @@ -0,0 +1,20 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity led_on is + port (led0, led1, led2, led3, led4, led5, led6, led7 : out std_logic); +end led_on; + +architecture test of led_on is +begin + + -- Turn on the Led0 + led0 <= '1'; + + -- Turn off the other leds + (led1, led2, led3, led4, led5, led6, led7) <= std_logic_vector'("0000000"); + +end test; + + -- cgit v1.2.3