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

VIP suite frame reader

Altera_Forum
Honored Contributor II
1,332 Views

hello. 

 

I'm trying to use Video Image Processing suite. 

 

I could out test pattern with Test Pattern Generator. 

 

after that, I'm trying to use frame reader. 

SOPC builder is like attached. 

 

also NiosII source is like below. 

//--------------------------------------- NiosII -------------------------------------------- 

 

# include <stdio.h> 

# include <io.h> 

# include "system.h" 

# include <malloc.h> 

 

# define ADDRMULT 1 

# define CONTROL (0 * ADDRMULT) 

# define STATUS (1 * ADDRMULT) 

# define INTERRUPT (2 * ADDRMULT) 

# define FRAMESEL (3 * ADDRMULT) 

# define FRAME0BADD (4 * ADDRMULT) 

# define FRAME0WORD (5 * ADDRMULT) 

# define FRAME0CPTR (6 * ADDRMULT) 

# define FRAME0RESV (7 * ADDRMULT) 

# define FRAME0WIDT (8 * ADDRMULT) 

# define FRAME0HIGT (9 * ADDRMULT) 

# define FRAME0INTR (10* ADDRMULT) 

 

# define BASEWIDTH 640 

# define BASEHEIGHT 480 

# define COLORNUM 3 

 

int main() 

unsigned char* fbuf0; 

long loop; 

 

fbuf0 = (unsigned char*)malloc(BASEWIDTH*BASEHEIGHT*COLORNUM); 

 

IOWR(ALT_VIP_VFR_0_BASE,CONTROL,0x00); 

usleep(100000); 

IOWR(ALT_VIP_VFR_0_BASE,FRAME0BADD,(int)fbuf0); 

 

IOWR(ALT_VIP_VFR_0_BASE,FRAMESEL,0x00); 

IOWR(ALT_VIP_VFR_0_BASE,FRAME0WIDT,BASEWIDTH); 

IOWR(ALT_VIP_VFR_0_BASE,FRAME0HIGT,BASEHEIGHT); 

IOWR(ALT_VIP_VFR_0_BASE,FRAME0WORD,4); 

IOWR(ALT_VIP_VFR_0_BASE,CONTROL,0x01); 

 

for( loop = 240*640*3; loop < 250*640*3;loop++) 

fbuf0[loop] = 0; // test pattern 

 

 

return 0; 

//------------------------------------ NiosII ------------------------------------------------- 

 

 

when I see signals Avalon Master is not read from the sdram( it looks like stuck ) 

what should I miss? what should I try?
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
326 Views

Hi, 

 

The control code you have hasn't written anything to register 6 (FRAME0CPTR). This value tells the frame reader how many Avalon-ST beats of data to output in each packet, and since you have not initialised it to anything it will probably start up at 0 and hence you will output nothing. The height and width values you specify in registers 8 and 9 only generate information for the control packet, so you must also specify the number of beats in the packet and number of memory words required to retrieve this data. The VIP user guide actually doesn't do too bad a job of describing the control interface for the frame reader and should give more detailed info. 

 

All the best, 

Kieron
0 Kudos
Altera_Forum
Honored Contributor II
326 Views

thanks kjt01 

 

I'll try.
0 Kudos
Reply