Verilog/VHDL simulations with Xilinx ISE Simulator (ISim)

Contents
  • Introduction
  • Documentation
  • Tutorials

Introduction

Documentation

UNIX environment setup

linux% source /opt/edatools/xilinx/ISE14.6/settings.csh

or write your own setup script by including:

# ISE installation directory
setenv ISE_DIR /opt/edatools/xilinx/ISE14.6/ISE
setenv XILINX $ISE_DIR

# add Xilinx executables to search path
set path = ( $ISE_DIR/bin/lin $ISE_DIR/sysgen/util $path )

Library mapping file

Example:

-- user libraries
work = ./libraries/worklib
vhdl_lib = ./libraries/vhdl_lib

-- STD and IEEE libraries
std = /opt/edatools/xilinx/ISE14.6/ISE/vhdl/hdp/lin/std
ieee = /opt/edatools/xilinx/ISE14.6/ISE/vhdl/hdp/lin/ieee

Note that by delfault a xilinxisim.ini library mapping file is searched and loaded from

  • $XILINX/vhdl/hdp/lin/xilinxisim.ini
  • ./xilinxisim.ini

It is recommended to use the -initfile flag with vlogcomp/vhpcomp compilers or fuse elaborator and linker indeed.

Makefile

# HDL sources (project file)
SOURCES = design.prj

# top-level design unit (testbench)
TOP = tb_design

# local library mapping file
LIBFILE = libs.ini

# compiler/elaborator
CC = fuse

# output simulation executable
SIMEXE = $(TOP).exe

# output waveform database
WDB = ./results/wdb/$(TOP).wdb

# Tcl run script
TCLBATCH = ./scripts/run.tcl

# compiler/elaborator options (use fuse -help for more details)
CCFLAGS = -initfile $(LIBFILE) \
          -incremental \
          -verbose 0 \
          -prj $(SOURCES) \
          -out $(SIMEXE)

# simulation executable options
SIMFLAGS = -gui \
           -wdb $(WDB) \
           -tclbatch $(TCLBATCH)

# useful command alias
RM = rm -f
RMDIR = rm -rf

# default target
all: compile

# compile and elaborate sources with fuse
compile:
    	$(CC) $(CCFLAGS) $(TOP)

# execute the simulation executable and run the simulation
sim:
    	./$(SIMEXE) $(SIMFLAGS) &

# delete log files, backup files etc.
clean:
        @find ./ -name '*~' -exec $(RM) {} \;
      	@$(RM) fuse.log fuse.xmsgs fuseRelaunch.cmd isim.log
        @$(RM) $(WDB)
        @$(RM) $(SIMEXE)
        @$(RMDIR) isim/


A simple ./scripts/run.tcl example:

# trace all top-level signals
wave add /

# run the simulation
run all

# show simulation time
show time


See also for example:
https://gist.github.com/gvillalta99/11436605

Tutorials



Last update: Luca Pacher - Oct 24, 2013