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
9dd5afeb
Commit
9dd5afeb
authored
Jul 30, 2019
by
rmrf
Browse files
Start adding tests.
parent
289d21f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
0 deletions
+94
-0
tests/basic-module-method-inherit.cpp
tests/basic-module-method-inherit.cpp
+32
-0
tests/basic-module-method.cpp
tests/basic-module-method.cpp
+31
-0
tests/basic-module-thread.cpp
tests/basic-module-thread.cpp
+31
-0
No files found.
tests/basic-module-method-inherit.cpp
0 → 100644
View file @
9dd5afeb
#include "systemc.h"
class
test
:
public
sc_module
{
public:
sc_in
<
int
>
in
;
sc_out
<
int
>
out
;
sc_signal
<
int
>
test_signal
;
void
entry_function_1
()
{
while
(
true
)
{
// do nothing
}
}
void
entry_function_2
()
{
while
(
true
)
{
// do nothing
}
}
SC_CTOR
(
test
)
{
SC_METHOD
(
entry_function_1
);
SC_METHOD
(
entry_function_2
);
}
};
int
sc_main
(
int
argc
,
char
*
argv
[])
{
sc_signal
<
int
>
sig1
;
test
test_instance
(
"testing"
);
test_instance
.
in
(
sig1
);
test_instance
.
out
(
sig1
);
return
0
;
}
tests/basic-module-method.cpp
0 → 100644
View file @
9dd5afeb
#include "systemc.h"
SC_MODULE
(
test
){
sc_in
<
int
>
in
;
sc_out
<
int
>
out
;
sc_signal
<
int
>
test_signal
;
void
entry_function_1
()
{
while
(
true
)
{
// do nothing
}
}
void
entry_function_2
()
{
while
(
true
)
{
// do nothing
}
}
SC_CTOR
(
test
)
{
SC_METHOD
(
entry_function_1
);
SC_METHOD
(
entry_function_2
);
}
};
int
sc_main
(
int
argc
,
char
*
argv
[])
{
sc_signal
<
int
>
sig1
;
test
test_instance
(
"testing"
);
test_instance
.
in
(
sig1
);
test_instance
.
out
(
sig1
);
return
0
;
}
tests/basic-module-thread.cpp
0 → 100644
View file @
9dd5afeb
#include "systemc.h"
SC_MODULE
(
test
){
sc_in
<
int
>
in
;
sc_out
<
int
>
out
;
sc_signal
<
int
>
test_signal
;
void
entry_function_1
()
{
while
(
true
)
{
// do nothing
}
}
void
entry_function_2
()
{
while
(
true
)
{
// do nothing
}
}
SC_CTOR
(
test
)
{
SC_THREAD
(
entry_function_1
);
SC_THREAD
(
entry_function_2
);
}
};
int
sc_main
(
int
argc
,
char
*
argv
[])
{
sc_signal
<
int
>
sig1
;
test
test_instance
(
"testing"
);
test_instance
.
in
(
sig1
);
test_instance
.
out
(
sig1
);
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