This paper presents a complete wave-to-wire approach to the modeling of wave energy farms. It captures all the main peculiarities of such applications, from the variability of sea waves to the issues related to the grid integration of a multi-MW wave farm, including the hydrodynamic modeling of wave energy converters (WECs). The paper specifically discusses the different levels of control of a wave farm and their integration and coordination. These are crucial to meet the power quality requirements at the point of common coupling (PCC) and ensure the efficiency of the power transfer from the waves to the main electric grid. A specific real-time technique for the centralized control of a wave farm is also proposed, which is exemplified with reference to the PCC voltage control in the real test case of bimep. Critical cases of weaker grids are also considered to extend the validity of the analysis.