question about sharing data between tile not using channel or interface Topic is solved

New to XMOS and XCore? Get started here.
etori90
Member++
Posts: 31
Joined: Thu Sep 05, 2019 6:49 am

question about sharing data between tile not using channel or interface

Postby etori90 » Mon Nov 16, 2020 8:48 am

Is there any way to share data between tiles not using interface or channel.
I'm using customized board with 2 ethernet ports and trying to transfer data from port to port by cut-through way not store and forwarding way
I used functions in rt_mac to transfer data by interfaces and channel.
I think using interfaces or channel is not working well for cut-through way because takes too much time

My opinion is this
for 100Mbps MII
taken time for filling up 32bit buffer when buffer is empty< taken time for getting word(4byte) from other port by channel or interface


do you have any better idea for solving this?

Thank you
View Solution
User avatar
akp
Respected Member
Posts: 466
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Mon Nov 16, 2020 12:48 pm

There is no way to cross the tile barrier -- internally to the chip, anyway -- other than using the switch matrix, and that requires use of channels. The RAM on one tile cannot be directly accessed from another tile; so you can't use shared memory buffers.

If you use interfaces or regular channels (non-streaming) then there's quite a bit of overhead in the setup and teardown. And interfaces just use channels under the hood, of course.

On the other hand, a streaming channel is setup once so it doesn't have this overhead. All of the bandwidth is accessible for your data. And a streaming channel over the switch matrix should support 500 Mbps according to what I understand. So it's more than fast enough for 100 Mbps MII.

Of course you'll need two streaming channels, one for RX and one for TX, and if you need outgoing timestamping then you'll need a return channel from the TX. So you could run out of switch matrix resources. The second fastest way to do it is using transactions on the channel. So you may wish to use streaming channel for RX for instance and transactions on the TX.

The optimized low level functions to transmit over a streaming channel are sout_char_array() and sin_char_array(), and if you need to use transactions then you'll use out_char_array() and in_char_array() (of course to use these you'll need some kind of buffering on the slave tile so that would imply one or two buffering cores).

I suspect in theory you could design it so the TX master is run from the master tile and the slave tile simply takes data from the channel and puts it to the MII pins. Then you could take the timestamp from the master tile but it could be subject to some jitter (and a systematic offset, of course). That would eliminate the need for a return channel from the TX.
etori90
Member++
Posts: 31
Joined: Thu Sep 05, 2019 6:49 am

Postby etori90 » Tue Nov 17, 2020 6:56 am

Thank you
I tried the way you recommended
In mii_master_rx_pins send word through In out_char_array() then mii_master_tx_pins gets data through in_char_array()

Before, there was a problem that master_rx_pins() miss some received word data while sending the received data through streaming channel.
when i blocked codes such like crc or others in receving code, rx_pins() function received full data and other tx_pins master() recevied well.

but still, can't make packet by this way
1. receive word
2. send word
only working well by store and forwarding

I just ask, in mii_master_init() these macros are relevant to these problem?

#define PAD_DELAY_RECEIVE 0
#define PAD_DELAY_TRANSMIT 0
#define CLK_DELAY_RECEIVE 0
#define CLK_DELAY_TRANSMIT 7 // Note: used to be 2 (improved simulator?)

or do i need to use phy chip supporting syncE?

thank you!
User avatar
akp
Respected Member
Posts: 466
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Tue Nov 17, 2020 7:03 pm

I suspect those macros will have no effect on your performance. I think they are intended to ensure proper timing for the IO.

Correct me if I am wrong, but I understand you have most of your MAC on the primary tile, and then just running a MII master on the secondary tile?

If it's your receive that's failing, which is what I understand, then it seems to me that the code on the primary tile that's on the receiving end of your streaming channel is too slow. A streaming channel won't block unless channel buffer is full (I think the channel buffer is something like 8 bytes, I forget).
etori90
Member++
Posts: 31
Joined: Thu Sep 05, 2019 6:49 am

Postby etori90 » Thu Nov 19, 2020 6:08 am

Ok thank you I'm gonna make other boards with 2 ethernet port using same tile.
User avatar
akp
Respected Member
Posts: 466
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Thu Nov 19, 2020 6:09 am

Yes, that's the best way to do it

Who is online

Users browsing this forum: No registered users and 1 guest