Efficient Code Generation for a Domain Specific Language

  • Andrew Moss
  • Henk Muller
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3676)


We present a domain-specific-language (DSL) for writing instances of a class of filter programs. The values in the language are symbolic and independent of a concrete precision. Efficient code generation is required to fit the program onto a target device limited in both memory and processing power. We construct an interpreter for the DSL in a language specific to the device which contains the semantics of the target instruction set embedded within a declarative meta-language. The compiler is automatically generated from the interpreter through specialisation. This extension of the instruction set allows the construction of an interpreter for the DSL that is both simple and clear. In particular it allows us to declare static representations of the symbolic values, and have the specialisation of the code produce operate upon these values in the instruction set of the target device.


Residual Program Target Language Partial Evaluation Intermediate Precision Target Device 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Microchip. PIC16F84 data sheet. Technical Report DS35007B, Microchip Technology Inc. (2001)Google Scholar
  2. 2.
    Willems, M., Bürsgens, V., Meyr, H.: FRIDGE: Floating-Point Programming of Fixed-Point Digital Signal Processors. In: Proc. Int. Conf. on Signal Processing Application and Technology (ICSPAT), San Diego, September 1997, pp. 1000–1005 (1997)Google Scholar
  3. 3.
    Kum, K.-I., Kang, J., Sung, W.: AUTOSCALER for C: An optimizing floating-point to integer C program converter for fixed-point digital signal processors. IEEE Transactions on Circuits and Systems-II: Analog and Digital Signal Processing 47(9), 840–848 (2000)CrossRefGoogle Scholar
  4. 4.
    Cmar, R., Rijnders, L., Schaumont, P., Vernalde, S., Bolsens, I.: A methodology and design environment for DSP ASIC fixed-point refinement. In: DATE, p. 271 (1999)Google Scholar
  5. 5.
    Keding, H., Hürtgen, F., Willems, M., Coors, M.: Transformation of Floating-Point into Fixed-Point Algorithms by Interpolation Applying a Statistical Approach. In: Proc. Int. Conf. on Signal Processing Application and Technology (ICSPAT), Toronto (September 1998)Google Scholar
  6. 6.
    Hermenegildo, M., Bueno, F., Cabeza, D., de la Banda, M.G., López, P., Puebla, G.: The CIAO Multi-Dialect Compiler and System: An Experimentation Workbench for Future (C)LP Systems. In: Parallelism and Implementation of Logic and Constraint Logic Programming, pp. 65–85. Nova Science, USA (1999)Google Scholar
  7. 7.
    Hermenegildo, M.V., Bueno, F., Puebla, G., Lopez, P.: Program analysis, debugging, and optimization using the ciao system preprocessor. In: Proceedings of the 1999 international conference on Logic programming, Cambridge, MA, USA, pp. 52–66. Massachusetts Institute of Technology (1999)Google Scholar
  8. 8.
    Piumarta, I.: Delayed Code Generation in a Smalltalk-80 Compiler. PhD thesis, Department of Computer Science, University of Manchester (October 1992)Google Scholar
  9. 9.
    Hatcliff, J., Mogensen, T.Æ., Thiemann, P. (eds.): DIKU 1998. LNCS, vol. 1706. Springer, Heidelberg (1999)Google Scholar
  10. 10.
    Jones, N.D., Gomard, C.K., Sestoft, P.: Partial evaluation and automatic program generation. Prentice-Hall, Inc., Upper Saddle River (1993)zbMATHGoogle Scholar
  11. 11.
    Hudak, P.: Modular domain specific languages and tools. In: ICSR 1998: Proceedings of the 5th International Conference on Software Reuse, p. 134. IEEE Computer Society, Los Alamitos (1998)Google Scholar
  12. 12.
    Ganz, S.E., Sabry, A., Taha, W.: Macros as multi-stage computations: Type-safe, generative, binding macros in macroml. In: ICFP, pp. 74–85 (2001)Google Scholar
  13. 13.
    McCool, M., Toit, S.D., Popa, T., Chan, B., Moule, K.: Shader algebra. ACM Trans. Graph. 23(3), 787–795 (2004)CrossRefGoogle Scholar
  14. 14.
    Elliott, C., Finne, S., de Moor, O.: Compiling embedded languages. In: Taha, W. (ed.) SAIG 2000. LNCS, vol. 1924, pp. 9–27. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  15. 15.
    Rhiger, M.: A foundation for embedded languages. ACM Trans. Program. Lang. Syst. 25(3), 291–315 (2003)CrossRefGoogle Scholar
  16. 16.
    Langhammer, T., Herrmann, C.: Automatic staging for image processing. Number MIP-0410 (2004)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Andrew Moss
    • 1
  • Henk Muller
    • 1
  1. 1.Department of Computer ScienceUniversity of Bristol 

Personalised recommendations