UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor c.akronbt
Visitor
6,392 Views
Registered: ‎12-14-2015

Can i use two different clock with custom axi stream ip core

Jump to solution

I have created a design with MicroBlaze and an Axi Stream custom IpCore. The microblaze need a 96MHz clock but my IpCore can have a faster clock. 


At first time i have connected MB and IpCore directly with the same clock. It work perfectly (i have used putfsl and getfsl to comunicate whit ipCore) .

I have tried to use a different clock for ipCore but i found an error. If Microblaze and ipcore are connected directly i can't use two different clock. So i have connected them with AXI Stream Interconnection block. 

 

Immagine.png

 

My question is : how can i comunicate with ipCore ? It seems that using putfsl and getfsl no data are trasmitted to ipCore. 

Someone can help me? if there are things that I have not explained well , ask me.

Regards Stefano

 

0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
11,534 Views
Registered: ‎05-11-2010

Re: Can i use two different clock with custom axi stream ip core

Jump to solution

Although AXI4-Stream Interconnect should do the trick, what you actually want is an AXI4-Stream Clock Converter.  The AXI4-Stream Interconnect is a combination of clock converters, registers/FIFOs, data width converters, and a switch; you don't need all that.

 

The switch might be what is causing the problem.  A few days ago I made a simple system with a single 2-in, 2-out switch that allowed me to bypass or not a component, with a similar "loop" connection as your system (switch output connects to module input and module output connects to switch input), but found that the system didn't work; I suspect this was due to a deadlock (the switch only being able to process 1 stream at a time).  I fixed this by replacing the loop with 2 switches, one before the module and one after it.  So if for some reason you still want to use the Axi4-Stream Interconnect I advise you to use one per stream.  But you'll probably prefer the Clock Converter anyway.

 

See Product Guide PG085, "AXI4-Stream Infrastructure IP Suite", to see all the available AXI4-Stream interconnection components; there are some useful cores there.

0 Kudos
7 Replies
Adventurer
Adventurer
11,535 Views
Registered: ‎05-11-2010

Re: Can i use two different clock with custom axi stream ip core

Jump to solution

Although AXI4-Stream Interconnect should do the trick, what you actually want is an AXI4-Stream Clock Converter.  The AXI4-Stream Interconnect is a combination of clock converters, registers/FIFOs, data width converters, and a switch; you don't need all that.

 

The switch might be what is causing the problem.  A few days ago I made a simple system with a single 2-in, 2-out switch that allowed me to bypass or not a component, with a similar "loop" connection as your system (switch output connects to module input and module output connects to switch input), but found that the system didn't work; I suspect this was due to a deadlock (the switch only being able to process 1 stream at a time).  I fixed this by replacing the loop with 2 switches, one before the module and one after it.  So if for some reason you still want to use the Axi4-Stream Interconnect I advise you to use one per stream.  But you'll probably prefer the Clock Converter anyway.

 

See Product Guide PG085, "AXI4-Stream Infrastructure IP Suite", to see all the available AXI4-Stream interconnection components; there are some useful cores there.

0 Kudos
Visitor c.akronbt
Visitor
6,340 Views
Registered: ‎12-14-2015

Re: Can i use two different clock with custom axi stream ip core

Jump to solution

Thank you for your fast reply. 
I think that for my design, your solution is useful. 
Now can you help me to understand how can i solve my problem with axi4 stream clock converter?

My microblaze work with 96 MHz and my ipCore can work with a clock up to 169 MHz.
Furthermore, my ipCore need two axi4 stream interface in input (two 32bit input) and one output interface (32 bit too). 
My questions are : 
1) I need one clock converter for each stream interface?
2) How should i set the parameters in the clock converter? 
3) I should connect microblaze and ipCore axi stream interfaces across axi stream clock converter interface? I mean something like attached image.
4) My ipCore needs s00_axis_aclk, s01_axis_aclk, m00_axis_aclk. same for reset signal. The same situazion is for clock converter. I should connect those components with the same clock of the microblaze or i need to create a different clock in the clocking wizard?

Regards Stefano 

 

Immagine.png
0 Kudos
Adventurer
Adventurer
6,314 Views
Registered: ‎05-11-2010

Re: Can i use two different clock with custom axi stream ip core

Jump to solution

Yes, the clock converter is a very simple thing; it just converts a stream with one clock to a stream with another clock.  I have not used it but from what I can see it just has one master and one slave port, and it copies data from master to slave, nothing more.  Additionally each port has its own set of clock and reset signals (they both appear on the left of the component because they're input signals, but the "m_axis_" ones correspond to the bus on the right).

 

1,3,4) Yes, you need 3 Clock Converters in total, one for each of the connections.  The way you show is correct: instead of connecting the blocks directly you insert a Clock Converter in the middle.  PG085 figure 2-2 illustrates this as well.  The clock signals must be connected to a clock to which the corresponding bus is synchronous, i.e. 169 MHz for the peripheral, and one side 169 and the other 96 for each clock converter.

2) Set everything as "Auto" (i.e. leave it with the default settings).  "Asynchronous clocks" should be "Yes" since you don't have something like a 2:1 clock ratio.  I'm not sure about "Synchronization Stages" though; I suppose that the default value of 2 will be enough.  As I said, have a look at PG085; in page 38 they suggest reading FIFO Generator Product Guide (PG075) for more details.

0 Kudos
Visitor c.akronbt
Visitor
6,304 Views
Registered: ‎12-14-2015

Re: Can i use two different clock with custom axi stream ip core

Jump to solution

Thank you, your help is useful. I have connected each block as in the figures below. At first time i have found a timing problem but i solved it with set_clock_groups. My design is ready but when i try to use it in sdk it doesn't work. 

Without the two clocks to comunicate between microblaze and ip core i used this function . 

int IpCoreElaboration(partType source, partType mask, smallBitAccumulator_t * oldWord, partType *target){
    int result = 0;
    partType t=0;


	nputfsl(source,0);
	nputfsl(mask,1);
	getfsl(t,0);

    	if(t==oldWord->pr_bitsAccumulator){
    		result=0;
    	}else{

    		result=1;
    		oldWord->pr_bitsAccumulator=t;
    		*target=t;

    	}

return result;
}

but with clock converter this function doesn't work. i don't know why. But the result of getfsl isn't correct. 

 

Can u help me again pls? 

 

Regards Stefano

Immagine.png
Immagine2.png
0 Kudos
Visitor c.akronbt
Visitor
6,270 Views
Registered: ‎12-14-2015

Re: Can i use two different clock with custom axi stream ip core

Jump to solution

Thank you very much.
i solved the problem with your solution. 
Below there is attached a foto where i show my links in this way this post should be useful for another one with the same problem. 
Now the last question : 
1) microblaze work with 96MHz and ipCore with 168MHz but the performances are the same that the basic design without clock converter and with microblaze linked directly to ipCore and both clocked with 96MHz. How is possible that?

 

Regards Stefano 

Immagine.png
0 Kudos
Adventurer
Adventurer
6,250 Views
Registered: ‎05-11-2010

Re: Can i use two different clock with custom axi stream ip core

Jump to solution

How fast is your core?  If it is able to process 1 value per clock cycle then the speed will be limited by the MicroBlaze (a simple loop like "load word 1; send word 1; load word 2; send word 2; receive word 3; store word 3; increment counter; compare; repeat" will take about 10 clock cycles to complete, so you will be limited to ~10 values per microsecond no matter how fast the core works).  If this is the case, consider using an AXI DMA to stream the data instead of using the MicroBlaze.

0 Kudos
Highlighted
Visitor c.akronbt
Visitor
6,236 Views
Registered: ‎12-14-2015

Re: Can i use two different clock with custom axi stream ip core

Jump to solution

I can't use DMA because the microblaze need to know the result of IpCore to go ahead. So i think that my bottleneck is the MB. My IpCore computes the result in 14 clock cycles so is useless to upgrade its clock. 

 

Thank you for your support

 

0 Kudos