From 449318c35c1caa955a5295dcac34e284a2ef2750 Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Sun, 25 Nov 2001 01:39:52 +0000 Subject: [PATCH] * sim/ucsim/s51.src/glob.cc: DS390 SFRs and bits added. * sim/ucsim/s51.src/port.cc: Port 4 and 5 added. * sim/ucsim/s51.src/regs51.h: DS390 SFRs added. * sim/ucsim/s51.src/uc390.cc: Some details improved, CKRDY works for tinibios. * sim/ucsim/s51.src/uc390cl.h: Work in progress. * sim/ucsim/sim.src/uccl.h: 6 ports for DS390. * support/regression/fwk/lib/testfwk.c: Run with tinibios. * support/regression/ports/mcs51/spec.mk: Fine tuninig. * support/regression/ports/ds390/support.c: Use tinibios. * support/regression/ports/ds390/spec.mk: Fine tuning, use tinibios. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1639 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 24 +++++++- support/regression/fwk/lib/testfwk.c | 4 ++ support/regression/ports/ds390/spec.mk | 5 +- support/regression/ports/ds390/support.c | 76 +----------------------- support/regression/ports/mcs51/spec.mk | 3 +- 5 files changed, 33 insertions(+), 79 deletions(-) diff --git a/ChangeLog b/ChangeLog index a315314b..024e28e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,26 @@ -2001-11-23 Michael Hope +2001-11-25 Bernhard Held + + * sim/ucsim/s51.src/glob.cc: DS390 SFRs and bits added. + + * sim/ucsim/s51.src/port.cc: Port 4 and 5 added. + + * sim/ucsim/s51.src/regs51.h: DS390 SFRs added. + + * sim/ucsim/s51.src/uc390.cc: Some details improved, CKRDY works for tinibios. + + * sim/ucsim/s51.src/uc390cl.h: Work in progress. + + * sim/ucsim/sim.src/uccl.h: 6 ports for DS390. + + * support/regression/fwk/lib/testfwk.c: Run with tinibios. + + * support/regression/ports/mcs51/spec.mk: Fine tuninig. + + * support/regression/ports/ds390/support.c: Use tinibios. + + * support/regression/ports/ds390/spec.mk: Fine tuning, use tinibios. + +2001-11-23 Michael Hope support/regression/tests/bug-460010.c * src/z80/ralloc.c (packRegsForHLUse3): Changed to not pack into HL if anything is in direct space. (packRegsForHLUse3): Added packing support for send, cast, and return value from a call. diff --git a/support/regression/fwk/lib/testfwk.c b/support/regression/fwk/lib/testfwk.c index aa52d874..87d99a89 100644 --- a/support/regression/fwk/lib/testfwk.c +++ b/support/regression/fwk/lib/testfwk.c @@ -3,6 +3,10 @@ #include #include +#ifdef __ds390 +#include /* main() must see the ISR declarations */ +#endif + /** Define this if the port's div or mod functions are broken. A slow loop based method will be substituded. */ diff --git a/support/regression/ports/ds390/spec.mk b/support/regression/ports/ds390/spec.mk index 26d30800..efdc92d3 100644 --- a/support/regression/ports/ds390/spec.mk +++ b/support/regression/ports/ds390/spec.mk @@ -1,9 +1,9 @@ # Port specification for the ds390 port running with uCsim # path to uCsim -S51 = ../../sim/ucsim/s51.src/s51 +S51 = $(SDCC_DIR)/sim/ucsim/s51.src/s51 -SDCCFLAGS +=-mds390 --lesspedantic -DREENTRANT=reentrant --stack-after-data +SDCCFLAGS +=-mds390 --lesspedantic -DREENTRANT=reentrant --stack-after-data --debug OBJEXT = .rel EXEEXT = .ihx @@ -27,7 +27,6 @@ EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT) -grep -n FAIL $@ /dev/null || true fwk/lib/timeout: fwk/lib/timeout.c - gcc -o $@ $< _clean: rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \ diff --git a/support/regression/ports/ds390/support.c b/support/regression/ports/ds390/support.c index d91f1880..a4f29b18 100644 --- a/support/regression/ports/ds390/support.c +++ b/support/regression/ports/ds390/support.c @@ -22,83 +22,12 @@ what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -#include - -#define TIMED_ACCESS(sfr,value) { TA=0xaa; TA=0x55; sfr=value; } - -signed char _sdcc_external_startup(void) -{ - TI_0 = 1; // init transmitter - -/* copied from tinibios.h */ - - IE=0; // disable ALL interrupts - - // use A19..16 and !CE3..0, no CAN - TIMED_ACCESS(P4CNT,0x3f); - - // use !PCE3..0, serial 1 at P5.2/3 - TIMED_ACCESS(P5CNT,0x27); - - // disable watchdog - EWT=0; - - // watchdog set to 9.1 seconds - // CKCON|=0xc0; - - // default stretch cycles for MOVX - //CKCON = (CKCON&0xf8)|(CPU_MOVX_STRETCH&0x07); - CKCON=0xf9; - - // use internal 4k RAM as data(stack) memory at 0x400000 and - // move CANx memory access to 0x401000 and upwards - // use !CE* for program and/or data memory access - TIMED_ACCESS(MCON,0xaf); - - // select default cpu speed - //CpuSpeed(CPU_SPEED); will hang on s51 - - _asm - ; save the 24-bit return address - pop ar2; msb - pop ar1 - pop ar0; lsb - - - mov _TA,#0xaa; timed access - mov _TA,#0x55 - mov _ACON,#0x06; 24 bit addresses, 10 bit stack at 0x400000 - - mov _ESP,#0x00; reinitialize the stack - mov _SP,#0x00 - - ; restore the 24-bit return address - push ar0; lsb - push ar1 - push ar2; msb - _endasm; - - // global interrupt enable, all masks cleared - // let the Gods be with us :) - // IE = 0x80; - - //Serial0Init(SERIAL_0_BAUD,1); - //Serial1Init(SERIAL_1_BAUD,1); - //ClockInit(); - //RtcInit(); - //WatchDogInit(); - - // signal _sdcc_gsinit_startup to initialize data (call _sdcc_init_data) - return 0; -} +#include void _putchar (char c) { - while (!TI_0) - ; - TI_0 = 0; - SBUF0 = c; + Serial0PutChar (c); } void @@ -106,3 +35,4 @@ _exitEmu (void) { * (char idata *) 0 = * (char xdata *) 0x7654; } + diff --git a/support/regression/ports/mcs51/spec.mk b/support/regression/ports/mcs51/spec.mk index 560f14eb..d778f852 100644 --- a/support/regression/ports/mcs51/spec.mk +++ b/support/regression/ports/mcs51/spec.mk @@ -3,7 +3,7 @@ # model small # path to uCsim -S51 = ../../sim/ucsim/s51.src/s51 +S51 = $(SDCC_DIR)/sim/ucsim/s51.src/s51 SDCCFLAGS +=--lesspedantic -DREENTRANT=reentrant --stack-after-data @@ -29,7 +29,6 @@ EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT) -grep -n FAIL $@ /dev/null || true fwk/lib/timeout: fwk/lib/timeout.c - gcc -o $@ $< _clean: rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \ -- 2.47.2