mirror of https://github.com/YosysHQ/yosys.git
Merge branch 'master' of https://github.com/stv0g/yosys into stv0g-master
This commit is contained in:
commit
a88e019b0c
49
Makefile
49
Makefile
|
@ -57,20 +57,36 @@ CXXFLAGS += -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -D_YOSYS_ -fPIC -I$(PRE
|
||||||
LDFLAGS += -L$(LIBDIR)
|
LDFLAGS += -L$(LIBDIR)
|
||||||
LDLIBS = -lstdc++ -lm
|
LDLIBS = -lstdc++ -lm
|
||||||
|
|
||||||
PKG_CONFIG = pkg-config
|
PKG_CONFIG ?= pkg-config
|
||||||
SED = sed
|
SED ?= sed
|
||||||
BISON = bison
|
BISON ?= bison
|
||||||
|
|
||||||
ifeq (Darwin,$(findstring Darwin,$(shell uname)))
|
ifeq (Darwin,$(findstring Darwin,$(shell uname)))
|
||||||
# add macports/homebrew include and library path to search directories, don't use '-rdynamic' and '-lrt':
|
|
||||||
CXXFLAGS += -I/opt/local/include -I/usr/local/opt/readline/include
|
# homebrew search paths
|
||||||
LDFLAGS += -L/opt/local/lib -L/usr/local/opt/readline/lib
|
ifneq ($(shell which brew),)
|
||||||
# add homebrew's libffi include and library path
|
BREW_PREFIX := $(shell brew --prefix)/opt
|
||||||
CXXFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --cflags libffi)
|
|
||||||
LDFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --libs libffi)
|
CXXFLAGS += -I$(BREW_PREFIX)/readline/include
|
||||||
# use bison installed by homebrew if available
|
LDFLAGS += -L$(BREW_PREFIX)/readline/lib
|
||||||
BISON = $(shell (brew list bison | grep -m1 "bin/bison") || echo bison)
|
|
||||||
SED = sed
|
PKG_CONFIG_PATH := $(BREW_PREFIX)/libffi/lib/pkgconfig:$(PKG_CONFIG_PATH)
|
||||||
|
PKG_CONFIG_PATH := $(BREW_PREFIX)/tcl-tk/lib/pkgconfig:$(PKG_CONFIG_PATH)
|
||||||
|
|
||||||
|
export PATH := $(BREW_PREFIX)/bison/bin:$(BREW_PREFIX)/gettext/bin:$(BREW_PREFIX)/flex/bin:$(PATH)
|
||||||
|
|
||||||
|
# macports search paths
|
||||||
|
else ifneq ($(shell which port),)
|
||||||
|
PORT_PREFIX := $(patsubst %/bin/port,%,$(shell which port))
|
||||||
|
|
||||||
|
CXXFLAGS += -I$(PORT_PREFIX)/include
|
||||||
|
LDFLAGS += -L$(PORT_PREFIX)/lib
|
||||||
|
|
||||||
|
PKG_CONFIG_PATH := $(PORT_PREFIX)/lib/pkgconfig:$(PKG_CONFIG_PATH)
|
||||||
|
|
||||||
|
export PATH := $(PORT_PREFIX)/bin:$(PATH)
|
||||||
|
endif
|
||||||
|
|
||||||
else
|
else
|
||||||
LDFLAGS += -rdynamic
|
LDFLAGS += -rdynamic
|
||||||
LDLIBS += -lrt
|
LDLIBS += -lrt
|
||||||
|
@ -210,15 +226,16 @@ endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ENABLE_PLUGINS),1)
|
ifeq ($(ENABLE_PLUGINS),1)
|
||||||
CXXFLAGS += -DYOSYS_ENABLE_PLUGINS $(shell $(PKG_CONFIG) --silence-errors --cflags libffi)
|
CXXFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --cflags libffi) -DYOSYS_ENABLE_PLUGINS
|
||||||
LDLIBS += $(shell $(PKG_CONFIG) --silence-errors --libs libffi || echo -lffi) -ldl
|
LDLIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs libffi || echo -lffi) -ldl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ENABLE_TCL),1)
|
ifeq ($(ENABLE_TCL),1)
|
||||||
TCL_VERSION ?= tcl$(shell bash -c "tclsh <(echo 'puts [info tclversion]')")
|
TCL_VERSION ?= tcl$(shell bash -c "tclsh <(echo 'puts [info tclversion]')")
|
||||||
TCL_INCLUDE ?= /usr/include/$(TCL_VERSION)
|
TCL_INCLUDE ?= /usr/include/$(TCL_VERSION)
|
||||||
CXXFLAGS += -I$(TCL_INCLUDE) -DYOSYS_ENABLE_TCL
|
|
||||||
LDLIBS += -l$(TCL_VERSION)
|
CXXFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --cflags tcl || echo -I$(TCL_INCLUDE)) -DYOSYS_ENABLE_TCL
|
||||||
|
LDLIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs tcl || echo -l$(TCL_VERSION))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ENABLE_GPROF),1)
|
ifeq ($(ENABLE_GPROF),1)
|
||||||
|
|
16
README.md
16
README.md
|
@ -40,14 +40,14 @@ Web Site
|
||||||
More information and documentation can be found on the Yosys web site:
|
More information and documentation can be found on the Yosys web site:
|
||||||
http://www.clifford.at/yosys/
|
http://www.clifford.at/yosys/
|
||||||
|
|
||||||
|
Setup
|
||||||
Getting Started
|
======
|
||||||
===============
|
|
||||||
|
|
||||||
You need a C++ compiler with C++11 support (up-to-date CLANG or GCC is
|
You need a C++ compiler with C++11 support (up-to-date CLANG or GCC is
|
||||||
recommended) and some standard tools such as GNU Flex, GNU Bison, and GNU Make.
|
recommended) and some standard tools such as GNU Flex, GNU Bison, and GNU Make.
|
||||||
TCL, readline and libffi are optional (see ``ENABLE_*`` settings in Makefile).
|
TCL, readline and libffi are optional (see ``ENABLE_*`` settings in Makefile).
|
||||||
Xdot (graphviz) is used by the ``show`` command in yosys to display schematics.
|
Xdot (graphviz) is used by the ``show`` command in yosys to display schematics.
|
||||||
|
|
||||||
For example on Ubuntu Linux 16.04 LTS the following commands will install all
|
For example on Ubuntu Linux 16.04 LTS the following commands will install all
|
||||||
prerequisites for building yosys:
|
prerequisites for building yosys:
|
||||||
|
|
||||||
|
@ -55,6 +55,13 @@ prerequisites for building yosys:
|
||||||
libreadline-dev gawk tcl-dev libffi-dev git mercurial \
|
libreadline-dev gawk tcl-dev libffi-dev git mercurial \
|
||||||
graphviz xdot pkg-config python3
|
graphviz xdot pkg-config python3
|
||||||
|
|
||||||
|
Similarily, on Mac OS X MacPorts or Homebrew can be used to install dependencies:
|
||||||
|
|
||||||
|
$ brew install bison flex gawk libffi \
|
||||||
|
git mercurial graphviz pkg-config python3
|
||||||
|
$ sudo port install bison flex readline gawk libffi \
|
||||||
|
git mercurial graphviz pkgconfig python36
|
||||||
|
|
||||||
There are also pre-compiled Yosys binary packages for Ubuntu and Win32 as well
|
There are also pre-compiled Yosys binary packages for Ubuntu and Win32 as well
|
||||||
as a source distribution for Visual Studio. Visit the Yosys download page for
|
as a source distribution for Visual Studio. Visit the Yosys download page for
|
||||||
more information: http://www.clifford.at/yosys/download.html
|
more information: http://www.clifford.at/yosys/download.html
|
||||||
|
@ -80,6 +87,9 @@ To build Yosys simply type 'make' in this directory.
|
||||||
Note that this also downloads, builds and installs ABC (using yosys-abc
|
Note that this also downloads, builds and installs ABC (using yosys-abc
|
||||||
as executable name).
|
as executable name).
|
||||||
|
|
||||||
|
Getting Started
|
||||||
|
===============
|
||||||
|
|
||||||
Yosys can be used with the interactive command shell, with
|
Yosys can be used with the interactive command shell, with
|
||||||
synthesis scripts or with command line arguments. Let's perform
|
synthesis scripts or with command line arguments. Let's perform
|
||||||
a simple synthesis job using the interactive command shell:
|
a simple synthesis job using the interactive command shell:
|
||||||
|
|
Loading…
Reference in New Issue