simple memory mapping unit - nealcrook/multicomp6809 GitHub Wiki

This memory mapping unit is obsolete; it has been superceeded by mk2 memory mapping unit.

If you add an external SRAM to multicomp the usual component to use is a 128KByte device. It seems a real shame to tie-off the upper address line.

The memory mapper provides these capabilities:

  • Through 1, 8-bit port it allows chunks of the address space to be write-protected (memory is protected in 8KByte chunks. The protection does not interfere with the I/O devices in the high address space)
  • Through 1, 8-bit port each of the top two 8Kbyte chunks of the address space can be mapped to any of the 32, 8Kbyte chunks of memory in the external RAM
  • Through 1 bit of an 8-bit port the multicomp internal 8Kbyte ROM can be disabled so that RAM can be accessed in this region.

The memory mapper is decoded in the same address space as the SDCard controller. It uses the same chip-select. In the 8-byte region selected by that chip-select it uses the 3 addresses that the SDCard does not. Its registers are write-only so the hookup is straightforward.

The memory mapper requires 1 wiring change. Connect a new FPGA output to the A16 address line of the SRAM. Change sramAddress output from (15 downto 0) to (16 downto 0) and associate the correct output pin with the new signal.

Grab the mem_mapper.vhd file, add it to the files list and edit your top-level to include an entity declaration like this:

	mm1 : entity work.mem_mapper
	port map(
			n_reset => n_reset,
			clk => clk,
			hold => hold,
			n_wr => n_WR_sd,

			dataIn => cpuDataOut,
			regAddr => cpuAddress(2 downto 0),
			
			cpuAddr => cpuAddress(15 downto 13),
			ramAddr => sramAddress(16 downto 13),
			ramWrInhib => ramWrInhib,
			romInhib => romInhib
	);

The chip select for the internal ROM has to be tweaked accordingly:

	n_basRomCS <= '0' when cpuAddress(15 downto 13) = "111" and romInhib='0' else '1'; --8K at top of memory