Hi Myriam,
You have a problem with the size of the memory, because the compiler told you "region onchip_mem is full" "Region needs to be 20832 bytes large". Your program is too large for the memory designed.
When you regenerate the SOPC file, do you create another project in the Nios II IDE or you still use the same ?
If you create another project you should take care about the project properties. In Nios II IDE, when you have created or open your project, click right on the folder corresponding to your project on the "Nios II C/C++ Projects" window, and select "System Library Properties".
Check the checkboxs that are enable. if you don't use C++, you can disable "Support C++" , and enable "Program never exits" if the program never exits. Like that the program generated is more light.
Maybe you can check the properties of the default design to compare.
It is the only thing I see that can cause that, because if you change neither the system in SoPC nor the program, the final size of the program should be the same.
Jérôme