[SystemC]SystemC Hello World

                                   SystemC Hello World

#include "systemc.h"
 
int sc_main (int argc, char* argv[]) {
   
  cout <<"Hello World "<< endl;
  return 0;// Terminate simulation
   
}

SIMULATOR OUTPUT :

Hello World

一、程序註解

(1)#include “systemc.h”:

       Includes SystemC library header file.

(2)int sc_main (int argc, char* argv[ ]):

  • int is the return value.
  • sc_main() is entry point to the users code form library, It is called by the function main() which is part of the SystemC library.

(3)The arguments argc and argv[] are the standard command-line arguments. They are passed to sc_main() from main() in the library.

(4){ } :

      The two curly brackets are used to indicate the beginning and the end of the function sc_main.

(5)cout:

       cout represents the standard output stream in C++.

扫描二维码关注公众号,回复: 10182364 查看本文章

(6)return 0;

       The return statement causes the main function to finish.

二、Basic Input and Output 

     Cin, cout, cerr and clog are are the instance of ostream class,

  1. cin   – gets the input from standard input device.
  2. cout – To display message on standard output device.
  3. cerr  – To display error message on standard output device.
  4. clog – To display log message on standard output device.
发布了140 篇原创文章 · 获赞 81 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/gsjthxy/article/details/105103423