aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-23 21:23:34 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-23 21:23:34 +0200
commit49725db159c752ef616715210c2ee7bf37187d33 (patch)
tree628b6da4d775cb32b01de6d8a49490460b2ce89a
parent3aa18af227eee3ee056b853b72dfcaa860f723fb (diff)
downloadghdl-yosys-plugin-49725db159c752ef616715210c2ee7bf37187d33.tar.gz
ghdl-yosys-plugin-49725db159c752ef616715210c2ee7bf37187d33.tar.bz2
ghdl-yosys-plugin-49725db159c752ef616715210c2ee7bf37187d33.zip
Re-add instructions to make a static build.
-rw-r--r--README.md18
-rw-r--r--yosys.diff27
2 files changed, 45 insertions, 0 deletions
diff --git a/README.md b/README.md
index e0cbcc0..8a1d5b5 100644
--- a/README.md
+++ b/README.md
@@ -106,3 +106,21 @@ iceprog leds.bin
```
> NOTE: on GNU/Linux, it should be possible to use `iceprog` through `ghdl/synth:icestorm`. On Windows and macOS, accessing USB/COM ports of the host from containers seems not to be supported yet. Therefore, `iceprog` is required to be available on the host.
+
+## Build as part of yosys (not recommended)
+
+- Get and build ghdl as in the previous section.
+
+- Get [yosys](https://github.com/YosysHQ/yosys) sources.
+
+- Get ghdl-yosys-plugin and:
+ - Patch yosys sources using `yosys.diff`.
+ - Copy `src/*` to `yosys/frontends/ghdl`.
+ - Configure yosys by adding (to) `Makefile.conf`:
+
+```makefile
+ENABLE_GHDL := 1
+GHDL_DIR := <ghdl install dir>
+```
+
+- Build and install yosys.
diff --git a/yosys.diff b/yosys.diff
new file mode 100644
index 0000000..3e3ecc3
--- /dev/null
+++ b/yosys.diff
@@ -0,0 +1,27 @@
+diff --git a/Makefile b/Makefile
+index b3cfd71..ea45121 100644
+--- a/Makefile
++++ b/Makefile
+@@ -13,6 +13,7 @@ ENABLE_TCL := 1
+ ENABLE_ABC := 1
+ ENABLE_GLOB := 1
+ ENABLE_PLUGINS := 1
++ENABLE_GHDL := 0
+ ENABLE_READLINE := 1
+ ENABLE_EDITLINE := 0
+ ENABLE_VERIFIC := 0
+@@ -487,6 +489,14 @@ ifeq ($(ENABLE_PROTOBUF),1)
+ LDLIBS += $(shell pkg-config --cflags --libs protobuf)
+ endif
+
++ifeq ($(ENABLE_GHDL),1)
++GHDL_DIR ?= /usr/local/ghdl
++GHDL_INCLUDE_DIR ?= $(GHDL_DIR)/include
++GHDL_LIB_DIR ?= $(GHDL_DIR)/lib
++CXXFLAGS += -I$(GHDL_INCLUDE_DIR) -DYOSYS_ENABLE_GHDL
++LDLIBS += $(GHDL_LIB_DIR)/libghdl.a $(shell cat $(GHDL_LIB_DIR)/libghdl.link)
++endif
++
+ ifeq ($(ENABLE_COVER),1)
+ CXXFLAGS += -DYOSYS_ENABLE_COVER
+ endif