From 781d283c3c8d55b2fa666a45f1c03e836a79f821 Mon Sep 17 00:00:00 2001 From: Florian Reitz Date: Sun, 24 Feb 2019 11:24:04 +0100 Subject: [PATCH] Flasher project added --- AppleIISd.sln | 6 + Software/Flasher.vcxproj | 97 +++++++++ Software/Flasher.vcxproj.filters | 12 ++ Software/makefile | 346 +++++++++++++++++++++++++++++++ Software/src/Flasher.c | 59 ++++++ VHDL/AddressDecoder_old.jhd | 1 - VHDL/AddressDecoder_old.sch | 275 ------------------------ VHDL/AddressDecoder_old_Test.vhd | 172 --------------- VHDL/sch2HdlBatchFile | 0 9 files changed, 520 insertions(+), 448 deletions(-) create mode 100644 Software/Flasher.vcxproj create mode 100644 Software/Flasher.vcxproj.filters create mode 100644 Software/makefile create mode 100644 Software/src/Flasher.c delete mode 100644 VHDL/AddressDecoder_old.jhd delete mode 100644 VHDL/AddressDecoder_old.sch delete mode 100644 VHDL/AddressDecoder_old_Test.vhd delete mode 100644 VHDL/sch2HdlBatchFile diff --git a/AppleIISd.sln b/AppleIISd.sln index 57f1e60..af8cc32 100644 --- a/AppleIISd.sln +++ b/AppleIISd.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleIISd", "Firmware\AppleIISd.vcxproj", "{9EA7EC3D-1771-420F-932F-231A35ED1200}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flasher", "Software\Flasher.vcxproj", "{B2CF2E9D-62A7-4A68-9477-9B15A8707E78}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -15,6 +17,10 @@ Global {9EA7EC3D-1771-420F-932F-231A35ED1200}.Debug|x86.Build.0 = Debug|Win32 {9EA7EC3D-1771-420F-932F-231A35ED1200}.Release|x86.ActiveCfg = Release|Win32 {9EA7EC3D-1771-420F-932F-231A35ED1200}.Release|x86.Build.0 = Release|Win32 + {B2CF2E9D-62A7-4A68-9477-9B15A8707E78}.Debug|x86.ActiveCfg = Debug|Win32 + {B2CF2E9D-62A7-4A68-9477-9B15A8707E78}.Debug|x86.Build.0 = Debug|Win32 + {B2CF2E9D-62A7-4A68-9477-9B15A8707E78}.Release|x86.ActiveCfg = Release|Win32 + {B2CF2E9D-62A7-4A68-9477-9B15A8707E78}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Software/Flasher.vcxproj b/Software/Flasher.vcxproj new file mode 100644 index 0000000..c1546b0 --- /dev/null +++ b/Software/Flasher.vcxproj @@ -0,0 +1,97 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + {B2CF2E9D-62A7-4A68-9477-9B15A8707E78} + MakeFileProj + Flasher + + + + Makefile + true + v140 + + + Makefile + false + v140 + + + + + + + + + + + + + + + __APPLE2__;__APPLE2ENH__;__fastcall__=__fastcall;_MSC_VER=0;__attribute__ + $(PATH);C:\cc65\bin + C:\cc65\include + C:\cc65\lib + + + $(MAKE_HOME)\make OPTIONS=mapfile,listing + $(ProjectDir)\src + $(MAKE_HOME)\make clean +$(MAKE_HOME)\make OPTIONS=mapfile,listing + $(SolutionDir)\ + $(MAKE_HOME)\make clean + + + + + + + + del /S /Q "$(ProjectDir)makefile.options +$(MAKE_HOME)\make -C "$(ProjectDir)\" PROGRAM="$(ProjectDir)$(Configuration)\$(ProjectName)" +rmdir /S /Q "$(ProjectDir)obj\Win32" +rmdir /S /Q "$(SolutionDir)Release" + del /S /Q "$(ProjectDir)makefile.options +$(MAKE_HOME)\make clean -C "$(ProjectDir)\" PROGRAM="$(ProjectDir)$(Configuration)\$(ProjectName)" +$(MAKE_HOME)\make -C "$(ProjectDir)\" PROGRAM="$(ProjectDir)$(Configuration)\$(ProjectName)" +rmdir /S /Q "$(ProjectDir)obj\Win32" +rmdir /S /Q "$(SolutionDir)Release" + + del /S /Q "$(ProjectDir)makefile.options +$(MAKE_HOME)\make clean -C "$(ProjectDir)\" PROGRAM="$(ProjectDir)$(Configuration)\$(ProjectName)" +rmdir /S /Q "$(ProjectDir)obj\Win32" +rmdir /S /Q "$(SolutionDir)Release" + $(PATH);C:\cc65\bin + $(VC_IncludePath);C:\cc65\include + + C:\cc65\lib + + + $(SolutionDir)$\ + + + + + + + \ No newline at end of file diff --git a/Software/Flasher.vcxproj.filters b/Software/Flasher.vcxproj.filters new file mode 100644 index 0000000..f146eaf --- /dev/null +++ b/Software/Flasher.vcxproj.filters @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/makefile b/Software/makefile new file mode 100644 index 0000000..d4887d5 --- /dev/null +++ b/Software/makefile @@ -0,0 +1,346 @@ +############################################################################### +### Generic Makefile for cc65 projects - full version with abstract options ### +### V1.3.0(w) 2010 - 2013 Oliver Schmidt & Patryk "Silver Dream !" ?ogiewa ### +############################################################################### + +############################################################################### +### In order to override defaults - values can be assigned to the variables ### +############################################################################### + +# Space or comma separated list of cc65 supported target platforms to build for. +# Default: c64 (lowercase!) +TARGETS := apple2enh + +# Name of the final, single-file executable. +# Default: name of the current dir with target name appended +PROGRAM := Flasher + +# Path(s) to additional libraries required for linking the program +# Use only if you don't want to place copies of the libraries in SRCDIR +# Default: none +LIBS := + +# Custom linker configuration file +# Use only if you don't want to place it in SRCDIR +# Default: none +CONFIG := + +# Additional C compiler flags and options. +# Default: none +CFLAGS = + +# Additional assembler flags and options. +# Default: none +ASFLAGS = + +# Additional linker flags and options. +# Default: none +LDFLAGS = + +# Path to the directory containing C and ASM sources. +# Default: src +SRCDIR := + +# Path to the directory where object files are to be stored (inside respective target subdirectories). +# Default: obj +OBJDIR := + +# Command used to run the emulator. +# Default: depending on target platform. For default (c64) target: x64 -kernal kernal -VICIIdsize -autoload +EMUCMD := + +# Optional commands used before starting the emulation process, and after finishing it. +# Default: none +# Examples +#PREEMUCMD := osascript -e "tell application \"System Events\" to set isRunning to (name of processes) contains \"X11.bin\"" -e "if isRunning is true then tell application \"X11\" to activate" +#PREEMUCMD := osascript -e "tell application \"X11\" to activate" +#POSTEMUCMD := osascript -e "tell application \"System Events\" to tell process \"X11\" to set visible to false" +#POSTEMUCMD := osascript -e "tell application \"Terminal\" to activate" +PREEMUCMD := +POSTEMUCMD := + +# On Windows machines VICE emulators may not be available in the PATH by default. +# In such case, please set the variable below to point to directory containing +# VICE emulators. +#VICE_HOME := "C:\Program Files\WinVICE-2.2-x86\" +VICE_HOME := + +# Options state file name. You should not need to change this, but for those +# rare cases when you feel you really need to name it differently - here you are +STATEFILE := Makefile.options + +################################################################################### +#### DO NOT EDIT BELOW THIS LINE, UNLESS YOU REALLY KNOW WHAT YOU ARE DOING! #### +################################################################################### + +################################################################################### +### Mapping abstract options to the actual compiler, assembler and linker flags ### +### Predefined compiler, assembler and linker flags, used with abstract options ### +### valid for 2.14.x. Consult the documentation of your cc65 version before use ### +################################################################################### + +# Compiler flags used to tell the compiler to optimise for SPEED +define _optspeed_ + CFLAGS += -Oris +endef + +# Compiler flags used to tell the compiler to optimise for SIZE +define _optsize_ + CFLAGS += -Or +endef + +# Compiler and assembler flags for generating listings +define _listing_ + CFLAGS += --listing $$(@:.o=.lst) -T + ASFLAGS += --listing $$(@:.o=.lst) + REMOVES += $(addsuffix .lst,$(basename $(OBJECTS))) +endef + +# Linker flags for generating map file +define _mapfile_ + LDFLAGS += --mapfile $$@.map + REMOVES += $(PROGRAM).map +endef + +# Linker flags for generating VICE label file +define _labelfile_ + LDFLAGS += -Ln $$@.lbl + REMOVES += $(PROGRAM).lbl +endef + +# Linker flags for generating a debug file +define _debugfile_ + LDFLAGS += -Wl --dbgfile,$$@.dbg + REMOVES += $(PROGRAM).dbg +endef + +############################################################################### +### Defaults to be used if nothing defined in the editable sections above ### +############################################################################### + +# Presume the C64 target like the cl65 compile & link utility does. +# Set TARGETS to override. +ifeq ($(TARGETS),) + TARGETS := c64 +endif + +# Presume we're in a project directory so name the program like the current +# directory. Set PROGRAM to override. +ifeq ($(PROGRAM),) + PROGRAM := $(notdir $(CURDIR)) +endif + +# Presume the C and asm source files to be located in the subdirectory 'src'. +# Set SRCDIR to override. +ifeq ($(SRCDIR),) + SRCDIR := src +endif + +# Presume the object and dependency files to be located in the subdirectory +# 'obj' (which will be created). Set OBJDIR to override. +ifeq ($(OBJDIR),) + OBJDIR := obj +endif +TARGETOBJDIR := $(OBJDIR) + +# On Windows it is mandatory to have CC65_HOME set. So do not unnecessarily +# rely on cl65 being added to the PATH in this scenario. +ifdef CC65_HOME + CC := $(CC65_HOME)/bin/cl65 +else + CC := cl65 +endif + +# Default emulator commands and options for particular targets. +# Set EMUCMD to override. +c64_EMUCMD := $(VICE_HOME)x64 -kernal kernal -VICIIdsize -autoload +c128_EMUCMD := $(VICE_HOME)x128 -kernal kernal -VICIIdsize -autoload +vic20_EMUCMD := $(VICE_HOME)xvic -kernal kernal -VICdsize -autoload +pet_EMUCMD := $(VICE_HOME)xpet -Crtcdsize -autoload +plus4_EMUCMD := $(VICE_HOME)xplus4 -TEDdsize -autoload +# So far there is no x16 emulator in VICE (why??) so we have to use xplus4 with -memsize option +c16_EMUCMD := $(VICE_HOME)xplus4 -ramsize 16 -TEDdsize -autoload +cbm510_EMUCMD := $(VICE_HOME)xcbm2 -model 510 -VICIIdsize -autoload +cbm610_EMUCMD := $(VICE_HOME)xcbm2 -model 610 -Crtcdsize -autoload +atari_EMUCMD := atari800 -windowed -xl -pal -nopatchall -run + +ifeq ($(EMUCMD),) + EMUCMD = $($(CC65TARGET)_EMUCMD) +endif + +############################################################################### +### The magic begins ### +############################################################################### + +# The "Native Win32" GNU Make contains quite some workarounds to get along with +# cmd.exe as shell. However it does not provide means to determine that it does +# actually activate those workarounds. Especially $(SHELL) does NOT contain the +# value 'cmd.exe'. So the usual way to determine if cmd.exe is being used is to +# execute the command 'echo' without any parameters. Only cmd.exe will return a +# non-empty string - saying 'ECHO is on/off'. +# +# Many "Native Win32" programs accept '/' as directory delimiter just fine. How- +# ever the internal commands of cmd.exe generally require '\' to be used. +# +# cmd.exe has an internal command 'mkdir' that doesn't understand nor require a +# '-p' to create parent directories as needed. +# +# cmd.exe has an internal command 'del' that reports a syntax error if executed +# without any file so make sure to call it only if there's an actual argument. +ifeq ($(shell echo),) + MKDIR = mkdir -p $1 + RMDIR = rmdir $1 + RMFILES = $(RM) $1 +else + MKDIR = mkdir $(subst /,\,$1) + RMDIR = rmdir $(subst /,\,$1) + RMFILES = $(if $1,del /f $(subst /,\,$1)) +endif +COMMA := , +SPACE := $(N/A) $(N/A) +define NEWLINE + + +endef +# Note: Do not remove any of the two empty lines above ! + +TARGETLIST := $(subst $(COMMA),$(SPACE),$(TARGETS)) + +ifeq ($(words $(TARGETLIST)),1) + +# Set PROGRAM to something like 'myprog.c64'. +override PROGRAM := $(PROGRAM).bin + +# Set SOURCES to something like 'src/foo.c src/bar.s'. +# Use of assembler files with names ending differently than .s is deprecated! +SOURCES := $(wildcard $(SRCDIR)/*.c) +SOURCES += $(wildcard $(SRCDIR)/*.s) +SOURCES += $(wildcard $(SRCDIR)/*.asm) +SOURCES += $(wildcard $(SRCDIR)/*.a65) + +# Add to SOURCES something like 'src/c64/me.c src/c64/too.s'. +# Use of assembler files with names ending differently than .s is deprecated! +SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.c) +SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.s) +SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.asm) +SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.a65) + +# Set OBJECTS to something like 'obj/c64/foo.o obj/c64/bar.o'. +OBJECTS := $(addsuffix .o,$(basename $(addprefix $(TARGETOBJDIR)/,$(notdir $(SOURCES))))) + +# Set DEPENDS to something like 'obj/c64/foo.d obj/c64/bar.d'. +DEPENDS := $(OBJECTS:.o=.d) + +# Add to LIBS something like 'src/foo.lib src/c64/bar.lib'. +LIBS += $(wildcard $(SRCDIR)/*.lib) +LIBS += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.lib) + +# Add to CONFIG something like 'src/c64/bar.cfg src/foo.cfg'. +CONFIG += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.cfg) +CONFIG += $(wildcard $(SRCDIR)/*.cfg) + +# Select CONFIG file to use. Target specific configs have higher priority. +ifneq ($(word 2,$(CONFIG)),) + CONFIG := $(firstword $(CONFIG)) + $(info Using config file $(CONFIG) for linking) +endif + +.SUFFIXES: +.PHONY: all test clean zap love + +all: $(PROGRAM) + +-include $(DEPENDS) +-include $(STATEFILE) + +# If OPTIONS are given on the command line then save them to STATEFILE +# if (and only if) they have actually changed. But if OPTIONS are not +# given on the command line then load them from STATEFILE. Have object +# files depend on STATEFILE only if it actually exists. +ifeq ($(origin OPTIONS),command line) + ifneq ($(OPTIONS),$(_OPTIONS_)) + ifeq ($(OPTIONS),) + $(info Removing OPTIONS) + $(shell $(RM) $(STATEFILE)) + $(eval $(STATEFILE):) + else + $(info Saving OPTIONS=$(OPTIONS)) + $(shell echo _OPTIONS_=$(OPTIONS) > $(STATEFILE)) + endif + $(eval $(OBJECTS): $(STATEFILE)) + endif +else + ifeq ($(origin _OPTIONS_),file) + $(info Using saved OPTIONS=$(_OPTIONS_)) + OPTIONS = $(_OPTIONS_) + $(eval $(OBJECTS): $(STATEFILE)) + endif +endif + +# Transform the abstract OPTIONS to the actual cc65 options. +$(foreach o,$(subst $(COMMA),$(SPACE),$(OPTIONS)),$(eval $(_$o_))) + +# Strip potential variant suffix from the actual cc65 target. +CC65TARGET := $(firstword $(subst .,$(SPACE),$(TARGETLIST))) + +# The remaining targets. +$(TARGETOBJDIR): + $(call MKDIR,$@) + +vpath %.c $(SRCDIR)/$(TARGETLIST) $(SRCDIR) + +$(TARGETOBJDIR)/%.o: %.c | $(TARGETOBJDIR) + $(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(CFLAGS) -o $@ $< + +vpath %.s $(SRCDIR)/$(TARGETLIST) $(SRCDIR) + +$(TARGETOBJDIR)/%.o: %.s | $(TARGETOBJDIR) + $(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $< + +vpath %.asm $(SRCDIR)/$(TARGETLIST) $(SRCDIR) + +$(TARGETOBJDIR)/%.o: %.asm | $(TARGETOBJDIR) + $(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $< + +vpath %.a65 $(SRCDIR)/$(TARGETLIST) $(SRCDIR) + +$(TARGETOBJDIR)/%.o: %.a65 | $(TARGETOBJDIR) + $(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $< + +$(PROGRAM): $(CONFIG) $(OBJECTS) $(LIBS) + $(CC) -t $(CC65TARGET) $(LDFLAGS) -o $@ $(patsubst %.cfg,-C %.cfg,$^) + +test: $(PROGRAM) + $(PREEMUCMD) + $(EMUCMD) $< + $(POSTEMUCMD) + +clean: + $(call RMFILES,$(OBJECTS)) + $(call RMFILES,$(DEPENDS)) + $(call RMFILES,$(REMOVES)) + $(call RMFILES,$(PROGRAM)) + +else # $(words $(TARGETLIST)),1 + +all test clean: + $(foreach t,$(TARGETLIST),$(MAKE) TARGETS=$t $@$(NEWLINE)) + +endif # $(words $(TARGETLIST)),1 + +OBJDIRLIST := $(wildcard $(OBJDIR)/*) + +zap: + $(foreach o,$(OBJDIRLIST),-$(call RMFILES,$o/*.o $o/*.d $o/*.lst)$(NEWLINE)) + $(foreach o,$(OBJDIRLIST),-$(call RMDIR,$o)$(NEWLINE)) + -$(call RMDIR,$(OBJDIR)) + -$(call RMFILES,$(basename $(PROGRAM)).* $(STATEFILE)) + +love: + @echo "Not war, eh?" + +################################################################### +### Place your additional targets in the additional Makefiles ### +### in the same directory - their names have to end with ".mk"! ### +################################################################### +-include *.mk \ No newline at end of file diff --git a/Software/src/Flasher.c b/Software/src/Flasher.c new file mode 100644 index 0000000..eb7e160 --- /dev/null +++ b/Software/src/Flasher.c @@ -0,0 +1,59 @@ +#include +#include +#include +#include + +int main() +{ + // Binary can't be larger than 2k + char buffer[2048]; + char* pBuf = buffer; + FILE* pFile; + size_t fileSize; + char slotNum; + + videomode(VIDEOMODE_80COL); + cprintf("AppleIISd firmware flasher\r"); + cprintf("(c) 2019 Florian Reitz\r\r"); + + // ask for slot + cursor(1); // enable blinking cursor + cprintf("Slot number (1-7): "); + slotNum = cgetc(); + cursor(0); // disable blinking cursor + + // check if slot is valid + if((slotNum < 1) || (slotNum > 7)) + { + cprintf("Invalid slot number!"); + return 1; // failure + } + + // open file + pFile = fopen("AppleIISd.bin", "rb"); + if(pFile) + { + // read buffer + fileSize = fread(buffer, sizeof(buffer), 1, pFile); + + // enable write + + // clear 0xCFFF + *((char*)0xCFFF) = 0; + + // write to SLOTROM + + // write to EXTROM + + // disable write + } + else + { + cprintf("Can't open binary file: %d\r", errno); + return 1; + } + + return 0; // success +} + + diff --git a/VHDL/AddressDecoder_old.jhd b/VHDL/AddressDecoder_old.jhd deleted file mode 100644 index 872d381..0000000 --- a/VHDL/AddressDecoder_old.jhd +++ /dev/null @@ -1 +0,0 @@ -MODULE AddressDecoder_old diff --git a/VHDL/AddressDecoder_old.sch b/VHDL/AddressDecoder_old.sch deleted file mode 100644 index feb12bd..0000000 --- a/VHDL/AddressDecoder_old.sch +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2001-3-9T11:23:0 - - - - - - - - - - - - - - - 2001-3-9T11:23:50 - - - - - - - - - 2001-3-9T11:23:11 - - - - - - 2001-5-11T10:41:37 - - - - - - - - - - 2001-5-11T10:43:14 - - - - - - - - - - - - 2001-3-9T11:23:50 - - - - - - - - - - - 2000-1-1T10:10:10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VHDL/AddressDecoder_old_Test.vhd b/VHDL/AddressDecoder_old_Test.vhd deleted file mode 100644 index 501717b..0000000 --- a/VHDL/AddressDecoder_old_Test.vhd +++ /dev/null @@ -1,172 +0,0 @@ --------------------------------------------------------------------------------- --- Company: --- Engineer: --- --- Create Date: 23:42:22 10/10/2017 --- Design Name: --- Module Name: C:/Git/AppleIISd/VHDL/AddressDecoder_Test.vhd --- Project Name: AppleIISd --- Target Device: --- Tool versions: --- Description: --- --- VHDL Test Bench Created by ISE for module: AddressDecoder --- --- Dependencies: --- --- Revision: --- Revision 0.01 - File Created --- Additional Comments: --- --- Notes: --- This testbench has been automatically generated using types std_logic and --- std_logic_vector for the ports of the unit under test. Xilinx recommends --- that these types always be used for the top-level I/O of a design in order --- to guarantee that the testbench will bind correctly to the post-implementation --- simulation model. --------------------------------------------------------------------------------- -LIBRARY ieee; -USE ieee.std_logic_1164.ALL; - --- Uncomment the following library declaration if using --- arithmetic functions with Signed or Unsigned values ---USE ieee.numeric_std.ALL; - -ENTITY AddressDecoder_old_Test IS -END AddressDecoder_old_Test; - -ARCHITECTURE behavior OF AddressDecoder_old_Test IS - - -- Component Declaration for the Unit Under Test (UUT) - - COMPONENT AddressDecoder_old - PORT( - A8 : IN std_logic; - A9 : IN std_logic; - A10 : IN std_logic; - B8 : OUT std_logic; - B9 : OUT std_logic; - B10 : OUT std_logic; - RNW : IN std_logic; - CLK : IN std_logic; - NDEV_SEL : IN std_logic; - NIO_SEL : IN std_logic; - NIO_STB : IN std_logic; - NOE : OUT std_logic - ); - END COMPONENT; - - - --Inputs - signal A : std_logic_vector(10 downto 8) := "101"; - signal RNW : std_logic := '1'; - signal NDEV_SEL : std_logic := '1'; - signal NIO_SEL : std_logic := '1'; - signal NIO_STB : std_logic := '1'; - signal NRESET : std_logic := '1'; - signal CLK : std_logic := '0'; - signal PHI0 : std_logic := '1'; - - --Outputs - signal B : std_logic_vector(10 downto 8); - signal DATA_EN : std_logic; - signal NG : std_logic; - signal NOE : std_logic; - - -- Clock period definitions - constant CLK_period : time := 142 ns; - -BEGIN - - -- Instantiate the Unit Under Test (UUT) - uut: AddressDecoder_old PORT MAP ( - A8 => A(8), - A9 => A(9), - A10 => A(10), - B8 => B(8), - B9 => B(9), - B10 => B(10), - RNW => RNW, - CLK => CLK, - NDEV_SEL => NDEV_SEL, - NIO_SEL => NIO_SEL, - NIO_STB => NIO_STB, - NOE => NOE - ); - - -- Clock process definitions - CLK_process :process - begin - CLK <= '0'; - wait for CLK_period/2; - CLK <= '1'; - wait for CLK_period/2; - end process; - - PHI0_process :process(CLK) - variable counter : integer range 0 to 7; - begin - if rising_edge(CLK) or falling_edge(CLK) then - counter := counter + 1; - if counter = 7 then - PHI0 <= not PHI0; - counter := 0; - end if; - end if; - end process; - - -- Stimulus process - stim_proc: process - begin - -- hold reset state. - wait for CLK_period * 10; - NRESET <= '0'; - wait for CLK_period * 20; - NRESET <= '1'; - wait for CLK_period * 10; - - -- insert stimulus here - -- CPLD access - wait until rising_edge(PHI0); - NDEV_SEL <= '0'; - wait until falling_edge(PHI0); - NDEV_SEL <= '1'; - wait until rising_edge(PHI0); - wait until rising_edge(PHI0); - -- CnXX access - NIO_SEL <= '0'; - wait until falling_edge(PHI0); - NIO_SEL <= '1'; - wait until rising_edge(PHI0); - wait until rising_edge(PHI0); - -- C8xx access, selected - NIO_STB <= '0'; - wait until falling_edge(PHI0); - NIO_STB <= '1'; - wait until rising_edge(PHI0); - wait until rising_edge(PHI0); - -- CPLD access - NDEV_SEL <= '0'; - wait until falling_edge(PHI0); - NDEV_SEL <= '1'; - wait until rising_edge(PHI0); - wait until rising_edge(PHI0); - -- CFFF access - A <= "111"; - NIO_STB <= '0'; - wait until falling_edge(PHI0); - A <= "000"; - NIO_STB <= '1'; - wait until rising_edge(PHI0); - wait until rising_edge(PHI0); - -- C8xx access, unselected - NIO_STB <= '0'; - wait until falling_edge(PHI0); - NIO_STB <= '1'; - wait until rising_edge(PHI0); - wait until rising_edge(PHI0); - - wait; - end process; - -END; diff --git a/VHDL/sch2HdlBatchFile b/VHDL/sch2HdlBatchFile deleted file mode 100644 index e69de29..0000000