enchanter Posted June 22, 2015 Report Posted June 22, 2015 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. Quote
dakupoto Posted June 23, 2015 Report Posted June 23, 2015 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. Quote
enchanter Posted June 23, 2015 Author Report Posted June 23, 2015 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. Quote
dakupoto Posted June 24, 2015 Report Posted June 24, 2015 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. Quote
Recommended Posts
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.