SystemC Verification Environment in Windows using WSL

in #coding6 years ago (edited)

Turn on WSL feature in windows features

  1. type 'windows features' in windows start.
    image.png
  2. Now reboot the system.
  3. Download Ubuntu wsl from 'Microsoft store' in ur PC

image.png

Necessary softwares

sudo apt-get install git make autoconf g++ flex bison # try gcc in place of g++ if fail
sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
sudo apt-get install libfl-dev

Installing SystemC in your Linux environment

  1. Download SystemC. https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.zip
  2. Extract at a convinient location and follow the instruction found inside from the file 'INSTALL'
  3. open linux shell from this folder by SHIFT+'right mouse click'

image.png
4.or convert ur systemc path to wsl path. for ex:
if ur path is C:\Users\user\Documents\sv\systemc-2.3.3
then do

cd /mnt/c/Users/user/Documents/sv/systemc-2.3.3 
  1. Follow 'basic systemc installation' instructions numbered 1,2,3.
  2. In 4 & 5 & 6 , do
export CXX=g++
../configure
make
make check # check for errors & debug accordingly
make install

Finished installing SystemC
Now edit bashrc file to permanantly add Systemc to environment

vi ~/.bashrc

in it, add at the end

export SYSTEMC_HOME=/your/path/to/systemc-2.3.2
export SYSTEMC_INCLUDE=$SYSTEMC_HOME/include
export SYSTEMC_LIBDIR=$SYSTEMC_HOME/lib-linux64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/path/to/systemc-2.3.2/lib-linux64

Installing Verilator in your Linux environment

  1. open https://www.veripool.org/projects/verilator/wiki/Installing
  2. now follow the instructions numbered:
  • 3.2 with 3.2.1 and 3.2.2
  • 3.3 and 3.4
  • 3.5.1
  • 3.7, and 3.8
  • don't do 3.9

Notes

Better have a separate folder for sysC and verilator, because we might need install additional libraries later on like SCV. Its convinient to have them in one location
Take care of the environment variables in linux before installing sysC and verilator