Altera_Forum
Honored Contributor
13 years agoTrouble with NIOS Reading Slave Across Clock Domain
I've set up a QSYS system that looks as follows in the attachment with a few custom components
With my code running on the NIOS I get the interrupt 0 signal, but when I try to read the slave interface results I never see the read line go high in signal tap. This is what I used to clear the interrupt, so the NIOS gets stuck in the interrupt indefinitely. This system was working before I switched my design to use multiple clock domains to add a different interface. Is it possible that since the slave is read only the QSYS fabric doesn't connect up the read? If so is there a better way to clear the interrupt? Any ideas on what else might be wrong? The Base address in the BSP is definitively the same as what's shown in QSYS. In case it helps here's the NIOS code
# include <io.h>
# include <system.h>
# include "parameters.h"
# include "sys/alt_irq.h"
# include "sys/alt_sys_wrappers.h"
# include "sys/alt_stdio.h"
# include <io.h>
# include <system.h>
# include "parameters.h"
# include "wiznet.h"
volatile int edge_capture;
static void handle_results_ready(void* context)
{
/* Cast context to edge_capture's type. It is important that this
be declared volatile to avoid unwanted compiler optimization. */
volatile int* edge_capture_ptr = (volatile int*) context;
IORD_32DIRECT(RINGAQUISITIONINTERFACE_0_BASE,0);
*edge_capture_ptr = 1;
}
int main()
{
alt_putstr("Starting\n");
/* Recast the edge_capture pointer to match the
alt_irq_register() function prototype. */
void* edge_capture_ptr = (void*) &edge_capture;
/* Register the ISR. */
alt_ic_isr_register(RINGAQUISITIONINTERFACE_0_IRQ_INTERRUPT_CONTROLLER_ID,
RINGAQUISITIONINTERFACE_0_IRQ,
handle_results_ready,
edge_capture_ptr, 0x0);
while(1)
{
int i;
while(!edge_capture)
{
ALT_USLEEP(1e3);
}
edge_capture=0;
for(i=0;i<7+2*508;i++)
{
alt_32 temp=IORD_32DIRECT(RINGAQUISITIONINTERFACE_0_BASE,4*i);
alt_printf("%x\n",temp);
//ALT_USLEEP(1e3);
}
alt_putstr("!\n");
}
return 0;
}
In addition the following warnings are probably relevant
Warning (332173): Ignored filter: *altera_avalon_st_clock_crosser:*|in_data_buffer* could not be matched with a register
Warning (332173): Ignored filter: *altera_avalon_st_clock_crosser:*|out_data_buffer* could not be matched with a register
The following warnings are also repeated about a hundred times
Warning (332048): Ignored set_false_path: Argument <from> is an empty collection
Warning (332048): Ignored set_false_path: Argument <to> is an empty collection