Changeset 953


Ignore:
Timestamp:
Jun 15, 2011, 10:53:50 AM (8 years ago)
Author:
mulligan
Message:

more changes, including additions to the bibliography, and tightening up the introduction

Location:
src/ASM/CPP2011
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ASM/CPP2011/cpp-2011.bib

    r927 r953  
     1@article
     2{ asperti:user:2007,
     3  author = {Andrea Asperti and Claudio Sacerdoti Coen and Enrico Tassi and Stefano Zacchiroli},
     4  title = {User interaction with the {Matita} proof assistant},
     5  journal = {Journal of Automated Reasoning},
     6  pages = {109--139},
     7  volume = {39},
     8  issue = {2},
     9  year = {2007}
     10}
     11
     12@article
     13{ bate:wcet:2011,
     14  author = {Iain Bate and Usman Khan},
     15  title = {{WCET} analysis of modern processors using multi-criteria optimisation},
     16  journal = {Empirical Software Engineering},
     17  pages = {5--28},
     18  volume = {16},
     19  issue = {1},
     20  year = {2011}
     21}
     22
    123@article
    224{ klein:sel4:2010,
     
    1032}
    1133
    12 @proceedings
     34@article
     35{ leroy:formal:2009,
     36  author = {Xavier Leroy},
     37  title = {Formal verification of a realistic compiler},
     38  journal = {Communications of the {Association of Computing Machinery}},
     39  volume = {52},
     40  number = {7},
     41  pages = {107--115},
     42  year = {2009}
     43}
     44
     45@article
     46{ leroy:formally:2009,
     47  author = {Xavier Leroy},
     48  title = {A formally verified compiler back-end},
     49  journal = {Journal of Automated Reasoning},
     50  volume = {43},
     51  number = {4},
     52  pages = {363--446},
     53  year = {2009}
     54}
     55
     56@inproceedings
     57{ blazy:formal:2006,
     58  author = {Sandrine Blazy and Zaynah Dargaye and Xavier Leroy},
     59  title = {Formal Verification of a {C} Compiler Front-End},
     60  booktitle = {International Symposium on Formal Methods},
     61  pages = {460--475},
     62  year = {2006}
     63}
     64
     65@inproceedings
    1366{ klein:sel4:2009,
    1467  author = {Gerwin Klein and June Andronick and Kevin Elphinstone and Gernot Heiser and David Cock and Philip Derrin and Dhammika Elkaduwe and Kai Engelhardt and Rafal Kolanski and Michael Norrish and Thomas Sewell, Harvey Tuch and Simon Winwood},
     
    1871}
    1972
     73@inproceedings
     74{ yan:wcet:2008,
     75  author = {Jun Yan and Wei Zhang},
     76  title = {{WCET} Analysis for Multi-Core Processors with Shared {L2} Instruction Caches},
     77  booktitle = {$\mathrm{14^{th}}$ {IEEE} Symposium on Real-time and Embedded Technology and Applications},
     78  pages = {80--89},
     79  year = {2008}
     80}
     81
    2082@misc
    2183{ cerco:2011,
    22   title = {The {CerCo} project},
    23   url = {http://cerco.cs.unibo.it/},
    24   year = {2011}
     84  title = {The {CerCo} {FET-Open} project},
     85  howpublished = {\url{http://cerco.cs.unibo.it/}},
     86  year = {2011},
     87  key = {cerco:2011}
     88}
     89
     90@misc
     91{ cerco-report-code:2011,
     92  title = {{CerCo Deliverable D2.2}: prototype cost-preserving C compiler},
     93  howpublished = {\url{http://cerco.cs.unibo.it/raw-attachment/wiki/WikiStart/D2_2.pdf} and \url{http://cerco.cs.unibo.it/raw-attachment/wiki/WikiStart/D2_2_Code.tar.gz}},
     94  year = {2011},
     95  key = {cerco-2.2-report-code:2011}
    2596}
    2697
     
    2899{ compcert:2011,
    29100  title = {The {CompCert} project},
    30   url = {http://compcert.inria.fr/},
    31   year = {2011}
     101  howpublished = {\url{http://compcert.inria.fr/}},
     102  year = {2011},
     103  key = {compcert:2011}
     104}
     105
     106@misc
     107{ sdcc:2011,
     108  title = {Small Device {C} Compiler 3.0.0},
     109  howpublished = {\url{http://sdcc.sourceforge.net/}},
     110  year = {2011},
     111  key = {sdcc:2010}
    32112}
    33113
     
    35115{ sel4:2011,
    36116  title = {The {l4.verified} project},
    37   url = {http://ertos.nicta.com.au/research/l4.verified/},
     117  howpublished = {\url{http://ertos.nicta.com.au/research/l4.verified/}},
    38118  year = {2011}
    39119}
     120
     121@misc
     122{ siemens:2011,
     123  title = {{Siemens Semiconductor Group} 8051 derivative instruction set},
     124  howpublished = {\url{http://www.win.tue.nl/~aeb/comp/8051/instruction-set.pdf}},
     125  year = {2011},
     126  key = {siemens:2011}
     127}
     128
     129@techreport
     130{ amadio:certifying:2010,
     131  author = {Roberto M. Amadio and Nicolas Ayache and Yann R\'{e}gis-Gianas and Ronan Saillard},
     132  title = {Cerifying cost annotations in compilers},
     133  institution = {Universit\'{e} Paris Diderot {(Paris 7)}, Laboratoire {PPS}},
     134  year = {2010}
     135}
  • src/ASM/CPP2011/cpp-2011.tex

    r952 r953  
    2727\label{sect.introduction}
    2828
    29 We consider the formalisation of an assembler for the Intel MCS-51 8-bit microprocessor in the Matita proof assistant.
    30 This formalisation forms a major component of the EU-funded CerCo project, concering the construction and formalisation of a concrete complexity preserving compiler for a large subset of the C programming language.
     29We consider the formalisation of an assembler for the Intel MCS-51 8-bit microprocessor in the Matita proof assistant~\cite{asperti:user:2007}.
     30This formalisation forms a major component of the EU-funded CerCo project~\cite{cerco:2011}, concering the construction and formalisation of a concrete complexity preserving compiler for a large subset of the C programming language.
    3131
    32 The MCS-51 dates from the early 1980s and is commonly called the 8051/8052.
    33 Despite the microprocessor's age, derivatives are still widely manufactured by a number of semiconductor foundries and the processor is widely used, especially in embedded systems development, where well-tested, cheap, predictable microprocessors find a niche.
     32The MCS-51 dates from the early 1980s and commonly called the 8051/8052.
     33Despite the microprocessor's age, derivatives are still widely manufactured by a number of semiconductor foundries.
     34As a result the processor is widely used, especially in embedded systems development, where well-tested, cheap, predictable microprocessors find their niche.
    3435
    3536The MCS-51 has a relative paucity of features compared to its more modern brethren.
     
    3738Instead, each semiconductor foundry that produces an MCS-51 derivative is able to provide accurate timing information in clock cycles for each instruction in their derivative's instruction set.
    3839It is important to stress that this timing information, unlike in more sophisticated processors, is not an estimate, it is a definition.
    39 With the MCS-51, if a manufacturer states that a particular opcode takes three clock cycles to execute, then that opcode \emph{always} takes three clock cycles to execute.
     40For the MCS-51, if a manufacturer states that a particular opcode takes three clock cycles to execute, then that opcode \emph{always} takes three clock cycles to execute.
    4041
    4142This predicability of timing information is especially attractive to the CerCo consortium.
    42 We are in the process of constructing a cost-preserving certified compiler for a realistic processor, and not for building and formalising the worst case execution time (WCET) tools that would be necessary to achieve the same result with, for example, a modern ARM or PowerPC microprocessor.
     43We are in the process of constructing a certified, concrete complexity compiler for a realistic processor, and not for building and formalising the worst case execution time (WCET) tools that would be necessary to achieve the same result with, for example, a modern ARM or PowerPC microprocessor.
     44
    4345However, the MCS-51's paucity of features is a double edged sword.
    44 In particular, the MCS-51 features relatively miniscule memory spaces (including read-only code memory, stack and internal/external RAM) by modern standards.
    45 As a result, our compiler, to have any sort of hope of successfully compiling realistic C programs, must produce `tight' machine code.
     46In particular, the MCS-51 features relatively miniscule memory spaces (including read-only code memory, stack and internal/external random access memory) by modern standards.
     47As a result our compiler, to have any sort of hope of successfully compiling realistic C programs, ought to produce `tight' machine code.
    4648This is not simple.
    4749
    48 To begin to understand the problems we faced, we here focus on a single issue in the MCS-51's instruction set: unconditional jumps.
    49 The MCS-51 features three conditional jump instructions: \texttt{LJMP} and \texttt{SJMP}---`long jump' and `short jump' respectively---and \texttt{AJMP}, an 11-bit oddity of the MCS-51 that we choose to ignore for simplicity's sake.\footnote{Ignoring \texttt{AJMP} and its analogue \texttt{ACALL} is not idiosyncratic.  The Small Device C Compiler (SDCC), the leading open source C compiler for the MCS-51, also seemingly does not produce \texttt{AJMP} and \texttt{ACALL} instructions.  Their utility in a modern context remains unclear.}
     50We here focus on a single issue in the MCS-51's instruction set: unconditional jumps.
     51The MCS-51 features three conditional jump instructions: \texttt{LJMP} and \texttt{SJMP}---`long jump' and `short jump' respectively---and an 11-bit oddity of the MCS-51, \texttt{AJMP}, that the prototype CerCo compiler~\cite{cerco-report-code:2011} ignores for simplicity's sake.\footnote{Ignoring \texttt{AJMP} and its analogue \texttt{ACALL} is not idiosyncratic.  The Small Device C Compiler (SDCC)~\cite{sdcc:2011}, the leading open source C compiler for the MCS-51, also seemingly does not produce \texttt{AJMP} and \texttt{ACALL} instructions.  Their utility in a modern context remains unclear.}
    5052Each of these three instructions expects arguments in different sizes and behaves in different ways.
    51 For instance, \texttt{SJMP} expects an 8-bit offset which is added to the current program counter to produce a relative, local jump.
    52 In contrast, \texttt{LJMP} expects a 16-bit addressing mode and can jump to any address in the MCS-51's memory space.
    53 As a result, the size of each opcode is different, and to squeeze as much code as possible into the MCS-51's limited code memory, the smallest instruction that produces the required effect should be picked.
     53\texttt{SJMP} may only perform a `local jump' whereas \texttt{LJMP} may jump to any address in the MCS-51's memory space.
     54Consequently, the size of each opcode is different, and to squeeze as much code as possible into the MCS-51's limited code memory, the smallest possible opcode should be selected.
    5455
    55 Having the compiler attempt to select the smallest possible jump instruction was deemed too high a burden, unneccessarily complicating the compilation chain.
    56 Instead, we decided to have the compiler target an assembly language, complete with pseudoinstructions.
    57 These pseudoinstructions included generic \texttt{Jmp} and \texttt{Call} instructions.
    58 We also implemented labels, conditional jumps to labels, a program preamble containing global data and a \texttt{MOV} instruction for moving this global data into the MCS-51's one 16-bit register.
     56The prototype CerCo C compiler does not attempt to select the smallest jump opcode in this manner, as this was thought to unneccessarily complicate the compilation chain.
     57Instead, the compiler targets an assembly language, complete with pseudoinstructions including bespoke \texttt{Jmp} and \texttt{Call} instructions.
     58Labels, conditional jumps to labels, a program preamble containing global data and a \texttt{MOV} instruction for moving this global data into the MCS-51's one 16-bit register also feature.
    5959This latter feature will ease any later consideration of separate compilation in the CerCo compiler.
    60 Further, our conditional jumps to labels behave differently from their machine code counterparts.
    61 At the machine code level, conditional jumps may only jump to a relative offset of the current program counter, limiting their scope.
    62 However, at the assembly level, conditional jumps may jump to a label that appears anywhere in the program, significantly liberalising the use of conditional jumps.
     60An assembler is used to expand pseudoinstructions into MCS-51 machine code.
    6361
    64 However, in line with CerCo's goal to produce a verified compilation chain, this assembly language to machine language translation must also be proved correct.
    65 Assemblers are not as simple as they first appear, and are in fact quite hard to formalise.
    66 In particular, the CerCo assembler needs to expand labels and pseudoinstructions into a correct representation at the machine level.
     62However, this assembly process is not trivial, for numerous reasons.
     63For example, our conditional jumps to labels behave differently from their machine code counterparts.
     64At the machine code level, conditional jumps may only jump to a relative offset, expressed in a byte, of the current program counter, limiting their range.
     65However, at the assembly level, conditional jumps may jump to a label that appears anywhere in the program, significantly liberalising the use of conditional jumps and further simplifying the design of the CerCo compiler.
    6766
    68 Trying to na\"ively relate assembly programs with their machine code counterparts simply does not work.
     67Further, trying to na\"ively relate assembly programs with their machine code counterparts simply does not work.
    6968Machine code programs that fetch from code memory and programs that combine the program counter with constant shifts do not make sense at the assembly level.
    7069More generally, memory addresses can only be compared with other memory addresses.
     
    7271In short, the full preservation of the semantics of the two languages is impossible.
    7372
    74 A further set of complications is added by the peculiarities of the CerCo project itself.
     73Yet more complications are added by the peculiarities of the CerCo project itself.
    7574As mentioned, the CerCo consortium is in the business of constructing a verified compiler for the C programming language.
    76 However, unlike CompCert---currently representing the state of the art for `industrial grade' verified compilers---and similar projects, CerCo considers not just the \emph{intensional correctness} of the compiler, but also its \emph{extensional correctness}.
     75However, unlike CompCert~\cite{compcert:2011,leroy:formal:2009,leroy:formally:2009}---which currently represents the state of the art for `industrial grade' verified compilers---CerCo considers not just the \emph{intensional correctness} of the compiler, but also its \emph{extensional correctness}.
    7776That is, CompCert focusses solely on the preservation of the \emph{meaning} of a program during the compilation process, guaranteeing that the program's meaning does not change as it is gradually transformed into assembly code.
    7877However in any realistic compiler (even the CompCert compiler!) there is no guarantee that the program's time properties are preserved during the compilation process; a compiler's `optimisations' could, in theory, even conspire to degrade the concrete complexity of certain classes of programs.
Note: See TracChangeset for help on using the changeset viewer.