Automatic Integration of HDL IPs in Simulink Using FMI and S-Function Interfaces

  • Stefano CentomoEmail author
  • Michele Lora
  • Antonio Portaluri
  • Francesco Stefanni
  • Franco Fummi
Part of the Lecture Notes in Electrical Engineering book series (LNEE, volume 530)


Verification of cyber-physical systems SW often requires simulation of accurate heterogeneous HW models. However, heterogeneous system simulators do not easily allow it and designers must connect multiple simulators in complex co-simulation environments. Furthermore, usually HW computing platforms are “approximated” by using abstracted models that do not accurately reproduce the cycle-based execution of HW components. In this chapter we present the automatic generation of cycle-accurate Simulink blocks from the most popular HW description languages: VHDL and Verilog.

The methodology starts from an IP core modeled in one of the two supported HW description languages. Then, it relies on state-of-the-art RTL models abstraction method to generate a functionally equivalent cycle-accurate model of the IP. Then, it uses two alternative mapping and code-generation techniques. The first relying on the portable FMI standard, while the other one exploits Mathworks’ proprietary C MEX S-Functions. These blocks can be easily integrated within Simulink to simulate digital HW components while avoiding to build complex co-simulation environments. A set of IP cores are used to evaluate the proposed approach. Furthermore, the experiments presented in this chapter compares the two proposed mapping and code-generation alternatives to highlight their advantages and drawbacks.


Hardware description languages Co-simulation Mathworks simulink Functional mockup interface Cyber-physical systems simulation Virtual platforms Automatic code generation 


  1. 1.
    ARM: Carbon Model Studio.
  2. 2.
    M. Bajaj, D. Zwemer, R. Yntema, A. Phung, A. Kumar, A. Dwivedi, M. Waikar, MBSE++–foundations for extended model-based systems engineering across system lifecycle, in INCOSE International Symposium, 2016, vol. 26, pp. 2429–2445CrossRefGoogle Scholar
  3. 3.
    T. Blochwitz et al., Functional mockup interface 2.0: the standard for tool independent exchange of simulation models, in Proceedings of MODELICA Conference, 2012, pp. 173–184Google Scholar
  4. 4.
    N. Bombieri, G. Di Guglielmo, M. Ferrari, F. Fummi, G. Pravadelli, F. Stefanni, A. Venturelli, Hifsuite: tools for HDL code conversion and manipulation. EURASIP J. Embed. Syst. 2010(1), 1–20 (2010)CrossRefGoogle Scholar
  5. 5.
    N. Bombieri, F. Fummi, G. Pravadelli, Automatic abstraction of RTL IPs into equivalent TLM descriptions. IEEE Trans. Comput. 60(12), 1730–1743 (2011)MathSciNetCrossRefGoogle Scholar
  6. 6.
    F. Bouchhima, M. Briere, G. Nicolescu, M. Abid, E. Aboulhamid, A SystemC/Simulink co-simulation framework for continuous/discrete-events simulation, in Proceedings of IEEE BMAS, 2006, pp. 1–6Google Scholar
  7. 7.
    S. Centomo, M. Lora, F. Fummi, Transaction-level functional mockup units for cyber-physical virtual platforms, in Proceedings of ECSI/IEEE FDL, 2018, pp. 1–8Google Scholar
  8. 8.
    S. Centomo, M. Panato, F. Fummi, Cyber-physical systems integration in a production line simulator, in Proceedings of IEEE VLSI-SoC, 2018, pp. 1–6Google Scholar
  9. 9.
    W. Chang, D. Roy, L. Zhang, S. Chakraborty, Model-based design of resource-efficient automotive control software, in Proceedings of IEEE/ACM ICCAD, 2016, pp. 1–8Google Scholar
  10. 10.
    F. Cremona, M. Lohstroh, D. Broman, E.A. Lee, M. Masin, S. Tripakis, Hybrid co-simulation: it’s about time, in Software & Systems Modeling, 2017.
  11. 11.
    E. Fraccaroli, M. Lora, S. Vinco, D. Quaglia, F. Fummi, Integration of mixed-signal components into virtual platforms for holistic simulation of smart systems, in Proceedings of IEEE/ACM DATE, 2016, pp. 1–6Google Scholar
  12. 12.
    F. Fummi, M. Lora, F. Stefanni, D. Trachanis, J. Vanhese, S. Vinco, Moving from co-simulation to simulation for effective smart systems design, in Proceedings of ACM/IEEE DATE, 2014, pp. 1–4Google Scholar
  13. 13.
    R. Görgen, J. Oetjens, W. Nebel, Transformation of event-driven HDL blocks for native integration into time-driven system models, in Proceedings of the IEEE/ECSI FDL, 2012, pp. 152–159Google Scholar
  14. 14.
    W. Hanini, M. Ayadi, PSpice and simulink co-simulation for diode and AC-DC converter using SLPS interface software, in 2017 18th International Conference on Sciences and Techniques of Automatic Control and Computer Engineering (STA) (IEEE, 2017).
  15. 15.
    M.S. Hasan, H. Yu, A. Carrington, T. Yang, Co-simulation of wireless networked control systems over mobile ad hoc network using SIMULINK and OPNET. IET Commun. 3(8), 1297–1310 (2009)CrossRefGoogle Scholar
  16. 16.
    J.C. Jensen, D.H. Chang, E.A. Lee, A model-based design methodology for cyber-physical systems, in Proceedings of IWCMC, 2011, pp. 1666–1671Google Scholar
  17. 17.
    R. Kawahara, D. Dotan, T. Sakairi, K. Ono, H. Nakamura, A. Kirshin, S. Hirose, H. Ishikawa, Verification of embedded system’s specification using collaborative simulation of SysML and simulink models, in 2009 International Conference on Model-Based Systems Engineering (IEEE, 2009).
  18. 18.
    Y.S. Kung, N.V. Quynh, N.T. Hieu, C.C. Huang, L.C. Huang, Simulink/modelsim co-simulation and FPGA realization of speed control IC for PMSM drive. Procedia Eng. 23, 718–727 (2011). CrossRefGoogle Scholar
  19. 19.
    W. Li, X. Zhang, H. Li, Co-simulation platforms for co-design of networked control systems: an overview. Control. Eng. Pract. 23, 44–56 (2014)CrossRefGoogle Scholar
  20. 20.
    M. Lora, R. Muradore, D. Quaglia, F. Fummi, Simulation alternatives for the verification of networked cyber-physical systems. Microprocess. Microsyst. 39(8), 843–853 (2015)CrossRefGoogle Scholar
  21. 21.
    M. Lora, E. Fraccaroli, F. Fummi, Virtual prototyping of smart systems through automatic abstraction and mixed-signal scheduling, in Proceedings of IEEE/ACM ASP-DAC, 2017, pp. 232–237Google Scholar
  22. 22.
    M. Lora, S. Centomo, D. Quaglia, F. Fummi, Automatic integration of cycle-accurate descriptions with continuous-time models for cyber-physical virtual platforms, in 2018 Design, Automation & Test in Europe Conference & Exhibition (DATE) (IEEE, 2018).
  23. 23.
    R. Malone, B. Friedland, J. Herrold, D. Fogarty, Insights from large scale model based systems engineering at Boeing, in Proceedings of INCOSE International Symposium, 2016, vol. 26, pp. 542–555CrossRefGoogle Scholar
  24. 24.
  25. 25.
    Y. Nakamoto, I. Abe, T. Osaki, H. Terada, Y. Moriyama, Toward integrated virtual execution platform for large-scale distributed embedded systems, in Software Technologies for Embedded and Ubiquitous Systems (Springer, Berlin/Heidelberg, 2008), pp. 317–322. CrossRefGoogle Scholar
  26. 26.
    T. Peter, S. Wenzel, Coupled simulation of energy and material flow using plant simulation and MATLAB simulink. SNE Simul. Notes Eur. 27(2), 105–113 (2017)CrossRefGoogle Scholar
  27. 27.
    D. Quaglia, R. Muradore, R. Bragantini, P. Fiorini, A SystemC/Matlab co-simulation tool for networked control systems. Simul. Model. Pract. Theory 23, 71–86 (2012)CrossRefGoogle Scholar
  28. 28.
    S. Tudoret, S. Nadjm-Tehrani, A. Benveniste, J.E. Strmberg, Co-Simulation of Hybrid Systems: Signal-Simulink. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), vol. 1926 (Springer, Berlin/New York, 2000), pp. 134–151. Cited By 9Google Scholar
  29. 29.
    S. Vinco, V. Guarnieri, F. Fummi, Code manipulation for virtual platform integration. IEEE Trans. Comput. 65(9), 2694–2708 (2016)MathSciNetCrossRefGoogle Scholar
  30. 30.
    Y. Wang, K. Li, H. Zhou, S. Deng, J. Xu, J. Liu, Dynamic analysis and co-simulation ADAMS-SIMULINK for a space manipulator joint, in 2015 International Conference on Fluid Power and Mechatronics (FPM) (IEEE, 2015).
  31. 31.
    H. Yan, T. Wang, C. Liu i, H. Zhang, Functional reliability simulation analysis for electronic throttle control system based on saber-simulink co-simulation, in 2015 Prognostics and System Health Management Conference (PHM) (IEEE, 2015).

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • Stefano Centomo
    • 1
    Email author
  • Michele Lora
    • 1
  • Antonio Portaluri
    • 2
  • Francesco Stefanni
    • 2
  • Franco Fummi
    • 1
  1. 1.Department of Computer ScienceUniversity of VeronaVeronaItaly
  2. 2.EdaLab s.r.l. VeronaVeronaItaly

Personalised recommendations