skip to main content
article

Efficient software implementation of embedded communication protocol controllers using asynchronous software thread integration with time- and space-efficient procedure calls

Published:01 February 2007Publication History
Skip Abstract Section

Abstract

The overhead of context switching limits efficient scheduling of multiple concurrent threads on a uniprocessor when real-time requirements exist. A software-implemented protocol controller may be crippled by this problem. The available idle time may be too short to recover through context switching, so only the primary thread can execute during message activity, slowing the secondary threads and potentially missing deadlines. Asynchronous software thread integration (ASTI) uses coroutine calls and integration, letting threads make independent progress efficiently, and reducing the needed context switches. We demonstrate the methods with a software implementation of an automotive communication protocol (J1850) and several secondary threads.

References

  1. Allen, F. E. and Cocke, J. 1972. A Catalogue of Optimizing Transformations. Prentice Hall.]]Google ScholarGoogle Scholar
  2. Arnold, M., Fink, S. J., Sarkar, V., and Sweeney, P. F. 2000. A comparative study of static and profile-based heuristics for inlining. In ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization (DYNAMO'00). ACM, New York. 52--64.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Asokan, V. 2003. Relaxing control flow constraints in ASTI. M.S. thesis, North Carolina State University.]]Google ScholarGoogle Scholar
  4. Asokan, V. and Dean, A. G. 2004. Providing time- and space- efficient procedure calls for asynchronous software thread integration. In Proceedings of the International Conference on Compilers, Architectures and Synthesis for Embedded Systems. ACM Press, New York.]] Google ScholarGoogle Scholar
  5. Atmel Corporation. Atmega 128: 8-Bit AVR Microcontroller with 128K Bytes In-System Programmable Flash. Atmel Corporation.]]Google ScholarGoogle Scholar
  6. Atmel Corporation. AVR Studio 3.52. Atmel Corporation.]]Google ScholarGoogle Scholar
  7. Atmel Corporation 1997. AVR304: Half Duplex Interrupt Driven Software UART. Atmel Corporation.]]Google ScholarGoogle Scholar
  8. Atmel Corporation 2002a. AVR308: Software LIN Slave. Atmel Corporation.]]Google ScholarGoogle Scholar
  9. Atmel Corporation 2002b. AVR320: Software SPI Master. Atmel Corporation.]]Google ScholarGoogle Scholar
  10. Atmel Corporation 2002c. AVR410: RC5 IR Remote Control Receiver. Atmel Corporation.]]Google ScholarGoogle Scholar
  11. Beckmann, C. J. 1993. Hardware and Software for Functional and Fine Grain Parallelism. Ph.D. thesis, University of Illinois at Urbana-Champaign, Urbana, IL.]] Google ScholarGoogle Scholar
  12. Breslin, T. 1997. Application note: 68hc05k0 infra-red remote control.]]Google ScholarGoogle Scholar
  13. Chang, P. P., Mahlke, S. A., Chen, W. Y., and Hwu, W.-M. 1992. Profile-guided automatic inline expansion for c programs. Software---Practice and Experience 22, 5, 349--369.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Chou, P. and Borriello, G. 1995. Interval scheduling: Fine grained code scheduling for embedded systems. In Proceedings of the Design Automation Conference. 462--467.]] Google ScholarGoogle Scholar
  15. Cooper, K. D., Hall, M. W., and Kennedy, K. 1993. A methodology for procedure cloning. Computer Languages 19, 2, 105--117.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Cortadella, J., Kondratyev, A., Lavagno, L., Passerone, C., and Watanabe, Y. 2000. Quasi-static scheduling of independent tasks for reactive systems. Design Automation Conference.]]Google ScholarGoogle Scholar
  17. Dean, A. G. 2000. Software thread integration for hardware to software migration. Ph.D. thesis, Carnegie Mellon University, Pittsburgh, PA.]] Google ScholarGoogle Scholar
  18. Dean, A. G. 2002. Compiling for concurrency: Planning and performing software thread integration. In Proceedings of the 23rd IEEE International Symposium on Real-Time Systems. IEEE Press, Austin, TX.]] Google ScholarGoogle Scholar
  19. Dean, A. G. and Grzybowski, R. R. 1999. A high-temperature embedded network interface using software thread integration. In Second Workshop on Compiler and Architectural Support for Embedded Systems. Washington, DC.]]Google ScholarGoogle Scholar
  20. Dean, A. G. and Shen, J. P. 1998. Techniques for software thread integration in real-time embedded systems. In Proceedings of the 19th IEEE International Symposium on Real-Time Systems. Madrid, Spain. 322--333.]] Google ScholarGoogle Scholar
  21. Dean, J., Chambers, C., and Grove, D. 1995. Selective specialization for object-oriented languages. In SIGPLAN Conference on Programming Language Design and Implementation. 93--102.]] Google ScholarGoogle Scholar
  22. Edwards, S. A. 2000. Compiling esterel into sequential code. In Design Automation Conference. 322--327.]] Google ScholarGoogle ScholarCross RefCross Ref
  23. Embacher, M. 1996. Replacing dedicated protocol controllers with code efficient and configurable microcontrollers---low speed can network applications.]]Google ScholarGoogle Scholar
  24. Free Software Foundation. avr-gcc 3.2. Free Software Foundation.]]Google ScholarGoogle Scholar
  25. French, R. S., Lam, M. S., Levitt, J. R., and Olukotun, K. 1995. A general method for compiling event-driven simulations. In Design Automation Conference. 151--156.]] Google ScholarGoogle Scholar
  26. Ganesan, P. and Dean, A. G. 2004. Enhancing the AVRx kernel with efficient secure communication using software thread integration. In Proceedings of the 10th IEEE Real-Time and Embedded Technology Applications Symposium. IEEE Press, Washington, D.C.]] Google ScholarGoogle Scholar
  27. George, S. HC05 software-driven asynchronous serial communication techniques using the mc68hc705j1a.]]Google ScholarGoogle Scholar
  28. Goodhue, G. A software duplex UART for the 751/752.]]Google ScholarGoogle Scholar
  29. Gupta, R. and Spezialetti, M. 1994. Busy-idle profiles and compact task graphs: Compile-time support for interleaved and overlapped scheduling of real-time tasks. In 15th IEEE Real Time Systems Symposium.]]Google ScholarGoogle Scholar
  30. Gupta, R. K. and De Micheli, G. 1996. A co-synthesis approach to embedded system design automation. Des. Autom. Embedded Syst. 1, 1-2, 69--120.]] Google ScholarGoogle Scholar
  31. Ha, S. and Lee, E. 1997. Compile-time scheduling of dynamic constructs in dataflow program graphs.]]Google ScholarGoogle Scholar
  32. Herbert, T. F. 1999. Integrating a soft modem. Embedded Systems Programming 12, 3 (Mar.), 62--74.]]Google ScholarGoogle Scholar
  33. Hill, J., Szewczyk, R., Woo, A., Hollar, S., Culler, D. E., and Pister, K. S. J. 2000. System architecture directions for networked sensors. In Architectural Support for Programming Languages and Operating Systems. 93--104.]] Google ScholarGoogle Scholar
  34. Holland, S. 1999. Low-cost software bell-202 modem. Circuit Cellar 107 (June), 12--19.]]Google ScholarGoogle Scholar
  35. Kumar, N. J. 2003. STI concepts for bit-bang communication protocols. M.S. thesis, North Carolina State University. Raleigh, NC.]]Google ScholarGoogle Scholar
  36. Kumar, N. J., Shivshankar, S., and Dean, A. G. 2004. Asynchronous software thread integration for efficient software implementations of embedded communication protocol controllers. In Proceedings of the 2004 ACM SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded Systems. ACM Press, New York.]] Google ScholarGoogle Scholar
  37. Lee, E. A. 1988. Recurrences, iteration, and conditionals in statically scheduled block diagram languages. In VLSI Signal Processing III, R. W. Brodersen and H. S. Moscovitz, Eds. IEEE Press, Washington, D.C. 330--340.]]Google ScholarGoogle Scholar
  38. Lee, E. A. and Messerschmitt, D. G. 1987. Static scheduling of synchronous data flow graphs for digital signal processing. IEEE Transactions on Computers.]] Google ScholarGoogle Scholar
  39. Leupers, R. and Marwedel, P. 1999. Function inlining under code size constraints for embedded processors. In ICCAD. 253--256.]] Google ScholarGoogle Scholar
  40. Lin, B. 1998. Efficient compilation of process-based concurrent programs without run-time scheduling. In Proceedings of the conference on Design, automation and test in Europe. IEEE Computer Society, Washington, D.C. 211--217.]] Google ScholarGoogle Scholar
  41. Loeffler, C., Lightenberg, A., Bheda, H., and Moschytz, G. 1988. Hierarchical scheduling systems for parallel architectures. In Proceedings of Euco. Grenoble.]]Google ScholarGoogle Scholar
  42. Micrel, Inc. 2000. MIC74 2-Wire Serial I/O Expander and Fan Controller. Micrel, Inc.]]Google ScholarGoogle Scholar
  43. Microchip Technology, Inc. 2000. MCP2502X/5X CAN I/O Expander Family Data Sheet. Microchip Technology, Inc.]]Google ScholarGoogle Scholar
  44. Naufel, N. Interfacing the 68hc05c5 SIOP to an I2C peripheral.]]Google ScholarGoogle Scholar
  45. Nisley, E. 2003. Rising tides. Dr. Dobb's Journal 346.]]Google ScholarGoogle Scholar
  46. Philips Semiconductors 1996. P82C150 CAN Serial Linked I/O Device (SLIO) with Digital and Analog Port Functions Data Sheet. Philips Semiconductors.]]Google ScholarGoogle Scholar
  47. Philips Semiconductors 2002. PCF8574 Remote 8-bit I/O Expander for I2C-bus. Philips Semiconductors.]]Google ScholarGoogle Scholar
  48. Richardson, S. and Ganapathi, M. 1989. Code optimization across procedures. Computer 22, 2, 42--50.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Sgroi, M., Lavagno, L., Watanabe, Y., and Sangiovanni-Vincentelli, A. L. 1999. Quasi-static scheduling of embedded software using equal conflict nets. In Proceedings of the 20th International Conference Application and Theory of Petri Nets. 208--227.]] Google ScholarGoogle Scholar
  50. Shivshankar, S., Vangara, S., and Dean, A. G. 2005. Balancing register pressure and context-switching delays in ASTI systems. In Proceedings of the 2005 International Conference on Compilers, Architecture, and Synthesis for Embedded Systems.]] Google ScholarGoogle Scholar
  51. So, W. and Dean, A. G. 2003. Procedure cloning and integration for converting parallelism from coarse to fine grain. In Proceedings of the Seventh Workshop on Interaction between Compilers and Computer Architectures.]] Google ScholarGoogle Scholar
  52. Society of Automotive Engineers 1992. SAE J1850 Class B data communication network interface. Society of Automotive Engineers.]]Google ScholarGoogle Scholar
  53. Vangara, S. 2003. Code motion techniques for software thread integration for bit-banged communication protocols. M.S. thesis, North Carolina State University, Raleigh, NC.]]Google ScholarGoogle Scholar
  54. Welch, B., Kanaujia, S., Seetharam, A., Thirumalai, D., and Dean, A. G. 2003. Extending STI for demanding hard-real-time systems. In Proceedings of the 2003 International Conference on Compilers, Architectures, and Synthesis for Embedded Systems. ACM Press, New York. 41--50.]] Google ScholarGoogle Scholar

Index Terms

  1. Efficient software implementation of embedded communication protocol controllers using asynchronous software thread integration with time- and space-efficient procedure calls

            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!