This paper develops an engine model for the model-in-the-loop (MIL) and hardware-in-the-loop (HIL) application to shorten the time duration and reduce the costs of developing and verifying the engine management system (EMS). The target engine is a 1.0L V-type two cylinder water-cooled spark-ignition engine. The engine model is developed using a so-called modulization method, which includes to: (1) separate the sub-models according to the different physical phenomena; (2) collect the sub-models to establish a library; (3) execute the component modules based on a pre-determined sequence by a more flexible way. The engine model is then applied in MIL structure for testing and verifying the control strategies in the developed EMS. After all strategies are verified, the HIL structure is constructed by a hardware controller and a virtual engine in the xPC target. The execution time-step of engine model is analyzed to keep enough accuracy and numeric stability for real-time simulation. After that, all EMS strategies can be verified and perform endurance test in the hardware controller through HIL structure. The maximum error between experimental and simulation results of wide open throttle (WOT) torque and brake specific fuel consumption (BSFC) are 5.31% and 3.10% respectively for the developed engine model. The engine model will further sacrifice the simulation accuracy on WOT torque and BSFC by 1.7% and 1.1% respectively in the real-time simulation scenario.