FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6664 Discussions

Altera Avalon Bus Slave interface

Altera_Forum
Honored Contributor II
1,551 Views

Hello! 

 

Simple question and straightforward: 

 

I'm building a custom IP core and want to connect it to avalon bus. This (slave) component accepts both read and write data (a master can both read it or write to it) BUT never at the same time. You can either read data, or write data. 

 

Should i use 2 data ports (write_data, read_data) as implied in the avalon bus slave interface, or is there any way to use ONE dataport but then it should be INOUT in direction.. 

 

What do you think is the most proper way? 

 

i) read_data OUT port 

write_data IN port 

 

ii) data_port INOUT 

 

thanks in advance!
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
702 Views

Best practice is to use separate buses for logic that is internal to the FPGA as it only uses routing resources and no extra logic. 

 

Any tristate buffers internal to the FPGA don't actually exist as tristate buffers and are synthesized into multiplexers. 

 

Good luck with designing your IP!
0 Kudos
Altera_Forum
Honored Contributor II
702 Views

So.. you are suggesting option (i). 

 

Separated read and write data ports. I'll try it anyway its easier than to merge both into a single port! 

 

Thanx for your time
0 Kudos
Altera_Forum
Honored Contributor II
702 Views

You create a single bus. One avalon interface to your slave component and use both the writedata and readdata ports. 

 

Option 1. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
702 Views

 

--- Quote Start ---  

You create a single bus. One avalon interface to your slave component and use both the writedata and readdata ports. 

 

Option 1. 

 

Jake 

--- Quote End ---  

 

 

Hi, 

 

Well you can say that if you view writedata as 0.5 bus and readdata as the other 0.5bus = one bus. It is a point of view anyway. 

 

I will go with you all for option (1) and will add this: 

if you choose inout, nios will ask for an avalon bridge and this adds the issue of byte mode addressing(according to my old nios, unless altera have changed that). 

 

bidirectional bus best suits external connections as it lessens the PCB tracks by half(this is significant, in general board designers love to go even serial single bit when possible e.g. serdes). 

 

kaz
0 Kudos
Altera_Forum
Honored Contributor II
702 Views

Hi  

 

On SOPC interface you can have inout port but inside your custom component you can control it using output enable pin. Which drives read data as input to component and write as output from comp....if your interface is 32 bit (both read/write) you can use 2 avalon slave busses otherwise 1 bus can work... 

 

Shaik
0 Kudos
Reply