FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
6673 Discussions

Avalon_ mm_ master wrapper (vhdl)

Altera_Forum
Honored Contributor II
5,001 Views

Hello, 

I have written a code for CDMA Encoding and CDMA Decoding using VHDL Language. Now i have to create as a custom IP using component editor.Here i want a help regarding the avalon signals. 

 

In my system , the output from NIOS-II processor will be given to CDMA_Encoding(it encodes 32-bit data from NIOS-II and convert it to 16-bit data) and then given to avalon interface. Similarly from avalon interface i will get 16-bit data,which is given to CDMA decoding( it again converts 16-bit data into 32-bit,as original output from NIOS-II) and then given to slave(like SDRAM or Flash Memory). 

 

NIOS-->CDMA_ENCODING-->AVALON-->CDMA_DECODING-->SLAVE. 

 

this is the flow of system. 

 

Kindly help me regarding creating custom IP to sync with avalon. 

 

i am not able to understand , which signals to be used after reading avalon specification manual. 

entity of my custom logic is given below.  

CDMA_ENCODING: 

entity CDMA_ENCODING is port (rst_n : in std_logic; clk : in std_logic; PI: IN STD_LOGIC_VECTOR(0 TO 31); output :buffer std_logic_vector (0 to 15)); end CDMA_ENCODING; 

CDMA_DECODING: 

entity CDMA_DECODING is port ( rst_n : in std_logic; clk : in std_logic; PI: IN STD_LOGIC_VECTOR(0 TO 15); output :buffer std_logic_vector (0 to 31)); end CDMA_DECODING; 

 

 

In order to interface with avalon Wrapper is necessary.. kindly give some hints regarding this as soon as possible. 

Thank you.
0 Kudos
22 Replies
Altera_Forum
Honored Contributor II
450 Views

for reading....  

if avs_m0_read='1' then avm_m1_read<=avs_m0_read; avm_m1_address<=avs_m0_address; --avm_m0_waitrequest<='1'; avs_m0_waitrequest<='1'; end if; 

 

for writing..... 

 

PI_WRAP_EN,PI_WRAP_DE are cdma encoding and decoding port maps. 

 

here i didnot add byte enable .  

 

if avs_m0_write='1' then avm_m1_write<=avs_m0_write; avm_m1_address<=avs_m0_address; avs_m0_waitrequest<=avm_m1_waitrequest; avs_m0_waitrequest<='1'; PI_WRAP_DE<=avs_m0_writedata; avm_m1_writedata<=OUTPUT_WRAP_DE; end if; 

 

is that read and write operations are correct. 

 

Tell me sir, 

Read and write should be '0' or '1' to start operation. 

 

thank you very much in advance.
0 Kudos
Altera_Forum
Honored Contributor II
450 Views

 

--- Quote Start ---  

for reading....  

if avs_m0_read='1' then avm_m1_read<=avs_m0_read; avm_m1_address<=avs_m0_address; --avm_m0_waitrequest<='1'; avs_m0_waitrequest<='1'; end if; 

 

for writing..... 

 

PI_WRAP_EN,PI_WRAP_DE are cdma encoding and decoding port maps. 

 

here i didnot add byte enable .  

 

if avs_m0_write='1' then avm_m1_write<=avs_m0_write; avm_m1_address<=avs_m0_address; avs_m0_waitrequest<=avm_m1_waitrequest; avs_m0_waitrequest<='1'; PI_WRAP_DE<=avs_m0_writedata; avm_m1_writedata<=OUTPUT_WRAP_DE; end if; 

 

is that read and write operations are correct. 

 

Tell me sir, 

Read and write should be '0' or '1' to start operation. 

 

thank you very much in advance. 

--- Quote End ---  

 

 

You need to start simulating your design by using a simulator. Some quick comments: 

- The "if avs_m0_read='1' then" (and the same for the write) are not needed. Just look at the code you wrote after the if/then "avm_m1_read<=avs_m0_read" but in order to execute the statement avs_m0_read must already be one which means that "avm_m1_read" will end up being '1' forever once 'avs_m0_read' first gets set to 1. 

- Ask yourself what do you think happens when you hit the statement "avs_m0_waitrequest<='1';". No where will it ever get set back to '0', which means the interface will forever be saying to wait which means it will hang. 

 

The entire 'if/then' statement needs to be removed. 

 

Like I said, it's time that you start to run the simulator with your code. Verify that your implementation of the various Avalon signals matches what the specification says. 

 

Kevin Jennings
0 Kudos
Reply