skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Reusable

Better living through operational semantics: an optimizing compiler for radio protocols

Published:29 August 2017Publication History
Skip Abstract Section

Abstract

Software-defined radio (SDR) promises to bring the flexibility and rapid iterative workflow of software to radio protocol design. Many factors make achieving this promise challenging, not least of which are the high data rates and timing requirements of real-world radio protocols. The Ziria language and accompanying compiler demonstrated that a high-level language can compete in this demanding space, but extracting reusable lessons from this success is difficult due to Ziria's lack of a formal semantics. Our first contribution is a core language, operational semantics, and type system for Ziria.

The insight we gained through developing this operational semantics led to our second contribution, consisting of two program transformations. The first is fusion, which can eliminate intermediate queues in Ziria programs. Fusion subsumes many one-off optimizations performed by the original Ziria compiler. The second transformation is pipeline coalescing, which reduces execution overhead by batching IO. Pipeline coalescing relies critically on fusion and provides a much simpler story for the original Ziria compiler's "vectorization" transformation. These developments serve as the basis of our third contribution, a new compiler for Ziria that produces significantly faster code than the original compiler. The new compiler leverages our intermediate language to help eliminate unnecessary memory traffic.

As well as providing a firm foundation for the Ziria language, our work on an operational semantics resulted in very real software engineering benefits. These benefits need not be limited to SDR---the core language and accompanying transformations we present are applicable to other domains that require processing streaming data at high speed.

Skip Supplemental Material Section

Supplemental Material

References

  1. E. A. Ashcroft and W. W. Wadge. 1977. Lucid, a Nonprocedural Language with Iteration. Commun. ACM 20, 7 (July 1977), 519–526. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Horia Vlad Balan, Marcelo Segura, Suvil Deora, Antonios Michaloliakos, Ryan Rogalin, Konstantinos Psounis, and Giuseppe Caire. 2013. USC SDR, an Easy-to-Program, High Data Rate, Real Time Software Radio Platform. In Proceedings of the Second Workshop on Software Radio Implementation Forum (SRIF ’13). Hong Kong, 25–30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Manu Bansal, Jeffrey Mehlman, Sachin Katti, and Philip Levis. 2012. OpenRadio: A Programmable Wireless Dataplane. In Proceedings of the First Workshop on Hot Topics in Software Defined Networks (HotSDN ’12). Helsinki, Finland, 109–114. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Gerard Berry and Georges Gonthier. 1992. The Esterel Synchronous Programming Language: Design, Semantics, Implementation. Science of Computer Programming 19, 2 (1992), 87–152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Eric Blossom. 2004. GNU Radio: Tools for Exploring the Radio Frequency Spectrum. Linux Journal 2004, 122 (June 2004), 4. https://www.linuxjournal.com/article/7319Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Magnus Carlsson and Thomas Hallgren. 1998. Fudgets - Purely Functional Processes with Applications to Graphical User Interfaces. Ph.D. Dissertation. Chalmers University of Technology, Göteborg, Sweden.Google ScholarGoogle Scholar
  7. Paul Caspi and Marc Pouzet. 1995. A Functional Extension to Lustre. In Eighth International Symposium on Languages for Intentional Programming (ISLIP ’95), Mehmet A. Orgun and Edward A. Ashcroft (Eds.). World Scientific, Sydney, Australia.Google ScholarGoogle Scholar
  8. James Chacko, C. Sahin, Danh Nguyen, Doug Pfeil, Nagarajan Kandasamy, and Kapil Dandekar. 2014. FPGA-Based Latency-Insensitive OFDM Pipeline for Wireless Research. In Proceedings of the 2014 IEEE Conference on High Performance Extreme Computing Conference (HPEC ’14). Waltham, MA, 1–6. Google ScholarGoogle ScholarCross RefCross Ref
  9. Antony Courtney and Conal Elliott. 2001. Genuinely Functional User Interfaces. In Proceedings of the 2001 ACM SIGPLAN Haskell Workshop (HW ’01). Firenze, Italy.Google ScholarGoogle Scholar
  10. Duncan Coutts, Roman Leshchinskiy, and Don Stewart. 2007. Stream Fusion: From Lists to Streams to Nothing at All. In Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming (ICFP ’07). Freiburg, Germany, 315–326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Frédéric de Mesmay. 2010. On the Computer Generation of Adaptive Numerical Libraries. Ph.D. Dissertation. Electrical and Computer Engineering, Carnegie Mellon University.Google ScholarGoogle Scholar
  12. Danny Dubé and Marc Feeley. 2005. BIT: A Very Compact Scheme System for Microcontrollers. Higher-Order and Symbolic Computation 18, 3 (Dec. 2005), 271–298. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Aveek Dutta, Dola Saha, Dirk Grunwald, and Douglas Sicker. 2013. CODIPHY: Composing on-Demand Intelligent Physical Layers. In Proceedings of the Second Workshop on Software Radio Implementation Forum (SRIF ’13). Hong Kong, 1–8. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Ettus Research. 2017. Ettus Research, USRP: Universal Software Radio Peripheral. (Feb. 2017). http://www.ettus.com/Google ScholarGoogle Scholar
  15. Matthias Felleisen. 1987. The Calculi of Lambdaν -CS Conversion: A Syntactic Theory of Control and State in Imperative Higher-Order Programming Languages. Ph.D. Dissertation. Indiana University, Indianapolis, IN.Google ScholarGoogle Scholar
  16. Matthias Felleisen, Robert Bruce Findler, and Matthew Flatt. 2009. Semantics Engineering with PLT Redex. The MIT Press, Cambridge, MA.Google ScholarGoogle Scholar
  17. Franz Franchetti, Markus Püschel, Yevgen Voronenko, Srinivas Chellappa, and José M. F. Moura. 2009. Discrete Fourier Transform on Multicore. IEEE Signal Processing Magazine 26, 6 (Nov. 2009), 90–102. Google ScholarGoogle ScholarCross RefCross Ref
  18. Matteo Frigo. 1999. A Fast Fourier Transform Compiler. In Proceedings of the 1999 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’99). Atlanta, Georgia, 169–180. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Thierry Gautier, Paul Le Guernic, and Loïc Besnard. 1987. SIGNAL: A Declarative Language for Synchronous Programming of Real-Time Systems. In Proceedings of Functional Programming Languages and Computer Architecture (FPCA ’87), Gilles Kahn (Ed.). Number 274 in Lecture Notes in Computer Science. Springer, Portland, Oregon, 257–277. Google ScholarGoogle ScholarCross RefCross Ref
  20. Andrew Gill, John Launchbury, and Simon L. Peyton Jones. 1993. A Short Cut to Deforestation. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture (FPCA ’93). ACM, Copenhagen, Denmark, 223–232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Nicholas Halbwachs, Paul Caspi, Pascal Raymond, and Daniel Pilaud. 1991. The Synchronous Data Flow Programming Language Lustre. Proc. IEEE 79, 9 (Sept. 1991), 1305–1320. Google ScholarGoogle ScholarCross RefCross Ref
  22. G. W. Hamilton. 2001. Extending Higher-Order Deforestation: Transforming Programs to Eliminate Even More Trees. In Selected Papers from the 3rd Scottish Functional Programming Workshop (SFP ’01), Kevin Hammond and Sharon Curtis (Eds.). Intellect Books, Exeter, UK, 25–36. http://dl.acm.org/citation.cfm?id=644403.644407Google ScholarGoogle Scholar
  23. John Hughes. 2000. Generalising Monads to Arrows. Science of Computer Programming 37, 1–3 (May 2000), 67–111. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. IEEE. 2012. IEEE Standard for Information Technology—Telecommunications and Information Exchange between Systems Local and Metropolitan Area Networks—Specific Requirements Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications. IEEE Std 802.11-2012 (Revision of IEEE Std 802.11-2007) (March 2012). Google ScholarGoogle ScholarCross RefCross Ref
  25. Patricia Johann. 2001. Short Cut Fusion: Proved and Improved. In Proceedings of the 2nd International Workshop on Semantics, Applications, and Implementation of Program Generation (SAIG ’01). Lecture Notes in Computer Science, Vol. 2196. Springer-Verlag, Florence, Italy, 47–71. Google ScholarGoogle ScholarCross RefCross Ref
  26. Geoffrey Mainland. 2017. A Domain-Specific Language for Software-Defined Radio. In Proceedings of the 19th International Symposium on Practical Aspects of Declarative Languages (PADL ’17). Lecture Notes in Computer Science, Vol. 10137. Springer International Publishing, Paris, France, 173–188. Google ScholarGoogle ScholarCross RefCross Ref
  27. Geoffrey Mainland, Roman Leshchinskiy, and Simon Peyton Jones. 2013. Exploiting Vector Instructions with Generalized Stream Fusion. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming (ICFP ’13). Boston, MA, 37–48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Simon Marlow and Philip Wadler. 1993. Deforestation for Higher-Order Functions. In Proceedings of the 1992 Glasgow Workshop on Functional Programming (Workshops in Computing). Springer-Verlag, Ayr, Scotland, 154–165. Google ScholarGoogle ScholarCross RefCross Ref
  29. Patrick Murphy, Ashnu Sabharwal, and Behnaam Aazhang. 2006. Design of WARP: A Flexible Wireless Open-Access Research Platform. In Proceedings of the 14th European Signal Processing Conference (EUSIPCO ’06). Florence, Italy.Google ScholarGoogle Scholar
  30. Man Cheuk Ng, Kermin Elliott Fleming, Mythili Vutukuru, Samuel Gross, Arvind, and Hari Balakrishnan. 2010. Airblue: A System for Cross-Layer Wireless Protocol Development. In Proceedings of the 6th ACM/IEEE Symposium on Architectures for Networking and Communications Systems (ANCS ’10). La Jolla, CA, 4:1–4:11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Rishiyur S. Nikhil. 2008. Bluespec: A General-Purpose Approach to High-Level Synthesis Based on Parallel Atomic Transactions. In High-Level Synthesis, Philippe Coussy and Adam Morawiec (Eds.). Springer Netherlands, 129–146. Google ScholarGoogle ScholarCross RefCross Ref
  32. Simon L. Peyton Jones and Philip Wadler. 1993. Imperative Functional Programming. In Proceedings of the 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’93). ACM, Charleston, South Carolina, 71–84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Markus Püschel, José M. F. Moura, Jeremy Johnson, David Padua, Manuela Veloso, Bryan Singer, Jianxin Xiong, Franz Franchetti, Aca Gacic, Yevgen Voronenko, Kang Chen, Robert W. Johnson, and Nicholas Rizzolo. 2005. Spiral: Code Generation for DSP Transforms. Proc. IEEE 93, 2 (Feb. 2005), 232–275. Google ScholarGoogle ScholarCross RefCross Ref
  34. T. Rondeau, Nicholas McCarthy, and Timothy O’Shea. 2013. SIMD Programming in GNURadio: Maintainable and User-Friendly Algorithm Optimization with VOLK. In Proceedings of SDR-WInnComm 2013. Washington, D.C.Google ScholarGoogle Scholar
  35. Sora Core Team and Kun Tan. 2012. Brick Specification. Technical Report MSR-TR-2012-26. Microsoft Research.Google ScholarGoogle Scholar
  36. Gordon Stewart, Mahanth Gowda, Geoffrey Mainland, Bozidar Radunovic, Dimitrios Vytiniotis, and Cristina Luengo Agulló. 2015. Ziria: An Optimizing Compiler for Wireless PHY Programming. In Proceedings of the 20th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’15). Istanbul, Turkey. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Gordon Stewart, Dimitrios Vytiniotis, Geoffrey Mainland, Bozidar Radunovic, and Edsko de Vries. 2016. Ziria. (April 2016). https://github.com/dimitriv/Ziria Version 85cc34db.Google ScholarGoogle Scholar
  38. Josef Svenningsson. 2002. Shortcut Fusion for Accumulating Parameters & Zip-like Functions. In Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming (ICFP ’02). ACM, Pittsburgh, PA, 124–132. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Akihiko Takano and Erik Meijer. 1995. Shortcut Deforestation in Calculational Form. In Proceedings of the Seventh International Conference on Functional Programming and Computer Architecture (FPCA ’95). La Jolla, CA, 306–313. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Kun Tan, Jiansong Zhang, Ji Fang, He Liu, Yusheng Ye, Shen Wang, Yongguang Zhang, Haitao Wu, Wei Wang, and Geoffrey M. Voelker. 2009. Sora: High Performance Software Radio Using General Purpose Multi-Core Processors. In Proceedings of the 6th USENIX Symposium on Networked Systems Design and Implementation (NSDI ’09). Boston, MA, 75–90.Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Michael Bedford Taylor, Jason Kim, Jason Miller, David Wentzlaff, Fae Ghodrat, Ben Greenwald, Henry Hoffman, Paul Johnson, Jae-Wook Lee, Walter Lee, Albert Ma, Arvind Saraf, Mark Seneski, Nathan Shnidman, Volker Strumpen, Matt Frank, Saman Amarasinghe, and Anant Agarwal. 2002. The Raw Microprocessor: A Computational Fabric for Software Circuits and General-Purpose Programs. IEEE Micro 22, 2 (March 2002), 25–35. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. William Thies and Saman Amarasinghe. 2010. An Empirical Characterization of Stream Programs and Its Implications for Language and Compiler Design. In Proceedings of the 19th International Conference on Parallel Architectures and Compilation Techniques (PACT ’10). ACM, Vienna, Austria, 365–376. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. William Thies, Michal Karczmarek, and Saman P. Amarasinghe. 2002. StreamIt: A Language for Streaming Applications. In Proceedings of the 11th International Conference on Compiler Construction (CC ’02). Grenoble, France, 179–196. Google ScholarGoogle ScholarCross RefCross Ref
  44. William Thies, Michal Karczmarek, Janis Sermulins, Rodric Rabbah, and Saman Amarasinghe. 2005. Teleport Messaging for Distributed Stream Programs. In Proceedings of the Tenth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’05). Chicago, IL, 224–235. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Charles F. Van Loan. 1992. Computational frameworks for the Fast Fourier Transform. Society for Industrial and Applied Mathematics, Philadelphia, PA. Google ScholarGoogle ScholarCross RefCross Ref
  46. Yevgen Voronenko, Volodymyr Arbatov, Christian Berger, Ronghui Peng, Markus Püschel, and Franz Franchetti. 2010. Computer Generation of Platform-Adapted Physical Layer Software. In Proceedings of Software Defined Radio (SDR ’10).Google ScholarGoogle Scholar
  47. William W. Wadge and Edward A. Ashcroft. 1985. Lucid, the Dataflow Programming Language. Number 22 in A.P.I.C. Studies in Data Processing. Academic Press, London.Google ScholarGoogle Scholar
  48. Philip Wadler. 1990. Deforestation: Transforming Programs to Eliminate Trees. Theoretical Computer Science 73, 2 (June 1990), 231–248. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Philip Wadler and Stephen Blott. 1989. How to Make Ad-Hoc Polymorphism Less Ad Hoc. In Proceedings of the 16th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’89). Austin, Texas, 60–76. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Zhanyong Wan and Paul Hudak. 2000. Functional Reactive Programming from First Principles. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI ’00). Vancouver, British Columbia, Canada, 242–252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Jianxin Xiong, Jeremy Johnson, Robert Johnson, and David Padua. 2001. SPL: A Language and Compiler for DSP Algorithms. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation (PLDI ’01). Snowbird, Utah, 298–308. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Better living through operational semantics: an optimizing compiler for radio protocols

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!