Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

Memory type for variables

I am modifying the sobel example to find out how to describe the behaviour I want of the system/program. The sobel example has a shift register that holds some of the pixels to be processed. When I change

<type> rows
to
<type> local rows
I get a kernel that is too large to compile. I am doing further tests on performance but this caused me to wonder about the memory types the variables are stored in. I know global resides in external ram and local in on-chip ram, but what about the variables that have no memory-space identifier (if this is the correct term) as the first piece of code?

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I found a configuration in which the only difference is the local keyword before the rows variable. This uses a little more resources, but the difference in performance (time) is more significant. It is significantly slower, 980us where the non-local runs in 700 us. I think this means the addition of local prevents the compiler from inferring a shift register. If that is the case I assume the first piece of code infers registers and thus is private. Am I correct?