Guidelines for the production of a programmers guide.
A simplified architecture diagram should be provided.
All user visible registers should be shown (including PC, IR and any single or multi bit Flag registers). In addition you should show datapath functional units and bus connections. In general you should not show internal control signals (such as LoadIR) which are of no interest to the programmer.
As part of an introduction to your processor, you should describe the function of all the registers shown in the architecture diagram. Where you have a bank of registers (e.g. R0-R31) you should list any special purpose for any register (e.g. R0 is a dummy register which always contains 0, R15 is used for storage of return address when the CALL instruction is used to invoke a subroutine). You may also like to list conventions here (e.g. conventionally R14 is used as the stack pointer while R30 is the frame pointer). Note that these conventions suggest a use for the register although there will be no hardware that makes this register more suitable than another. Any conventions listed here must be strictly adhered to in any example programs.
To complete the introduction, you should give an overview of the instruction set, giving details of the types of instruction supported and the addressing modes available for each of these types. At this stage you may wish to describe the instruction field coding and the length of the instructions under different addressing modes.
You should provide complete documentation for the instruction set. For each instruction (or group of instructions) and each addressing mode you should list the Mnemonic (instruction name used in assembly language), the operation (including any changes to status flags), the assembly language syntax, a short text description and the instruction format.
The following is an example from the SPARC Instruction Set (you need not follow exactly the the arrangement shown but you should ensure that that all elements are included):
And and modify icc
This instruction does a bitwise logical AND of the contents of register R[rs1] with either the contents of R[rs2] (in register register mode) or the 13 bit, sign-extended immediate value contained in the instruction (in register immediate mode). The result is stored in register R[rd]. ANDcc also modifies all the integer condition codes in the manner described below.
Register Register Mode
ANDcc Rs1, Rs2, Rd e.g. ANDcc R3, R4, R12
R[rd] <- R[rs1] AND R[rs2] N <- R[rd]<31> Z <- if R[rd]=0 then 1, else 0 V <- 0 C <- 0
Register Immediate Mode
ANDcc Rs1, simm13, Rd e.g. ANDcc R3, -316, R12
R[rd] <- R[rs1] AND sign_extend(simm13) N <- R[rd]<31> Z <- if R[rd]=0 then 1, else 0 V <- 0 C <- 0
Note that syntax and semantics of each instruction are unambiguously defined such that the programmer reading this guide can work out how to write assembly language for your processor. Similarly the instruction coding is given so that the programmer may produce machine code (i.e. a hex format file) for your processor.
With this sort of arrangement it is typical to have only one or a very few instructions per page. For this reason it is essential that the contents page for your document lists all of these instructions, with page numbers, so that the document may easily be used as a reference guide by the programmer. If you choose to describe instructions by groups rather than individually (to avoid repetition and to save paper), then all instruction names should be included on the contents page together with the name of the instruction group.
This section of the report should guide the programmer on making the best use of your processor.
You may wish to include details of useful pseudo-instructions (e.g. CMPcc RS1, RS2 which performs SUBcc RS1, RS2, R0 for the side effect of setting the flags). This allows you to show the flexibility of your small instruction set.
You should include details of suggested use of subroutines. In particular you should include sequences of instructions used for subroutine call and return along with the setting up and destruction of stack frames. These sequences should match those used in your example programs.
If you have written an assembler for your processor, you should provide documentation for it here.
The programmer will need to know:
You should include and discuss the assembly language for the example programs:
This allows you to explain the algorithms used, the program structure and the use of the instruction set. All of this will be of significant use to a future programmer of your processor.
This section of the report should give details on how to run the simulations, including the commands required to run each of the programs on each of the models (behavioural, mixed & structural).
Here is a good chance to include screen shots of the register window with a brief explanation of the information presented.
For each of the programs you should give details of the number of clock cycles required for the simulation run.
ELEC6027: VLSI Design Project
Programmer's Guide
together with the names of all team members, the date and the name of the course tutor (me).
Since this report is a group effort, the author(s) of each section or chapter should be declared in order to allow the fair allocation of marks. Where no author is declared, no marks will be awarded.
You may include information in appendices in order to make the main body of the report more readable as you see fit.
Iain McNally
18-3-2011