New Horizons

Welcome to my blog

My name is Sven Andersson and I
work as a consultant in embedded
system design, implemented in ASIC
and FPGA.
In my spare time I write this blog
and I hope it will inspire others to
learn more about this fantastic field.
I live in Stockholm Sweden and have
my own company


You are welcome to contact me
and ask questions or make comments
about my blog.


New Horizons
What's new
Starting a blog
Writing a blog
Using an RSS reader

Zynq Design From Scratch
Started February 2014
1 Introduction
Changes and updates
2 Zynq-7000 All Programmable SoC
3 ZedBoard and other boards
4 Computer platform and VirtualBox
5 Installing Ubuntu
6 Fixing Ubuntu
7 Installing Vivado
8 Starting Vivado
9 Using Vivado
10 Lab 1. Create a Zynq project
11 Lab 1. Build a hardware platform
12 Lab 1. Create a software application
13 Lab 1. Connect to ZedBoard
14 Lab 1. Run a software application
15 Lab 1. Benchmarking ARM Cortex-A9
16 Lab 2. Adding a GPIO peripheral
17 Lab 2. Create a custom HDL module
18 Lab 2. Connect package pins and implement
19 Lab 2. Create a software application and configure the PL
20 Lab 2. Debugging a software application
21 Running Linux from SD card
22 Installing PetaLinux
23 Booting PetaLinux
24 Connect to ZedBoad via ethernet
25 Rebuilding the PetaLinux kernel image
26 Running a DHCP server on the host
27 Running a TFTP server on the host
28 PetaLinux boot via U-boot
29 PetaLinux application development
30 Fixing the host computer
31 Running NFS servers
32 VirtualBox seamless mode
33 Mounting guest file system using sshfs
34 PetaLinux. Setting up a web server
35 PetaLinux. Using cgi scripts
36 PetaLinux. Web enabled application
37 Convert from VirtualBox to VMware
38 Running Linaro Ubuntu on ZedBoard
39 Running Android on ZedBoard
40 Lab2. Booting from SD card and SPI flash
41 Lab2. PetaLinux board bringup
42 Lab2. Writing userspace IO device driver
43 Lab2. Hardware debugging
44 MicroZed quick start
45 Installing Vivado 2014.1
46 Lab3. Adding push buttons to our Zynq system
47 Lab3. Adding an interrupt service routine
48 Installing Ubuntu 14.04
49 Installing Vivado and Petalinux 2014.2
50 Using Vivado 2014.2
51 Upgrading to Ubuntu 14.04
52 Using Petalinux 2014.2
53 Booting from SD card and SPI flash
54 Booting Petalinux 2014.2 from SD card
55 Booting Petalinux 2014.2 from SPI flash
56 Installing Vivado 2014.3

Chipotle Verification System

EE Times Retrospective Series
It all started more than 40 years ago
My first job as an electrical engineer
The Memory (R)evolution
The Microprocessor (R)evolution

Four soft-core processors
Started January 2012
Table of contents
OpenRISC 1200
Nios II

Using the Spartan-6 LX9 MicroBoard
Started August 2011
Table of contents
Problems, fixes and solutions

FPGA Design From Scratch
Started December 2006
Table of contents
Acronyms and abbreviations

Actel FPGA design
Designing with an Actel FPGA. Part 1
Designing with an Actel FPGA. Part 2
Designing with an Actel FPGA. Part 3
Designing with an Actel FPGA. Part 4
Designing with an Actel FPGA. Part 5

A hardware designer's best friend
Zoo Design Platform

Installing Cobra Command Tool
A processor benchmark

Porting a Unix program to Mac OS X
Fixing a HyperTerminal in Mac OS X
A dream come true

Stockholm by bike

The New York City Marathon

Kittelfjall Lappland

Tour skating in Sweden and around the world
Wild skating
Tour day
Safety equipment
A look at the equipment you need
Skate maintenance
Books, photos, films and videos
Weather forecasts

38000 feet above see level
A trip to Spain
Florida the sunshine state

Photo Albums
Seaside Florida
Ronda Spain
Sevilla Spain
Cordoba Spain
Alhambra Spain
KittelfjÀll Lapland
Landsort Art Walk
Skating on thin ice

100 Power Tips for FPGA Designers

Adventures in ASIC
Computer History Museum
Design & Reuse
d9 Tech Blog
EDA Cafe
EDA DesignLine
Eli's tech Blog
FPGA Arcade
FPGA Central
FPGA developer
FPGA Journal
FPGA World
Lesley Shannon Courses
Mac 2 Ubuntu
Programmable Logic DesignLine
World of ASIC

If you want to be updated on this weblog Enter your email here:

rss feed

Thursday, December 14, 2006
FPGA design from scratch. Part 6
Now when we have the simulation environment in place it is time to start looking at the simulation process using the Cadence Incisive HDL simulator.

The simulation process

It was easier before when we were using Verilog-XL. Just write one input script file including all design files, all macro library files and all testbench files and start Verilog using that file. The simulation kicked-off and when it finished there was a logfile to read. When using the Incisive HDL simulator it is a little bit more complicated. The simulation process is now a three step process including the following steps:
  1. Compilation of all design files, macro library files and testbench files.
  2. Elaboration of the whole design and saving the result in a snapshot.
  3. Simulation of the snapshot.
In the compilation phase all source files will be compiled in to one or more libraries and stored as binary data. It is a good idea to use several libraries and compile the macro library files into one library, the design files into another library and the testbench into yet another library. In this way it is easy to modify the testbench without affecting the rest of the compiled data. In Mongoose we will use this scheme. All files are compiled as induvidual files and there is no control of interconnects between modules.

In the elaboration phase all the libraries are read and elaborated, which means that all depencies are checked. Missing modules, missing connection and unconnected inputs and outputs will be reported. During the elaboration a new database will be built containing the whole design and the testbench connected together. This database can be saved in a snapshot file or it will reside in the testbench library database.

In the simulation phase the snapshot file will be read and the simulation will start executing the simulation flow described in the testbench. Data will be written to a logfile and if enabled there will be a waveform file generated.

Here is a flow diagram showing the simulation process in Mongoose.

This is what the default Incisive HDL simulator setup looks like in Mongoose

The mapping of library names to physical file locations are done in the cds.lib file which must be referenced in the ncvlog compile script. When starting a compilation in Mongoose the mapping shown above will be written to the cds.lib file. The file will look like this:

softinclude $CDS_INST_DIR/tools/inca/files/cds.lib
define macrolib         /home/svenand/root/projects/ETC/verification/database/ncsim/macrolib
define design            /home/svenand/root/projects/ETC/verification/database/ncsim/design
define testbench      /home/svenand/root/projects/ETC/verification/database/ncsim/testbench

Before we can start compiling the source code we need to setup definition files containing all files we are going to compile. Let's start with the macro library files from Xilinx. If you browse through the Xilinx installation you will find the macro libraries here:

We will use the script generator built in to Mongoose to generate the definition files. The Unisims library (having unit delays) and the CoreLib library will be used for our functional simulations.

Now we are ready to compile the macro libraries. Select Macro Library Def from the Object menu. Select one of the definition files and click the start button (the Mongoose).

The compilation will run in the terminal window:

In the same way we compile the design files and the testbench files. The database directory will contain the following files after the compilation phase is finished. The design-info file is added by the Mongoose and includes information about the source files compiled. When Clearcase revision handling is used this file also includes the config spec.

Congratulations, we have all our source code compiled. Time to start elaboration. Just one more thing we have to do before we start, enter the name of the top module (the testbench). We do that in the NCSIM setup window. In our case it is ETC_TEST.

Select IUS/Elaboration and start the elaboration phase. This is what to output looks like:

ncelab: 05.83-p003: (c) Copyright 1995-2006 Cadence Design Systems, Inc.
    Elaborating the design hierarchy:
        Caching library 'testbench' ....... Done
        Caching library 'std' ....... Done
        Caching library 'synopsys' ....... Done
        Caching library 'ieee' ....... Done
        Caching library 'ambit' ....... Done
        Caching library 'vital_memory' ....... Done
        Caching library 'ncutils' ....... Done
        Caching library 'ncinternal' ....... Done
        Caching library 'ncmodels' ....... Done
        Caching library 'cds_assertions' ....... Done
        Caching library 'sdilib' ....... Done
        Caching library 'macrolib' ....... Done
        Caching library 'design' ....... Done
    Building instance overlay tables: .................... Done
    Loading native compiled code:     .................... Done
    Building instance specific data structures.
    Design hierarchy summary:
                                            Instances  Unique
        Modules:                        4348      87
        UDPs:                              2208       6
        Primitives:                     2710       9
        Timing outputs:           2220      35
        Registers:                     1014     462
        Scalar wires:                2995       -
        Vectored wires:               37       -
        Always blocks:                 98      64
        Initial blocks:                    10       7
        Cont. assignments:         50     194
        Pseudo assignments:       5       5
        Timing checks:            7984     811
        Simulation timescale:   1ps
    Writing initial simulation snapshot: testbench.ETC_TEST:module

We are ready to start the simulation. We only need a IUS license file from Cadence.

Top Next  Previous

Posted at 08:29 by


Leave a Comment:


Homepage (optional)


Previous Entry Home Next Entry