Skip to content

Commit 028a5b8

Browse files
committedOct 30, 2014
add a systemc example
1 parent 97a63f5 commit 028a5b8

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed
 

Diff for: ‎Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ calc:calc.cc
1010
tempcalc:tempcalc.cc
1111
@echo 'Building file: $(@F)'
1212
$(CXX) $< -o $@
13+
hello:hello.cc
14+
@echo 'building file: $(@F)'
15+
$(CXX) -I/usr/local/systemc-2.3.0/include -O0 -g3 -Wall -c hello.cc
16+
$(CXX) -L/usr/local/systemc-2.3.0/lib-linux64 -o "hello" hello.o -lsystemc
1317
cleanclock:
1418
rm -f clock.o clock
1519
clean:

Diff for: ‎hello.cc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include<iostream>
2+
#include "systemc.h"
3+
#include "hello.h"
4+
5+
using namespace std;
6+
7+
int sc_main(int argc, char* argv[]){
8+
9+
sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", SC_DO_NOTHING);
10+
cout<<"the set time resolution is: "<<sc_get_default_time_unit()<<endl;
11+
12+
test mytest("mytest");
13+
sc_start();
14+
return 0;
15+
}

Diff for: ‎hello.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include"systemc.h"
2+
3+
SC_MODULE(test){
4+
//sc_in<uint32_t> a;
5+
6+
SC_CTOR(test){
7+
SC_METHOD(testing);
8+
// sensitive<<a;
9+
}
10+
void testing(void){
11+
SC_REPORT_INFO(SC_INFO,"Hello SystemC World!");
12+
}
13+
~test(){
14+
//delete stuff
15+
}
16+
};

Diff for: ‎module.h

Whitespace-only changes.

0 commit comments

Comments
 (0)
Please sign in to comment.