mirror of https://github.com/openXC7/prjxray.git
commit
da7bf6a078
110
README.md
110
README.md
|
|
@ -42,99 +42,135 @@ shell that is then only used to run Vivado to avoid these problems.
|
||||||
### Step 2: ###
|
### Step 2: ###
|
||||||
Clone the ``prjxray`` repository and its submodules:
|
Clone the ``prjxray`` repository and its submodules:
|
||||||
|
|
||||||
git clone git@github.com:SymbiFlow/prjxray.git
|
```bash
|
||||||
cd prjxray
|
git clone git@github.com:SymbiFlow/prjxray.git
|
||||||
git submodule update --init --recursive
|
cd prjxray
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: ###
|
### Step 3: ###
|
||||||
Install CMake:
|
Install CMake:
|
||||||
|
|
||||||
sudo apt-get install cmake # version 3.5.0 or later required,
|
```bash
|
||||||
# for Ubuntu Trusty pkg is called cmake3
|
sudo apt-get install cmake # version 3.5.0 or later required,
|
||||||
|
# for Ubuntu Trusty pkg is called cmake3
|
||||||
|
```
|
||||||
|
|
||||||
### Step 4: ###
|
### Step 4: ###
|
||||||
Build the C++ tools:
|
Build the C++ tools, in the prjxray root directory run:
|
||||||
|
|
||||||
make build
|
```bash
|
||||||
|
make build
|
||||||
|
```
|
||||||
|
|
||||||
### Step 5: ###
|
### Step 5: ###
|
||||||
Choose one of the following options:
|
Choose one of the following options:
|
||||||
|
|
||||||
(Option 1) - Install the Python environment locally
|
(Option 1) - Install the Python environment locally
|
||||||
|
|
||||||
sudo apt-get install virtualenv python3 python3-pip python3-virtualenv python3-yaml
|
```bash
|
||||||
make env
|
sudo apt-get install virtualenv python3 python3-pip python3-virtualenv python3-yaml
|
||||||
|
make env
|
||||||
|
```
|
||||||
|
|
||||||
(Option 2) - Install the Python environment globally
|
(Option 2) - Install the Python environment globally
|
||||||
|
|
||||||
sudo apt-get install python3 python3-pip python3-yaml
|
```bash
|
||||||
sudo -H pip3 install -r requirements.txt
|
sudo apt-get install python3 python3-pip python3-yaml
|
||||||
|
sudo -H pip3 install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
This step is known to fail with a compiler error while building the `pyjson5`
|
This step is known to fail with a compiler error while building the `pyjson5`
|
||||||
library when using Arch Linux and Fedora. If this occurs, `pyjson5` needs one
|
library when using Arch Linux and Fedora. If this occurs, `pyjson5` needs one
|
||||||
change to build correctly:
|
change to build correctly:
|
||||||
|
|
||||||
git clone https://github.com/Kijewski/pyjson5.git
|
```bash
|
||||||
cd pyjson5
|
git clone https://github.com/Kijewski/pyjson5.git
|
||||||
sed -i 's/char \*PyUnicode/const char \*PyUnicode/' src/_imports.pyx
|
cd pyjson5
|
||||||
sudo make
|
sed -i 's/char \*PyUnicode/const char \*PyUnicode/' src/_imports.pyx
|
||||||
|
sudo make
|
||||||
|
```
|
||||||
|
|
||||||
This might give you an error about `sphinx_autodoc_typehints` but it should
|
This might give you an error about `sphinx_autodoc_typehints` but it should
|
||||||
correctly build and install pyjson5. After this, run either option 1 or 2 again.
|
correctly build and install pyjson5. After this, run either option 1 or 2 again.
|
||||||
|
|
||||||
### Step 6: ###
|
### Step 6: ###
|
||||||
Always make sure to set the environment for the device you are working on before
|
|
||||||
running any other commands:
|
|
||||||
|
|
||||||
source settings/artix7.sh
|
|
||||||
|
|
||||||
### Step 7: ###
|
|
||||||
Prepare the database with static part information, which are needed by the
|
Prepare the database with static part information, which are needed by the
|
||||||
fuzzers, either for all device families
|
fuzzers, either for all device families
|
||||||
|
|
||||||
make db-prepare-parts
|
```bash
|
||||||
|
make db-prepare-parts
|
||||||
|
```
|
||||||
|
|
||||||
or only for a selected one
|
or only for a selected one
|
||||||
|
|
||||||
make db-prepare-artix7
|
```bash
|
||||||
|
make db-prepare-artix7
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 7: ###
|
||||||
|
Always make sure to set the environment for the device you are working on before
|
||||||
|
running any other commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
source settings/artix7.sh
|
||||||
|
```
|
||||||
|
|
||||||
### Step 8: ###
|
### Step 8: ###
|
||||||
|
|
||||||
(Option 1, recommended) - Download a current stable version (you can use the
|
(Option 1, recommended) - Download a current stable version (you can use the
|
||||||
Python API with a pre-generated database)
|
Python API with a pre-generated database)
|
||||||
|
|
||||||
./download-latest-db.sh
|
```bash
|
||||||
|
./download-latest-db.sh
|
||||||
|
```
|
||||||
|
|
||||||
(Option 2) - (Re-)create the entire database (this will take a very long time!)
|
(Option 2) - (Re-)create the entire database (this will take a very long time!)
|
||||||
|
|
||||||
cd fuzzers
|
```bash
|
||||||
make -j$(nproc)
|
cd fuzzers
|
||||||
|
make -j$(nproc)
|
||||||
|
```
|
||||||
|
|
||||||
### Step 9: ###
|
### Step 9: ###
|
||||||
Pick a fuzzer (or write your own) and run:
|
Pick a fuzzer (or write your own), from the ``prjxray`` root dir, run:
|
||||||
|
|
||||||
cd fuzzers/010-clb-lutinit
|
```bash
|
||||||
make -j$(nproc) run
|
cd fuzzers/010-clb-lutinit
|
||||||
|
make -j$(nproc) run
|
||||||
|
```
|
||||||
|
|
||||||
### Step 10: ###
|
### Step 10: ###
|
||||||
Create HTML documentation:
|
Create HTML documentation, from the ``prjxray`` root dir, run:
|
||||||
|
|
||||||
cd htmlgen
|
```
|
||||||
python3 htmlgen.py
|
cd htmlgen
|
||||||
|
python3 htmlgen.py
|
||||||
|
```
|
||||||
|
|
||||||
# C++ Development
|
# C++ Development
|
||||||
|
|
||||||
Tests are not built by default. Setting the PRJXRAY\_BUILD\_TESTING option to
|
Tests are not built by default. Setting the PRJXRAY\_BUILD\_TESTING option to
|
||||||
ON when running cmake will include them:
|
ON when running cmake will include them. From the ``prjxray`` root dir, run:
|
||||||
|
|
||||||
cmake -DPRJXRAY_BUILD_TESTING=ON ..
|
```bash
|
||||||
make
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake -DPRJXRAY_BUILD_TESTING=ON ..
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
The default C++ build configuration is for releases (optimizations enabled, no
|
The default C++ build configuration is for releases (optimizations enabled, no
|
||||||
debug info). A build configuration for debugging (no optimizations, debug info)
|
debug info). A build configuration for debugging (no optimizations, debug info)
|
||||||
can be chosen via the CMAKE\_BUILD\_TYPE option:
|
can be chosen via the CMAKE\_BUILD\_TYPE option. From the ``prjxray`` root dir, run:
|
||||||
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
```bash
|
||||||
make
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=ON ..
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
The options to build tests and use a debug build configuration are independent
|
The options to build tests and use a debug build configuration are independent
|
||||||
to allow testing that optimizations do not cause bugs. The build configuration
|
to allow testing that optimizations do not cause bugs. The build configuration
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue