From d8c2a6861befc3789ec9f4b87f30c3e8618d89bd Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 27 Jan 2022 16:42:31 +0800 Subject: [PATCH] refine Readme for demo --- demo/Readme.md | 35 +++++++++++++++++++++++++++++++++++ demo/helloworld/Makefile | 4 ++-- demo/jtag/Readmd.md | 18 ++++++++++++++++++ demo/jtag/readmd.md | 27 --------------------------- 4 files changed, 55 insertions(+), 29 deletions(-) create mode 100644 demo/Readme.md create mode 100644 demo/jtag/Readmd.md delete mode 100644 demo/jtag/readmd.md diff --git a/demo/Readme.md b/demo/Readme.md new file mode 100644 index 0000000..514d2d8 --- /dev/null +++ b/demo/Readme.md @@ -0,0 +1,35 @@ +# Demo + +## helloworld + +This a demo for llvm build and sim with verilator. + +## jtag + +This is a demo of jtag simulation by openocd running on verilator. + +## install openocd + +```shell +git clone https://github.com/riscv/riscv-openocd.git +cd riscv-openocd +./bootstrap +./configure --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --enable-ftdi --enable-jlink +make +sudo make install +``` + +## build and install riscv tools + +* Opetion1 :https://github.com/riscv-collab/riscv-gnu-toolchain.git +* Opetion2 : + +```bash +sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev libfl-dev +git clone https://github.com/chipsalliance/rocket-tools.git +git submodule update --init --recursive +sudo su +export RISCV=/opt/riscv +export MAKEFLAGS="-j12" +./build-rv32ima.sh +``` \ No newline at end of file diff --git a/demo/helloworld/Makefile b/demo/helloworld/Makefile index 82b6d1f..39622d5 100644 --- a/demo/helloworld/Makefile +++ b/demo/helloworld/Makefile @@ -1,6 +1,6 @@ export RV_ROOT = ${PWD}/../.. LLVMINSTALL = /home/colin/develop/llvm-build/install -GCC_PREFIX = /opt/riscv/bin/riscv64-unknown-elf +GCC_PREFIX = /opt/riscv/bin/riscv32-unknown-elf DEMODIR = ${PWD} BUILD_DIR = ${DEMODIR}/build @@ -69,4 +69,4 @@ build: $(TEST).out help: @echo Possible targets: verilator help clean all verilator-build program.hex -.PHONY: help clean verilator \ No newline at end of file +.PHONY: help clean verilator diff --git a/demo/jtag/Readmd.md b/demo/jtag/Readmd.md new file mode 100644 index 0000000..2b06cdd --- /dev/null +++ b/demo/jtag/Readmd.md @@ -0,0 +1,18 @@ +# jtag simulation + + +## start openocd + +`openocd -d -f swerv.cfg` + +## start gdb + +`/opt/riscv/bin/riscv32-unknown-elf-gdb -ex "target extended-remote :3333"` + +## quick start + +At demo/jtag/ + +1. `make all` +2. `make openocd` +3. `make gdb` \ No newline at end of file diff --git a/demo/jtag/readmd.md b/demo/jtag/readmd.md deleted file mode 100644 index 4df3495..0000000 --- a/demo/jtag/readmd.md +++ /dev/null @@ -1,27 +0,0 @@ -# jtag simulation - -## install openocd - -```shell -git clone https://github.com/riscv/riscv-openocd.git -cd riscv-openocd -./bootstrap -./configure --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --enable-ftdi --enable-jlink -make -sudo make install -``` -## start openocd - -`openocd -d -f swerv.cfg` - -## start gdb - -`/opt/riscv/bin/riscv32-unknown-elf-gdb -ex "target extended-remote :3333"` - -## quick start - -At demo/jtag/ - -1. `make all` -2. `make openocd` -3. `make gdb` \ No newline at end of file