Problem with 'altpll' phase parameter.
- 5 years ago
It looks like this is the only trick which will work:
localparam DDR3_WDQ_PHASE_ps = (((1000000 / ( PLL1_in_KHz/1000 * CLK_IN_MULT / CLK_IN_DIV )) * DDR3_WDQ_PHASE / 360) -1) ;
localparam DDR3_RDQ_PHASE_ps = (((1000000 / ( PLL1_in_KHz/1000 * CLK_IN_MULT / CLK_IN_DIV )) * DDR3_RDQ_PHASE / 360) -1) ;localparam int Altera_Dummy_String [0:399] = '{ // Seriously, this is the only way... I feel like an idiot making this public...
"0000","0010","0020","0030","0040","0050","0060","0070","0080","0090","0100","0110","0120","0130","0140","0150","0160","0170","0180","0190",
"0200","0210","0220","0230","0240","0250","0260","0270","0280","0290","0300","0310","0320","0330","0340","0350","0360","0370","0380","0390",....... All the way up to 3990 .....
localparam DDR3_WDQ_PHASE_pss = Altera_Dummy_String[DDR3_WDQ_PHASE_ps/10] ;
localparam DDR3_RDQ_PHASE_pss = Altera_Dummy_String[DDR3_RDQ_PHASE_ps/10] ;Though this lowers my ps resolution to every 10ps, your so called string for some reason needs to be an INT parameter defined with numbers in quotes for ModelSim and Quartus to accept the results, hence my array 'localparam 'INT' Altera_Dummy_String [0:399] '.
Simulation and results in the fitter's utilization report in the PLL section prove my calculated parameter referenced to the array 'DDR3_R/WDQ_PHASE_pss' takes proper effect.
Really weird since the other 'STRING' parameters accept normal strings properly. It is only the PLL phase exclusively which requires an INT localparam with a number packaged in Quotes as if it were a string. Something is fishy with the way the coder decided to implement the phase feature as a non-standard string.