Code Generation from Simulink Models with Task and Data Parallelism


  • Pin Xu Nagoya University
  • Masato Edahiro
  • Kondo Masaki



Simulink model, code generation, task parallelism, data parallelism


In this paper, we propose a method to automatically generate parallelized code from Simulink models, while exploiting both task and data parallelism. Building on previous research, we propose a model-based parallelizer (MBP) that exploits task parallelism and assigns tasks to CPU cores using a hierarchical clustering method. We also propose a
method in which data-parallel SYCL code is generated from Simulink models; computations with data parallelism are expressed in the form of S-Function Builder blocks and are executed in a heterogeneous computing environment. Most parts of the procedure can be automated with scripts, and the two methods can be applied together. In the evaluation, the data-parallel programs generated using our proposed method achieved a maximum speedup of approximately 547 times, compared to sequential programs, without observable differences in the computed results. In addition, the programs generated while exploiting both task and data parallelism were confirmed to have achieved better performance than those exploiting either one of the two.


Download data is not yet available.


Alpay, A. (2020). Hipsycl. Heidelberg University. Retrieved January 24, 2021, from

Cha, M., Kim, K. H., Lee, C. J., Ha, D., & Kim, B. S. (2011). Deriving high-performance real-time multicore systems based on simulink applications, In 2011 ieee ninth international conference on dependable, autonomic and secure computing. IEEE.

Cha, M., Kim, S., & Kim, K. (2012). An automatic parallelization scheme for simulink-based real-time multicore systems. Science & Engineering Reasearch Support Society, 5, 215–217. vol5_2012/37.pdf

Cilardo, A., Socci, D., & Mazzocca, N. (2014). Asp-based optimized mapping in a simulink-to-mpsoc designflow. Journal of Systems Architecture, 60 (1), 108–118.

Codeplay. (2020). Computecpp. Codeplay Software Ltd. Retrieved January 24, 2021, from

https://developer.codeplay. com/products/computecpp/ce/home/

Feautrier, P. (1996). Automatic parallelization in the polytope model. In The data parallel programming model (pp. 79– 103). Springer.

GNU. (2020). Gnu gprof. Free Software Foundation, Inc. Retrieved January 24, 2021, from binutils/docs/gprof/

Han, G., Di Natale, M., Zeng, H., Liu, X., & Dou, W. (2013). Optimizing the implementation of real-time simulink models onto distributed automotive architectures. Journal of Systems Architecture, 59 (10), 1115–1127. https: //

Intel. (2020). Intel oneapi. Intel. Retrieved January 24, 2021, from develop/tools/oneapi.html

Kasahara, H., & Narita, S. (1984). Practical multiprocessor scheduling algorithms for efficient parallel processing.IEEE Computer Architecture Letters, 33 (11), 1023–1029.

Khronos. (2020). Sycl. The Khronos Group Inc. Retrieved January 24, 2021, from

Kumura, T., Nakamura, Y., Ishiura, N., Takeuchi, Y., & Imai, M. (2012). Model based parallelization from the simulink models and their sequential c code, In Proceedings of the 17th workshop on synthesis and system integration of mixed information technologies (sasimi 2012). p186_R2-8.pdf

International Journal of Computer and Technology Vol 21 (2021) ISSN: 2277-3061

Mathworks. (2020). Embedded coder. The MathWorks, Inc. Retrieved January 24, 2021, from https://www.mathworks. com/products/embedded-coder.html

Mathworks. (2020). Simulink. The MathWorks, Inc. Retrieved January 24, 2021, from products/simulink.html

Tran, Q. M., Wilmes, B., & Dziobek, C. (2013). Refactoring of simulink diagrams via composition of transformation steps, In International conference on software engineering advances. Citeseer.

triSYCL. (2020). Trisycl. Github, Inc. Retrieved January 24, 2021, from

Tuncali, C. E., Fainekos, G., & Lee, Y.-H. (2015). Automatic parallelization of simulink models for multi-core architectures, In 2015 ieee 17th international conference on high performance computing and communications, 2015 ieee 7th international symposium on cyberspace safety and security, and 2015 ieee 12th international conference on embedded software and systems. IEEE.

Umeda, D., Suzuki, T., Mikami, H., Kimura, K., & Kasahara, H. (2015). Multigrain parallelization for modelbased design applications using the oscar compiler, In Languages and compilers for parallel computing. Springer.

Verdoolaege, S., Carlos Juega, J., Cohen, A., Ignacio Gomez, J., Tenllado, C., & Catthoor, F. (2013). Polyhedral parallel code generation for cuda. ACM Transactions on Architecture and Code Optimization (TACO), 9 (4), 1–23.

Verdoolaege, S., & Grosser, T. (2012). Polyhedral extraction tool, In Second international workshop on polyhedral compilation techniques (impact’12), paris, france.

Yamaguchi, K., Takematsu, S., Iketa, Y., Li, R., Zhong, Z., Kondo, M., & Edahiro, M. (2015). Block-level parallelization of simulink models [In Japanese], In Embedded systems symposium 2015 proceedings (sigemb). In Japanese.

Zhong, Z., & Edahiro, M. (2018). Model-based parallelizer for embedded control systems on single-isa heterogeneous multicore processors, In 2018 international soc design conference (isocc). IEEE. ISOCC.2018.8649919




How to Cite

Xu, P., Edahiro, M., & Masaki, K. (2021). Code Generation from Simulink Models with Task and Data Parallelism. INTERNATIONAL JOURNAL OF COMPUTERS &Amp; TECHNOLOGY, 21, 1–13.



Research Articles