The utilization of active rectifiers as converters in the interface between AC and DC microgrids has become a prevalent practice owing to their capacity to facilitate bidirectional power flow. The contemporary methodology for the development of power converters includes the integration of real-time simulation steps for the validation of control schemes and the assurance of safe implementation with hardware. The present study proposes a methodology for developing a real-time Hardware-in-theLoop (HIL) simulation framework, which aims to facilitate the rapid prototyping of advanced control algorithms for an ActiveFront-End (AFE) rectifier, especially a Virtual Synchronous Generator (VSG) control strategy. This approach aims to enhance the dynamic performance and stability of low-inertia power systems by mimicking the behavior of a synchronous generator, thereby providing virtual inertia to the power system. The control schemes and the primary circuit models are designed and implemented utilizing Matlab/Simulink and are optimized for code generation.