Forum Discussion
few days ago i had such an interesting situation. i had a clock going into altera from a pin. i needed this clock to triggering something inside, but when i simulated it, triggered signal reacted the register with very big delay. it was obvious that such a big delay was not normal for altera. then i checked RTL viewer and noticed that synthesizer added buffer LCELL near the clock pin enterance, and this delayed my clock in phase. synthesizer also added one more disgusting LCELL buffer and named it myclock ~buf0clkctrl. and that lcell delayed my clock so much, that when my clock actually reached a register it had 180 degree phase shift with respect to original clock that came through input pin. why did this happened? i had a statement there, something like when my counter goes beyond number 5, then react on clock positive edge. synthesizer looked at my counter and noticed that clock edge nearly matches the point where the counter increments, and thus changes it's numerical value. as you may know these transition moments are very dangerous, in these picoseconds counter's true value is not unknown, and one must wait until it finishes incrementing and settles down with the new value. so synthesizer thought it would be nice to delay my clock to keep it's positive edge a little bit away from counter's transition point. thats why it added that horrible bufclkctrl which threw my clock in phase. unchecking timing analysis didnt helped. the buffer was still there. and thats what i did, i went into an assignment editor,chose Design Entity (display all) , searched the node under name ~buf0clkctrl. selected it and gave it an option Netlist Optimizations Never allow. and compiled the project. it instantly killed that buffer and my clock came back to it's original phase. but the threat remains, the one from which synthesizer was trying to save me. my clock positive edge is too close to my counter increment transition point. if something goes wrong and transition will get late... the system will collapse.
whatever... at least i'v got my phase back :) in other words use this method i described to force synthesizer to kill synthesis time buffers