whitespace (indentation)
[libreriscv.git] / HDL_workflow / nextpnr-xilinx.mdwn
index eb3f7af63fce36369f68723d6e43c3ef6a4c289b..fbe86a6bcc91f1d320d95a1b052c5ec7d5ef1a54 100644 (file)
@@ -1,7 +1,5 @@
 # nextpnr-xilinx
 
-**Page under development**
-
 Installation instructions for Nextpnr-xilinx with Digilent Arty A7-100t
 with Xilinx Artix7 100T
 
@@ -9,11 +7,9 @@ Use of the automated install scripts recommended
 
 * Source code: <https://github.com/gatecat/nextpnr-xilinx>
 * Bugzilla page <https://bugs.libre-soc.org/show_bug.cgi?id=790>
-* Auto-install script: <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=nextpnr-xilinx;hb=HEAD>
+* Auto-install script: <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=nextpnr-xilinx-install;hb=HEAD>
 * Prerequisites: yosys <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=hdl-tools-yosys;hb=HEAD>
 
-
-
 # Setting up new debootstrap and chroot into it
 
 Run the following if you wish to isolate the nextpnr-xilinx build
@@ -41,7 +37,10 @@ auto-preparation script here:
 
 ## Necessary software to install
 
-apt-get install -y python3-pip
+    apt-get install -y build-essential make cmake python3 python3-dev \
+     python3-setuptools python3-numpy cython3 python3-pip
+
+    pip3 install textx fasm
 
 ## Build prjxray
 
@@ -49,16 +48,18 @@ apt-get install -y python3-pip
     git checkout 18b92012afe2b03f3f975a78c4372c74b60dca0c
     git submodule update --init --recursive
     mkdir build; cd build
-    cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nx ..
+    cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-xilinx ..
     make -j$(nproc)
     make install
-    install -d -m 0755 /usr/local/nx/build/tools
+    install -d -m 0755 /usr/local/nextpnr-xilinx/build/tools
     install -m 0755 tools/{bitread,bittool,frame_address_decoder,gen_part_base_yaml,segmatch,xc7frames2bit,xc7patch} \
-     /usr/local/nx/build/tools
+     /usr/local/nextpnr-xilinx/build/tools
     cd ..
-    cp -dpr utils /usr/local/nx
-    sed -i -e '/^# Vivado /,$d' /usr/local/nx/utils/environment.sh
-    pip3 install .
+    cp -dpr utils /usr/local/nextpnr-xilinx
+    sed -i -e '/^# Vivado /,$d' \
+     /usr/local/nextpnr-xilinx/utils/environment.sh
+    python3 setup.py develop
+    export PATH=/usr/local/nextpnr-xilinx/bin:$PATH
     cd ..
 
 # Steps to compile prjxray-db
@@ -68,7 +69,7 @@ apt-get install -y python3-pip
     cd prjxray-db
     git archive --format=tar --prefix=database/ \
       0a0addedd73e7e4139d52a6d8db4258763e0f1f3 | \
-      tar -C /usr/local/nx -xf -
+      tar -C /usr/local/nextpnr-xilinx -xf -
     cd ..
 
 # Steps to compile nextpnr-xilinx
@@ -76,21 +77,23 @@ apt-get install -y python3-pip
 ## Necessary software to install
 
     apt-get install -y libboost-thread-dev libboost-iostreams-dev \
-     libboost-program-options-dev libeigen3-dev
+     libboost-program-options-dev libeigen3-dev libboost-python-dev \
+     libboost-filesystem-dev
 
 ## Build nextpnr-xilinx
 
     cd nextpnr-xilinx
     git checkout 565588a69ea95a52f7c7592f4ed81d9bef6cfb60
-    cmake -DARCH=xilinx -DBUILD_GUI=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/nx .
+    cmake -DARCH=xilinx -DBUILD_GUI=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-xilinx .
     make -j$(nproc)
     make install
     python3 xilinx/python/bbaexport.py --device xc7a100tcsg324-1 \
      --bba xilinx/xc7a100t.bba
     ./bbasm --l xilinx/xc7a100t.bba xilinx/xc7a100t.bin
-    install -d -m 0755 /usr/local/nx/share/xilinx
-    install -m 0755 xilinx/xc7a100t.bin /usr/local/nx/share/xilinx
-    export XRAY_DIR=/usr/local/nx
+    install -d -m 0755 /usr/local/nextpnr-xilinx/share/xilinx
+    install -m 0755 xilinx/xc7a100t.bin \
+     /usr/local/nextpnr-xilinx/share/xilinx
+    export XRAY_DIR=/usr/local/nextpnr-xilinx
 
     # build attosoc example; it should build attosoc.bit as final bitstream
 
@@ -99,7 +102,7 @@ apt-get install -y python3-pip
     cd arty-a100
     sed -i -e 's@xc7a35tcsg324-1@xc7a100tcsg324-1@g' \
      -e 's@../../../nextpnr-xilinx@nextpnr-xilinx@g' \
-     -e 's@../../xc7a35t.bin@/usr/local/nx/share/xilinx/xc7a100t.bin@g' \
+     -e 's@../../xc7a35t.bin@/usr/local/nextpnr-xilinx/share/xilinx/xc7a100t.bin@g' \
      attosoc.sh
     ./attosoc.sh