Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Regular Visitor
yasirmahmoodqureshi
Posts: 29
Registered: ‎09-03-2009
0
Accepted Solution

Connecting a Custom IP to MPMC

I want to connect my custom IP to MPMC directly for high data transfer. I know that connecting the MPMC to the microprocessor(microblaze or PowerPC) is simple as it is done by the BSB, but i don't know how to connect it to a custom IP, i.e how do I instantiate it in my .v file etc. Some of the xilinx tutorials suggest that I need to create some protocol cores like NPI core etc. 

 

Can some give a tutorial or guide how to do this. 

Regular Contributor
mariano_severi
Posts: 56
Registered: ‎09-15-2008

Re: Connecting a Custom IP to MPMC

Hi,

it is exactly what I typically do. The IP core is provided with the following input/output signals (I use vhdl not verilog):

 

    PIM_Addr              : OUT std_logic_vector(31 downto 0);
    PIM_AddrReq           : OUT std_logic;
    PIM_AddrAck           : IN std_logic;    
    PIM_RNW               : OUT std_logic;
    PIM_Size              : OUT std_logic_vector(3 downto 0);
    PIM_RdModWr           : OUT std_logic;
    PIM_WrFIFO_Data       : OUT std_logic_vector(31 downto 0);
    PIM_WrFIFO_BE         : OUT std_logic_vector(3 downto 0);
    PIM_WrFIFO_Push       : OUT std_logic;
    PIM_RdFIFO_Data       : IN std_logic_vector(31 downto 0);
    PIM_RdFIFO_Pop        : OUT std_logic;
    PIM_RdFIFO_RdWdAddr   : IN std_logic_vector(3 downto 0);
    PIM_WrFIFO_Empty      : IN std_logic;
    PIM_WrFIFO_AlmostFull : IN std_logic;
    PIM_WrFIFO_Flush      : OUT std_logic;
    PIM_RdFIFO_Empty      : IN std_logic;
    PIM_RdFIFO_Flush      : OUT std_logic;
    PIM_RdFIFO_Latency    : IN std_logic_vector(1 downto 0);
    PIM_InitDone          : IN std_logic;

 

Then  I add the following lines to the mpd file of the IP core :

 

## PIM NPI Interface
BUS_INTERFACE BUS = MPMC_PIM, BUS_STD = XIL_NPI, BUS_TYPE = INITIATOR
PORT PIM_Addr = Addr, DIR = O, BUS = MPMC_PIM, VEC = [31:0]
PORT PIM_AddrReq = AddrReq, DIR = O, BUS = MPMC_PIM
PORT PIM_AddrAck = AddrAck, DIR = I, BUS = MPMC_PIM
PORT PIM_RNW = RNW, DIR = O, BUS = MPMC_PIM
PORT PIM_Size = Size, DIR = O, BUS = MPMC_PIM, VEC = [3:0]
PORT PIM_RdModWr = RdModWr, DIR = O, BUS = MPMC_PIM
PORT PIM_WrFIFO_Data = WrFIFO_Data, DIR = O, BUS = MPMC_PIM, VEC = [31:0]
PORT PIM_WrFIFO_BE = WrFIFO_BE, DIR = O, BUS = MPMC_PIM, VEC = [3:0]
PORT PIM_WrFIFO_Push = WrFIFO_Push, DIR = O, BUS = MPMC_PIM
PORT PIM_RdFIFO_Data = RdFIFO_Data, DIR = I, BUS = MPMC_PIM, VEC = [31:0]
PORT PIM_RdFIFO_Pop = RdFIFO_Pop, DIR = O, BUS = MPMC_PIM
PORT PIM_RdFIFO_RdWdAddr = RdFIFO_RdWdAddr, DIR = I, BUS = MPMC_PIM, VEC = [3:0]
PORT PIM_WrFIFO_Empty = WrFIFO_Empty, DIR = I, BUS = MPMC_PIM
PORT PIM_WrFIFO_AlmostFull = WrFIFO_AlmostFull, DIR = I, BUS = MPMC_PIM
PORT PIM_WrFIFO_Flush = WrFIFO_Flush, DIR = O, BUS = MPMC_PIM
PORT PIM_RdFIFO_Empty = RdFIFO_Empty, DIR = I, BUS = MPMC_PIM
PORT PIM_RdFIFO_Flush = RdFIFO_Flush, DIR = O, BUS = MPMC_PIM
PORT PIM_RdFIFO_Latency = RDFIFO_Latency, DIR = I, BUS = MPMC_PIM, VEC = [1:0]
PORT PIM_InitDone = InitDone, DIR = I, BUS = MPMC_PIM

 

Now, you can enable a port in the MPMC instance, configure it to support NPI protocol and connect it to the port of your IP.

Regards

 Mariano

Regular Visitor
yasirmahmoodqureshi
Posts: 29
Registered: ‎09-03-2009
0

Re: Connecting a Custom IP to MPMC

Thanks Marino!

 

Can you please tell if any connection betwen my IP and MPMC port should appear in the system assembly view or in Blockdiagram after editing the mpd file as you have mentioned?

 

Regards

Yasir

 

Regular Contributor
mariano_severi
Posts: 56
Registered: ‎09-15-2008

Re: Connecting a Custom IP to MPMC

Look at the bus connection of your IP in the System Assembly View. Do not forget to rescan the user repositories (or close and restart EDK) after you change the mpd file of your IP.

Regular Visitor
yasirmahmoodqureshi
Posts: 29
Registered: ‎09-03-2009
0

Re: Connecting a Custom IP to MPMC

Thank you very much Mariano!!

 

Got it done.

 

Regards

Yasir

Regular Visitor
wen119at
Posts: 51
Registered: ‎02-16-2010
0

Re: Connecting a Custom IP to MPMC

Hi,

 

I have a problem regarding connecting my ip to the npi port of mpmc. I am a new starter to EDK, so I would really appreciate it if you could be so kind to help me out.

I have successfully connected my own ip to the npi port of mpmc (such as add generic and port to my toplevel and modify the mpd file as well). The connection between my ip and mpmc can be seen from Block Diagram of XPS.  However, i have no idea what to do next...

My own created ip is a multiplier,  i am wondering how can i send the output of the multiplier to the DDR through mpmc(npi port)? How can i get the data from DDR back to my ip and show it on HyperTerminal? I know that since the communication between mpmc and my ip has nothing to do with SDK, so I really have no idea how to communicate between my ip and mpmc...

Hope anyone can help me out...

Thanks in advance...

Any hint would be appreciated...

Regular Visitor
wen119at
Posts: 51
Registered: ‎02-16-2010
0

Re: Connecting a Custom IP to MPMC

Hi ,

 

I have a problem regarding connecting my ip to the npi port of mpmc. I am a new starter to EDK, so I would really appreciate it if you could be so kind to help me out.

I have successfully connected my own ip to the npi port of mpmc (such as add generic and port to my toplevel and modify the mpd file as well). The connection between my ip and mpmc can be seen from Block Diagram of XPS.  However, i have no idea what to do next...

My own created ip is a multiplier,  i am wondering how can i send the output of the multiplier to the DDR through mpmc(npi port)? How can i get the data from DDR back to my ip and show it on HyperTerminal? I know that since the communication between mpmc and my ip has nothing to do with SDK, so I really have no idea how to communicate between my ip and mpmc...

Hope anyone can help me out...

Thanks in advance...

Any hint would be appreciated...

Regular Visitor
yasirmahmoodqureshi
Posts: 29
Registered: ‎09-03-2009
0

Re: Connecting a Custom IP to MPMC

You should also connect the your IP to the Processor(either mircoblaze or Power PC, which ever you are using), through the bus interfaces provided like PLB or FSL, so that you can give some data to your IP to multiply(as its a multiplier).

 

About MPMC, see the datasheet for timing diagram of NPI read and write and proceed according to it. The protocol is given very well in the timing diagrams.

 

Now at the end if you want to display the result  on the hyperterminal, you can access the your DDR through your processor (either mircoblaze or Power PC) and then use the simple xil_printf() command to see the data on hyperterminal.

Regular Visitor
wen119at
Posts: 51
Registered: ‎02-16-2010
0

Re: Connecting a Custom IP to MPMC

[ Edited ]

Hi,

 

 Thank you so much for your reply.

I have connect my IP to MicroBlaze. Now I have two questions... Waiting for your kind reply...

 

The first question is I know that if i want to see the data on hyperterminal, i have to connect DDR to MB and i have done this step. As to this step, I have a question, do you think that the xil_printf() will print the data from RAM such as DDR directly without other operations? What about print the data saved in FPGA on-chip DPRAM? Dose this has anything to do with Linker Script?

 

 I  have read the datasheet for timing diagram of NPI read and write.The other question is do i have to write the protocol by myself using VHDL in the toplevel of my IP?Is it possible to communicate between MPMC and my IP without the control by MicroBlaze? Such as send the output of the ip to mpmc and read the data back from mpmc to ip? I am just a starter and really get confused about this problem... Hoping you could give me some explanation about this question... I really appreciate it...Thanks for your time...

 

Winnie

Message Edited by wen119at on 03-10-2010 05:24 AM
Regular Visitor
yasirmahmoodqureshi
Posts: 29
Registered: ‎09-03-2009
0

Re: Connecting a Custom IP to MPMC

Ans1:

 

Yes, you should connect DDR to MB first for showing data on hyperterminal. You can access the memory as follows,

 

u32 *read_ddr = (u32 *) XPAR_DDR_SDRAM_MPMC_BASEADDR; //pointer to base address of MPMC
u32 data;
data=read_ddr[0];  //read the data at zero memory location(1st to 4th byte), if you type  read_ddr[1], it will access the 5th-8th byte in memory as eachmemory is of 32bits(4bytes).


xil_printf("This is the data 0x%X\r\n",data); // prints the read data on hyperterminal

 

Ans2:

 

 yes, you will have to write the NPI protocol in VHDL yourself. Yes you can communicate between your IP and microblaze without the control of microblaze, control and communication to MB is actually done so that it knows about the currrent state of your IP, and your IP don't work independent on its own,

 But ofcourse you can do without this link.