Jump to content

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


enchanter

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.

Link to comment
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.

Link to comment
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. 

Link to comment
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.

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...