Setting up SystemC-AMS and Eclipse

SystemC-AMS is a new library that is used to model analog and mixed signal systems in addition to the traditional functionality given by systemC for modeling only digital systems. Currently, I’m using version 2.0 the beta version, which is the latest version as per now. Downloading it from the actual Acellera site was quite a hustle so I downloaded it from the COSEDA Technologies GmbH site.

So firstly,you need to extract the downloaded .zip file to your sources directory (or wherever you choose). Get into the directory where the downloaded file was saved which in my case was the sources directory in my home directory, ~/src

cd ~/src/systemc-ams-2.1 

While still in this directory, make a new directory in the /usr/local called systemc-amsbeta-01 where the installation will be made using the following command

sudo mkdir /usr/local/systemc-ams-2.1

You need to use sudo because you’re going to attempt to create a directory in a restricted area and so you absolutely need some authentication.

Then to run the configuration file which is in the downloaded files enter

./configure --prefix=/usr/local/systemc-ams-2.1/ --with-systemc=/usr/local/systemc-2.3.2/

and to make it run quicker, type

make -j5

If you get errors like memset not defined, add “#include” to the begining of the files indicated to cause the errors: sca_tdf_ltf_ss_proxy.cpp and sca_tdf_ltf_nd_proxy.cpp.
Finally install the library:

sudo make install

So now you have the new library  installed in your computer and all that is left to do is to configure it to work with eclipse, and the procedure is really simple! You just need to follow the same steps as those in the previous post on Setting up SystemC and Eclipse for C++ hardware simulation. BUT in addition to configuring the SystemC library and includes, add those of SystemC-ams as well.

To check whether the libraries have been correctly installed you can build and run this sample code for a simple TDF module implementation that produces a sine wave.

#include <systemc-ams.h>

	sca_tdf::sca_out<double> out;

	double ampl;
	double freq;

	void set_attributes()
		out.set_timestep(5, SC_US);

	void processing ()
		double t=out.get_time().to_seconds();
		double x = ampl * std::sin(2.0 * M_PI * freq * t);

		out("out"), ampl(1.0), freq(1e3){}

and for the main file

#include "sin_source.h"
#include <systemc-ams.h>
#include <cmath>

int sc_main (int argc, char* argv[])
	sca_tdf::sca_signal <double> out1;

	sin_source mySine("sine1");


	sca_util::sca_trace_file *tf1= sca_create_vcd_trace_file("sine_wave");

	sc_core::sc_start(10, SC_MS);

	return 0;


If this builds and runs correctly then voilà! your libraries are good to go.

You may now enjoy the fruits of your labor 🙂

7 responses to “Setting up SystemC-AMS and Eclipse”

  1. Paul Chaffey

    The command line above has a typo: “sudo mkdir /usr/local/systemc-amsbeta-01”

    Also in the header file: “sca_tdf::sca_out&ltdouble&lt out;” should be “sca_tdf::sca_out out;” – typical html gotcha

    This example displays a Sine wave nicely in Impulse

  2. Paul Chaffey

    hmm – my post also had the less than and greater than removed around the “double”

  3. Karibe

    Thanks Paul for pointing it out, fixed.

  4. stephen lohning

    Hi Karibe,
    I have not been able to find the source code at either the Acellera or the Fraunhofer sites, do you know where I can find the it?

    Stephen Lohning

    1. Karibe

      Sorry for very late reply, I have updated the post with a working link. Thanks for heads up

  5. Santosh Shinde

    HI Kabire

    I am simulating on eclips using cygwin, I am able to simulate the sine wave code but the trace file generates is empty.

    The output generated by eclips is
    SystemC 2.3.3-Accellera — Feb 21 2019 17:13:07
    Copyright (c) 1996-2018 by all Contributors,

    Info: SystemC-AMS:
    1 dataflow clusters instantiated
    cluster 0:
    1 dataflow modules/solver, contains e.g. module: sine1
    1 elements in schedule list,
    5 us cluster period,
    ratio to lowest: 1 e.g. module: sine1
    ratio to highest: 1 sample time e.g. module: sine1
    0 connections to SystemC de, 0 connections from SystemC de

    How can I create VCD file??

    1. Karibe

      I use a real Linux OS, I am not so sure it’s not something wrong with cygwin. The example in this post was tested in Feb 2016. Something might have changed in the tracing class. Check the documentation. I will test this later this week and see.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: