Jump to content
Sign in to follow this  
enchanter

Is there any simple Makefile template for both SystemC and SCV examples?

Recommended Posts

I start to learn SystemC and SCV. But I don't have much experience on complex Makefile as the one provided in the install package by SCV.

 

It is too hard for me to understand who the files are really compiled.

 

I am not sure if any one can provide simple Makefile template (Only Linux platform is OK).

 

Thanks.

Share this post


Link to post
Share on other sites

I start to learn SystemC and SCV. But I don't have much experience on complex Makefile as the one provided in the install package by SCV.

 

It is too hard for me to understand who the files are really compiled.

 

I am not sure if any one can provide simple Makefile template (Only Linux platform is OK).

 

Thanks.

Hello,

It is not clear if you are looking for a Makefile to compile your

own modules or the SystemC library. If it is the SystemC

 library, please use the provided Makefiles and follow the

instructions in the INSTALL file. In most cases, for one's

own modules, a Makefile is not necessary - on Linux simple

command line arguments work fine, and if a large number of

modules are involved, a short shell script works fine.

Share this post


Link to post
Share on other sites

Hello,

It is not clear if you are looking for a Makefile to compile your

own modules or the SystemC library. If it is the SystemC

 library, please use the provided Makefiles and follow the

instructions in the INSTALL file. In most cases, for one's

own modules, a Makefile is not necessary - on Linux simple

command line arguments work fine, and if a large number of

modules are involved, a short shell script works fine.

 

I try to find a simple template which can compile both the example code and my own (in the future).

 

The reason why I want one for the example code is I may try to do some modification on the example code to try things, it is too hard for me to tweak the original Makefile in the package.

 

About the command line, I think that is not a good idea. There's so many flags you have to remember for just compile a single file. I consider Makefile is more productive. 

Share this post


Link to post
Share on other sites

I try to find a simple template which can compile both the example code and my own (in the future).

 

The reason why I want one for the example code is I may try to do some modification on the example code to try things, it is too hard for me to tweak the original Makefile in the package.

 

About the command line, I think that is not a good idea. There's so many flags you have to remember for just compile a single file. I consider Makefile is more productive. 

 

Hello Sir,

It is highly rcommended that you do some background reading on Makefiles and 

shell scripts, before starting with SystemC. You DO NOT have to set any flags at

all, to compile a simple program via a command line. For example, consider a

simple D flip-flop.

The source code for it is:

#ifndef DFF1_H

#define DFF1_H

#include <systemc>

SC_MODULE(dff1)

{

 sc_core::sc_in<bool> din;

 sc_core::sc_in<bool> clock;

 sc_core::sc_out<bool> dout;

 void ffoperation()

 {

   while(true)

   {

     wait();

     dout.write(din.read());

   }

 };

 SC_CTOR(dff1)

 {

   SC_CTHREAD(ffoperation, clock.pos());

 }

};

#endif

 

To compile this with a test bench just use the

command line,

 

g++ -I. -I<absolute or relative directory path to systemc directory>/include

-L. -L<absolute or relative directory path to systemc directory>/lib-linux -o

 <executable name> dff1testt.cc -lsystemc -lm

 

As you see, there are no flags or anything complicated.

 

Running the ezexutable will be another issue, as from SystemC 2.3.0

onwards, the core SystemC library is loaded dynamically. Please try

out the above example. Proof of the pudding is in the eating.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×