Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
caesr-pub
systemc-clang
Commits
49d75bfe
Commit
49d75bfe
authored
Aug 01, 2019
by
rmrf
Browse files
Update makefile
parent
9dd5afeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
5 deletions
+39
-5
Makefile.systemc
Makefile.systemc
+6
-5
tests/next-trigger.cpp
tests/next-trigger.cpp
+33
-0
No files found.
Makefile.systemc
View file @
49d75bfe
...
...
@@ -7,7 +7,7 @@
########################################################
SYSTEMC
?=
SYSTEMC_HOME
?=
$(SYSTEMC)
TARGET_ARCH
=
linux64
TARGET_ARCH
?
=
linux64
SYSTEMC_INC_DIR
=
$(SYSTEMC_HOME)
/include
SYSTEMC_LIB_DIR
=
$(SYSTEMC_HOME)
/lib-
$(TARGET_ARCH)
...
...
@@ -75,20 +75,21 @@ PRGS := $(patsubst %.cpp,%,$(SRCS))
PRG_SUFFIX
=
.x
BINS
:=
$(
patsubst
%,%
$(PRG_SUFFIX)
,
$(PRGS)
)
## OBJS are automagically compiled by make.
OBJ
S
:=
$(
patsubst
%,%.o,
$(
PRG
S)
)
OBJ
:=
$(
patsubst
%
.cpp
,%.o,
$(
SRC
S)
)
##
all
:
$(BINS)
##
## For clarity sake we make use of:
.SECONDEXPANSION
:
OBJ
=
$(
patsubst
%
$(PRG_SUFFIX)
,%.o,
$@
)
#
OBJ = $(patsubst %$(PRG_SUFFIX),%.o,$@)
ifeq
($(PRG_SUFFIX_FLAG),0)
BIN
=
$(
patsubst
%
$(PRG_SUFFIX)
,%,
$@
)
else
BIN
=
$@
endif
## Compile the executables
%$(PRG_SUFFIX)
:
$(OBJS)
#%$(PRG_SUFFIX) : $(OBJ)
%.x
:
%.o
$(LIBTOOL)
--mode
=
link
--tag
=
CXX g++
-o
$(BIN)
$<
$(FLAGS)
$(LDFLAGS)
%.o
:
%.cpp
...
...
@@ -102,5 +103,5 @@ else
endif
##
rebuild
:
veryclean all
#
rebuild: veryclean all
tests/next-trigger.cpp
0 → 100644
View file @
49d75bfe
#include "systemc.h"
#include <iostream>
SC_MODULE
(
test
){
sc_in
<
int
>
in
;
sc_out
<
int
>
out
;
sc_signal
<
int
>
test_signal
;
void
hello
()
{
std
::
cout
<<
sc_time_stamp
()
<<
": Hello"
<<
std
::
endl
;
next_trigger
(
sc_time
(
50
,
SC_NS
));
std
::
cout
<<
sc_time_stamp
()
<<
": World"
<<
std
::
endl
;
next_trigger
(
sc_time
(
1000
,
SC_NS
));
std
::
cout
<<
sc_time_stamp
()
<<
": !!"
<<
std
::
endl
;
}
SC_CTOR
(
test
)
{
SC_METHOD
(
hello
);
}
};
int
sc_main
(
int
argc
,
char
*
argv
[])
{
std
::
cout
<<
"start of test"
<<
std
::
endl
;
sc_signal
<
int
>
sig1
;
test
test_instance
(
"testing"
);
test_instance
.
in
(
sig1
);
test_instance
.
out
(
sig1
);
sc_start
();
std
::
cout
<<
"End of test"
<<
std
::
endl
;
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment