Artifact ff656bfc7d8b6cc43f3e28da6e3577780b33a020:

Wiki page [Memory Map] by kc5tja 2018-03-03 04:28:31.
D 2018-03-03T04:28:31.620
L Memory\sMap
N text/x-markdown
P edf3e445df38f8a64d9172a78100e127127909bd
U kc5tja
W 2978
# Memory Map

(For historical context, see the [original Kestrel 2 memory map](wiki/Original Memory Map).)

|Low|High|Size|Purpose|
|:--|:---|:--:|:-----:|
|`000000`|`003FFF`|16KiB|ROM|
|`004000`|`007FFF`|16KiB|unmapped<sup>[1](#cc)</sup> |
|`008000`|`00FFFF`|32KiB|unmapped<sup>[2](#mirror)</sup>|
|`010000`|`01BFFF`|48KiB|IPL/Video RAM|
|`01C000`|`01FFFF`|16KiB|unmapped<sup>[3](#deadlock)</sup>|
|`020000`|`020003`|4B|[GPIA](wiki/GPIA)|
|`020004`|`02FFFF`|64KiB|unmapped<sup>[2](#mirror)</sup>|
|`030000`|`030003`|4B|[KIA](wiki/KIA)|
|`030004`|`FFFFFF`|~16MiB|unmapped<sup>[2](#mirror)</sup>|

Addresses not explicitly listed above either aren't assigned or are mirrors of previous address decode domains.

## IPL Resources

The ROM has sufficient space to hold around 12KiB worth of executable code,
considering 4KiB for font and keyboard tables.
Thus, the ROM image can hold about 3000 CPU instructions.
This is big enough to hold
the console output code,
keyboard input code,
some basic SD card access routines,
and a minimal, interactive bootstrap program called "TIM/V".

The IPL RAM is FPGA-internal block RAM, always available for use by the ROM image.
It also doubles as the source of video data for the [MGIA](wiki/MGIA) core.
All together, the IPL RAM can provide up to three 16KB pages of video,
which you can select with some bits set in the [GPIA](wiki/GPIA) output register.
If required,
the last 384 bytes of video RAM may also be used for data storage
without affecting the displayed image.
At cold-boot, $10000-$13E80 is selected as the default video page.

## Expansion Memory

Plenty of expansion space exists to explore interfacing with external memory
or other peripherals yet to be added or designed.
Using this space will entail modifying the Verilog source code to suit your needs.
The CPU provides a true 64-bit address bus,
even though the Kestrel-2DX as currently implemented does not use all address bits available.
It is entirely possible your programs will be made to run on an arbitrarily expanded Kestrel-2DX.
For this reason, your programs must *never* depend upon behavior of any unmapped memory regions.

## I/O Space

The I/O space contains memory-mapped I/O resources familiar to
Kestrel 2 programmers:
the GPIA, KIA, etc.
Additional cores may appear in the future.

<hr />
<a name="cc"><sup>1</sup></a>  Writes ignored; reads always returns `$CC`.  You should *not* depend on this behavior.

<a name="mirror"><sup>2</sup></a>  Contains mirrors of the previous block of address space.  You should *not* depend on this behavior.

<a name="deadlock"><sup>3</sup></a>  Loads or stores to this region of address space will not generate a memory transaction acknowledgement, causing the CPU to halt indefinitely.  Only a hard reset will restore operation.  This is a [known bug](tktview/1e03cdbd75afd64ca044a217f9d9c1a3bd23f90b), and will be fixed in a future revision of the design.
Z 04c51f139e9292e58e105b7f84676643