Jump to content

Cannot find commonsrcs.h and gendatatrace.h files in systemc-ams package


Recommended Posts

Hi everyone,
 
I have just started working with SystemC-AMS.
I have installed the systemcams-1.0.tar package from www.systemc-ams.org .
 
As reference I am using the examples from the book: http://www.amazon.de/SystemC-SystemC-AMS-Practice-2-3-ebook/dp/B00F8HSYF8

SystemC and SystemC-AMS in Practice: SystemC 2.3, 2.2 and SystemC-AMS 1.0 from Amal Banerjee (Autor)Balmiki Sur (Autor)
 
I am trying to run their first example from the book and I find myself stuck at compiling.
 
Here is the part that is giving me a hard time:

#include <systemc-ams>
#include "commonsrcs.h"                                     //<-- doesn't exist
#include "gendatatrace.h"                                   //<-- doesn't exist
#include <cstdlib>
#include <cstring>
#include <iostream>                                         //<-- was not written in original example

using namespace std;                                        //<-- was not written in original example

int sc_main (int argc, char **argv)
{
    double amplitude;
    double frequency;
    
    if (argc < 3)
    {
        cout<<"Insufficient input parameters ..."<<endl;
        cout<<"give <amplitude> and <frequency> arguments to output file"<<endl;
        exit(0);
    }
    
    sca_tdf::sca_signal<double> sigin0;
    sca_tdf::sca_signal<double> sigout0;
    
    amplitude = strtod(argv[1], NULL);
    frequency = strtod(argv[2], NULL);
    
    sinsrc sin_src ("sin_src");                              //<-- cannot be referenced due to commonsrcs.h not being found
    tracedoublecombo trdbl ("tr_nd");                        //<-- cannot be referenced due to gendatatrace.h not being found
    
    sin_src.sigout(sigin0);                                 //<-- cannot be referenced due to error above
    sin_src.amplitude = amplitude;                          //<-- cannot be referenced due to error above
    sin_src.frequency = frequency;                          //<-- cannot be referenced due to error above
    
    trdbl.in1(sigin0);                                      //<-- cannot be referenced due to error above
    trdbl.in2(sigout0);                                     //<-- cannot be referenced due to error above
    
    sc_core::sc_start(100.0, sc_core::SC_MS);
    sc_core::sc_stop();
    return 0;
}

The compiler version I am using is:

gcc version 4.1.2 20080704 

The compilation output is:

g++ \
                -I. -I/home/tabacaru/systemc-2.3.0/include -I/home/tabacaru/systemc-ams-1.0/include \
                -L. -L/home/tabacaru/systemc-2.3.0/lib-linux64 -L/home/tabacaru/systemc-ams-1.0/lib-linux64 \
                -o butter butter.cpp \
                -lsystemc-ams -lsystemc -lm
butter.cpp:2:80: error: commonsrcs.h: No such file or directory
butter.cpp:3:80: error: gendatatrace.h: No such file or directory
butter.cpp: In function 'int sc_main(int, char**)':
butter.cpp:28: error: 'sinsrc' was not declared in this scope
butter.cpp:28: error: expected `;' before 'sin_src'
butter.cpp:29: error: 'tracedoublecombo' was not declared in this scope
butter.cpp:29: error: expected `;' before 'trdbl'
butter.cpp:31: error: 'sin_src' was not declared in this scope
butter.cpp:35: error: 'trdbl' was not declared in this scope

 
I am sure I am doing something wrong, however I do not know what exactly. I already installed the systemc-ams-1.0 package twice and I still get the same problem.
Any feedback regarding the 2 header files (commonsrcs.h and gendatatrace.h) would be much appreciated.
If you know another package from an official/mirror web-page I would be happy for a link.
 
Thank you in advance.
 
Bogdan

Link to comment
Share on other sites

Hello Bogdan, 

while searching for the missing file in the referenced book, and on this current discussion forum, I got directed to following link by my google browser, which is nothing but a old discussed initiated by the Author of the book himself.

 

http://www.accellera.org/Discussion_Forums/ams_forum/archive/msg?list_name=ams_forum&monthdir=201106&msg=msg00015.html

 

in this link you can see the attachment testcode.tgz. by downloading and uncompressing the attachment, you may get the required files. 

 

all the best.

regards, 

 

Milind.

Link to comment
Share on other sites

Hi Milind,

 

Thank you for your reply.

I have found this post yesterday. My problem is that I cannot extract the information inside the .tgz file. I tried zip (windows & unix), gzip and tar -xzf

 

The error that I am receiving is that it's not a valid archive.

Were you maybe able to extract the archive?

 

Kind Regards,

Bogdan

Link to comment
Share on other sites

Hi everyone,

 

I have just started working with SystemC-AMS.

I have installed the systemcams-1.0.tar package from www.systemc-ams.org .

 

As reference I am using the examples from the book: http://www.amazon.de/SystemC-SystemC-AMS-Practice-2-3-ebook/dp/B00F8HSYF8

SystemC and SystemC-AMS in Practice: SystemC 2.3, 2.2 and SystemC-AMS 1.0 from Amal Banerjee (Autor)Balmiki Sur (Autor)

 

I am trying to run their first example from the book and I find myself stuck at compiling.

 

Here is the part that is giving me a hard time:

#include <systemc-ams>
#include "commonsrcs.h"                                     //<-- doesn't exist
#include "gendatatrace.h"                                   //<-- doesn't exist
#include <cstdlib>
#include <cstring>
#include <iostream>                                         //<-- was not written in original example

using namespace std;                                        //<-- was not written in original example

int sc_main (int argc, char **argv)
{
    double amplitude;
    double frequency;
    
    if (argc < 3)
    {
        cout<<"Insufficient input parameters ..."<<endl;
        cout<<"give <amplitude> and <frequency> arguments to output file"<<endl;
        exit(0);
    }
    
    sca_tdf::sca_signal<double> sigin0;
    sca_tdf::sca_signal<double> sigout0;
    
    amplitude = strtod(argv[1], NULL);
    frequency = strtod(argv[2], NULL);
    
    sinsrc sin_src ("sin_src");                              //<-- cannot be referenced due to commonsrcs.h not being found
    tracedoublecombo trdbl ("tr_nd");                        //<-- cannot be referenced due to gendatatrace.h not being found
    
    sin_src.sigout(sigin0);                                 //<-- cannot be referenced due to error above
    sin_src.amplitude = amplitude;                          //<-- cannot be referenced due to error above
    sin_src.frequency = frequency;                          //<-- cannot be referenced due to error above
    
    trdbl.in1(sigin0);                                      //<-- cannot be referenced due to error above
    trdbl.in2(sigout0);                                     //<-- cannot be referenced due to error above
    
    sc_core::sc_start(100.0, sc_core::SC_MS);
    sc_core::sc_stop();
    return 0;
}

The compiler version I am using is:

gcc version 4.1.2 20080704 

The compilation output is:

g++ \
                -I. -I/home/tabacaru/systemc-2.3.0/include -I/home/tabacaru/systemc-ams-1.0/include \
                -L. -L/home/tabacaru/systemc-2.3.0/lib-linux64 -L/home/tabacaru/systemc-ams-1.0/lib-linux64 \
                -o butter butter.cpp \
                -lsystemc-ams -lsystemc -lm
butter.cpp:2:80: error: commonsrcs.h: No such file or directory
butter.cpp:3:80: error: gendatatrace.h: No such file or directory
butter.cpp: In function 'int sc_main(int, char**)':
butter.cpp:28: error: 'sinsrc' was not declared in this scope
butter.cpp:28: error: expected `;' before 'sin_src'
butter.cpp:29: error: 'tracedoublecombo' was not declared in this scope
butter.cpp:29: error: expected `;' before 'trdbl'
butter.cpp:31: error: 'sin_src' was not declared in this scope
butter.cpp:35: error: 'trdbl' was not declared in this scope

 

I am sure I am doing something wrong, however I do not know what exactly. I already installed the systemc-ams-1.0 package twice and I still get the same problem.

Any feedback regarding the 2 header files (commonsrcs.h and gendatatrace.h) would be much appreciated.

If you know another package from an official/mirror web-page I would be happy for a link.

 

Thank you in advance.

 

Bogdan

 

I am very sorry for your troubles. Actually the publisher Springer has a link from their own

Web site to a FTP site from where the source code tarball might be downloaded, PROVIDED

you buy from Springer itself. Amazon has not yet included a FTP URL. Currently, Amazon

and Springer are trying to work out a solution. So please wait, something will be worked out.

Both commonsrcs.h and gendatatrace.h contain utility code.

commonsrcs.h provides utility classes to create some signal sources as square wave, triangle

wave.

gendatatrace.h provides utility classes to format output data for plotting with Gnuplot.

Please supply me an email at dakupoto@gmail.com and I can email the two files to you.

Link to comment
Share on other sites

thank you Milind for sending me the files!

I have attached them now (testcode.zip). I hope the files work. I have not gotten around to test them.

 

Personally I gave the book 1 star on Amazon and I believe it needs a lot of rework until it could become reader appropriate. I hope that future revisions will be better (if any).

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...