skip to main content
research-article

A MATLAB Vectorizing Compiler Targeting Application-Specific Instruction Set Processors

Published: 04 January 2017 Publication History

Abstract

This article discusses a MATLAB-to-C vectorizing compiler that exploits custom instructions, for example, for Single Instruction Multiple Data (SIMD) processing and instructions for complex arithmetic present in Application-Specific Instruction Set Processors (ASIPs). Custom instructions are represented via specialized intrinsic functions in the generated code, and the generated code can be used as input to any C/C++ compiler supporting the target processor. Furthermore, the specialized instruction set of the target processor is described in a parameterized way using a target processor-independent architecture description approach, thus allowing the support of any processor. The compiler has been used for the generation of application code for two different ASIPs for several benchmarks. The code generated by the compiler achieves a speedup between 2× --74× and 2× --97× compared to the code generated by the MathWorks MATLAB-to-C compiler. Experimental results also prove that the compiler efficiently exploits SIMD custom instructions achieving a 3.3 factor speedup compared to cases where no SIMD processing is used. Thus the compiler can be employed to reduce the development time/effort/cost and time to market through raising the abstraction of application design in an embedded systems/system-on-chip development context.

References

[1]
3GPP-LTE 2016. IEEE Standard Association. IEEE Get Program. Retrieved from http://www.3gpp.org/specifications/releases.
[2]
Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman. 2006. Compilers: Principles, Techniques, and Tools (2nd. ed.). Addison-Wesley Longman, Boston, MA.
[3]
George Almsi and David Padua. 2002. MaJIC: Compiling MATLAB for speed and responsiveness. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation (PLDI’02). ACM, New York, NY, 294--303.
[4]
E. Anderson, Z. Bai, and J. Dongarra. 1992. Generalized QR factorization and its applications. Linear Algebr. Appl. 162 (Feb. 1992), 243--271.
[5]
Ray Andraka. 1998. A survey of CORDIC algorithms for FPGA based computers. In Proceedings of the 1998 ACM/SIGDA Sixth International Symposium on Field Programmable Gate Arrays (FPGA’98). ACM, New York, NY, 191--200.
[6]
ASIP Designer 2016. Synopsys—ASIP Designer. Retrieved from http://www.synopsys.com/dw/ipdir.php?ds=asip-designer.
[7]
P. Banerjee. 2003. An overview of a compiler for mapping MATLAB programs onto FPGAs. In Proceedings of the Asia and South Pacific Design Automation Conference, 2003 (ASP-DAC 2003). 477--482.
[8]
P. Banerjee, N. Shenoy, A. Choudhary, S. Hauck, C. Bachmann, M. Chang, M. Haldar, P. Joisha, A. Jones, A. Kanhare, A. Nayak, S. Periyacheri, and M. Walkden. 1999. MATCH: A MATLAB Compiler for Configurable Computing Systems. Technical Report.
[9]
P. Banerjee, M. Haldar, A. Nayak, V. Kim, V. Saxena, S. Parkes, Debabrata Bagchi, S. Pal, N. Tripathi, D. Zaretsky, R. Anderson, and J. R. Uribe. 2004. Overview of a compiler for synthesizing MATLAB programs onto FPGAs. IEEE Trans. VLSI) Syst. 12, 3 (March 2004), 312--324.
[10]
P. Banerjee, N. Shenoy, A. Choudhary, S. Hauck, C. Bachmann, M. Haldar, P. Joisha, A. Jones, A. Kanhare, A. Nayak, S. Periyacheri, M. Walkden, and D. Zaretsky. 2000. A MATLAB compiler for distributed, heterogeneous, reconfigurable computing systems. In FCCM’00.
[11]
M. Benincasa, R. Besler, D. Brassaw, and R. L. Kohler. 1998. Rapid development of real-time systems using RTExpressTM. In Parallel Processing Symposium, 1998. IPPS/SPDP 1998. Proceedings of the First Merged International Parallel Processing Symposium and Symposium on Parallel and Distributed Processing 1998. 594--599.
[12]
Joo Bispo, Lus Reis, and Joo M. P. Cardoso. 2014. Multi-target C code generation from MATLAB. In Proceedings of ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming (ARRAY’14). ACM, New York, NY, 95:95--95:100.
[13]
Joo Bispo, Lus Reis, and Joo M. P. Cardoso. 2015. Techniques for efficient MATLAB-to-C compilation. In Proceedings of the 2nd ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming (ARRAY’15). ACM, New York, NY, 7--12.
[14]
BoT 2014. BoT—A Low Power Processor for Wireless BaseBand. Retrieved from http://tinyurl.com/olasdj6.
[15]
Joo M. P. Cardoso, Tiago Carvalho, Jos G. F. Coutinho, Wayne Luk, Ricardo Nobre, Pedro Diniz, and Zlatko Petrov. 2012. LARA: An aspect-oriented programming language for embedded systems. In Proceedings of the 11th Annual International Conference on Aspect-oriented Software Development (AOSD’12). ACM, New York, NY, 179--190.
[16]
Stphane Chauveau and Franois Bodin. 1999. Menhir; an environment for high performance MATLAB. Sci. Program. 7, 3-4 (Aug. 1999), 303--312.
[17]
Luiz De Rose and David Padua. 1999. Techniques for the translation of MATLAB programs into Fortran 90. ACM Trans. Program. Lang. Syst. 21, 2 (Mar. 1999), 286--323.
[18]
DeRose, L. A. 1996. Compiler Techniques for MATLAB Programs. Ph.D dissertion. University of Illinois at Urbana-Champaign.
[19]
Robert Fasthuber, Francky Catthoor, Praveen Raghavan, and Frederik Naessens. 2013. Energy-Efficient Communication Processors. Springer, New York, NY.
[20]
GCC 2016. GCC, the GNU Compiler Collection. Retrieved from https://gcc.gnu.org/.
[21]
IEEE-802.11 2009. IEEE Standard Association. IEEE Get Program. Retrieved from http://standards.ieee.org/getieee802/download/802.11n-2009.pdf.
[22]
Pramod G. Joisha and Prithviraj Banerjee. 2003. The MAGICA type inference engine for MATLAB 8#174;. In Proceedings of the 12th International Conference on Compiler Construction (CC’03). Springer-Verlag, Berlin, 121--125.
[23]
Pramod G. Joisha and Prithviraj Banerjee. 2007. A translator system for the MATLAB language: Research articles. Softw. Pract. Exper. 37, 5 (Apr. 2007), 535--578.
[24]
Ken Kennedy and John R. Allen. 2002. Optimizing Compilers for Modern Architectures: A Dependence-based Approach. Morgan Kaufmann, San Francisco, CA.
[25]
Bruno Cardoso Lopes and Rafael Auler. 2014. Getting Started with LLVM Core Libraries. Packt Publishing.
[26]
Saeed Maleki, Yaoqing Gao, Maria J. Garzarn, Tommy Wong, and David A. Padua. 2011. An evaluation of vectorizing compilers. In Proceedings of the 2011 International Conference on Parallel Architectures and Compilation Techniques (PACT’11). IEEE Computer Society, Washington, DC, 372--382.
[27]
MATLAB coder 2016. MATLAB Coder - Generate C and C++ code from MATLAB. Retrieved from http://www.mathworks.com/products/matlab-coder.
[28]
MATLAB compiler 2016. MATLAB Compiler—Build standalone applications from MATLAB programs. Retrieved from http://www.mathworks.com/products/compiler/index.html.
[29]
MATLAB embedded coder 2016. MATLAB embedded coder—Generate C and C++ code optimized for embedded systems. Retrieved from http://www.mathworks.com/products/embedded-coder/.
[30]
MATLAB fi 2016. Construct fixed-point numeric object—MATLAB fi. 2016). Retrieved from http://www.mathworks.com/help/fixedpoint/ref/fi.html.
[31]
Giovanni De Micheli. 1994. Synthesis and Optimization of Digital Circuits (1st ed.). McGraw-Hill Higher Education, New York, NY.
[32]
Ashwin Prasad, Jayvant Anantpur, and R. Govindarajan. 2011. Automatic compilation of MATLAB programs for synergistic execution on heterogeneous processors. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’11). ACM, New York, NY, 152--163.
[33]
M. J. Quinn, A Malishevsky, and N. Seelam. 1998a. Otter: Bridging the gap between MATLAB and ScaLAPACK. In Proceedings of the 7th International Symposium on High Performance Distributed Computing. 114--121.
[34]
M. J. Quinn, A. Malishevsky, N. Seelam, and Y. Zhao. 1998b. Preliminary results from a parallel MATLAB compiler. In Proceedings of the First Merged International Parallel Processing Symposium and Symposium on Parallel and Distributed Processing 1998 (IPPS/SPDP 1998). 81--87.
[35]
Chun-Yu Shei, A. Yoga, M. Ramesh, and A. Chauhan. 2011. MATLAB parallelization through scalarization. In Proceedings of the 2011 15th Workshop on Interaction between Compilers and Computer Architectures (INTERACT). 44--53.

Cited By

View all
  • (2021)Generalized Eigenvalue Decomposition Applied to Estimation of Spatial rPPG Distribution of SkinJournal of Mathematical Imaging and Vision10.1007/s10851-021-01025-363:7(807-820)Online publication date: 1-Sep-2021
  • (2020)A Retargetable MATLAB-to-C Compiler Exploiting Custom Instructions and Data ParallelismACM Transactions on Embedded Computing Systems10.1145/339189819:6(1-27)Online publication date: 3-Oct-2020

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Design Automation of Electronic Systems
ACM Transactions on Design Automation of Electronic Systems  Volume 22, Issue 2
Special Section of IDEA: Integrating Dataflow, Embedded Computing, and Architecture
April 2017
458 pages
ISSN:1084-4309
EISSN:1557-7309
DOI:10.1145/3029795
  • Editor:
  • Naehyuck Chang
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Journal Family

Publication History

Published: 04 January 2017
Accepted: 01 September 2016
Revised: 01 July 2016
Received: 01 February 2016
Published in TODAES Volume 22, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. MATLAB
  2. application specific instruction set processor (ASIP)
  3. compilation
  4. embedded systems
  5. system-on-chip (SoC)

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

  • European Community
  • FP7 ALMA

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)9
  • Downloads (Last 6 weeks)0
Reflects downloads up to 08 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2021)Generalized Eigenvalue Decomposition Applied to Estimation of Spatial rPPG Distribution of SkinJournal of Mathematical Imaging and Vision10.1007/s10851-021-01025-363:7(807-820)Online publication date: 1-Sep-2021
  • (2020)A Retargetable MATLAB-to-C Compiler Exploiting Custom Instructions and Data ParallelismACM Transactions on Embedded Computing Systems10.1145/339189819:6(1-27)Online publication date: 3-Oct-2020

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media