Merge branch 'master' into up5k

This commit is contained in:
David Shah 2017-11-18 18:03:20 +00:00
commit ed61efa023
8 changed files with 44 additions and 13 deletions

View File

@ -1,7 +1,7 @@
include config.mk
SUBDIRS = icebox icepack iceprog icemulti icepll icetime icebram
include config.mk
all clean install uninstall:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@ || exit; \

View File

@ -6,12 +6,18 @@ PKG_CONFIG ?= pkg-config
C_STD ?= c99
CXX_STD ?= c++11
ifeq ($(EMCC),1)
OPT_LEVEL ?= 2
DBG_LEVEL ?=
else
OPT_LEVEL ?= 0
DBG_LEVEL ?= -ggdb
endif
WARN_LEVEL ?= all
LDLIBS = -lm -lstdc++
CFLAGS += -MD -O$(OPT_LEVEL) -ggdb -W$(WARN_LEVEL) -std=$(C_STD) -I$(PREFIX)/include
CXXFLAGS += -MD -O$(OPT_LEVEL) -ggdb -W$(WARN_LEVEL) -std=$(CXX_STD) -I$(PREFIX)/include
CFLAGS += -MD -O$(OPT_LEVEL) $(DBG_LEVEL) -W$(WARN_LEVEL) -std=$(C_STD) -I$(PREFIX)/include
CXXFLAGS += -MD -O$(OPT_LEVEL) $(DBG_LEVEL) -W$(WARN_LEVEL) -std=$(CXX_STD) -I$(PREFIX)/include
DESTDIR ?=
CHIPDB_SUBDIR ?= icebox
@ -22,3 +28,12 @@ CXX = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc
CC = $(CXX)
PKG_CONFIG = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-pkg-config
endif
ifeq ($(EMCC),1)
EXE = .js
CC = emcc
CXX = emcc
PREFIX = /
LDFLAGS = -O2 --memory-init-file 0 -s TOTAL_MEMORY=64*1024*1024
SUBDIRS = icebox icepack icemulti icepll icetime icebram
endif

View File

@ -184,7 +184,7 @@ after updating your IceStorm installation.
bit-streams to a Lattice iCEstick and/or a Lattice iCE40-HX8K Breakout Board as unprivileged user:
</p>
<pre style="padding-left: 3em">ACTION=="add", ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", MODE:="666"</pre>
<pre style="padding-left: 3em">ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0660", GROUP="plugdev", TAG+="uaccess"</pre>
<p>
<b>Notes for Archlinux:</b> just install <a href="https://aur.archlinux.org/packages/icestorm-git/">icestorm-git</a>, <a href="https://aur.archlinux.org/packages/arachne-pnr-git/">arachne-pnr-git</a> and <a href="https://aur.archlinux.org/packages/yosys-git/">yosys-git</a> from the Arch User Repository (no need to follow the install instructions above).

View File

@ -20,7 +20,7 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/icebram$(EXE)
clean:
rm -f icebram
rm -f icebram$(EXE)
rm -f icebram.exe
rm -f demo.* demo_*.*
rm -f *.o *.d

View File

@ -17,7 +17,7 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/icemulti$(EXE)
clean:
rm -f icemulti
rm -f icemulti$(EXE)
rm -f icemulti.exe
rm -f *.o *.d

View File

@ -10,8 +10,8 @@ all: icepack$(EXE) iceunpack$(EXE)
icepack$(EXE): icepack.o
$(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS)
iceunpack: icepack
ln -sf icepack iceunpack
iceunpack$(EXE): icepack$(EXE)
ln -sf icepack$(EXE) iceunpack$(EXE)
iceunpack.exe:
# no iceunpack.exe, use icepack -u
@ -26,8 +26,8 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/iceunpack$(EXE)
clean:
rm -f icepack
rm -f iceunpack
rm -f icepack$(EXE)
rm -f iceunpack$(EXE)
rm -f icepack.exe
rm -f *.o *.d

View File

@ -17,7 +17,7 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/icepll$(EXE)
clean:
rm -f icepll
rm -f icepll$(EXE)
rm -f icepll.exe
rm -f *.o *.d

View File

@ -8,6 +8,22 @@ endif
all: icetime$(EXE)
ifeq ($(EXE),.js)
icetime$(EXE): | share/$(CHIPDB_SUBDIR)/chipdb-384.txt share/$(CHIPDB_SUBDIR)/chipdb-1k.txt share/$(CHIPDB_SUBDIR)/chipdb-8k.txt
share/$(CHIPDB_SUBDIR)/chipdb-384.txt: ../icebox/chipdb-384.txt
mkdir -p share/$(CHIPDB_SUBDIR)
cp $< $@
share/$(CHIPDB_SUBDIR)/chipdb-1k.txt: ../icebox/chipdb-1k.txt
mkdir -p share/$(CHIPDB_SUBDIR)
cp $< $@
share/$(CHIPDB_SUBDIR)/chipdb-8k.txt: ../icebox/chipdb-8k.txt
mkdir -p share/$(CHIPDB_SUBDIR)
cp $< $@
override LDFLAGS += --embed-file share
endif
icetime$(EXE): icetime.o
$(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS)
@ -46,7 +62,7 @@ test: test0 test1 test2 test3 test4 test5 test6 test7 test8 test9
show: show0 show1 show2 show3 show4 show5 show6 show7 show8 show9
clean:
rm -f icetime icetime.exe timings.inc *.o *.d
rm -f icetime$(EXE) icetime.exe timings.inc *.o *.d
rm -rf test[0-9]*
-include *.d