mirror of https://github.com/YosysHQ/yosys.git
Added "make PRETTY=1"
This commit is contained in:
parent
2f54345cff
commit
b17d6531c8
42
Makefile
42
Makefile
|
@ -44,6 +44,11 @@ YOSYS_VER := 0.3.0+
|
|||
GIT_REV := $(shell git rev-parse --short HEAD || echo UNKOWN)
|
||||
OBJS = kernel/version_$(GIT_REV).o
|
||||
|
||||
PRETTY = 0
|
||||
P =
|
||||
Q =
|
||||
S =
|
||||
|
||||
# set 'ABCREV = default' to use abc/ as it is
|
||||
#
|
||||
# Note: If you do ABC development, make sure that 'abc' in this directory
|
||||
|
@ -102,6 +107,12 @@ CXXFLAGS += $(patsubst %,-I$(VERIFIC_DIR)/%,$(VERIFIC_COMPONENTS)) -DYOSYS_ENABL
|
|||
LDLIBS += $(patsubst %,$(VERIFIC_DIR)/%/*-linux.a,$(VERIFIC_COMPONENTS))
|
||||
endif
|
||||
|
||||
ifeq ($(PRETTY), 1)
|
||||
P = @echo "Building $@";
|
||||
Q = @
|
||||
S = -s
|
||||
endif
|
||||
|
||||
OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o
|
||||
OBJS += kernel/compatibility.o
|
||||
|
||||
|
@ -127,41 +138,48 @@ include techlibs/*/Makefile.inc
|
|||
top-all: $(TARGETS) $(EXTRA_TARGETS)
|
||||
|
||||
yosys: $(OBJS)
|
||||
$(CXX) -o yosys $(LDFLAGS) $(OBJS) $(LDLIBS)
|
||||
$(P) $(CXX) -o yosys $(LDFLAGS) $(OBJS) $(LDLIBS)
|
||||
|
||||
%.o: %.cc
|
||||
$(P) $(CXX) -o $@ -c $(CXXFLAGS) $<
|
||||
|
||||
%.o: %.cpp
|
||||
$(P) $(CXX) -o $@ -c $(CXXFLAGS) $<
|
||||
|
||||
kernel/version_$(GIT_REV).cc: Makefile
|
||||
rm -f kernel/version_*.o kernel/version_*.d kernel/version_*.cc
|
||||
echo "extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys $(YOSYS_VER) (git sha1 $(GIT_REV))\";" > kernel/version_$(GIT_REV).cc
|
||||
$(P) rm -f kernel/version_*.o kernel/version_*.d kernel/version_*.cc
|
||||
$(Q) echo "extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys $(YOSYS_VER) (git sha1 $(GIT_REV))\";" > kernel/version_$(GIT_REV).cc
|
||||
|
||||
yosys-config: yosys-config.in
|
||||
$(SED) -e 's,@CXX@,$(CXX),;' -e 's,@CXXFLAGS@,$(CXXFLAGS),;' -e 's,@LDFLAGS@,$(LDFLAGS),;' -e 's,@LDLIBS@,$(LDLIBS),;' \
|
||||
$(P) $(SED) -e 's,@CXX@,$(CXX),;' -e 's,@CXXFLAGS@,$(CXXFLAGS),;' -e 's,@LDFLAGS@,$(LDFLAGS),;' -e 's,@LDLIBS@,$(LDLIBS),;' \
|
||||
-e 's,@BINDIR@,$(DESTDIR)/bin,;' -e 's,@DATDIR@,$(DESTDIR)/share/yosys,;' < yosys-config.in > yosys-config
|
||||
chmod +x yosys-config
|
||||
$(Q) chmod +x yosys-config
|
||||
|
||||
yosys-svgviewer: libs/svgviewer/*.h libs/svgviewer/*.cpp
|
||||
cd libs/svgviewer && $(QMAKE) && make
|
||||
cp `find libs/svgviewer -name svgviewer -type f` yosys-svgviewer
|
||||
$(P) cd libs/svgviewer && $(QMAKE) && $(MAKE) $(S)
|
||||
$(Q) cp `find libs/svgviewer -name svgviewer -type f` yosys-svgviewer
|
||||
|
||||
abc/abc-$(ABCREV):
|
||||
$(P)
|
||||
ifneq ($(ABCREV),default)
|
||||
if ( cd abc && hg identify; ) | grep -q +; then \
|
||||
$(Q) if ( cd abc && hg identify; ) | grep -q +; then \
|
||||
echo 'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'; false; \
|
||||
fi
|
||||
if test "`cd abc && hg identify | cut -f1 -d' '`" != "$(ABCREV)"; then \
|
||||
$(Q) if test "`cd abc && hg identify | cut -f1 -d' '`" != "$(ABCREV)"; then \
|
||||
test $(ABCPULL) -ne 0 || { echo 'REEBE: NOP abg hc gb qngr naq NOPCHYY frg gb 0 va Znxrsvyr!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'; exit 1; }; \
|
||||
test -d abc || hg clone https://bitbucket.org/alanmi/abc abc; \
|
||||
cd abc && hg pull && hg update -r $(ABCREV); \
|
||||
fi
|
||||
endif
|
||||
rm -f abc/abc-[0-9a-f]*
|
||||
cd abc && $(MAKE) PROG="abc-$(ABCREV)" MSG_PREFIX="YOSYS-ABC: "
|
||||
$(Q) rm -f abc/abc-[0-9a-f]*
|
||||
$(Q) cd abc && $(MAKE) $(S) PROG="abc-$(ABCREV)" MSG_PREFIX="YOSYS-ABC: "
|
||||
|
||||
ifeq ($(ABCREV),default)
|
||||
.PHONY: abc/abc-$(ABCREV)
|
||||
endif
|
||||
|
||||
yosys-abc: abc/abc-$(ABCREV)
|
||||
cp abc/abc-$(ABCREV) yosys-abc
|
||||
$(P) cp abc/abc-$(ABCREV) yosys-abc
|
||||
|
||||
test: $(TARGETS) $(EXTRA_TARGETS)
|
||||
cd tests/simple && bash run-test.sh
|
||||
|
|
|
@ -5,13 +5,13 @@ GENFILES += frontends/ilang/parser.output
|
|||
GENFILES += frontends/ilang/lexer.cc
|
||||
|
||||
frontends/ilang/parser.tab.cc: frontends/ilang/parser.y
|
||||
bison -d -r all -b frontends/ilang/parser frontends/ilang/parser.y
|
||||
mv frontends/ilang/parser.tab.c frontends/ilang/parser.tab.cc
|
||||
$(P) bison -d -r all -b frontends/ilang/parser frontends/ilang/parser.y
|
||||
$(Q) mv frontends/ilang/parser.tab.c frontends/ilang/parser.tab.cc
|
||||
|
||||
frontends/ilang/parser.tab.h: frontends/ilang/parser.tab.cc
|
||||
|
||||
frontends/ilang/lexer.cc: frontends/ilang/lexer.l
|
||||
flex -o frontends/ilang/lexer.cc frontends/ilang/lexer.l
|
||||
$(P) flex -o frontends/ilang/lexer.cc frontends/ilang/lexer.l
|
||||
|
||||
OBJS += frontends/ilang/parser.tab.o frontends/ilang/lexer.o
|
||||
OBJS += frontends/ilang/ilang_frontend.o
|
||||
|
|
|
@ -5,13 +5,13 @@ GENFILES += frontends/verilog/parser.output
|
|||
GENFILES += frontends/verilog/lexer.cc
|
||||
|
||||
frontends/verilog/parser.tab.cc: frontends/verilog/parser.y
|
||||
bison -d -r all -b frontends/verilog/parser frontends/verilog/parser.y
|
||||
mv frontends/verilog/parser.tab.c frontends/verilog/parser.tab.cc
|
||||
$(P) bison -d -r all -b frontends/verilog/parser frontends/verilog/parser.y
|
||||
$(Q) mv frontends/verilog/parser.tab.c frontends/verilog/parser.tab.cc
|
||||
|
||||
frontends/verilog/parser.tab.h: frontends/verilog/parser.tab.cc
|
||||
|
||||
frontends/verilog/lexer.cc: frontends/verilog/lexer.l
|
||||
flex -o frontends/verilog/lexer.cc frontends/verilog/lexer.l
|
||||
$(P) flex -o frontends/verilog/lexer.cc frontends/verilog/lexer.l
|
||||
|
||||
OBJS += frontends/verilog/parser.tab.o
|
||||
OBJS += frontends/verilog/lexer.o
|
||||
|
|
|
@ -10,11 +10,11 @@ OBJS += passes/techmap/extract.o
|
|||
GENFILES += passes/techmap/stdcells.inc
|
||||
|
||||
passes/techmap/stdcells.inc: techlibs/common/stdcells.v
|
||||
echo "// autogenerated from $<" > $@.new
|
||||
echo "static char stdcells_code[] = {" >> $@.new
|
||||
od -v -td1 -An $< | $(SED) -e 's/[0-9][0-9]*/&,/g' >> $@.new
|
||||
echo "0};" >> $@.new
|
||||
mv $@.new $@
|
||||
$(P) echo "// autogenerated from $<" > $@.new
|
||||
$(Q) echo "static char stdcells_code[] = {" >> $@.new
|
||||
$(Q) od -v -td1 -An $< | $(SED) -e 's/[0-9][0-9]*/&,/g' >> $@.new
|
||||
$(Q) echo "0};" >> $@.new
|
||||
$(Q) mv $@.new $@
|
||||
|
||||
passes/techmap/techmap.o: passes/techmap/stdcells.inc
|
||||
|
||||
|
@ -22,5 +22,5 @@ TARGETS += yosys-filterlib
|
|||
GENFILES += passes/techmap/filterlib.o
|
||||
|
||||
yosys-filterlib: passes/techmap/filterlib.o
|
||||
$(CXX) -o yosys-filterlib $(LDFLAGS) $^ $(LDLIBS)
|
||||
$(P) $(CXX) -o yosys-filterlib $(LDFLAGS) $^ $(LDLIBS)
|
||||
|
||||
|
|
|
@ -2,24 +2,24 @@
|
|||
EXTRA_TARGETS += techlibs/common/blackbox.v
|
||||
|
||||
techlibs/common/blackbox.v: techlibs/common/blackbox.sed techlibs/common/simlib.v techlibs/common/simcells.v
|
||||
cat techlibs/common/simlib.v techlibs/common/simcells.v | $(SED) -rf techlibs/common/blackbox.sed > techlibs/common/blackbox.v.new
|
||||
mv techlibs/common/blackbox.v.new techlibs/common/blackbox.v
|
||||
$(P) cat techlibs/common/simlib.v techlibs/common/simcells.v | $(SED) -rf techlibs/common/blackbox.sed > techlibs/common/blackbox.v.new
|
||||
$(Q) mv techlibs/common/blackbox.v.new techlibs/common/blackbox.v
|
||||
|
||||
EXTRA_TARGETS += share/simlib.v share/simcells.v share/blackbox.v share/pmux2mux.v
|
||||
|
||||
share/simlib.v: techlibs/common/simlib.v
|
||||
mkdir -p share
|
||||
cp techlibs/common/simlib.v share/simlib.v
|
||||
$(P) mkdir -p share
|
||||
$(Q) cp techlibs/common/simlib.v share/simlib.v
|
||||
|
||||
share/simcells.v: techlibs/common/simcells.v
|
||||
mkdir -p share
|
||||
cp techlibs/common/simcells.v share/simcells.v
|
||||
$(P) mkdir -p share
|
||||
$(Q) cp techlibs/common/simcells.v share/simcells.v
|
||||
|
||||
share/blackbox.v: techlibs/common/blackbox.v
|
||||
mkdir -p share
|
||||
cp techlibs/common/blackbox.v share/blackbox.v
|
||||
$(P) mkdir -p share
|
||||
$(Q) cp techlibs/common/blackbox.v share/blackbox.v
|
||||
|
||||
share/pmux2mux.v: techlibs/common/pmux2mux.v
|
||||
mkdir -p share
|
||||
cp techlibs/common/pmux2mux.v share/pmux2mux.v
|
||||
$(P) mkdir -p share
|
||||
$(Q) cp techlibs/common/pmux2mux.v share/pmux2mux.v
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@ OBJS += techlibs/xilinx/synth_xilinx.o
|
|||
EXTRA_TARGETS += share/xilinx/cells.v
|
||||
|
||||
share/xilinx/cells.v: techlibs/xilinx/cells.v
|
||||
mkdir -p share/xilinx
|
||||
cp techlibs/xilinx/cells.v share/xilinx/cells.v
|
||||
$(P) mkdir -p share/xilinx
|
||||
$(Q) cp techlibs/xilinx/cells.v share/xilinx/cells.v
|
||||
|
||||
|
|
Loading…
Reference in New Issue