Test register

Last updated

A test register, in the Intel 80386 and Intel 80486 processor, was a register used by the processor, usually to do a self-test. Most of these registers were undocumented, and used by specialized software. The test registers were named TR3 to TR7. Regular programs don't usually require these registers to work. With the Pentium, the test registers were replaced by a variety of model-specific registers (MSRs). [1]

In the 80386, two test registers, TR6 and TR7, were provided for the purpose of TLB testing. TR6 was the test command register, and TR7 was the test data register. The 80486 provided three additional registers, TR3, TR4 and TR5, for testing of the L1 cache. TR3 was a data register, TR4 was an address register and TR5 was a command register. These registers were accessed by variants of the MOV instruction. A test register may either be the source operand or the destination operand. The MOV instructions are defined in both real-address mode and protected mode. The test registers are privileged resources. In protected mode, the MOV instructions that access them can only be executed at privilege level 0. An attempt to read or write the test registers when executing at any other privilege level causes a general protection exception. Also, those instructions generate invalid opcode exception on most CPUs newer than 80486.

The instruction is encoded in two ways, depending on the flow of data. Moving data from a general purpose register into a test register is encoded as 0F 26 /r (with r/m being the GPR, and reg being the test register). Moving data the other way (i.e. from the test register into a general purpose register) is encoded as 0F 24 /r (with r/m being the GPR, and reg being the test register). [2] Only register-register moves are supported - as such, the "mod" field (top 2 bits) of the instruction's ModR/M byte should be set to 11b. (Setting the "mod" field of the ModR/M byte to anything else than 11b results in undefined behaviour, with different behaviour observed on different processors. [3] )

The test registers and/or associated opcodes were supported in the following x86 processors:

ProcessorsCache Test RegistersTLB Test Registers
TR0TR1TR2TR3TR4TR5TR6TR7
Intel 386 (all models)NoNoundoc [a] Yes
Intel 486 (all models)NoYesYes
AMD 386 (all models)
AMD Élan SC3xx
NoNo ?Yes [5]
AMD 486 (all models)
AMD 5x86
AMD Élan SC4xx,SC5xx
NoYes [6] Yes
IBM 386SLC
IBM BL486SLC2/SX2/SX3
NoYes [7] Yes
C&T Super386NoNoYes [8]
NexGen Nx586NoNoYes [9]
Cyrix [b] 486 (all models [c] )NoYes [11] Yes
Cyrix 5x86 Noundoc [12] YesYes
Cyrix 6x86 Noundoc [d] YesYes (VSPM) [e]
Cyrix 6x86MX, MIINoundoc [12] Yes (scratchpad) [f] Yes
VIA Cyrix III [g] No ?Yes (scratchpad) [f] Yes
Cyrix MediaGX
NatSemi Geode GX
No ?Yes [18] Yes
NatSemi Geode GX2
AMD Geode GX, LX
TR0-TR7 registers present as 32-bit read/write data registers
without any cache/TLB test functionality. [19]
IDT WinChip (all models)Registers not present. The MOV TRx opcodes can be enabled
with the WinChip's FCR.EMOVTR [20] bit, but will act as NOPs.
Intel Quark X1000NoYes [21] Yes
  1. On the Intel 386, the TR4 and TR5 registers have been reported to act as undocumented read-only registers returning a data item related to instruction prefetch. [4]
  2. Cyrix manufacturing partner CPU models from IBM, TI and ST also all supported the same test registers as their corresponding Cyrix-branded CPU models.
  3. SoCs based on the Cyrix-derived ST486 CPU core also supported the same set of test registers as the Cyrix 486 - such SoCs include e.g. STPC Atlas and ZFMicro ZFx86. [10]
  4. On the Cyrix 6x86, the TR1 and TR2 registers could be enabled by setting bit 6 of Cyrix configuration register 30h. These registers are not documented, but example code using them has been published by Cyrix. [13]
  5. On the Cyrix 6x86, the TR6 and TR7 registers could be used not only to test the TLB, but also to configure the processor's VSPM (Variable-Size Paging Mechanism). [14] The VSPM was a 4-entry [15] software TLB with a per-entry mask to support all power-of-2 page sizes from to bytes. It was present in the Cyrix 6x86 only - it was removed in 6x86MX and later processors.
  6. 1 2 On the 6x86MX, MII, and "Joshua" Cyrix III processors, the TR3-TR5 registers could be used not just to test the L1 cache but also to lock individual L1 cache-lines to specific addresses for scratchpad memory use. [16] [17]
  7. "Joshua" core only. "Samuel" core variants of Cyrix III did not support the TRx test registers.

See also

Related Research Articles

<span class="mw-page-title-main">Cyrix 6x86</span> Microprocessor

The Cyrix 6x86 is a line of sixth-generation, 32-bit x86 microprocessors designed and released by Cyrix in 1995. Cyrix, being a fabless company, had the chips manufactured by IBM and SGS-Thomson. The 6x86 was made as a direct competitor to Intel's Pentium microprocessor line, and was pin compatible.

IA-32 is the 32-bit version of the x86 instruction set architecture, designed by Intel and first implemented in the 80386 microprocessor in 1985. IA-32 is the first incarnation of x86 that supports 32-bit computing; as a result, the "IA-32" term may be used as a metonym to refer to all x86 versions that support 32-bit computing.

i386 32-bit microprocessor by Intel

The Intel 386, originally released as the 80386 and later renamed i386, was the first x86 32-bit microprocessor designed by Intel. Pre-production samples of the 386 were released to select developers in 1985, while mass production commenced in 1986. The processor was a significant evolution in the x86 architecture, extending a long line of processors that stretched back to the Intel 8008. The 386 was the central processing unit (CPU) of many workstations and high-end personal computers of the time. The 386 began to fall out of public use starting with the release of the i486 processor in 1989, while in embedded systems the 386 remained in widespread use until Intel finally discontinued it in 2007.

i486 Successor to the Intel 386

The Intel 486, officially named i486 and also known as 80486, is a microprocessor introduced in 1989. It is a higher-performance follow-up to the Intel 386. It represents the fourth generation of binary compatible CPUs following the 8086 of 1978, the Intel 80286 of 1982, and 1985's i386.

<span class="mw-page-title-main">Pentium (original)</span> Intel microprocessor

The Pentium is a microprocessor introduced by Intel on March 22, 1993. It is the first CPU using the Pentium brand. Considered the fifth generation in the x86 (8086) compatible line of processors, succeeding the i486, its implementation and microarchitecture was internally called P5.

x86 Family of instruction set architectures

x86 is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. The 8086 was introduced in 1978 as a fully 16-bit extension of 8-bit Intel's 8080 microprocessor, with memory segmentation as a solution for addressing more memory than can be covered by a plain 16-bit address. The term "x86" came into being because the names of several successors to Intel's 8086 processor end in "86", including the 80186, 80286, 80386 and 80486. Colloquially, their names were "186", "286", "386" and "486".

<span class="mw-page-title-main">Cyrix</span> American microprocessor developer

Cyrix Corporation was a microprocessor developer that was founded in 1988 in Richardson, Texas, as a specialist supplier of floating point units for 286 and 386 microprocessors. The company was founded by Tom Brightman and Jerry Rogers.

<span class="mw-page-title-main">Cyrix 5x86</span> 1995 line of x86-compatible microprocessors

The Cyrix 5x86 is a line of x86 microprocessors designed by Cyrix and released on June 5 of 1995. Cyrix, being a fabless company, had the chips manufactured by IBM. The line came out about 5 months before the more famous Cyrix 6x86. The Cyrix 5x86 was one of the fastest CPUs ever produced for Socket 3 computer systems. With better performance in most applications than an Intel Pentium processor at 75 MHz, the Cyrix Cx5x86 filled a gap by providing a medium-performance processor option for 486 Socket 3 motherboards.

The PR system was a figure of merit developed by AMD, Cyrix, IBM Microelectronics and SGS-Thomson in the mid-1990s as a method of comparing their x86 processors to those of rival Intel. The idea was to consider instructions per cycle (IPC) in addition to the clock speed, so that the processors become comparable with Intel's Pentium that had a higher clock speed with overall lower IPC.

<span class="mw-page-title-main">Am386</span> AMD microprocessor clone

The Am386 CPU is a 100%-compatible clone of the Intel 80386 design released by AMD in March 1991. It sold millions of units, positioning AMD as a legitimate competitor to Intel, rather than being merely a second source for x86 CPUs.

NexGen, Inc. was a private semiconductor company based in Milpitas, California, that designed x86 microprocessors until it was purchased by AMD in 1996. NexGen was a fabless design house that designed its chips but relied on other companies for production. NexGen's chips were produced by IBM's Microelectronics division in Burlington, Vermont alongside PowerPC and DRAM parts.

<span class="mw-page-title-main">WinChip</span> Series of CPUs

The WinChip series is a discontinued low-power Socket 7-based x86 processor that was designed by Centaur Technology and marketed by its parent company IDT.

The x86 instruction set refers to the set of instructions that x86-compatible microprocessors support. The instructions are usually part of an executable program, often stored as a computer file and executed on the processor.

In the x86 architecture, the CPUID instruction is a processor supplementary instruction allowing software to discover details of the processor. It was introduced by Intel in 1993 with the launch of the Pentium and SL-enhanced 486 processors.

The Time Stamp Counter (TSC) is a 64-bit register present on all x86 processors since the Pentium. It counts the number of CPU cycles since its reset. The instruction RDTSC returns the TSC in EDX:EAX. In x86-64 mode, RDTSC also clears the upper 32 bits of RAX and RDX. Its opcode is 0F 31. Pentium competitors such as the Cyrix 6x86 did not always have a TSC and may consider RDTSC an illegal instruction. Cyrix included a Time Stamp Counter in their MII.

On the x86 architecture, a debug register is a register used by a processor for program debugging. There are six debug registers, named DR0...DR7, with DR4 and DR5 as obsolete synonyms for DR6 and DR7. The debug registers allow programmers to selectively enable various debug conditions associated with a set of four debug addresses. Two of these registers are used to control debug features. These registers are accessed by variants of the MOV instruction. A debug register may be either the source operand or destination operand. The debug registers are privileged resources; the MOV instructions that access them can only be executed at privilege level zero. An attempt to read or write the debug registers when executing at any other privilege level causes a general protection fault.

Memory type range registers (MTRRs) are a set of processor supplementary capability control registers that provide system software with control of how accesses to memory ranges by the CPU are cached. It uses a set of programmable model-specific registers (MSRs) which are special registers provided by most modern CPUs. Possible access modes to memory ranges can be uncached, write-through, write-combining, write-protect, and write-back. In write-back mode, writes are written to the CPU's cache and the cache is marked dirty, so that its contents are written to memory later.

A model-specific register (MSR) is any of various control registers in the x86 system architecture used for debugging, program execution tracing, computer performance monitoring, and toggling certain CPU features.

References

  1. Intel, Pentium® Processor Family Developer’s Manual, order no. 241428-005, 1997, section 16.1.2, page 442 - provides a list of Pentium MSRs that provide the same functionality as the 386/486 TRx registers.
  2. Introduction to the 80386 Including the 80386 Data Sheet. Intel. April 1986. p. 122.
  3. Robert L. Hummel, PC Magazine Programmer's Technical Reference, 1992, ISBN   1-56276-016-5, page 476.
  4. Robert Collins, Move Special Registers, archived on 5 Jun 1997.
  5. AMD, Am386 Microprocessors Data Book, 1992, pages 21 and 151
  6. AMD, Am486® Microprocessor Software User’s Manual, rev.1, 1994, section 1.59, p. 82
  7. John H. Wharton, The Complete X86, Volume 1, 1994. MicroDesign Resources, ISBN   1-885330-02-2, page 296.
  8. Chips and Technologies, Super386 DX Programmer's Reference Manual, pub.no. UG85, rev 1.0, 1992, page 201.
  9. NexGen, Nx586™ Processor and Nx587™ Numerics Processor Databook, 8 July 1993, page 116
  10. ZFMicro, ZFx86 Data Book 1.0 Rev D, 5 June 2006, page 101
  11. Cyrix, Cx486DLC Microprocessor Data Sheet, order no. 94706-01, May 1992, section 2.3.2.6, p.37
  12. 1 2 Sandpile, IA32 Configuration Control Registers, see the BTB_TR bit in registers 20h and 30h for how to enable the undocumented TR1/TR2 registers on Cyrix 5x86, 6x86 and 6x86MX. Archived from the original on 20 May 2011.
  13. Cyrix, 6x86 BIOS Writer’s Guide, revision 4.1, 29 July 1996, page 43.
  14. Cyrix, 6x86 Processor data book, order no. 94175-01, March 1996, section 2.6.5, p. 74
  15. Linux kernel archive, Re: Cyrix 6x86 Patch.., 4 Nov 1996
  16. Cyrix, 6x86MX Processor Data Book, order no. 94329-00, 15 July 1997, section 2.13.1.1, page 87
  17. VIA-Cyrix Corp., Cyrix III Processor Data Book, v1.0, 25 January 2000, section 2.9.1.1, page 86
  18. Cyrix, MediaGX Processor Data Book, rev 2.0, 29 October 1998, section 3.3.2.4, p.59
  19. AMD, Geode™ LX Processors Data Book, publication ID: 33234H, February 2009, section 8.3.4.3, p.648
  20. IDT, WinChip C6 Processor Data Sheet, section A.2, p.79
  21. Intel, Quark SOC X1000 Core Developer's Manual, order no. 329679-001, October 2013, appendix B, page 296