Giter VIP home page Giter VIP logo

ibex-yosys-build's Introduction

ibex-yosys-build

Build Status This repository contains scripts to synthesize and build Ibex CPU for Arty A7 (A35T) board using SymbiFlow toolchain.

Getting started

Clone repository

git clone --recursive https://github.com/antmicro/ibex-yosys-build

Install Prerequisites

This repository requires SymbiFlow toolchain and Lowrisc RISCV toolchain Install SymbiFlow toolchain using:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
export INSTALL_DIR="/opt/symbiflow/xc7"
bash conda_installer.sh -b -p $INSTALL_DIR/conda && rm conda_installer.sh
source "$INSTALL_DIR/conda/etc/profile.d/conda.sh"
conda env create -f examples/xc7/environment.yml
conda activate xc7
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/27/20200630-100111/symbiflow-arch-defs-install-30f7325f.tar.xz | tar -xJ -C $INSTALL_DIR
export PATH="$INSTALL_DIR/install/bin:$PATH"

download Lowrisc RISCV toolchain using (you can change the installation directory using -t flag):

wget https://raw.githubusercontent.com/lowRISC/opentitan/master/util/get-toolchain.py
python3 get-toolchain.py -t ${PWD}/tools/riscv
export PATH=$PATH:${PWD}/tools/riscv/bin

Preparing tools

To prepare environment, apply ibex.patch, download ibex requirements and prepare ibex for Arty A7 to build with yosys:

cd ibex
git apply ../ibex.patch
pip install -r python-requirements.txt
make sw-led
fusesoc --cores-root=. run --target=synth --setup lowrisc:ibex:top_artya7 --part xc7a35ticsg324-1L
cd ..
make ibex/configure
make patch/symbiflow

Build yosys, symbiflow yosys plugins and install it in conda environment:

cd yosys && make -j$(nproc) && PREFIX=$INSTALL_DIR/conda/envs/xc7 make install && cd ..
cd yosys-symbiflow-plugins && make -j$(nproc) install && cd ..

Generating bitstream

To generate bitstream run:

make

ibex-yosys-build's People

Contributors

acomodi avatar ax3ghazy avatar dependabot-preview[bot] avatar joannabrozek avatar kamilrakoczy avatar kgugala avatar mithro avatar tgorochowik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ibex-yosys-build's Issues

Yosys complaining about a syntax error at the data type token in parameter statements

Hello,

I have followed the instructions on the main README, and running make in the conda environment fails at synthesis due to yosys flagging things like parameter <data_type> name as syntax errors:

1. Executing Verilog-2005 frontend: /home/ag/ibex-yosys-build/ibex/build/lowrisc_ibex_top_artya7_0.1/src/lowrisc_ibex_ibex_pkg_0.1/rtl/ibex_pkg.sv
Parsing SystemVerilog input from `/home/ag/ibex-yosys-build/ibex/build/lowrisc_ibex_top_artya7_0.1/src/lowrisc_ibex_ibex_pkg_0.1/rtl/ibex_pkg.sv' to AST representation.
/home/ag/ibex-yosys-build/ibex/build/lowrisc_ibex_top_artya7_0.1/src/lowrisc_ibex_ibex_pkg_0.1/rtl/ibex_pkg.sv:290: ERROR: syntax error, unexpected TOK_INT
make: *** [Makefile:46: build/top_artya7.eblif] Error 1

which refers to this line:

parameter int unsigned PMP_MAX_REGIONS      = 16;

Here's the yosys version (the submodule included in this repo):

Yosys 0.9+2406 (git sha1 d8b2d1a2, x86_64-conda_cos6-linux-gnu-gcc 1.23.0.449-a04d0 -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -fdebug-prefix-map=/tmp/really-really-really-really-really-really-really-really-really-really-really-really-really-long-path/conda/conda-bld/symbiflow-yosys_1594678149043/work=/usr/local/src/conda/symbiflow-yosys-0.8_6021_gd8b2d1a2 -fdebug-prefix-map=/opt/symbiflow/xc7/conda/envs/xc7=/usr/local/src/conda-prefix -fPIC -Os -fno-merge-constants)

Yosys commit hash: fe58e937ef87fdb157dd89c365bb6a570fe616ea

Ibex commit hash: 6b9165fa66b49534226acfcb739f2c252be4853c

Thanks.

Build currently broken due to pip / conda issue.

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Installing pip dependencies: ...working... Pip subprocess error:
ERROR: Exception:
Traceback (most recent call last):
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
    return func(self, options, args)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 286, in run
    reqs = self.get_requirements(args, options, finder, session)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 384, in get_requirements
    for parsed_req in parse_requirements(
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/req/req_file.py", line 135, in parse_requirements
    for parsed_line in parser.parse(filename, constraint):
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/req/req_file.py", line 319, in parse
    yield from self._parse_and_recurse(filename, constraint)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/req/req_file.py", line 348, in _parse_and_recurse
    yield from self._parse_and_recurse(req_path, nested_constraint)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/req/req_file.py", line 324, in _parse_and_recurse
    for line in self._parse_file(filename, constraint):
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/req/req_file.py", line 353, in _parse_file
    _, content = get_file_content(filename, self._session)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/req/req_file.py", line 518, in get_file_content
    resp = session.get(url)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_internal/network/session.py", line 454, in request
    return super().request(method, url, *args, **kwargs)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py", line 697, in send
    r.content
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_vendor/requests/models.py", line 836, in content
    self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
  File "/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/lib/python3.8/site-packages/pip/_vendor/requests/models.py", line 769, in generate
    chunk = self.raw.read(chunk_size)
AttributeError: 'FileNotFoundError' object has no attribute 'read'

Ran pip subprocess with arguments:
['/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/bin/python', '-m', 'pip', 'install', '-U', '-r', '/tmpfs/src/github/ibex-yosys-build/condaenv.o2j6_bfy.requirements.txt']
Pip subprocess output:

failed

CondaEnvException: Pip failed

third_party/make-env/conda.mk:145: recipe for target '/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/bin/python' failed
make: *** [/tmpfs/src/github/ibex-yosys-build/env/conda/envs/xc7/bin/python] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.