New Horizons






<< June 2008 >>
Sun Mon Tue Wed Thu Fri Sat
01 02 03 04 05 06 07
08 09 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30


Table of content

New Horizons
What's new
Starting a blog
Writing a blog
I got a job

SystemC
SystemC from scratch. Part 1
SystemC from scratch. Part 2
SystemC from scratch. Part 3

ASIC/FPGA Design
Table of content
Index
FPGA design from scratch. Part 1
FPGA design from scratch. Part 2
FPGA design from scratch. Part 3
FPGA design from scratch. Part 4
FPGA design from scratch. Part 5
FPGA design from scratch. Part 6
FPGA design from scratch. Part 7
FPGA design from scratch. Part 8
FPGA design from scratch. Part 9
FPGA design from scratch. Part 10
FPGA design from scratch. Part 11
FPGA design from scratch. Part 12
FPGA design from scratch. Part 13
FPGA design from scratch. Part 14
FPGA design from scratch. Part 15
FPGA design from scratch. Part 16
FPGA design from scratch. Part 17
FPGA design from scratch. Part 18
FPGA design from scratch. Part 19
FPGA design from scratch. Part 20
FPGA design from scratch. Part 21
FPGA design from scratch. Part 22
FPGA design from scratch. Part 23
FPGA design from scratch. Part 24
FPGA design from scratch. Part 25
FPGA design from scratch. Part 26
FPGA design from scratch. Part 27
FPGA design from scratch. Part 28
FPGA design from scratch. Part 29
FPGA design from scratch. Part 30
FPGA design from scratch. Part 31
FPGA design from scratch. Part 32
FPGA design from scratch. Part 33
FPGA design from scratch. Part 34
FPGA design from scratch. Part 35
FPGA design from scratch. Part 36
FPGA design from scratch. Part 37
FPGA design from scratch. Part 38
FPGA design from scratch. Part 39
FPGA design from scratch. Part 40
FPGA design from scratch. Part 41
FPGA design from scratch. Part 42
FPGA design from scratch. Part 43
FPGA design from scratch. Part 44
FPGA design from scratch. Part 45
FPGA design from scratch. Part 46
FPGA design from scratch. Part 47
FPGA design from scratch. Part 48
FPGA design from scratch. Part 49
FPGA design from scratch. Part 50
Links
Acronyms and abbreviations
XCell Journals
CAD
A hardware designer's best friend
Zoo Design Platform
Linux
Installing Ubuntu Linux on a MacBook
Customizing Ubuntu Linux 1
Customizing Ubuntu Linux 2
Upgrading to Ubuntu 7.04
Install Ubuntu 7.04 with VMware
Making the virtual machine run faster
Ubuntu Links
A processor benchmark
Mac
Porting a Unix program to Mac OS X
Fixing a HyperTerminal in Mac OS X
A dream come true
Wireless freedom
Running
The New York City Marathon
Skiing/Skating
Kittelfjäll Lappland
Tour skating in Sweden and around the world
Top
Introduction
SSSK
Wild skating
Tour day
Safety equipment
A look at the equipment you need
Skate maintenance
Calendar
Links
Books, photos, films and videos
Weather forecasts
Travel
38000 feet above see level
A trip to Spain
Florida the sunshine state


Example Files
Verilog Testbench Body
Verilog Testcase
Verilog Setup
Simulation Result File
Simulation Report File




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


Favorites
Adventures in ASIC
ChipHit
Computer History Museum
Community of Sweden
DeepChip
Design & Reuse
Dilbert
EDA Cafe
EDA DesignLine
Embedded.com
EmbeddedRelated.com
FPGA Arcade
FPGA Blog
FPGA Central
FPGA Journal
FPGA World
MacApper
Mac geekery
Mac 2 Ubuntu
Get Perpendicular
Programmable Logic DesignLine
History of Linux
OpenCores
ORSoC
Simplehelp
SOCcentral
World of ASIC



New York City Marathon




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



rss feed



 
Jun 7, 2008
SystemC from scratch. Part 2

Hardware and software platform

We will use our Ubuntu Linux installation to run all the SystemC simulations. For more information see Installing Ubuntu 7.04 with VMware.

Downloading SystemC libraries

Before we can download the SystemC C++ class libraries from the OSCI web page we must register as a member. After that we can use the OSCI download page: http://www.systemc.org/downloads/standards/ and download the file systemc-2.2.0.tgz.



SystemC 2.2 installation

After unzipping and unpacking (tar zxvf systemc-2.2.0.tgz) the downloaded file (systemc-2.2.0.tgz) we have the following file structure.



SystemC documentation

In the docs directory we find the following documents:

  • FuncSpec20.pdf

  • IEEE1666_specification

  • License.pdf

  • SystemS_2_1_features.pdf

  • SystemC_2_1_overview.pdf

  • UserGuide20.pdf

  • WhitePaper.pdf


Install and configure SystemC

We will start by reading the INSTALL file. To build, install and use SystemC we need the GNU c++ compiler (gcc) and the GNU make program (gmake). If you don't have gcc installed on your system use the following command to install everything you needsudo apt-get install build-essential

To install SystemC on a Linux system, do the following steps:

1. Change to the top level directory (systemc-2.2)

2. Create a temporary directory, e.g.,

> mkdir objdir

3. Change to the temporary directory, e.g.,

> cd objdir

4. Set the following environment variable(s):

> set CXX=g++

> export CXX

5. Configure the package for your system.

> ../configure

While the 'configure' script is running, which takes a few moments, it prints messages to inform you of the features it is checking. It also detects the platform.

6. Compile the package. For an optimized SystemC library, enter:

> gmake (or you can use make which is actually the same as gmake in Ubuntu)

For a debug SystemC library, enter:

> gmake debug

7. Install the package.

> gmake install

8. At this point you may wish to verify the installation by testing the example suite.

> gmake check

this will compile and run the examples in the subdirectory examples.

Let's start to configure the system

> ../configure


checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/config/missing: Unknown `--run' option
Try `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/config/missing --help' for more information
configure: WARNING: `missing' script is too old or missing
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
..........
config.status: creating examples/sysc/2.1/Makefile
config.status: creating examples/sysc/2.1/dpipe/Makefile
config.status: creating examples/sysc/2.1/forkjoin/Makefile
config.status: creating examples/sysc/2.1/reset_signal_is/Makefile
config.status: creating examples/sysc/2.1/sc_export/Makefile
config.status: creating examples/sysc/2.1/sc_report/Makefile
config.status: creating examples/sysc/2.1/scx_barrier/Makefile
config.status: creating examples/sysc/2.1/scx_mutex_w_policy/Makefile
config.status: creating examples/sysc/2.1/specialized_signals/Makefile
config.status: executing depfiles commands


Now let's compile everything.
 
>gmake

Making all in src
gmake[1]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src'
Making all in sysc
gmake[2]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc'
Making all in kernel
gmake[3]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc/kernel'
g++ -I. -I. -I../../../../src/sysc/kernel -I../../../../src    -Wall -DSC_INCLUDE_FX -O3 -c -o sc_attribute.o `test -f '../../../../src/sysc/kernel/sc_attribute.cpp' || echo '../../../../src/sysc/kernel/'`../../../../src/sysc/kernel/sc_attribute.cpp
g++ -I. -I. -I../../../../src/sysc/kernel -I../../../../src    -Wall -DSC_INCLUDE_FX -O3 -c -o sc_cor_fiber.o `test -f '../../../../src/sysc/kernel/sc_cor_fiber.cpp' || echo '../../../../src/sysc/kernel/'`../../../../src/sysc/kernel/sc_cor_fiber.cpp
g++ -I. -I. -I../../../../src/sysc/kernel -I../../../../src    -Wall -DSC_INCLUDE_FX -O3 -c -o sc_cor_pthread.o `test -f '../../../../src/sysc/kernel/sc_cor_pthread.cpp' || echo '../../../../src/sysc/kernel/'`../../../../src/sysc/kernel/sc_cor_pthread.cpp

.........

To compile and run this example type
   make check
gmake[4]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc/2.1/specialized_signals'
gmake[4]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc/2.1'
gmake[4]: Nothing to be done for `all-am'.
gmake[4]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc/2.1'
gmake[3]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc/2.1'
gmake[3]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc'
gmake[3]: Nothing to be done for `all-am'.
gmake[3]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc'
gmake[2]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc'
Making all in .
gmake[2]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples'
gmake[2]: Nothing to be done for `all-am'.
gmake[2]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples'
gmake[1]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples'
Making all in .
gmake[1]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
gmake[1]: Nothing to be done for `all-am'.
gmake[1]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'


>
and last we install everything.

>gmake install

Making install in src
gmake[1]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src'
Making install in sysc
gmake[2]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc'
Making install in kernel
gmake[3]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc/kernel'
gmake[4]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc/kernel'
gmake[4]: Nothing to be done for `install-exec-am'.
/bin/sh ../../../../config/mkinstalldirs /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include/sysc/kernel
mkdir /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include
mkdir /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include/sysc
mkdir /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include/sysc/kernel
for file in sc_attribute.h sc_boost.h sc_cmnhdr.h sc_constants.h sc_cor.h sc_dynamic_processes.h sc_event.h sc_except.h sc_externs.h sc_join.h sc_kernel_ids.h sc_macros.h sc_module.h sc_module_name.h sc_object.h sc_process.h sc_process_handle.h sc_reset.h sc_runnable.h sc_sensitive.h sc_spawn.h sc_spawn_options.h sc_simcontext.h sc_time.h sc_ver.h sc_wait.h sc_wait_cthread.h ; do
      /usr/bin/install -c -m 644 ../../../../src/sysc/kernel/$file /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include/sysc/kernel/$file;
    done

.............................

Making install in .
gmake[1]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
gmake[2]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
gmake[2]: Nothing to be done for `install-exec-am'.
for file in AUTHORS COPYING ChangeLog INSTALL LICENSE NEWS README RELEASENOTES docs; do
      d=..;
      if test -d $d/$file; then
        test -d /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/$file
        || cp -pr $d/$file /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0 || :;
      else
        test -f /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/$file
        || cp -p $d/$file /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/$file || :;
      fi;
    done
gmake[2]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
gmake[1]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'

To compile and run all examples we execute the following command:

> gmake check

We are now ready to start exploring all features of SystemC. We will do that by looking closer to some of the examples that came with the installation.




Posted at 12:22 pm by svenand

apolychrono
May 7, 2009   06:32 PM PDT
 
For Ubuntu 9.04 after make an error like this:
"sc_utils_ids.cpp:110 getenv is not a member of std" solved after editing the file: /pathTo/systemc-2.2.0/objdir/src/sysc/utils$ gedit ../../../../src/sysc/utils/sc_utils_ids.cpp and adding the following :

#include <cstdio>
#include <cstdlib>
#include <cstring>
 

Leave a Comment:

Name


Homepage (optional)


Comments




Previous Entry Home Next Entry