26
AT94KAL Series FPSLIC
Rev. 1138G–FPSLI–11/03
B Side
The B side is not partitioned; the FPGA (and AVR debug mode) views the memory space as
36 x 8 Kbytes.
•
The B side is accessed by the FPGA/Configuration Logic.
•
The B side is accessed by the AVR with ST and LD instructions in DBG mode for code
self-modify.
To activate the debug mode and allow the AVR to access the program code space (with
ST – see Figure 21 – and LD – see Figure 22 – instructions), the DBG bit (bit 1) of the
SFTCR $3A ($5A) register has to be set. When this bit is set, SCR36 and SCR37 are
ignored – you can overwrite anything in the AVR program memory.
The FPGA memory access interface should be disabled while in debug mode. This is to
ensure that there is no contention between the FPGA address and data signals and the
AVR-generated address and data signals. To ensure the AVR has control over the “B
side” memory interface, the FMXOR bit (bit 3) of the SFTCR $3A ($5A) register should be
used in conjunction with the SCR63 system control register bit.
The FMXOR bit is XORed with the System Control Register’s Enable FPGA SRAM Inter-
face bit (SCR63). The behavior when this bit is set to 1 is dependent on how the SCR was
initialized. If the Enable FPGA SRAM Interface bit (SCR63) in the SCR is 0, the FMXOR
bit enables the FPGA SRAM Interface when set to 1. If the Enable FPGA SRAM Interface
bit in the SCR is 1, the FMXOR bit disables the FPGA SRAM Interface when set to 1. Dur-
ing AVR reset, the FMXOR bit is cleared by the hardware.
Even though the FPGA (and AVR debug mode) views the memory space as
36 x 8 Kbytes, an awareness of the 2K x 8 partitions (or SRAM labels) is required if Frame
(and AVR debug mode) read/writes are to be meaningful to the AVR.
•
AVR data to FPGA addressing is 1:1 mapping.
•
AVR program to FPGA addressing requires 16-bit to 8-bit mapping and an understanding
of the partitions in Table 7.
Table 6.
AVR Data Decode for SRAM 0:17 (16K8)
Address Range
SRAM
Comments
$07FF – $0000
$0FFF – $0800
00
01
AVR Data Read/Write
AVR Data Read/Write
$17FF – $1000
$1FFF – $1800
02
03
CR41:40 = 11,10,01
$27FF – $2000
$2FFF – $2800
04
05
CR41:40 = 11,10
$37FF – $3000
$3FFF – $3800
06
07
CR41:40 = 11
Table 7.
Summary Table for AVR and FPGA SRAM Addressing
SRAM
FPGA and AVR DBG
Address Range
AVR Data
Address Range
AVR PC Address Range
00
$0000 - $07FF
$0000 - $07FF
01
$0800 - $0FFF
$0800 - $0FFF
02
$1000 - $17FF
$1000 - $17FF
$3800 - $3FFF (LS Byte)
03
$1800 - $1FFF
$1800 - $1FFF
$3800 - $3FFF (MS Byte)
04
$2000 - $27FF
$2000 - $27FF
$3000 - $37FF (LS Byte)