Hi there,
I have a DM368EVM Rev G and we have added our own FPGA to the J14 EMIF expansion header. The FPGA is sharing the bus with the CPLD U33 onboard the DM368EVM. I have mapped the FPGA into some of the unused portions of memory within the CPLD's address range. Here is the memory mapping that's currently setup:
/*
CPLD Registers on the DM368 EVM
Reg # Entire Address A13-A8 A2-A1 Function
0 0x0400 0000 0 0 0 0 0 0 0 0 CPLD Version
1 0x0400 0008 0 0 0 0 0 0 0 1 Test Register
2 0x0400 0010 0 0 0 0 0 0 1 0 LED Register
3 0x0400 0018 0 0 0 0 0 0 1 1 Board Mux Control
4 0x0400 0400 0 0 0 0 0 1 0 0 Board Switch Register
5 0x0400 0408 0 0 0 0 0 1 0 1 Power Control Register
6 0x0400 0410 0 0 0 0 0 1 1 0 GPIO Video Register
7 0x0400 0418 0 0 0 0 0 1 1 1 Media Card Status
8 0x0400 0800 0 0 0 0 1 0 0 0 DILC Output Pin Mapping
9 0x0400 0808 0 0 0 0 1 0 0 1 DILC Input Pin Mapping
10 0x0400 0810 0 0 0 0 1 0 1 0 Imager Internal I/O Direction Register 0
11 0x0400 0818 0 0 0 0 1 0 1 1 Imager Internal I/O Mux Register 0
12 0x0400 0C00 0 0 0 0 1 1 0 0 Imager Internal I/O Mux Register 1
13 0x0400 0C08 0 0 0 0 1 1 0 1 Imager Internal I/O Direction Register 1
14 0x0400 0C10 0 0 0 0 1 1 1 0 Imager Internal I/O Mux Register 2
15 0x0400 0C18 0 0 0 0 1 1 1 1 Imager Internal I/O Mux Register 3
16 0x0400 1000 0 0 0 1 0 0 0 0 Imager Internal I/O Direction Register 2
17 0x0400 1008 0 0 0 1 0 0 0 1 Imager Internal I/O Mux Register 4
18 0x0400 1010 0 0 0 1 0 0 1 0 Imager Internal I/O Mux Register 5
19 0x0400 1018 0 0 0 1 0 0 1 1 Board RESET Register
20 0x0400 1400 0 0 0 1 0 1 0 0 Interrupt Register
24 0x0400 1800 0 0 0 1 1 0 0 0 CPLD Test Register 0
25 0x0400 1808 0 0 0 1 1 0 0 1 CPLD Test Register 1
26 0x0400 1810 0 0 0 1 1 0 1 0 CPLD Test Register 2
27 0x0400 1818 0 0 0 1 1 0 1 1 CPLD Test Register 3
28 0x0400 1C00 0 0 0 1 1 1 0 0 CPLD Test Register 4
29 0x0400 1C08 0 0 0 1 1 1 0 1 CPLD Test Register 5
30 0x0400 1C10 0 0 0 1 1 1 1 0 CPLD Test Register 6
31 0x0400 1C18 0 0 0 1 1 1 1 1 CPLD Test Register 7
32 0x0400 2000 0 0 1 0 0 0 0 0 FPGA Register 0
33 0x0400 2008 0 0 1 0 0 0 0 1 FPGA Register 1
34 0x0400 2010 0 0 1 0 0 0 1 0 FPGA Register 2
35 0x0400 2018 0 0 1 0 0 0 1 1 FPGA Register 3
36 0x0400 2400 0 0 1 0 0 1 0 0 FPGA Register 4
37 0x0400 2408 0 0 1 0 0 1 0 1 FPGA Register 5
38 0x0400 2410 0 0 1 0 0 1 1 0 FPGA Register 6
39 0x0400 2418 0 0 1 0 0 1 1 1 FPGA Register 7
720 0x0400 F800 1 1 1 1 1 0 0 0 CCD Internal I/O Direction Register 1
721 0x0400 F808 1 1 1 1 1 0 0 1 CCD Internal I/O Read/Write Register 1
722 0x0400 F810 1 1 1 1 1 0 1 0 CCD Internal I/O Direction Register 2
723 0x0400 F818 1 1 1 1 1 0 1 1 CCD Internal I/O Read/Write Register 2
724 0x0400 FC00 1 1 1 1 1 1 0 0 CCD Internal I/O Direction Register 3
725 0x0400 FC08 1 1 1 1 1 1 0 1 CCD Internal I/O Read/Write Register 3
*/
FPGA registers begin at address 0x04002000. I have modified the CPLD firmware to tri-state the data bus when not accessing one of its registers. It previously output the contents of register 0, version register, when the address went beyond it's decoded register set. I also added 8 test registers from registers 24 to 31.
I've been testing the interface to the FPGA, as we have a custom cable running between J14 on the EVM and the FPGA to interface the appropriate EMIF signals. These are:
DM368EVM_EMIF_D : inout STD_LOGIC_VECTOR (7 downto 0);
DM368EVM_EMIF_WE : in STD_LOGIC;
DM368EVM_EMIF_CE1 : in STD_LOGIC;
DM368EVM_EMIF_OE : in STD_LOGIC;
DM368EVM_EMIF_SEL : in STD_LOGIC;
DM368EVM_EMIF_A1 : in STD_LOGIC;
DM368EVM_EMIF_A2 : in STD_LOGIC;
DM368EVM_EMIF_A9 : in STD_LOGIC;
DM368EVM_EMIF_A8 : in STD_LOGIC;
DM368EVM_EMIF_A11 : in STD_LOGIC;
DM368EVM_EMIF_A10 : in STD_LOGIC;
DM368EVM_EMIF_A13 : in STD_LOGIC;
DM368EVM_EMIF_A12 : in STD_LOGIC;
For the most part, the interface appears to be working well. I can read and write registers within the CPLD and the FPGA without interfering with each other. My test software generates a random fpga register value and random 8bit value, writes the value and reads it back, testing to see if what was written and what was readback are matching, to ensure valid data is being transferred. I loop this for about 100,000,000 iterations, which runs for about 2min. If the values don't match, I trigger an error flag and I'm able to capture the status of various signals on our logic analyzer.
Every once in awhile, I get ringing on the WE, CE1 and OE lines, which causes data corruption. It doesn't appear to be electrical noise, as I can cause the error to occur repeatedly by commenting out the random number seed in the software. This makes the random number generation repeatable through multiple runs of the software.
Attached is a plot showing what's happening:

You can see that at around the -3us mark, a valid write and read cycle occured. However, on the following write and read cycle, just after the -1us mark, the write cycle appears valid, but on the read to validate what was written, the CE, WE and OE lines begin to ring and I get a corrupted readback.
I've managed to suppress the write glitching by adding a glitch filter to the FPGA firmware. I can't seem to figure out what to do prevent the remainder of the glitching from occuring. The value it was attempting to write was 0xFF to fpga register number 4.
Has anyone else seen such behavior from the EMIF port? Any ideas what may be causing this type of glitch?
Thanks
Derek