Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Tuesday, July 30, 2013

Python Tutorials


Thursday, December 1, 2011

ffmpeg sample use collection

Caveat: may not work in all cases

Very important, add "-threads 0" to every ffmpeg invocation to use all available cores.

Friday, August 26, 2011

Hello World in SystemC

Create two files and run it at the Shell prompt.

1. Edit the CPP file first.

// All systemc modules should include systemc.h header file
 #include "systemc.h"
 // Hello_world is module name
 SC_MODULE (hello_world) {
   SC_CTOR (hello_world) {
     // Nothing in constructor 
   }
   void say_hello() {
     //Print "Hello World" to the console.
     cout << "Hello World.\n";
   }
 };
 
 // sc_main in top level function like in C++ main
 int sc_main(int argc, char* argv[]) {
   hello_world hello("HELLO");
   // Print the hello world
   hello.say_hello();
   return(0);
 }
2. Then create a Makefile. This makefile is reusable for all SystemC projects.
SYSTEMC=/usr/local/systemc
LDFLAGS= -L$(SYSTEMC)/lib-linux -lsystemc
CXXFLAGS=-Wno-deprecated -I$(SYSTEMC)/include -fpermissive

all:
 g++ $(CXXFLAGS) *.cpp $(LDFLAGS)
 ./a.out
3. The command "make" compiles and runs the Hello World program.
$ make
g++ -Wno-deprecated -I/usr/local/systemc/include  *.cpp -L/usr/local/systemc/lib-linux -lsystemc
./a.out

             SystemC 2.2.0 --- Aug 25 2011 10:30:16
        Copyright (c) 1996-2006 by all Contributors
                    ALL RIGHTS RESERVED
Hello World.

Wednesday, February 2, 2011

SystemC on Mac

SystemC works on Mac!

Thanks to the folks at Logic Poet, SystemC on Mac is much easier than on Windows and Linux. Get then installer here and install it. You know how to install an app in Mac, don't you? don't you?

The important files are installed in /Library/SystemC/Current.
For your compulsory Hello World in SystemC, first create a New Project by keying Shift-Apple-N. When you get this dialog, choose SystemC app:

You can also see there's other types of SystemC projects available including TLM and AMS. Anyway, you'll get a dummy program FOC. Let's name the project "sc_hello". You will then get this:

Build it by hitting Apple-B. Run it by clicking on Product->sc_hello on the control pane on the left:

Congratulations! Now you can forget about SystemC on Linux, or gasp, on Visual Studio!...