Commit 971e3ded authored by rmrf's avatar rmrf
Browse files

Update makefile and add two tests.

method-as-member-variable:

This test identifies a missing feature.  That being, when there is a
an SC_MODULE instantiated within an SC_MODULE as a member variable, then it is not recognized.  The reason is because there is no second pass after the initial sc_module collection.
parent c8432a12
../Makefile.systemc
\ No newline at end of file
#include "systemc.h"
#include <iostream>
SC_MODULE( member_variable ) {
void print() {
std::cout << "This is an SC object as member variable" << std::endl;
}
void var() {
std::cout << "I'm var?" << std::endl;
}
SC_CTOR( member_variable) {
SC_METHOD(var);
}
};
SC_MODULE( test ){
sc_in<int> in;
sc_out<int> out;
sc_signal<int> test_signal;
member_variable mv;
void entry_function_1() {
std::cout << "ef1: " << std::endl;
// mv.print();
}
SC_CTOR( test ): mv("mv") {
SC_METHOD(entry_function_1);
}
};
int sc_main(int argc, char *argv[]) {
sc_signal<int> sig1;
test test_instance("testing");
test_instance.in(sig1);
test_instance.out(sig1);
sc_start(100, SC_NS);
return 0;
}
#include "systemc.h"
#include <iostream>
template<typename FP, int DIM>
SC_MODULE( test ){
sc_in<int> in;
sc_out<int> out;
sc_signal<int> test_signal;
void entry_function_1() {
std::cout << "value: " << DIM << std::endl;
}
SC_CTOR( test ) {
SC_METHOD(entry_function_1);
}
};
int sc_main(int argc, char *argv[]) {
sc_signal<int> sig1;
test<int,5> test_instance("testing");
test_instance.in(sig1);
test_instance.out(sig1);
sc_start(100, SC_NS);
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment