Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12661 Discussions

altera_avalon_fifo_write_ienable IE_ALMOSTFULL

andy25
New Contributor I
943 Views

Hi all.

In my Nios V code, I'm trying to use:
status = altera_avalon_fifo_write_ienable(IPMB_0_FIFO_IN_CSR_BASE, IE_FULL | IE_ALMOSTFULL);

 

I'm guessing the IE_FULL and IE_ALMOSTFULL are the masks I want, but they don't seem to be defined anywhere.

E_FULL and E_ALMOSTFULL are also not defined.

 

Am I missing a header?  Or is this just a constant I create for myself?

Thanks

-Andy

0 Kudos
1 Solution
andy25
New Contributor I
874 Views

No, you don't understand.

I obviously read the documentation and that's where I got the names IE_FULL, etc.

 

Then I wrote some C code:

status = altera_avalon_fifo_write_ienable(IPMB_0_FIFO_IN_CSR_BASE, IE_FULL | IE_ALMOSTFULL);

 

And tried to compile it, and it errors saying IE_FULL (and friends) are not defined.

grepping the hal_bsp directory reveals those names are not defined anywhere.

 

But that was 5 days ago.

The correct answer is:

#include "altera_avalon_fifo_regs.h"

Use:

ALTERA_AVALON_FIFO_IENABLE_F_MSK

ALTERA_AVALON_FIFO_IENABLE_AF_MSK

etc.

 

But the real real correct answer is:

You cant call altera_avalon_fifo_write_ienable() function after altera_avalon_fifo_init().  Instead, pass the ienable flags you want as the second parameter of altera_avalon_fifo_init().

 

-Andy

View solution in original post

0 Kudos
3 Replies
EBERLAZARE_I_Intel
884 Views

Hi,


Here are the descriptions:


IE_FULL Enables an interrupt if the FIFO is currently full. 0 IE_EMPTY Enables an interrupt if the FIFO is currently empty.

IE_ALMOSTFULL Enables an interrupt if the fill level of the FIFO is greater than the value of the almostfull register.


Reference:

https://www.intel.com/content/www/us/en/docs/programmable/683130/23-4/software-control.html


0 Kudos
andy25
New Contributor I
875 Views

No, you don't understand.

I obviously read the documentation and that's where I got the names IE_FULL, etc.

 

Then I wrote some C code:

status = altera_avalon_fifo_write_ienable(IPMB_0_FIFO_IN_CSR_BASE, IE_FULL | IE_ALMOSTFULL);

 

And tried to compile it, and it errors saying IE_FULL (and friends) are not defined.

grepping the hal_bsp directory reveals those names are not defined anywhere.

 

But that was 5 days ago.

The correct answer is:

#include "altera_avalon_fifo_regs.h"

Use:

ALTERA_AVALON_FIFO_IENABLE_F_MSK

ALTERA_AVALON_FIFO_IENABLE_AF_MSK

etc.

 

But the real real correct answer is:

You cant call altera_avalon_fifo_write_ienable() function after altera_avalon_fifo_init().  Instead, pass the ienable flags you want as the second parameter of altera_avalon_fifo_init().

 

-Andy

0 Kudos
EBERLAZARE_I_Intel
804 Views

Hi Andy,


My apologies, yes you are right, so it should be define as you mentioned, below in the "include" tab:

https://www.intel.com/content/www/us/en/docs/programmable/683130/23-4/altera-avalon-fifo-write-ienable.html


You could also use RiscFree if you like to check the current defined variables values by setting breakpoints and see the debug/registers/modules tab etc.:

https://www.intel.com/content/www/us/en/docs/programmable/730783/23-4/debug-setup-for-processor-system.html


If you have a new question, Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.



p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.


0 Kudos
Reply