Changeset 55 for sources/test_regression/05092005
- Timestamp:
- May 28, 2013, 11:17:14 AM (11 years ago)
- Location:
- sources/test_regression/05092005
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/test_regression/05092005/Makefile
r15 r55 1 1 2 include ../env.mk 3 include ../Makefile.common 2 4 3 SYSTEM = system.cpp4 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)10 5 11 .SECONDARY: 6 test: $(EXE_SCASS) 7 @echo -ne "| Testing $$(basename $$(pwd)): " ; 8 @./$< 2> /dev/null ; 9 @if [ $$? -eq 0 ] ; then echo "KO" ; else echo "OK" ; fi ; 12 10 13 main : $(EXE)14 11 15 test : $(EXE_SCASS)16 @for i in ${EXE_SCASS} ; do \17 echo Testing $$i... ; \18 $$i ; \19 if [ $$? -ne 77 ] ; then eval $${failcom} ; fi ; \20 echo Bug detection OK ; \21 done;22 23 %.gif : %.dot24 dot -Tgif -o $*.gif $*.dot25 26 %_systemc.x : %_systemc.o $(SYSTEMC_LIB)27 $(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)28 29 %_systemcass.x : %_systemcass.o $(SYSTEMCASS_LIB)30 $(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)31 32 -include Makefile.deps33 34 %_systemc.cpp : %.cpp35 ln -s $*.cpp $*_systemc.cpp36 37 %_systemcass.cpp : %.cpp38 ln -s $*.cpp $*_systemcass.cpp39 40 %_systemc.o : %_systemc.cpp41 $(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps42 $(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o43 44 %_systemcass.o : %_systemcass.cpp45 $(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps46 $(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o47 48 clean :49 rm -f Makefile.deps50 -rm -f *.o gmon.out *~51 -rm -f ${LOG}52 -rm -f signal_order.txt module_order.dot signal_graph.dot53 -rm -f module_order.gif signal_graph.gif54 -rm -f $(EXE) $(OBJECTS)55 -for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null56 -rm -f core*57 -rm -rf system_systemcass.x.vcd system_systemc.x.vcd58 -rm -rf generated_by_systemcass59 -
sources/test_regression/05092005/system.cpp
r1 r55 1 1 2 #include "systemc.h" 2 3 3 #define ASSERT(x) \ 4 { errnum++; \ 5 if (!(x)) \ 6 { \ 7 cerr << "ASSERT : " #x "\n"; \ 8 exit (errnum); \ 9 } \ 10 } 4 #include "test.h" 11 5 12 6 using namespace std; 13 7 14 struct hard : sc_module 15 { 16 sc_in <bool> i; 17 sc_out<bool> o; 18 SC_HAS_PROCESS(hard); 19 hard(sc_module_name) 20 { 21 } 8 struct hard : sc_module { 9 sc_in<bool> i; 10 sc_out<bool> o; 11 SC_HAS_PROCESS(hard); 12 hard(sc_module_name) {} 22 13 }; 23 14 24 int25 sc_main (int argc, char ** argv)26 {27 sc_signal<bool> s[5];28 hard a("a");29 hard b("b");30 a.i (s[0]);31 a.o (s[1]);32 b.i (s[5]); // Wrong array index. This BUG should be detected.33 b.o (s[2]);34 15 35 sc_initialize (); 36 sc_start (1); 16 int sc_main (int argc, char ** argv) { 17 sc_clock signal_clk("my_clock", sc_time(1, sc_core::SC_NS)); 18 sc_signal<bool> s[5]; 19 hard a("a"); 20 hard b("b"); 21 a.i(s[0]); 22 a.o(s[1]); 23 b.i(s[5]); // Wrong array index. This BUG should be detected. 24 b.o(s[2]); 37 25 38 cerr << "Test KO.\n"; 39 return 0; 26 sc_start(sc_time(0, sc_core::SC_NS)); 27 28 sc_start(sc_time(1, sc_core::SC_NS)); 29 30 return 0; 40 31 } 41 32 33 34 /* 35 # Local Variables: 36 # tab-width: 4; 37 # c-basic-offset: 4; 38 # c-file-offsets:((innamespace . 0)(inline-open . 0)); 39 # indent-tabs-mode: nil; 40 # End: 41 # 42 # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 43 */ 44
Note: See TracChangeset
for help on using the changeset viewer.