Forum Discussion
Altera_Forum
Honored Contributor
8 years agoThanks HRZ and fand
I have tried declare volatile at every position, then I find out that in quartus 17.0, volatile won't work if we use a non-volatile variable to catch a volatile variable. But in quartus 17.1, this won't happend. won't work: __kernel foo(__global volatile const B_parallel *W, int count){ B_parallel p = W[idx]; } work: __kernel foo(__global volatile const B_parallel *W, int count){ volatile B_parallel p = W[idx]; } I also want to know relation between RAM blocks and memory bits. In my code # define A_PARALLEL 16# define B_PARALLEL 16 typedef struct{ float kk[A_PARALLEL]; } A_parallel; typedef struct{ A_parallel ff[B_PARALLEL]; } B_parallel; __kernel fooA(__global const B_parallel *W, int count){ } __kernel fooB(__global const B_parallel *W, int count){ B_parallel temp[256]; } fooB use more 2,102,272 memory bits than fooA, which is reasonable because 256 B_parallel equals 256*16*16*32=2,097,152 bits. However, fooB use more 208 RAM blocks than fooA, 208 RAM blocks equals 4,160,000 bits. how this happened?(report.html says it implement 256 RAM blocks, but real implement is 208 RAM blocks in my compare) and also I want to know that the report.html says my local memory has 1 read and 1 write. but every times I use B_parallel, I have read 16*16=256 floats from local memory, so do I need 256 banks that I can read 256 floats from local memory in parallel? report.html: Private memory: Optimal Requested size: 262144 bytes Implemented size: 262144 bytes Number of banks: 1 Bank width: 8192 bits Bank depth: 256 words Total replication: 1 Additional information: Requested size 262144 bytes, implemented size 262144 bytes, stall-free, 1 read and 1 write. and Is there any bugs with emulator if I declare local memory too large ? like if I declare local memory exceed 5000 floats, program will crash when run with emulator. how to solve this problem?