Skip to main content
Log in

On embedding a hardware description language in Isabelle/HOL

  • Published:
Design Automation for Embedded Systems Aims and scope Submit manuscript

Abstract

In order to define executable hardware description language while at the same time be fit for formal proofs of properties, a hardware description language VeriFormal, embedded in Isabelle/HOL, was created. VeriFormal, together with a translator and Isabelle/HOL proof facility, provides a platform for designing, simulating and reasoning about hardware designs. Building such an environment is challenging due to the fact that the designer must have expertise in programming language design, the specific domain and theorem prover. It requires selection of a language design criteria, host language, grammar, embedding approach and techniques and mechanisms to address determinism and termination issues. When the language in question is a hardware description language, it requires specialized treatment of events, their scheduling, data types and assignments. In this paper, we report on our experience of embedding hardware description language VeriFormal in theorem prover Isabelle/HOL. In particular, the structure and execution of programs in the context of theorem provers and their impact on the overall language design are discussed. Among the main features of VeriFormal include formal semantics of the language, support for mechanical reasoning about designs and compiler and type checking of modules using Isabelle/HOL as well as VeriFormal type checkers.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21

Similar content being viewed by others

Notes

  1. Numbers are expressions and its constructor is skipped for simplicity.

  2. This latter assumption is used to keep the scenario simple.

  3. The online Synopsys VCS and Icarus Verilog simulators were accessed from URL https://www.edaplayground.com/.

References

  1. HOL Interactive Theorem Prover. https://hol-theorem-prover.org/. Accessed 8th Jan 2018

  2. VeryPCC project. http://isabelle.in.tum.de/verypcc/. Accessed 22nd Nov 2017

  3. Aho AV, Sethi R, Ullman JD (2007) Compilers: principles, techniques, and tools, vol 2. Addison-Wesley Reading, Boston

    MATH  Google Scholar 

  4. Ashenden PJ (2010) The designer’s guide to VHDL, vol 3. Morgan Kaufmann, Burlington

    Google Scholar 

  5. Association IS et al (2005) IEEE Standard for Verilog Hardware Description Language. Design Automation Standards Committee. IEEE Std 1364TM-2005

  6. Bachrach J, Vo H, Richards B, Lee Y, Waterman A, Avižienis R, Wawrzynek J, Asanović K (2012) Chisel: constructing hardware in a scala embedded language. In: Proceedings of the 49th annual design automation conference. ACM, pp 1216–1225

  7. Barras B, Boutin S, Cornes C, Courant J, Filliatre JC, Gimenez E, Herbelin H, Huet G, Munoz C, Murthy C et al (1997) The Coq proof assistant reference manual: Version 6.1. Ph.D. thesis, Inria

  8. Barthe G, Forest J, Pichardie D, Rusu V (2006) Defining and reasoning about recursive functions: a practical tool for the Coq proof assistant. In: International symposium on functional and logic programming. Springer, pp 114–129

  9. Bohannon A (2012) Foundations of web script security. University of Pennsylvania, Philadelphia

    Google Scholar 

  10. Boulton RJ, Gordon AD, Gordon MJ, Harrison J, Herbert J, Van Tassel J (1992) Experience with embedding hardware description languages in HOL. TPCD 10:129–156

    Google Scholar 

  11. Bowen J, Gordon M (1995) A shallow embedding of Z in HOL. Inf Softw Technol 37(5–6):269–276

    Article  Google Scholar 

  12. Boyer RS, Hunt Jr WA (2007) The e language. In: Proceedings of the international workshop on hardware design and functional languages, March

  13. Braibant T, Chlipala A (2013) Formal verification of hardware synthesis. In: computer aided verification. Springer, pp 213–228

  14. Bugliesi M, Calzavara S, Focardi R, Khan W (2015) CookiExt: patching the browser against session hijacking attacks. J Comput Secur 23(4):509–537

    Article  Google Scholar 

  15. Choi J, Vijayaraghavan M, Sherman B, Chlipala A et al (2017) Kami: a platform for high-level parametric hardware specification and its modular verification. Proc ACM Program Lang 1(ICFP):24

    Article  Google Scholar 

  16. Clarke EM, Grumberg O, Peled D (1999) Model checking. MIT Press, Cambridge

    MATH  Google Scholar 

  17. Clavel M, Durán F, Hendrix J, Lucas S, Meseguer J, Ölveczky P (2007) The Maude formal tool environment. In: Algebra and coalgebra in computer science. Springer, pp 173–178

  18. Compiler II F (1999) FPGA express Verilog reference manual, synopsys. Inc.-Ver

  19. Compiler II F (1999) FPGA express VHDL reference manual, synopsys. Inc.-Ver

  20. Cuadrado JS, Izquierdo JLC, Molina JG (2013) Comparison between internal and external DSLs via RubyTL and Gra2MoL. In: Formal and practical aspects of domain-specific languages: recent developments. IGI Global, pp 109–131

  21. Dawson J (2009) Isabelle theories for machine words. Electron Notes Theor Comput Sci 250(1):55–70

    Article  Google Scholar 

  22. Decaluwe J (2004) MyHDL: a python-based hardware description language. Linux J 2004(127):5

    Google Scholar 

  23. Fowler M (2010) Domain-specific languages. Pearson Education, London

    Google Scholar 

  24. Ghosh D (2011) DSL for the uninitiated. Commun ACM 54(7):44–50

    Article  Google Scholar 

  25. Gibbons J (2013) Functional programming for domain-specific languages. In: Central European Functional Programming School. Springer, pp 1–28

  26. Gibbons J, Wu N (2014) Folding domain-specific languages: deep and shallow embeddings (functional pearl). In: ACM SIGPLAN Notices, vol. 49. ACM, pp 339–347

  27. Gordon M (1995) The semantic challenge of Verilog HDL. In: Proceedings of tenth annual IEEE symposium on logic in computer science, 1995. LICS’95. IEEE, pp 136–145

  28. Grimm T, Lettnin D, Hübner M (2018) A survey on formal verification techniques for safety-critical systems-on-chip. Electronics 7(6):81

    Article  Google Scholar 

  29. Haftmann F, Nipkow T (2010) Code generation via higher-order rewrite systems. In: International symposium on functional and logic programming. Springer, pp 103–117

  30. Hanna K, Daeche N (1985) Specification and verification using higher-order logic. Computer hardware description languages and their applications pp 418–433

  31. Hudak P (1996) Building domain-specific embedded languages. ACM Comput Surv (CSUR) 28(4es):196

    Article  Google Scholar 

  32. Hunt Jr WA (1987) The mechanical verification of a microprocessor design. HDL descriptions to guaranteed correct circuit designs, pp 89–129

  33. Hupel L, Nipkow T (2018) A verified compiler from Isabelle/HOL to CakeML. In: European symposium on programming. Springer, pp 999–1026

  34. Johnson SC (1977) Lint, a C program checker. Bell Telephone Laboratories, Murray Hill

    Google Scholar 

  35. Khan W, Azam B, Shahid N, Moeed Khan A, Shaheen A (2019) Formal verification of digital circuits using simulator with mathematical foundation. In: Applied mechanics and materials, vol 892. Trans Tech Publications Ltd., pp 134–142

  36. Khan W, Tiu A, Sanán D (2017) VeriFormal: an executable formal model of a hardware description language. In: SG-CRC, pp 19–36

  37. Kosar T, Bohra S, Mernik M (2016) Domain-specific languages: a systematic mapping study. Inf Softw Technol 71:77–91

    Article  Google Scholar 

  38. Krauss A (2008) Defining recursive functions in Isabelle/HOL

  39. Krauss A (2010) Partial and nested recursive function definitions in higher-order logic. J Autom Reason 44(4):303–336

    Article  MathSciNet  Google Scholar 

  40. Lam WK (2005) Hardware design verification: simulation and formal method-based approaches (Prentice Hall Modern semiconductor design series). Prentice Hall PTR, Upper Saddle River

    Google Scholar 

  41. Lockhart D, Zibrat G, Batten C (2014) PyMTL: a unified framework for vertically integrated computer architecture research. In: 2014 47th annual IEEE/ACM international symposium on microarchitecture (MICRO). IEEE, pp 280–292

  42. Love E, Jin Y, Makris Y (2012) Proof-carrying hardware intellectual property: a pathway to trusted module acquisition. IEEE Trans Inf Forensics Secur 7(1):25–40

    Article  Google Scholar 

  43. Melham TF et al (1988) Using recursive types to reason about hardware in higher order logic, vol 135. University of Cambridge, Computer Laboratory

  44. Meredith P, Katelman M, Meseguer J, Rosu G (2010) A formal executable semantics of Verilog. In: 2010 8th IEEE/ACM international conference on formal methods and models for codesign (MEMOCODE). IEEE, pp 179–188

  45. Mernik M, Heering J, Sloane AM (2005) When and how to develop domain-specific languages. ACM Comput Surv (CSUR) 37(4):316–344

    Article  Google Scholar 

  46. Nikhil RS (2008) Bluespec: a general-purpose approach to high-level synthesis based on parallel atomic transactions. In: High-level synthesis. Springer, pp 129–146

  47. Nipkow T, Paulson LC, Wenzel M (2002) Isabelle/HOL: a proof assistant for higher-order logic, vol 2283. Springer, Berlin

    Book  Google Scholar 

  48. Odersky M, Altherr P, Cremet V, Emir B, Maneth S, Micheloud S, Mihaylov N, Schinz M, Stenman E, Zenger M (2004) An overview of the Scala programming language. Technical Report

  49. Pace GJ, He J (1998) Formal reasoning with Verilog HDL. In: Workshop on formal techniques for hardware and hardware-like systems

  50. Reetz R (1995) Deep embedding VHDL. In: International conference on theorem proving in higher order logics. Springer, pp 277–292

  51. Shelley G, Forrest S, ACL2 Theorem Prover

  52. Sloane T (2008) Experiences with domain-specific language embedding in Scala. In: Domain-specific program development, p 7

  53. Svenningsson J, Axelsson E (2012) Combining deep and shallow embedding for EDSL. In: International symposium on trends in functional programming. Springer, pp 21–36

  54. Thomas D, Moorby P (2008) The Verilog®hardware description language. Springer, Berlin

    MATH  Google Scholar 

  55. Wildmoser M, Nipkow T (2004) Certifying machine code safety: shallow versus deep embedding. Theorem proving in higher order logics, pp 133–142

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Wilayat Khan.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Khan, W., Sanan, D., Hou, Z. et al. On embedding a hardware description language in Isabelle/HOL. Des Autom Embed Syst 23, 123–151 (2019). https://doi.org/10.1007/s10617-019-09226-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10617-019-09226-1

Keywords

Navigation