From: R Veera Kumar Date: Mon, 24 May 2021 08:22:12 +0000 (+0530) Subject: Add pages for GHDL setup and use. X-Git-Tag: DRAFT_SVP64_0_1~881 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0035578bd889c4e10c827a8cc329f170848e5c6;p=libreriscv.git Add pages for GHDL setup and use. --- diff --git a/HDL_workflow.mdwn b/HDL_workflow.mdwn index 92928bfdf..d3b2a5b72 100644 --- a/HDL_workflow.mdwn +++ b/HDL_workflow.mdwn @@ -546,6 +546,18 @@ Advise use only v4.106 at the moment. See [[HDL_workflow/verilator]] page for installation instructions. +## GHDL + +GHDL is a shorthand for G Hardware Design Language. It is a VHDL analyzer, compiler, simulator and (experimental) synthesizer that can process (nearly) any VHDL design. + +VHDL is an acronym for Very High Speed Integrated Circuit (VHSIC) Hardware Description Language (HDL), which is a programming language used to describe a logic circuit by function, data flow behavior, or structure. + +Unlike some other simulators, GHDL is a compiler: it directly translates a VHDL file to machine code, without using an intermediary language such as C or C++. Therefore, the compiled code should be faster and the analysis time should be shorter than with a compiler using an intermediary language. + +GHDL aims at implementing VHDL as defined by IEEE 1076. It supports the 1987, 1993 and 2002 revisions and, partially, 2008. PSL is also partially supported. + +See [[HDL_workflow/ghdl]] page for installation instructions. + # Registering for git repository access After going through the onboarding process and having agreed to take diff --git a/HDL_workflow/ghdl.mdwn b/HDL_workflow/ghdl.mdwn new file mode 100644 index 000000000..f95f7aae6 --- /dev/null +++ b/HDL_workflow/ghdl.mdwn @@ -0,0 +1,63 @@ +# Installation instructions for GHDL + +## Setting up new debootstrap and chroot into it + +Run the following if you wish to isolate the ghdl build +from other software (reproducible builds) or use the schroot +auto-preparation script here: + + + export MY_CHROOT=/stable-chroot + mkdir $MY_CHROOT + debootstrap stable $MY_CHROOT http://deb.debian.org/debian/ + mount -t proc proc $MY_CHROOT/proc + mount -t sysfs sysfs $MY_CHROOT/sys + mount -t devpts devpts $MY_CHROOT/dev/pts/ + chroot $MY_CHROOT /bin/bash + +## Steps to compile GHDL + +### Necessary software to install + + apt-get install git gnat gcc make g++ file texinfo zlib1g-dev + + git clone https://github.com/ghdl/ghdl.git + wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz + wget https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz + wget https://www.mpfr.org/mpfr-4.1.0/mpfr-4.1.0.tar.xz + wget https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 + wget https://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.xz + +### Build GHDL + + tar -xf gcc-10.3.0.tar.xz + cd gcc-10.3.0 + tar -xf ../gmp-6.2.1.tar.xz + mv gmp-6.2.1 gmp + tar -xf ../mpc-1.2.1.tar.gz + mv mpc-1.2.1 mpc + tar -xf ../mpfr-4.1.0.tar.xz + mv mpfr-4.1.0 mpfr + tar -xf ../isl-0.18.tar.bz2 + mv isl-0.18 isl + cd .. + + cd ghdl + git checkout v1.0.0 + mkdir build + cd build + ../configure --with-gcc=../../gcc-10.3.0 --prefix=/usr/local/ghdl + make copy-sources + mkdir gcc-objs; cd gcc-objs + ../../../gcc-10.3.0/configure --prefix=/usr/local/ghdl \ + --enable-languages=c,vhdl --disable-bootstrap --disable-lto \ + --disable-multilib --disable-libssp --disable-libgomp \ + --disable-libquadmath --enable-default-pie + make -j$(nproc) + make install + cd .. + make ghdllib + make install + +Please adjust the install paths for ghdl. +