⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chk2xx.txt

📁 lf2407自检源代码
💻 TXT
📖 第 1 页 / 共 3 页
字号:
bit in the RAM array to a 1 and then verifies that the pattern is correct by
reading each word and checking bits.  The test then switches the pattern
bits and again checks the memory to verify that each memory bit can be set
to a 0 and 1.


3.2 PRESERVED REGISTERS

    Since the selfcheck is C-callable, the C environment (e.g. AR0, AR1,
AR6, and AR7) must be saved upon entering the program and restored prior to
returning to the calling routine.  Certain other CPU core registers are also
actively preserved as follows:

    ST0: All bits preserved except ARP and INTM.  Upon return, ARP = 1 (the
         standard TMS320C2xx C language convention), and INTM = 1 (all
         maskable interrupts disabled).

    ST1: All bits preserved except ARB.  At return, ARB = 2.

    IMR: All bits preserved.

In addition to these, the GREG and IFR registers are never modified by the
selfcheck program, and may thus be considered preserved.  If an interrupt
occurs during selfcheck execution, its flag in the IFR will still be set
upon return to the calling routine.  If the selfcheck is called from
assembly code, the program still performs the complete save described above,
although in this case much of it is not necessary.


3.3 HOW THE PROGRAM IS STRUCTURED

    The selfcheck program is written as a series of modules that test
different components of the CPU (or different functional groupings of
instructions).  Each of these routines is called by the main control shell,
contained in the file CHK2XX.ASM.  The following is the order in which the
test modules are called:

    BASIC.ASM    ----    basic operations module
    DATA.ASM     ----    data memory operations module
    CTRL.ASM     ----    control instructions module
    BRNCH.ASM    ----    branch instructions module
    ALU.ASM      ----    arithmetic operations module
    MULT.ASM     ----    multiplier operations module
    RAM.ASM      ----    RAM check module
    SHFT.ASM     ----    scaling shifters operations module

In general, the code is designed to functionally check each instruction
before that instruction is used to test a different operation.  The above
calling order meets this design, and therefore lends some validity to the
error code returned.  All tested instructions are checked in either the
first six modules or in the CHK2XX control shell itself.  The modules
RAM.ASM and SHFT.ASM are targeted at hardware testing.

    Table 1 identifies the module in which each instruction is tested.  The
module CHK2XX is listed last since its testing is performed after all other
modules have been called.  The exception to this is the program code
checksum test in CHK2XX, which is in fact executed before any test modules
are called.  However, since this test is optional, its effects have not been
included in the table.  Note that the table attempts to identify where each
instruction is functionally tested, rather than simply where each is used.
In most cases, an instruction is tested any time it is used, but there are
some exceptions.  For example, consider the following example code segment,
targeted at testing the LACC instruction with direct addressing:

        LDP     #0h             ;data page @ 0h
        SPLK    #5555h,60h      ;data(60h) = 5555h
        LACC    60h             ;ACC = 5555h
        SUB     #5555h          ;ACC = 0h
        BCND    error,NEQ       ;if ACC != 0 then error

If the LDP instruction fails, the code can still execute properly provided
that location 60h on the (erroneous) data page is a valid memory location
(e.g. if DP = 6h, then data memory location 360h is valid and is located in
DARAM BLOCK B1).  The above code segment would not warrant listing the LDP
instruction in the Op-Codes list.  When writing the SELFCHK program, a
reasonable attempt was made to avoid or minimize non-detectable instruction
failures such as that illustrated above.


          TABLE 1: Op-Code Functional Testing by Module

                                   | | | | | | | | | |n|
                                   | | | | | | | | | |o|
                                   | | | | | | | | | |t|
                                   | | | | | | | | | | |
                                   | | | | | | | | |C|t|
                                   |B| | |B| | | | |H|e|
                                   |A|D|C|R| |M| |S|K|s|
                                   |S|A|T|N|A|U|R|H|2|t|
                                   |I|T|R|C|L|L|A|F|X|e|
          Op-Code  /  module name: |C|A|L|H|U|T|M|T|X|d|
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          ABS                      | | | | |X| | | | | |
          ADD dma [,shift]         | | | | |X| | |X| | |
          ADD dma,16               | | | | |X| | | | | |
          ADD ind [,shift [,ARn]]  | | |X| |X| | | | | |
          ADD ind,16[,ARn]         | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          ADD #k                   | | | | |X| | | | | |
          ADD #lk [,shift]         | | | | |X| | | | | |
          ADDC dma                 | | | | |X| | | | | |
          ADDC ind [,ARn]          | | | | |X| | | | | |
          ADDS dma                 | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          ADDS ind [,ARn]          | | | | |X| | | | | |
          ADDT dma                 | | | | |X| | | | | |
          ADDT ind [,ARn]          | | | | |X| | | | | |
          ADRK #k                  | |X| | | | | | | | |
          AND dma                  | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          AND ind [,ARn]           | | | | |X| |X| | | |
          AND #lk [,shift]         | | | | |X| | | | | |
          AND #lk,16               | | | | |X| | | | | |
          APAC                     | | | | | |X| |X| | |
          B                        |X| | | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          BACC                     | | | |X| | | | | | |
          BANZ                     | | | |X| | | | | | |
          BCND                     |X| | | | | | | | | |
          BIT dma, bit code        | | |X| | | | | | | |
          BIT ind, bit code [,ARn] | | |X| | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          BITT dma                 | | |X| | | | | | | |
          BITT ind [,ARn]          | | |X| | | | | | | |
          BLDD #lk, dma            | |X| | | | | | | | |
          BLDD #lk, ind [,ARn]     | |X| | | | | | | | |
          BLDD dma, #lk            | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          BLDD ind, #lk [,ARn]     | |X| | | | | | | | |
          BLPD #pma, dma           | |X| | | | | | | | |
          BLPD #pma, ind [,ARn]    | |X| | | | | | | | |
          CALA                     | | | |X| | | | | | |
          CALL pma [,ind [,ARn]]   | | | | | | | | |X| |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          CC                       | | | |X| | | | | | |
          CLRC OVM                 | | |X| |X| | | | | |
          CLRC SXM                 | | |X| | | | | | | |
          CLRC TC                  | | |X| | | | | | | |
          CLRC C                   | | |X| | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          CLRC CNF                 | |X|X| | | |X| | | |
          CLRC INTM                | | |X| | | | | | | |
          CLRC XF                  | | |X| | | | | | | |
          CMPL                     | | | | |X|X| | | | |
          CMPR 0                   | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          CMPR 1                   | |X| | | | | | | | |
          CMPR 2                   | |X| | | | | | | | |
          CMPR 3                   | |X| | | | | | | | |
          DMOV dma                 | |X| | | | | | | | |
          DMOV ind [,ARn]          | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          IDLE                     | | | | | | | | | |X|
          IN dma, PA               | | | | | | | | | |X|
          IN ind, PA [,ARn]        | | | | | | | | | |X|
          INTR k                   | | | | | | | | | |X|
          LACC dma [,shift]        |X|X|X| |X| | |X| | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          LACC dma,16              | | | | |X| | | | | |
          LACC ind [,shift [,ARn]] | |X| | | | | | | | |
          LACC ind,16[,ARn]        | | |X| | | | | | | |
          LACC #lk [,shift]        |X|X| |X| | |X| | | |
          LACL dma                 | |X| | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          LACL ind [,ARn]          | |X| | | | | | | | |
          LACL #k                  |X| |X|X|X| | |X|X| |
          LACT dma                 | |X| | | | | | | | |
          LACT ind [,ARn]          | |X| | | | | | | | |
          LAR AR|X|, dma           | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          LAR AR|X|, ind [,ARn]    | |X| | | | |X| | | |
          LAR AR|X|, #k            | |X|X|X|X|X|X| | | |
          LAR AR|X|, #lk           | |X| | | | |X| | | |
          LDP dma                  | |X| | | | | | | | |
          LDP ind [,ARn]           | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          LDP #k                   | |X|X| | | | | | | |
          LPH dma                  | | | | | |X| |X| | |
          LPH ind [,ARn]           | | | | | |X| | | | |
          LST #m, dma              | | |X| | | | | | | |
          LST #m, ind [,ARn]       | | |X| | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          LT dma                   | | |X| |X|X| |X| | |
          LT ind [,ARn]            | |X|X| | |X| | | | |
          LTA dma                  | | | | | |X| | | | |
          LTA ind [,ARn]           | | | | | |X| | | | |
          LTD dma                  | | | | | |X| | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          LTD ind [,ARn]           | | | | | |X| | | | |
          LTP dma                  | | | | | |X| | | | |
          LTP ind [,ARn]           | | | | | |X| | | | |
          LTS dma                  | | | | | |X| | | | |
          LTS ind [,ARn]           | | | | | |X| | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          MAC pma, dma             | | | | | |X| | | | |
          MAC pma, ind [,ARn]      | | | | | |X| | | | |
          MACD pma, dma            | | | | | |X| | | | |
          MACD pma, ind [,ARn]     | | | | | |X| | | | |
          MAR dma                  | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          MAR ind [,ARn]           | |X|X|X|X|X|X| | | |
          MPY dma                  | | | | | |X| | | | |
          MPY ind [,ARn]           | | | | | |X| | | | |
          MPY #k                   | | | | | |X| |X| | |
          MPYA dma                 | | | | | |X| | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          MPYA ind [,ARn]          | | | | | |X| | | | |
          MPYS dma                 | | | | | |X| | | | |
          MPYS ind [,ARn]          | | | | | |X| | | | |
          MPYU dma                 | | | | | |X| | | | |
          MPYU ind [,ARn]          | | | | | |X| | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          NEG                      | | | | |X| | | | | |
          NMI                      | | | | | | | | | |X|
          NOP                      | |X| | | | | | | | |
          NORM ind                 | | | | |X| | | | | |
          OR dma                   | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          OR ind [,ARn]            | | | | |X| |X| | | |
          OR #lk [,shift]          | | | | |X| | | | | |
          OR #lk,16                | | | | |X| | | | | |
          OUT dma, PA              | | | | | | | | | |X|
          OUT ind, PA [,ARn]       | | | | | | | | | |X|
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          PAC                      | | | | | |X| |X| | |
          POP                      | | |X| | | | | | | |
          POPD dma                 | | |X| | | | | | | |
          POPD ind [,ARn]          | | |X| | | | | | | |
          PSHD dma                 | | |X| | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          PSHD ind [,ARn]          | | |X| | | | | | | |
          PUSH                     | | |X| | | | | | | |
          RET                      |X|X|X|X|X|X|X|X|X| |
          RETC                     | | | |X| | | | | | |
          ROL                      | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          ROR                      | | | | |X| | | | | |
          RPT dma                  | | |X| | | | | | | |
          RPT ind [,ARn]           | | |X| | | |X| | | |
          RPT #k                   | | |X| | |X| | | | |
          SACH dma [,shift]        | | |X| |X| | |X| | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          SACH ind [,shift [,ARn]] | | |X| | | | | | | |
          SACL dma [,shift]        |X|X|X| | | | |X| | |
          SACL ind [,shift [,ARn]] | |X| | | | |X| | | |
          SAR AR|X|, dma           | |X| | | | | | | | |
          SAR AR|X|, ind [,ARn]    | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          SBRK #k                  | |X| | | | | | | | |
          SETC OVM                 | | |X| |X| | | | | |
          SETC SXM                 | | |X| |X| | |X| | |
          SETC TC                  | | |X| | | | | | | |
          SETC C                   | | |X| | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          SETC CNF                 | |X| | | | | | | | |
          SETC INTM                | | |X| | | | | | | |
          SETC XF                  | | |X| | | | | | | |
          SFL                      | | |X| | | | | | | |
          SFR                      | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          SPAC                     | | | | | |X| | | | |
          SPH dma                  | | | | | |X| | | | |
          SPH ind [,ARn]           | | | | | |X| | | | |
          SPL dma                  | | | | | |X| | | | |
          SPL ind [,ARn]           | | | | | |X| | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          SPLK #lk, dma            |X|X|X| |X|X| |X| | |
          SPLK #lk, ind [,ARn]     | |X|X| | | |X| | | |
          SPM                      | | | | | |X| |X| | |
          SQRA dma                 | | | | | |X| | | | |
          SQRA ind [,ARn]          | | | | | |X| | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          SQRS dma                 | | | | | |X| | | | |
          SQRS ind [,ARn]          | | | | | |X| | | | |
          SST #m, dma              | | |X| | | | | | | |
          SST #m, ind [,ARn]       | | |X| | | | | | | |
          SUB dma [,shift]         |X|X| | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          SUB dma,16               | | | | |X| | | | | |
          SUB ind [,shift [,ARn]]  | | | | |X| | | | | |
          SUB ind,16[,ARn]         | | | | |X| | | | | |
          SUB #k                   |X| | | |X| | | | | |
          SUB #lk [,shift]         |X|X|X| |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -