From 41ef33bded77a2d0f7c380f7a6ecd3604ee4b384 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 29 Feb 2020 09:16:50 -0600 Subject: [PATCH] eZ80: Fix optimization issues board/z80/ez80/*/scripts/Make.defs: Fix optimization definition use in assembly flags. It was using the compiler optimization settings instead of the assembler optimization settings. Hence, enabling optimization would could cause assembler command line errors. arch/z80/src/ez80/Toolchain.defs: Back out some work arounds. Now compiler optimization flags can again set set without assembler command line errors. boards/z80/ez80/z20x/README.txt: Trivial update to size/optimization discussion. --- arch/z80/src/ez80/Toolchain.defs | 14 ++++------ .../ez80/ez80f910200kitg/scripts/Make.defs | 2 +- .../z80/ez80/ez80f910200zco/scripts/Make.defs | 2 +- boards/z80/ez80/makerlisp/scripts/Make.defs | 2 +- boards/z80/ez80/z20x/README.txt | 26 +++++++++++++------ boards/z80/ez80/z20x/scripts/Make.defs | 2 +- 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/arch/z80/src/ez80/Toolchain.defs b/arch/z80/src/ez80/Toolchain.defs index f869a56ef5..e4e319e7a0 100644 --- a/arch/z80/src/ez80/Toolchain.defs +++ b/arch/z80/src/ez80/Toolchain.defs @@ -107,14 +107,12 @@ endif # CPU Identification ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) - ARCHCPU = eZ80F91 + ARCHCPU = eZ80F91 ARCHCPUDEF = _EZ80F91 ARCHFAMILY = _EZ80ACCLAIM! else ifeq ($(CONFIG_ARCH_CHIP_EZ80F92),y) - #ARCHCPU = eZ80F92 - #ARCHCPUDEF = _EZ80F92 - ARCHCPU = eZ80F91 - ARCHCPUDEF = _EZ80F91 + ARCHCPU = eZ80F92 + ARCHCPUDEF = _EZ80F92 ARCHFAMILY = _EZ80ACCLAIM! endif @@ -129,11 +127,9 @@ else endif ifeq ($(CONFIG_DEBUG_NOOPT),y) -# ARCHOPTIMIZATION += -promote -reduceopt -NOsdiopt - ARCHOPTIMIZATION += -NOsdiopt + ARCHOPTIMIZATION += -NOpromote -reduceopt -NOsdiopt else -# ARCHOPTIMIZATION += -NOpromote -NOreduceopt -sdiopt -optsize - ARCHOPTIMIZATION += -sdiopt + ARCHOPTIMIZATION += -promote -NOreduceopt -sdiopt -optsize endif # Tool names/paths. diff --git a/boards/z80/ez80/ez80f910200kitg/scripts/Make.defs b/boards/z80/ez80/ez80f910200kitg/scripts/Make.defs index ae25e7f385..27f4907106 100644 --- a/boards/z80/ez80/ez80f910200kitg/scripts/Make.defs +++ b/boards/z80/ez80/ez80f910200kitg/scripts/Make.defs @@ -63,7 +63,7 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHOPTIMIZATION)" + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn diff --git a/boards/z80/ez80/ez80f910200zco/scripts/Make.defs b/boards/z80/ez80/ez80f910200zco/scripts/Make.defs index b16713515e..0f4b15c6b1 100644 --- a/boards/z80/ez80/ez80f910200zco/scripts/Make.defs +++ b/boards/z80/ez80/ez80f910200zco/scripts/Make.defs @@ -63,7 +63,7 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHOPTIMIZATION)" + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn diff --git a/boards/z80/ez80/makerlisp/scripts/Make.defs b/boards/z80/ez80/makerlisp/scripts/Make.defs index c722657eae..b351ee7332 100644 --- a/boards/z80/ez80/makerlisp/scripts/Make.defs +++ b/boards/z80/ez80/makerlisp/scripts/Make.defs @@ -63,7 +63,7 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHOPTIMIZATION)" + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn diff --git a/boards/z80/ez80/z20x/README.txt b/boards/z80/ez80/z20x/README.txt index 09f6c27a0d..bae5957b5a 100644 --- a/boards/z80/ez80/z20x/README.txt +++ b/boards/z80/ez80/z20x/README.txt @@ -95,13 +95,6 @@ Memory Constaints you enable assertions, debug outputs, or even debug symbols. It is very unlikely that the nsh_flash configuration will fit into FLASH at all! - I believe that there is some issue with the optimization CFLAGS used with - the ZDS-II compiler. The size of the FLASH images that are generated are - larger than you would see with, say, an equivalent Cortex-M compilation. - I reviewed the individual object files. There is not one thing that is - causing the large size. Rather, the ZDS-II compiler is simply generating - larger CODE sections in the object files. - Serial Console ============== @@ -222,9 +215,12 @@ Configuration Subdirectories NOTES: 1. UNVERIFIED! I doubt that the nsh_flash program will fit into the - smaller FLASH memory of the eZ80F92 part. See discusssion under + smaller FLASH memory of the eZ80F92 part. See discussion under "Memory Constraints" above. + The nsh_ram configuration, of course, depends on the sdboot + bootloader to load that program into RAM. + 2. The two configurations different only in that one builds for execution entirely from FLASH and the other for execution entirely from RAM. A bootloader of some kind is required to support such @@ -349,3 +345,17 @@ Configuration Subdirectories 64Kb of FLASH memory. It will not be possible to run programs in SRAM *unless* some mechanism is developed to redirect interrupts from ROM and into loaded SRAM logic. + + For example, it might be possible to implement this kind of + vectoring to get to a RAM based interrupt handler: + + a. The initial 16-bit address in the interrupt vector table can + transfer the interrupt to a larger jump table also in lower + flash memory. + b. That jump table could vector to another jump table at a known + location RAM. + c. The RAM jump table could then jump to the final RAM-based + interrupt handler. + + This would effect the logic in arch/z80/src/ez80/ez80f92_handlers.am + and possible the z20x *.linkcmd files. diff --git a/boards/z80/ez80/z20x/scripts/Make.defs b/boards/z80/ez80/z20x/scripts/Make.defs index dab450ea2f..71d9b08088 100644 --- a/boards/z80/ez80/z20x/scripts/Make.defs +++ b/boards/z80/ez80/z20x/scripts/Make.defs @@ -48,7 +48,7 @@ AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) # Compiler definitions ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHOPTIMIZATION)" + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn