This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Address mapping to 6748 EMIF, and BA[1] behavior?

This topic of EMIF address mapping has generated many threads, but I haven't seen one yet that clearly answers it for a 6748 device. Sorry if this is a rehash.

My group is designing a board with a 6748 EMIF interfaced to an FPGA. We are using EMIF CS3 to select the FPGA, and only implementing 2K FPGA registers inside the CS3 address space (0x6200 0000 to 0x63FF FFFF)

We're using the EMIF in 16-bit mode, and software will have its registers for that space declared as unsigned 16-bit types, so all reads and writes should be one atomic 16-bit transaction.

The EMIF address bus is connected to the FPGA as follows:

EMA_A[9]  --> FPGA_ADDR[10]

EMA_A[8] --> FPGA_ADDR[9]

...

EMA_A[0] --> FPGA_ADDR[1]

EMA_BA[1] --> FPGA_ADDR[0]

EMA_BA[0] is not connected

This gives us, from the FPGA's perspective, 2^11 16-bit registers in the address range 0-2047 (0x000 - 0x7FF).

My questions pertain to exactly how we describe the address space for our software team in a HW/SW interface document, and what behavior I will see on EMA_BA[1].

Obviously BA[1] must toggle in order to access even/odd addresses inside the FPGA.

When software in the 6748 accesses the lowest FPGA register (FPGA address 0x000) I assume that corresponds to DSP/EMIF address 0x62000000, with (binary) EMA_A[9:0] = "0000000000" and BA[1] = 0.

For the 2nd register (FPGA address 0x001), the FPGA needs to see EMA_A[9:0] = "0000000000" and BA[1] = 1.

For the 3rd register (FPGA address 0x002), the FPGA needs to see EMA_A[9:0] = "0000000001" and BA[1] = 0.

For the 4th register (FPGA address 0x003), the FPGA needs to see EMA_A[9:0] = "0000000001" and BA[1] = 1.

etc...

How do I specify these addresses and addressing modes to the software guys in terms of absolute DSP addresses?

DSP(0x62000000) = FPGA(0x000) ?

DSP(0x62000001) = FPGA(0x001) ?

DSP(0x62000002) = FPGA(0x002) ?

DSP(0x62000003) = FPGA(0x003) ?

This seems counterintuitive, because it appears the Address LSB ( EMA_A[0] ) is advancing and BA[1] is not specified, so these accesses would skip every other FPGA register, unless those addresses are software-specific and the EMIF hardware translates them.

I could see

DSP(0x62000000) with (BA[1]=0) = FPGA(0x000) ?

DSP(0x62000000) with (BA[1]=1) = FPGA(0x001) ?

DSP(0x62000001) with (BA[1]=0) = FPGA(0x002) ?

DSP(0x62000001) with (BA[1]=1) = FPGA(0x003) ?

but then you have the problem of two different FPGA registers getting accessed by the same DSP address, and I don't know how the source code would be written to resolve that, unless it thought of DSP(0x62000000) as a 32-bit word, pulling in FPGA(0x000) as the lower half and FPGA(0x001) as the upper half, etc...

The other explanation I've heard is 

DSP(0x62000000) = FPGA(0x000) ?

DSP(0x62000002) = FPGA(0x001) ?

DSP(0x62000004) = FPGA(0x002) ?

DSP(0x62000006) = FPGA(0x003) ?

In this case, the assumption is that everything is byte-addressable, and when accessing

DSP(0x62000000), you would get the lower byte of what's in FPGA(0x000) ?

DSP(0x62000001), you would get the upper byte of what's in FPGA(0x001) ?

DSP(0x62000002), you would get the lower byte of what's in FPGA(0x002) ?

DSP(0x62000003), you would get the upper byte of what's in FPGA(0x003) ?

etc...

but since it's a 16-bit access, you would only NEED to access the even addresses (0x62000000, 0x62000002, etc...)

This still requires the EMIF controller do the translations from internal addresses to external EMA_A[22:0] and BA[1:0] pins so the FPGA sees

EMA_A[9:0] = "0000000000" and BA[1] = 0.

EMA_A[9:0] = "0000000000" and BA[1] = 1.

EMA_A[9:0] = "0000000001" and BA[1] = 0.

EMA_A[9:0] = "0000000001" and BA[1] = 1.

Without a timing diagram, development board, or a simulation model (which I'm trying to write), I don't know whether to choose Door #1, Door #2, or Door #3...

Thanks for any insight you can provide!

  • Hello John,

    The connection of EMIF BA[1] pin to A0 represents the half- word or 16-bit access. 

    In this mode, the address mapping would be as mentioned below.

    DSP(0x62000000) with (BA[1]=0) = FPGA(0x000)

    DSP(0x62000000) with (BA[1]=1) = FPGA(0x001)

    DSP(0x62000001) with (BA[1]=0) = FPGA(0x002)

    DSP(0x62000001) with (BA[1]=1) = FPGA(0x003)

    Here two 16-bit FPGA register access would have the same 32-bit word address in DSP and they are differentiated by the value of BA[1].

    By entering the data width in configuration register, the EMIF controller will take care of the above operations and you don't need to do anything explicitly.

    Regards,
    Senthil

  • Hi Sentil,

    I agree that is what has to happen physically on the EMIF bus in order to correctly access the FPGA, but my big misunderstanding is how I provide the addressing information to my software team.

    Please forgive my outdated C programming skills, but

    If there were an attempt to directly read from an absolute address, like

    var1 = *(0x62000000);

    it would be ambiguous as to whether it is accessing FPGA(0x000) or FPGA(0x001), unless such an access always implies 32 bits, in which case it would try to read both. If that were the case, since the bus is only 16 bits wide, would it actually do two simultaneous accesses of 0x62000000, first with BA[1] = 0 and second with BA[1]=1?

    Or, if ptr is declared as pointed to a short int,

    short int *ptr;

    short int var1, var2;

    ptr = 0x62000000;

    var1 = *ptr

    ptr++;

    var2 = *ptr;

    Will this correctly read FPGA(0x000) and then FPGA(0x001), with physical EMIF Addr 0x62000000 for both, toggling BA[1] as needed?

    Thanks again!

  • Hello John,

    When you perform read/write access to DSP memory address (ex: 0x62000000) which is 32-bit word; the EMIF controller will perform two (16 bit data mode) consecutive read/write accesses (first with BA[1] = 0 and second with BA[1]=1) internally to accomplish 32-bit read/write. 

    The ASIZE field of CEnCFG register determines the number of external accesses required to fulfill a request generated by one of the sources like CPU, EDMA, other master peripherals.

    A request for a 32-bit word would require four external access when ASIZE = 0 (8 bit) and two external access when ASIZE = 1 (16 bit).

    Hope this clarifies you.

    Regards,

    Senthil

  • Hi,

    I have two question regarding  the same topic.

    1) by executing a single statement var1=*(0x62000000); will double toggle the read pin of processor, which in turn will give us access to 16+16 bit of data by keeping the same configuration as mentioned by  john. How can we explicitly get a single chunk of 16bit data without toggling read pin of processor twice

  • Hi,

    I have two question regarding  the same topic.

    1) by executing a single statement var1=*(0x62000000); will double toggle the read pin of processor, which in turn will give us access to 16+16 bit of data by keeping the same configuration as mentioned by  john. How can we explicitly get a single chunk of 16bit data without toggling read pin of processor twice

    2) and will the same configuration be working with cs2,cs4 and cs5?

  • Hi,

    I have two question regarding  the same topic.

    1) by executing a single statement var1=*(0x62000000); will double toggle the read pin of processor, which in turn will give us access to 16+16 bit of data by keeping the same configuration as mentioned by  john. How can we explicitly get a single chunk of 16bit data without toggling read pin of processor twice

    2) and will the same configuration be working with cs2,cs4 and cs5?

    If you could give us the pin mapping for 1) and programming statement to get our neat and clean data of 16 bit. It will be highly appreciated.

    Thanks