diff options
author | FreeArtMan <dos21h@gmail.com> | 2018-10-14 14:07:48 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2018-10-14 14:07:48 +0100 |
commit | 7369b3610373baffa47c049eb7e7c637c02ff9ef (patch) | |
tree | dfe8580d75afe2cc10e308bc2fb2a97ecc945636 /cpu8/hello_world | |
parent | 4ea2be2ca3a5945abd6f36d2ac0cb1eb05613a45 (diff) | |
download | cpu8-7369b3610373baffa47c049eb7e7c637c02ff9ef.tar.gz cpu8-7369b3610373baffa47c049eb7e7c637c02ff9ef.zip |
Added hello world example
Diffstat (limited to 'cpu8/hello_world')
-rw-r--r-- | cpu8/hello_world/Makefile | 7 | ||||
-rw-r--r-- | cpu8/hello_world/hello_world.cpp | 18 | ||||
-rw-r--r-- | cpu8/hello_world/notes.md | 5 |
3 files changed, 30 insertions, 0 deletions
diff --git a/cpu8/hello_world/Makefile b/cpu8/hello_world/Makefile new file mode 100644 index 0000000..50bb5dd --- /dev/null +++ b/cpu8/hello_world/Makefile @@ -0,0 +1,7 @@ +SYSTEMC_PATH=/home/fam/downloads/source/systemc/systemc-2.3.2 +SYSTEMC_INC=$(SYSTEMC_PATH)/src +SYSTEMC_LIB=$(SYSTEMC_PATH)/src/.libs + +make: + g++ hello_world.cpp -I$(SYSTEMC_INC) -L$(SYSTEMC_LIB) -Wl,-rpath=$(SYSTEMC_LIB)\ + -o hello_world -lsystemc -lm
\ No newline at end of file diff --git a/cpu8/hello_world/hello_world.cpp b/cpu8/hello_world/hello_world.cpp new file mode 100644 index 0000000..4a1e336 --- /dev/null +++ b/cpu8/hello_world/hello_world.cpp @@ -0,0 +1,18 @@ + +#include "systemc.h" + +SC_MODULE (hello_world) { + SC_CTOR(hello_world) { + + } + + void say_hello() { + cout << "Hello world\n"; + } +}; + +int sc_main(int argc, char **argv) { + hello_world hello("HELLO"); + hello.say_hello(); + return(0); +}
\ No newline at end of file diff --git a/cpu8/hello_world/notes.md b/cpu8/hello_world/notes.md new file mode 100644 index 0000000..8dc02b1 --- /dev/null +++ b/cpu8/hello_world/notes.md @@ -0,0 +1,5 @@ +cmake . +make + +define INCLUDE and LIBRARY directory + |