skip to main content
10.1145/3427081.3427086acmotherconferencesArticle/Chapter ViewAbstractPublication PagessblpConference Proceedingsconference-collections
research-article

A formalisation of LEGv8 in Agda

Published:22 October 2020Publication History

ABSTRACT

The LEGv8 architecture is a restricted representation of the ARMv8 architecture. In this paper, we present a formalisation of the LEGv8 architecture in Agda. We have modelled machine words, the processor state, and the semantics of the instruction set; we also include an assembler and disassembler with round-trip correctness. We explain how dependent types allow us to abstract away some repetitive definitions and drive the correctness proof of the assembler.

References

  1. Jade Alglave, Anthony C. J. Fox, Samin Ishtiaq, Magnus O. Myreen, Susmit Sarkar, Peter Sewell, and Francesco Zappa Nardelli. 2009. The semantics of power and ARM multiprocessor machine code. In Proceedings of the POPL 2009 Workshop on Declarative Aspects of Multicore Programming, DAMP 2009, Savannah, GA, USA, January 20, 2009, Leaf Petersen and Manuel M. T. Chakravarty (Eds.). ACM, 13--24. https://doi.org/10.1145/1481839.1481842 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. ARM Ltd. 2017. ARM Architecture Reference Manual (ARMv8, for ARMv8-A architecture profile) (DDI0487). ARM Ltd. https://developer.arm.com/docs/ddi0487/a/arm-architecture- reference- manual- armv8-for-armv8-a-architecture-profileGoogle ScholarGoogle Scholar
  3. Patrick Bahr and Graham Hutton. 2015. Calculating Correct Compilers. Journal of Functional Programming 25 (Sept. 2015).Google ScholarGoogle ScholarCross RefCross Ref
  4. Patrick Bahr and Graham Hutton. 2020. Calculating Correct Compilers II: Return of the Register Machines. Journal of Functional Programming (2020). To appear.Google ScholarGoogle Scholar
  5. Gergö Barany. 2018. A more precise, more correct stack and register model for CompCert. In LOLA 2018 - Syntax and Semantics of Low-Level Languages 2018. Oxford, United Kingdom. https://hal.inria.fr/hal-01799629Google ScholarGoogle Scholar
  6. H.G. Cragon. 1980. The Elements of Single-Chip Microcomputer Architecture. Computer 13 (1980), 27--41. Issue 10. https://doi.org/10.1109/mc.1980.1653373 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Nils Anders Danielsson. 2010. Total parser combinators. In Proceeding of the 15th ACM SIGPLAN international conference on Functional programming, ICFP 2010, Baltimore, Maryland, USA, September 27--29, 2010, Paul Hudak and Stephanie Weirich (Eds.). ACM, 285--296. https://doi.org/10.1145/1863543.1863585 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Xavier Leroy. 2009. Formal verification of a realistic compiler. Commun. ACM 52, 7 (July 2009), 107--115. https://doi.org/10.1145/1538788.1538814 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Alberto Pardo, Emmanuel Gunther, Marcos Viera, and Miguel Pagano. 2018. An Internalist Approach to Correct-by-Construction Compilers. In PPDP. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. David A. Patterson and John L. Hennessy. 2016. Computer Organization and Design: The Hardware/Software Interface. Morgan Kaufmann. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Mitchell Pickard and Graham Hutton. 2020. Dependently-typed compilers don't go wrong. (2020). http://www.cs.nott.ac.uk/~pszgmh/well-typed.pdf In preparation.Google ScholarGoogle Scholar
  12. Christopher Pulte, Shaked Flur, Will Deacon, Jon French, Susmit Sarkar, and Peter Sewell. 2018. Simplifying ARM concurrency: multicopy-atomic axiomatic and operational models for ARMv8. PACMPL 2, POPL (2018), 19:1--19:29. https://doi.org/10.1145/3158107 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Alastair Reid. 2016. Trustworthy specifications of ARM® v8-A and v8-M system level architecture. In 2016 Formal Methods in Computer-Aided Design, FMCAD 2016, Mountain View, CA, USA, October 3--6, 2016, Ruzica Piskac and Muralidhar Talupur (Eds.). IEEE, 161--168. https://doi.org/10.1109/FMCAD.2016.7886675 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Alastair Reid. 2017. Who guards the guards? formal validation of the Arm v8-m architecture specification. PACMPL 1, OOPSLA (2017), 88:1--88:24. https://doi.org/10.1145/3133912 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Yong Kiam Tan, Magnus O. Myreen, Ramana Kumar, Anthony Fox, Scott Owens, and Michael Norrish. 2016. A New Verified Compiler Backend for CakeML. In ICFP '16: Proceedings of the 21th ACM SIGPLAN International Conference on Functional Programming. ACM Press, 60--73. https://doi.org/10.1145/2951913.2951924 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Agda Development Team. 2020. Agda. https://agda.readthedocs.io/en/latest/Google ScholarGoogle Scholar
  17. Paul van der Walt and Wouter Swierstra. 2012. Engineering Proof by Reflection in Agda. In Implementation and Application of Functional Languages - 24th International Symposium, IFL 2012, Oxford, UK, August 30 - September 1, 2012, Revised Selected Papers (Lecture Notes in Computer Science), Ralf Hinze (Ed.), Vol. 8241. Springer, 157--173. https://doi.org/10.1007/978-3-642-41582-1_10Google ScholarGoogle Scholar
  18. Marcell van Geest and Wouter Swierstra. 2017. Generic packet descriptions: verified parsing and pretty printing of low-level data. In Proceedings of the 2nd ACM SIGPLAN International Workshop on Type-Driven Development, TyDe@ICFP 2017, Oxford, UK, September 3, 2017, Sam Lindley and Brent A. Yorgey (Eds.). ACM, 30--40. https://doi.org/10.1145/3122975.3122979 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A formalisation of LEGv8 in Agda

      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
      • Published in

        cover image ACM Other conferences
        SBLP '20: Proceedings of the 24th Brazilian Symposium on Context-Oriented Programming and Advanced Modularity
        October 2020
        81 pages
        ISBN:9781450389433
        DOI:10.1145/3427081

        Copyright © 2020 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 22 October 2020

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed limited

        Acceptance Rates

        Overall Acceptance Rate22of50submissions,44%
      • Article Metrics

        • Downloads (Last 12 months)6
        • Downloads (Last 6 weeks)0

        Other Metrics

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader