Changeset 55 for sources/test_regression/08092005
- Timestamp:
- May 28, 2013, 11:17:14 AM (11 years ago)
- Location:
- sources/test_regression/08092005
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/test_regression/08092005/Makefile
r15 r55 1 1 include ../env.mk 2 include ../Makefile.common 2 3 3 SYSTEM = system.cpp 4 EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x) 5 EXE_SC = $(SYSTEM:.cpp=_systemc.x) 6 EXE = ${EXE_SCASS} ${EXE_SC} 7 LOG = $(SYSTEM:.cpp=.log) 8 OBJECTS = $(EXE:.x=.o) 9 LINKS = $(OBJECTS:.o=.cpp) 4 test: $(EXE_SCASS) 5 @echo -ne "| Testing $$(basename $$(pwd)): " ; 6 @./$(EXE_SCASS) --p --t 2> /dev/null ; \ 7 if [ $$? -eq 197 ] ; then \ 8 if diff methodprocess_graph.dot methodprocess_graph_reference.dot > /dev/null ; then \ 9 if tail -n +3 reduced_signal_graph.dot | diff reduced_signal_graph_reference.dot - > /dev/null ; then \ 10 echo "OK" ; \ 11 else \ 12 echo "KO1" ; \ 13 fi ; \ 14 else \ 15 echo "KO2" ; \ 16 fi ; \ 17 else \ 18 echo "KO3" ; \ 19 fi ; 10 20 11 .SECONDARY:12 21 13 main : $(EXE)14 15 test : $(EXE_SCASS)16 @for i in ${EXE_SCASS} ; do \17 echo Testing $$i... ; \18 $$i --p --t ; \19 if [ $$? -ne 197 ] ; then eval $${failcom} ; fi ; \20 (tail -n +3 reduced_signal_graph.dot | diff reduced_signal_graph_reference.dot -) || eval ${failcom} ; \21 diff methodprocess_graph.dot methodprocess_graph_reference.dot || eval ${failcom} ; \22 echo Bug detection OK ; \23 done;24 25 %.gif : %.dot26 dot -Tgif -o $*.gif $*.dot27 28 %_systemc.x : %_systemc.o $(SYSTEMC_LIB)29 $(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)30 31 %_systemcass.x : %_systemcass.o $(SYSTEMCASS_LIB)32 $(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)33 34 -include Makefile.deps35 36 %_systemc.cpp : %.cpp37 ln -s $*.cpp $*_systemc.cpp38 39 %_systemcass.cpp : %.cpp40 ln -s $*.cpp $*_systemcass.cpp41 42 %_systemc.o : %_systemc.cpp43 $(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps44 $(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o45 46 %_systemcass.o : %_systemcass.cpp47 $(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps48 $(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o49 50 clean :51 rm -f Makefile.deps52 -rm -f *.o gmon.out *~53 -rm -f ${LOG}54 -rm -f signal_order.txt module_order.dot signal_graph.dot55 -rm -f module_order.gif signal_graph.gif56 -rm -f $(EXE) $(OBJECTS)57 -for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null58 -rm -f core*59 -rm -rf generated_by_systemcass60 -rm -rf system_systemcass.x.vcd system_systemc.x.vcd61 -
sources/test_regression/08092005/system.cpp
r1 r55 1 2 // Circular sensitivity dependency 3 // Does not compile with systemcass 4 1 5 #include "systemc.h" 2 6 3 #define ASSERT(x) \ 4 { errnum++; \ 5 if (!(x)) \ 6 { \ 7 cerr << "ASSERT : " #x "\n"; \ 8 exit (errnum); \ 9 } \ 10 } 7 8 #include "test.h" 11 9 12 10 using namespace std; 13 11 14 struct hard : sc_module 15 { 16 sc_in_clk clk; 17 sc_in <int> i1, i2; 18 sc_out<int> o1, o2; 12 struct hard : sc_module { 13 sc_in_clk clk; 14 sc_in <int> i1, i2; 15 sc_out<int> o1, o2; 19 16 20 void f () 21 { 22 o1 = i1; 23 o2 = i2; 24 } 17 void f() { 18 o1 = i1; 19 o2 = i2; 20 } 25 21 26 SC_HAS_PROCESS(hard); 27 hard(sc_module_name) /*: 28 clk("clk"), 29 i1 ("i1"), 30 i2 ("i2"), 31 o1 ("o1"), 32 o2 ("o2")*/ 33 { 34 SC_METHOD(f); 35 dont_initialize(); 36 sensitive << i1 << i2; 22 SC_HAS_PROCESS(hard); 23 hard(sc_module_name) { 24 SC_METHOD(f); 25 sensitive << i1 << i2; 26 dont_initialize(); 27 37 28 #ifdef SYSTEMCASS_SPECIFIC 38 o1(i1);39 o2(i2);29 o1(i1); 30 o2(i2); 40 31 #endif 41 }32 } 42 33 }; 43 34 44 int45 sc_main (int argc, char ** argv)46 {47 sc_clock clk("clk");48 sc_signal<int> s[10];49 hard a("a");50 hard b("b");51 hard c("c");52 35 53 a.clk (clk); 54 b.clk (clk); 36 int sc_main(int argc, char ** argv) { 37 sc_clock clk("clk"); 38 sc_signal<int> s[10]; 39 hard a("a"); 40 hard b("b"); 41 hard c("c"); 55 42 56 a.i1 (s[0]); 43 a.clk(clk); 44 b.clk(clk); 57 45 58 a.o1 (s[1]); 59 b.i1 (s[1]); 46 a.i1(s[0]); 60 47 61 b.o1 (s[2]); 48 a.o1(s[1]); 49 b.i1(s[1]); 62 50 63 b.i2 (s[3]);51 b.o1(s[2]); 64 52 65 b.o2 (s[4]); 66 a.i2 (s[4]); 53 b.i2(s[3]); 67 54 68 a.o2 (s[5]); 55 b.o2(s[4]); 56 a.i2(s[4]); 69 57 70 c.i1 (s[6]); 71 c.o1 (s[7]); 72 c.i2 (s[8]); 73 c.o2 (s[9]); 58 a.o2(s[5]); 74 59 75 sc_initialize ();76 77 s[0] = 1;78 s[3] = 1;60 c.i1(s[6]); 61 c.o1(s[7]); 62 c.i2(s[8]); 63 c.o2(s[9]); 79 64 80 sc_start (1);65 sc_start(sc_time(0, sc_core::SC_NS)); 81 66 82 s[0] = 123;83 s[3] = 321;67 s[0] = 1; 68 s[3] = 1; 84 69 85 sc_start (1);70 sc_start(sc_time(0, sc_core::SC_NS)); 86 71 87 return 0; 72 s[0] = 123; 73 s[3] = 321; 74 75 sc_start(sc_time(1, sc_core::SC_NS)); 76 77 return 0; 88 78 } 89 79 80 81 /* 82 # Local Variables: 83 # tab-width: 4; 84 # c-basic-offset: 4; 85 # c-file-offsets:((innamespace . 0)(inline-open . 0)); 86 # indent-tabs-mode: nil; 87 # End: 88 # 89 # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 90 */ 91
Note: See TracChangeset
for help on using the changeset viewer.