Thanks. I don't understand all what you wrote but I will try to make sense of it all soon. But my clock related questions are not over. In NIOS, system.h lists ALT_CPU_FREQ 50000000. The command alt_timestamp_freq() also returns 50 000 000.
As the system.h is generated by SOPC builder and my SOPC shows the CPU connected to the External clock of 50 MHz, is this why the frequency is shown as 50 MHz in system.h despite the fact that this external clock is then multiplied by 2 in my main .v file? Is the CPU working at 50 MHz or 100 MHz?
If CPU is still working at 50 MHz, how do I get it to work at 100 MHz? I am thinking that instead of instantiating the altpll component obtained from Quartus MegaWizard in the main .v file, maybe I have to use the altpll component inside SOPC builder and then connect the output clocks to the CPU. Is that any good?
At the moment, I have everything in the .v file with pll
sdram_pll neg_3ns (CLOCK_50, DRAM_CLK, system_clock);
and clk input to the NIOS as follows
.clk (system_clock),