can I use same code on different FPGA like for example can I use same code on stratix 10 & Agilex. or do I need to change the code or rewrite the whole code.
thanks & cheers
In general, HDL languages are standards, so yes, you can take code from one device and move it to another. However, some code, such as that for IP, is usually optimized for a specific device architecture, so you would want to regenerate that code for the new architecture. Also, you need to recompile code for a new architecture because the output files from compilation (such as the programming file) will not work in the different device.
Additional, you will have to look into the timing closure once you migrate the code. Since the architecture are different, there will be code optimization need to be done from your side. My suggestion is to look into the class available here: