From: borutr Date: Sun, 28 Oct 2007 14:45:55 +0000 (+0000) Subject: * support/regression/Makefile.in, X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=62340b1075f4347fb9e4aa007635b561d0f1ce45;p=fw%2Fsdcc * support/regression/Makefile.in, support/regression/ports/mcs51-large/spec.mk, support/regression/ports/mcs51-xstack-auto/spec.mk, support/regression/ports/mcs51-stack-auto/spec.mk, support/regression/ports/mcs51-medium/spec.mk, support/regression/ports/mcs51-common/spec.mk, support/regression/ports/mcs51-common/*, support/regression/ports/mcs51-small/*: mcs51 renamed to mcs51-common, created mcs51-small git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4945 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 70b5d09a..9076edc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-10-28 Borut Razem + + * support/regression/Makefile.in, + support/regression/ports/mcs51-large/spec.mk, + support/regression/ports/mcs51-xstack-auto/spec.mk, + support/regression/ports/mcs51-stack-auto/spec.mk, + support/regression/ports/mcs51-medium/spec.mk, + support/regression/ports/mcs51-common/spec.mk, + support/regression/ports/mcs51-common/*, + support/regression/ports/mcs51-small/*: + mcs51 renamed to mcs51-common, created mcs51-small + 2007-10-26 Maarten Brock * src/mcs51/peeph.def: moved rules 257.x to 253.x and re-enabled 253.b, diff --git a/support/regression/Makefile.in b/support/regression/Makefile.in index 4bedab0c..08a1c0ee 100644 --- a/support/regression/Makefile.in +++ b/support/regression/Makefile.in @@ -69,10 +69,10 @@ GENERATE_CASES = $(srcdir)/generate-cases.py # Each directory under ports/ is used as a port name. Each port is tested. # Each port must have a spec.mk which describes how to build the object # files and how to run the emulator. -ALL_PORTS = $(filter-out .svn xa51 z80 gbz80 pic16 pic14,$(notdir $(wildcard $(PORTS_DIR)/*))) +ALL_PORTS = $(filter-out .svn xa51 z80 gbz80 pic16 pic14 mcs51-common,$(notdir $(wildcard $(PORTS_DIR)/*))) # These ports will be cleaned with 'make clean' -CLEAN_PORTS = $(filter-out .svn,$(notdir $(wildcard $(PORTS_DIR)/*))) +CLEAN_PORTS = $(filter-out .svn mcs51-common,$(notdir $(wildcard $(PORTS_DIR)/*))) MAKE_LIBRARY = @@ -94,7 +94,7 @@ test-gbz80: test-mcs51: test-mcs51-small test-mcs51-medium test-mcs51-large test-mcs51-stack-auto test-mcs51-xstack-auto test-mcs51-small: - $(MAKE) test-port PORT=mcs51 + $(MAKE) test-port PORT=mcs51-small test-mcs51-medium: $(MAKE) test-port PORT=mcs51-medium diff --git a/support/regression/ports/mcs51-common/T2_isr.c b/support/regression/ports/mcs51-common/T2_isr.c new file mode 100644 index 00000000..2a248d15 --- /dev/null +++ b/support/regression/ports/mcs51-common/T2_isr.c @@ -0,0 +1,6 @@ +//dummy interrupt service routine +//just to make linker happy + +void T2_isr (void) interrupt 5 +{ +} diff --git a/support/regression/ports/mcs51-common/fwk.lib b/support/regression/ports/mcs51-common/fwk.lib new file mode 100644 index 00000000..c6898f8f --- /dev/null +++ b/support/regression/ports/mcs51-common/fwk.lib @@ -0,0 +1 @@ +T2_isr.rel diff --git a/support/regression/ports/mcs51-common/spec.mk b/support/regression/ports/mcs51-common/spec.mk new file mode 100644 index 00000000..14aeffd3 --- /dev/null +++ b/support/regression/ports/mcs51-common/spec.mk @@ -0,0 +1,51 @@ +# Common specification for the mcs51 ports running with uCsim + +ifndef DEV_NULL + DEV_NULL = /dev/null +endif + +# path to uCsim +S51A = $(top_builddir)/sim/ucsim/s51.src/s51 +S51B = $(top_builddir)/bin/s51 + +S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi) + +SDCCFLAGS +=--nostdinc --less-pedantic -DREENTRANT=reentrant -I$(INC_DIR)/mcs51 -I$(top_srcdir) +LINKFLAGS = --nostdlib +LINKFLAGS += mcs51.lib libsdcc.lib liblong.lib libint.lib libfloat.lib + +OBJEXT = .rel +EXEEXT = .ihx + +EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) +FWKLIB = $(PORT_CASES_DIR)/T2_isr$(OBJEXT) + +# Rule to link into .ihx +%$(EXEEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ + +%$(OBJEXT): %.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51-common/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/fwk.lib: + cp $(PORTS_DIR)/mcs51-common/fwk.lib $@ + +# run simulator with 30 seconds timeout +%.out: %$(EXEEXT) gen/timeout + mkdir -p $(dir $@) + -gen/timeout 30 "$(S51)" -t32 -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/mcs51-common/uCsim.cmd > $(@:.out=.sim) \ + || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ + python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@ + -grep -n FAIL $@ /dev/null || true + + +gen/timeout: $(srcdir)/fwk/lib/timeout.c + $(CC) $< -o $@ + +_clean: diff --git a/support/regression/ports/mcs51-common/support.c b/support/regression/ports/mcs51-common/support.c new file mode 100644 index 00000000..9edef199 --- /dev/null +++ b/support/regression/ports/mcs51-common/support.c @@ -0,0 +1,33 @@ +// #define MICROCONTROLLER_8051 +#include + +unsigned char +_sdcc_external_startup (void) +{ + /* serial port mode 0 is default */ + /* enable transmission of first byte */ + TI = 1; + return 0; +} + +void +_putchar (char c) +{ + while (!TI) + ; + TI = 0; + SBUF = c; +} + +void +_initEmu (void) +{ +} + +void +_exitEmu (void) +{ + while (!TI) /* wait for the last character to be transmitted */ + ; /* before hitting the breakpoint */ + * (char idata *) 0 = * (char xdata *) 0x7654; +} diff --git a/support/regression/ports/mcs51-common/uCsim.cmd b/support/regression/ports/mcs51-common/uCsim.cmd new file mode 100644 index 00000000..cd2b1680 --- /dev/null +++ b/support/regression/ports/mcs51-common/uCsim.cmd @@ -0,0 +1,8 @@ +set error non-classified off +set error unknown_code off +set error memory off +set error stack off +break xram r 0x7654 +run +state +quit diff --git a/support/regression/ports/mcs51-large/spec.mk b/support/regression/ports/mcs51-large/spec.mk index e7353466..e919a49e 100644 --- a/support/regression/ports/mcs51-large/spec.mk +++ b/support/regression/ports/mcs51-large/spec.mk @@ -1,13 +1,9 @@ -# Port specification for the mcs51 port running with uCsim +# Port specification for the mcs51-large port running with uCsim # # model large SDCCFLAGS +=--model-large -include $(PORTS_DIR)/mcs51/spec.mk - -# use C sources from mcs51 -$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ +include $(PORTS_DIR)/mcs51-common/spec.mk LIBDIR = $(top_builddir)/device/lib/build/large diff --git a/support/regression/ports/mcs51-medium/spec.mk b/support/regression/ports/mcs51-medium/spec.mk index 5fdd1593..a6014ab7 100644 --- a/support/regression/ports/mcs51-medium/spec.mk +++ b/support/regression/ports/mcs51-medium/spec.mk @@ -1,13 +1,9 @@ -# Port specification for the mcs51 port running with uCsim +# Port specification for the mcs51-medium port running with uCsim # # model medium SDCCFLAGS +=--model-medium -include $(PORTS_DIR)/mcs51/spec.mk - -# use C sources from mcs51 -$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ +include $(PORTS_DIR)/mcs51-common/spec.mk LIBDIR = $(top_builddir)/device/lib/build/medium diff --git a/support/regression/ports/mcs51-small/spec.mk b/support/regression/ports/mcs51-small/spec.mk new file mode 100644 index 00000000..58a0616d --- /dev/null +++ b/support/regression/ports/mcs51-small/spec.mk @@ -0,0 +1,9 @@ +# Port specification for the mcs51 port running with uCsim +# +# model small + +SDCCFLAGS +=--model-small + +include $(PORTS_DIR)/mcs51-common/spec.mk + +LIBDIR = $(top_builddir)/device/lib/build/small diff --git a/support/regression/ports/mcs51-stack-auto/spec.mk b/support/regression/ports/mcs51-stack-auto/spec.mk index 9025a9b4..4727dccd 100644 --- a/support/regression/ports/mcs51-stack-auto/spec.mk +++ b/support/regression/ports/mcs51-stack-auto/spec.mk @@ -1,13 +1,9 @@ -# Port specification for the mcs51 port running with uCsim +# Port specification for the mcs51-stack-auto port running with uCsim # # model small stack-auto SDCCFLAGS +=--stack-auto -include $(PORTS_DIR)/mcs51/spec.mk - -# use C sources from mcs51 -$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ +include $(PORTS_DIR)/mcs51-common/spec.mk LIBDIR = $(top_builddir)/device/lib/build/small-stack-auto diff --git a/support/regression/ports/mcs51-xstack-auto/spec.mk b/support/regression/ports/mcs51-xstack-auto/spec.mk index 16fcc2df..ca07c46a 100644 --- a/support/regression/ports/mcs51-xstack-auto/spec.mk +++ b/support/regression/ports/mcs51-xstack-auto/spec.mk @@ -1,8 +1,8 @@ -# Port specification for the mcs51 port running with uCsim +# Port specification for the mcs51-xstack-auto port running with uCsim # # model small xstack-auto -include $(PORTS_DIR)/mcs51/spec.mk +include $(PORTS_DIR)/mcs51-common/spec.mk LIBSRCDIR = $(top_srcdir)/device/lib LIBBUILDDIR = $(top_builddir)/device/lib @@ -11,10 +11,6 @@ LIBDIR = $(PORT_CASES_DIR)/lib LIBSDCCFLAGS+= --stack-auto --xstack --std-c99 SDCCFLAGS += --stack-auto --xstack --std-sdcc99 -# use C sources from mcs51 -$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - SOURCES = _atoi.c _atol.c _autobaud.c _bp.c _schar2fs.c \ _decdptr.c _divsint.c _divslong.c _divuint.c \ _divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \ diff --git a/support/regression/ports/mcs51/T2_isr.c b/support/regression/ports/mcs51/T2_isr.c deleted file mode 100644 index 2a248d15..00000000 --- a/support/regression/ports/mcs51/T2_isr.c +++ /dev/null @@ -1,6 +0,0 @@ -//dummy interrupt service routine -//just to make linker happy - -void T2_isr (void) interrupt 5 -{ -} diff --git a/support/regression/ports/mcs51/fwk.lib b/support/regression/ports/mcs51/fwk.lib deleted file mode 100644 index c6898f8f..00000000 --- a/support/regression/ports/mcs51/fwk.lib +++ /dev/null @@ -1 +0,0 @@ -T2_isr.rel diff --git a/support/regression/ports/mcs51/spec.mk b/support/regression/ports/mcs51/spec.mk deleted file mode 100644 index 4d3ebf3c..00000000 --- a/support/regression/ports/mcs51/spec.mk +++ /dev/null @@ -1,54 +0,0 @@ -# Port specification for the mcs51 port running with uCsim -# -# model small - -ifndef DEV_NULL - DEV_NULL = /dev/null -endif - -# path to uCsim -S51A = $(top_builddir)/sim/ucsim/s51.src/s51 -S51B = $(top_builddir)/bin/s51 - -S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi) - -SDCCFLAGS +=--nostdinc --less-pedantic -DREENTRANT=reentrant -I$(INC_DIR)/mcs51 -I$(top_srcdir) -LINKFLAGS = --nostdlib -LINKFLAGS += mcs51.lib libsdcc.lib liblong.lib libint.lib libfloat.lib -LIBDIR = $(top_builddir)/device/lib/build/small - -OBJEXT = .rel -EXEEXT = .ihx - -EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) -FWKLIB = $(PORT_CASES_DIR)/T2_isr$(OBJEXT) - -# Rule to link into .ihx -%$(EXEEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib - $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ - -%$(OBJEXT): %.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - -$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - -$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - -$(PORT_CASES_DIR)/fwk.lib: - cp $(PORTS_DIR)/mcs51/fwk.lib $@ - -# run simulator with 30 seconds timeout -%.out: %$(EXEEXT) gen/timeout - mkdir -p $(dir $@) - -gen/timeout 30 "$(S51)" -t32 -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/mcs51/uCsim.cmd > $(@:.out=.sim) \ - || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ - python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@ - -grep -n FAIL $@ /dev/null || true - - -gen/timeout: $(srcdir)/fwk/lib/timeout.c - $(CC) $< -o $@ - -_clean: diff --git a/support/regression/ports/mcs51/support.c b/support/regression/ports/mcs51/support.c deleted file mode 100644 index 9edef199..00000000 --- a/support/regression/ports/mcs51/support.c +++ /dev/null @@ -1,33 +0,0 @@ -// #define MICROCONTROLLER_8051 -#include - -unsigned char -_sdcc_external_startup (void) -{ - /* serial port mode 0 is default */ - /* enable transmission of first byte */ - TI = 1; - return 0; -} - -void -_putchar (char c) -{ - while (!TI) - ; - TI = 0; - SBUF = c; -} - -void -_initEmu (void) -{ -} - -void -_exitEmu (void) -{ - while (!TI) /* wait for the last character to be transmitted */ - ; /* before hitting the breakpoint */ - * (char idata *) 0 = * (char xdata *) 0x7654; -} diff --git a/support/regression/ports/mcs51/uCsim.cmd b/support/regression/ports/mcs51/uCsim.cmd deleted file mode 100644 index cd2b1680..00000000 --- a/support/regression/ports/mcs51/uCsim.cmd +++ /dev/null @@ -1,8 +0,0 @@ -set error non-classified off -set error unknown_code off -set error memory off -set error stack off -break xram r 0x7654 -run -state -quit