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.
Similar content being viewed by others
Notes
Numbers are expressions and its constructor is skipped for simplicity.
This latter assumption is used to keep the scenario simple.
The online Synopsys VCS and Icarus Verilog simulators were accessed from URL https://www.edaplayground.com/.
References
HOL Interactive Theorem Prover. https://hol-theorem-prover.org/. Accessed 8th Jan 2018
VeryPCC project. http://isabelle.in.tum.de/verypcc/. Accessed 22nd Nov 2017
Aho AV, Sethi R, Ullman JD (2007) Compilers: principles, techniques, and tools, vol 2. Addison-Wesley Reading, Boston
Ashenden PJ (2010) The designer’s guide to VHDL, vol 3. Morgan Kaufmann, Burlington
Association IS et al (2005) IEEE Standard for Verilog Hardware Description Language. Design Automation Standards Committee. IEEE Std 1364TM-2005
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
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
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
Bohannon A (2012) Foundations of web script security. University of Pennsylvania, Philadelphia
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
Bowen J, Gordon M (1995) A shallow embedding of Z in HOL. Inf Softw Technol 37(5–6):269–276
Boyer RS, Hunt Jr WA (2007) The e language. In: Proceedings of the international workshop on hardware design and functional languages, March
Braibant T, Chlipala A (2013) Formal verification of hardware synthesis. In: computer aided verification. Springer, pp 213–228
Bugliesi M, Calzavara S, Focardi R, Khan W (2015) CookiExt: patching the browser against session hijacking attacks. J Comput Secur 23(4):509–537
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
Clarke EM, Grumberg O, Peled D (1999) Model checking. MIT Press, Cambridge
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
Compiler II F (1999) FPGA express Verilog reference manual, synopsys. Inc.-Ver
Compiler II F (1999) FPGA express VHDL reference manual, synopsys. Inc.-Ver
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
Dawson J (2009) Isabelle theories for machine words. Electron Notes Theor Comput Sci 250(1):55–70
Decaluwe J (2004) MyHDL: a python-based hardware description language. Linux J 2004(127):5
Fowler M (2010) Domain-specific languages. Pearson Education, London
Ghosh D (2011) DSL for the uninitiated. Commun ACM 54(7):44–50
Gibbons J (2013) Functional programming for domain-specific languages. In: Central European Functional Programming School. Springer, pp 1–28
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
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
Grimm T, Lettnin D, Hübner M (2018) A survey on formal verification techniques for safety-critical systems-on-chip. Electronics 7(6):81
Haftmann F, Nipkow T (2010) Code generation via higher-order rewrite systems. In: International symposium on functional and logic programming. Springer, pp 103–117
Hanna K, Daeche N (1985) Specification and verification using higher-order logic. Computer hardware description languages and their applications pp 418–433
Hudak P (1996) Building domain-specific embedded languages. ACM Comput Surv (CSUR) 28(4es):196
Hunt Jr WA (1987) The mechanical verification of a microprocessor design. HDL descriptions to guaranteed correct circuit designs, pp 89–129
Hupel L, Nipkow T (2018) A verified compiler from Isabelle/HOL to CakeML. In: European symposium on programming. Springer, pp 999–1026
Johnson SC (1977) Lint, a C program checker. Bell Telephone Laboratories, Murray Hill
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
Khan W, Tiu A, Sanán D (2017) VeriFormal: an executable formal model of a hardware description language. In: SG-CRC, pp 19–36
Kosar T, Bohra S, Mernik M (2016) Domain-specific languages: a systematic mapping study. Inf Softw Technol 71:77–91
Krauss A (2008) Defining recursive functions in Isabelle/HOL
Krauss A (2010) Partial and nested recursive function definitions in higher-order logic. J Autom Reason 44(4):303–336
Lam WK (2005) Hardware design verification: simulation and formal method-based approaches (Prentice Hall Modern semiconductor design series). Prentice Hall PTR, Upper Saddle River
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
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
Melham TF et al (1988) Using recursive types to reason about hardware in higher order logic, vol 135. University of Cambridge, Computer Laboratory
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
Mernik M, Heering J, Sloane AM (2005) When and how to develop domain-specific languages. ACM Comput Surv (CSUR) 37(4):316–344
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
Nipkow T, Paulson LC, Wenzel M (2002) Isabelle/HOL: a proof assistant for higher-order logic, vol 2283. Springer, Berlin
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
Pace GJ, He J (1998) Formal reasoning with Verilog HDL. In: Workshop on formal techniques for hardware and hardware-like systems
Reetz R (1995) Deep embedding VHDL. In: International conference on theorem proving in higher order logics. Springer, pp 277–292
Shelley G, Forrest S, ACL2 Theorem Prover
Sloane T (2008) Experiences with domain-specific language embedding in Scala. In: Domain-specific program development, p 7
Svenningsson J, Axelsson E (2012) Combining deep and shallow embedding for EDSL. In: International symposium on trends in functional programming. Springer, pp 21–36
Thomas D, Moorby P (2008) The Verilog®hardware description language. Springer, Berlin
Wildmoser M, Nipkow T (2004) Certifying machine code safety: shallow versus deep embedding. Theorem proving in higher order logics, pp 133–142
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10617-019-09226-1