[1] | 1 | include ../env.mk |
---|
| 2 | |
---|
| 3 | SOCVIEW_INC = ${SOCVIEW}/include |
---|
| 4 | SOCVIEW_LIB = ${SOCVIEW}/lib-linux/libsystemc.a |
---|
| 5 | CFLAGS_SOCVIEW = ${CFLAGS} -I${SOCVIEW_INC} |
---|
[3] | 6 | LFLAGS_SOCVIEW = ${LFLAGS} -ltermcap -lreadline -lpthread ${SOCVIEW_LIB} |
---|
[1] | 7 | |
---|
| 8 | SYSTEM = system.cpp system2.cpp |
---|
| 9 | EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x) |
---|
| 10 | EXE_SC = $(SYSTEM:.cpp=_systemc.x) |
---|
| 11 | EXE_SVIEW = $(SYSTEM:.cpp=_socview.x) |
---|
| 12 | EXE = ${EXE_SCASS} ${EXE_SVIEW} ${EXE_SC} |
---|
| 13 | OBJECTS = $(EXE:.x=.o) |
---|
| 14 | LINKS = $(OBJECTS:.o=.cpp) |
---|
| 15 | |
---|
| 16 | TEST1_DAT = \ |
---|
| 17 | test_socview_1.dat test_socview_1_reloaded.dat \ |
---|
| 18 | test_socview_2.dat test_socview_2_reloaded.dat \ |
---|
| 19 | test_socview_3.dat test_socview_3_reloaded.dat \ |
---|
| 20 | test_socview_3b.dat test_socview_3_reloaded_bis.dat \ |
---|
| 21 | test_socview_4.dat test_socview_4_reloaded.dat \ |
---|
| 22 | test_socview_5.dat test_socview_5_reloaded.dat \ |
---|
| 23 | test_socview_6.dat test_socview_6_reloaded.dat \ |
---|
| 24 | test_socview_7.dat test_socview_7_reloaded.dat \ |
---|
| 25 | test_socview_8.dat test_socview_8_reloaded.dat \ |
---|
| 26 | test_socview_9.dat test_socview_9_reloaded.dat \ |
---|
| 27 | test_socview_10.dat test_socview_10_reloaded.dat \ |
---|
| 28 | test_socview_10b.dat \ |
---|
| 29 | test_systemcass_0.dat \ |
---|
| 30 | test_systemcass_1.dat \ |
---|
| 31 | test_systemcass_2.dat \ |
---|
| 32 | test_systemcass_3.dat \ |
---|
| 33 | test_systemcass_4.dat \ |
---|
| 34 | test_systemcass_5.dat \ |
---|
| 35 | test_systemcass_6.dat \ |
---|
| 36 | test_systemcass_7.dat \ |
---|
| 37 | test_systemcass_8.dat \ |
---|
| 38 | test_systemcass_9.dat \ |
---|
| 39 | test_systemcass_10.dat \ |
---|
| 40 | test_systemcass_11.dat \ |
---|
| 41 | # |
---|
| 42 | TEST2_DAT = test2_socview_10.dat \ |
---|
| 43 | test2_socview_24a.dat test2_socview_24b.dat test2_socview_24c.dat \ |
---|
| 44 | test2_socview_20a.dat test2_socview_20b.dat test2_systemcass_20.dat |
---|
| 45 | # |
---|
| 46 | TEST3 = 20 |
---|
| 47 | TEST3_DAT = \ |
---|
| 48 | $(foreach i,${TEST3},test3_systemcass_$(i).dat) |
---|
| 49 | # |
---|
| 50 | .SECONDARY: |
---|
| 51 | |
---|
| 52 | main : $(EXE) |
---|
| 53 | |
---|
| 54 | test : test1 test2 test3 |
---|
| 55 | |
---|
| 56 | test1 : ${TEST1_DAT} |
---|
| 57 | diff test_socview_10.dat test_socview_10b.dat |
---|
| 58 | diff test_socview_1.dat test_socview_1_reloaded.dat |
---|
| 59 | diff test_socview_2.dat test_socview_2_reloaded.dat |
---|
| 60 | diff test_socview_3.dat test_socview_3b.dat |
---|
| 61 | diff test_socview_3.dat test_socview_3_reloaded_bis.dat |
---|
| 62 | diff test_socview_3.dat test_socview_3_reloaded.dat |
---|
| 63 | diff test_socview_4.dat test_socview_4_reloaded.dat |
---|
| 64 | diff test_socview_5.dat test_socview_5_reloaded.dat |
---|
| 65 | diff test_socview_6.dat test_socview_6_reloaded.dat |
---|
| 66 | diff test_socview_7.dat test_socview_7_reloaded.dat |
---|
| 67 | diff test_socview_8.dat test_socview_8_reloaded.dat |
---|
| 68 | diff test_socview_9.dat test_socview_9_reloaded.dat |
---|
| 69 | diff test_socview_10.dat test_socview_10_reloaded.dat |
---|
| 70 | @echo Test OK. |
---|
| 71 | |
---|
| 72 | test2 : ${TEST2_DAT} |
---|
| 73 | diff test2_socview_20a.dat test2_socview_20b.dat |
---|
| 74 | diff test2_socview_24a.dat test2_socview_24c.dat |
---|
| 75 | diff test2_socview_24a.dat test2_socview_24b.dat |
---|
| 76 | |
---|
| 77 | test3 : ${TEST3_DAT} ${TEST2_DAT} |
---|
| 78 | for i in ${TEST3} ; do \ |
---|
| 79 | diff test2_systemcass_$${i}.dat test3_systemcass_$${i}.dat \ |
---|
| 80 | || eval ${failcom} ; \ |
---|
| 81 | done |
---|
| 82 | |
---|
| 83 | ${TEST1_DAT} : system_socview.x system_systemcass.x socview_check_command socview_command |
---|
| 84 | rm -f ${TEST1_DAT} |
---|
| 85 | ./system_socview.x 11 < socview_command |
---|
| 86 | ./system_systemcass.x 11 |
---|
| 87 | ./system_socview.x 11 < socview_check_command |
---|
| 88 | |
---|
| 89 | ${TEST2_DAT} : system2_systemcass.x system2_socview.x socview_command2 |
---|
| 90 | rm -f ${TEST2_DAT} |
---|
| 91 | ./system2_systemcass.x 20 |
---|
| 92 | ./system2_socview.x 20 < socview_command2 |
---|
| 93 | |
---|
| 94 | ${TEST3_DAT} : system3_systemcass.x |
---|
| 95 | for i in ${TEST3} ; do \ |
---|
| 96 | system3_systemcass.x --save_on_exit test3_systemcass_$${i}.dat $${i} \ |
---|
| 97 | || eval ${failcom} ; \ |
---|
| 98 | done |
---|
| 99 | |
---|
| 100 | %.gif : %.dot |
---|
| 101 | dot -Tgif -o $*.gif $*.dot |
---|
| 102 | |
---|
| 103 | %_systemc.x : %_systemc.o $(SYSTEMC_LIB) |
---|
| 104 | $(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) |
---|
| 105 | |
---|
| 106 | %_systemcass.x : %_systemcass.o $(SYSTEMCASS_LIB) |
---|
| 107 | $(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) |
---|
| 108 | |
---|
| 109 | %_socview.x : %_socview.o $(SOCVIEW_LIB) |
---|
| 110 | $(CXX) -o $@ $*_socview.o $(LFLAGS_SOCVIEW) |
---|
| 111 | |
---|
| 112 | include Makefile.deps |
---|
| 113 | |
---|
| 114 | %_systemc.cpp : %.cpp |
---|
| 115 | ln -s $*.cpp $*_systemc.cpp |
---|
| 116 | |
---|
| 117 | %_systemcass.cpp : %.cpp |
---|
| 118 | ln -s $*.cpp $*_systemcass.cpp |
---|
| 119 | |
---|
| 120 | %_socview.cpp : %.cpp |
---|
| 121 | ln -s $*.cpp $*_socview.cpp |
---|
| 122 | |
---|
| 123 | %_systemc.o : %_systemc.cpp |
---|
| 124 | $(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps |
---|
| 125 | $(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o |
---|
| 126 | |
---|
| 127 | %_systemcass.o : %_systemcass.cpp |
---|
| 128 | $(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps |
---|
| 129 | $(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o |
---|
| 130 | |
---|
| 131 | %_socview.o : %_socview.cpp |
---|
| 132 | $(CXX) $(CFLAGS_SOCVIEW) -MM $*_socview.cpp >> Makefile.deps |
---|
| 133 | $(CXX) $(CFLAGS_SOCVIEW) -c $*_socview.cpp -o $*_socview.o |
---|
| 134 | |
---|
| 135 | cleandat : |
---|
| 136 | -rm -f ${TEST1_DAT} ${TEST2_DAT} ${TEST3_DAT} |
---|
| 137 | |
---|
| 138 | clean : cleandat |
---|
| 139 | -echo > Makefile.deps |
---|
| 140 | -rm -f *.o gmon.out *~ |
---|
| 141 | -rm -f results |
---|
| 142 | -rm -f signal_order.txt module_order.dot signal_graph.dot |
---|
| 143 | -rm -f module_order.gif signal_graph.gif |
---|
| 144 | -rm -f $(EXE) $(OBJECTS) |
---|
| 145 | -for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null |
---|
| 146 | -rm -f core* |
---|
| 147 | -rm -rf generated_by_systemcass |
---|
| 148 | -rm -rf system_systemcass.x.vcd system_systemc.x.vcd |
---|
| 149 | |
---|