KEEP and DONT_TOUCH are valuable attributes for debugging a design. The tool does not optimize the objects because they instruct it not to.
- KEEP is used by the synthesis tool and is not passed along as a property in the netlist. Use KEEP to retain a specific signal. For example, it turns off specific optimizations on the signal during synthesis.
- The synthesis tool uses DONT_TOUCH and then passes it to the place and route tools. This setting prevents optimization of the object.
Take care when using these attributes:
- A KEEP attribute on a register that receives RAM output prevents that register from being merged into the RAM. This action prevents a block RAM from being inferred.
- Do not use these attributes on a level of hierarchy that is driving a 3-state output or bidirectional signal in the level above. If the driving signal and the 3-state condition are at this hierarchy level, the tool does not infer the IOBUF. It must change the hierarchy to create the IOBUF.
- Attributes that disable optimization often result in larger, higher power-consuming circuits. AMD recommends using these controls sparingly and removing them when no longer needed.
Also, be aware that there is a difference between putting DONT_TOUCH on a signal or on a level of hierarchy:
- Place the attribute on a signal to keep that signal.
- If the attribute is placed on a level of hierarchy, the tool does not touch the boundaries of that hierarchy, and no constant propagation occurs through the hierarchy. The system retains optimizations inside that level of hierarchy.