Microcode: Difference between revisions

Content deleted Content added
m Instruction sets: Fix wording
Citation bot (talk | contribs)
Alter: url, template type. URLs might have been anonymized. Add: isbn, publisher, date, title. Removed URL that duplicated identifier. Changed bare reference to CS1/2. Removed parameters. | Use this bot. Report bugs. | Suggested by Jay8g | Linked from User:Jay8g/sandbox | #UCB_webform_linked 119/183
 
(5 intermediate revisions by 5 users not shown)
Line 3:
{{Program execution}}
 
In [[processor design]], '''microcode''' serves as an intermediary layer situated between the [[central processing unit]] (CPU) hardware and the programmer-visible [[instruction set architecture]] of a computer.<ref name="Kent2813">{{cite book |last1=Kent |first1=Allen |url=https://books.google.com/books?id=EjWV8J8CQEYC |title=Encyclopedia of Computer Science and Technology: Volume 28 - Supplement 13 |last2=Williams |first2=James G. |date=April 5, 1993 |publisher=Marcel Dekker, Inc |isbn=0-8247-2281-7 |___location=New York |page=34 |access-date=Jan 17, 2016 |archive-url=https://web.archive.org/web/20161120161636/https://books.google.com/books?id=EjWV8J8CQEYC |archive-date=November 20, 2016 |url-status=live}}</ref>{{Page needed|date=July 2022}} It consists of a set of hardware-level instructions that implement the higher-level [[machine code]] instructions or control internal [[finite-state machine]] sequencing in many [[digital processing]] components. While microcode is utilized in [[Intel]] and [[AMD]] general-purpose CPUs in contemporary desktops and laptops, it functions only as a fallback path for scenarios that the faster [[hardwired control unit]] is unable to manage.<ref name="FogMicro">{{cite report |url=https://www.agner.org/optimize/microarchitecture.pdf |title=The microarchitecture of Intel, AMD and VIA CPUs |last1=Fog |first1=Agner |date=2017-05-02 |publisher=Technical University of Denmark |access-date=2024-08-21 |archive-url= https://web.archive.org/web/20170328065929/https://agner.org/optimize/microarchitecture.pdf |archive-date=2017-03-28 |url-status=live}}</ref>
 
Housed in special high-speed memory, microcode translates machine instructions, [[state machine]] data, or other input into sequences of detailed circuit-level operations. It separates the machine instructions from the underlying [[electronics]], thereby enabling greater flexibility in designing and altering instructions. Moreover, it facilitates the construction of complex multi-step instructions, while simultaneously reducing the complexity of computer circuits. The act of writing microcode is often referred to as ''microprogramming'', and the microcode in a specific processor implementation is sometimes termed a ''microprogram''.
Line 70:
==History==
===Early examples===
The ACE computer, designed by [[Alan Turing]] in 1946, used microprogramming.<ref>{{cite book | title=Modern Mathematics | date=2006 | publisher=Infobase | isbn=978-0-7910-9720-5 | url=https://books.google.com/books?id=5LMVSFNhFI0C&dq=ace+microprogramming&pg=PA121 }}</ref>
 
In 1947, the design of the [[Whirlwind (computer)|MIT Whirlwind]] introduced the concept of a control store as a way to simplify computer design and move beyond ''[[ad hoc]]'' methods. The control store is a [[diode matrix]]: a two-dimensional lattice, where one dimension accepts "control time pulses" from the CPU's internal clock, and the other connects to control signals on gates and other circuits. A "pulse distributor" takes the pulses generated by the [[CPU clock]] and breaks them up into eight separate time pulses, each of which activates a different row of the lattice. When the row is activated, it activates the control signals connected to it.<ref>{{Cite tech report |last1=Everett |first1=R.R. |last2=Swain |first2=F.E. |year=1947 |title=Whirlwind I Computer Block Diagrams |publisher=MIT Servomechanisms Laboratory |id=R-127 |url=http://www.cryptosmith.com/wp-content/uploads/2009/05/whirlwindr-127.pdf |access-date=June 21, 2006 |url-status=dead |archive-url=https://web.archive.org/web/20120617112919/http://www.cryptosmith.com/wp-content/uploads/2009/05/whirlwindr-127.pdf |archive-date=June 17, 2012}}</ref>
 
Line 109 ⟶ 111:
The industry responded to the concept of RISC with both confusion and hostility, including a famous dismissive article by the VAX team at Digital.<ref name=comments>{{cite journal |url=https://dl.acm.org/doi/pdf/10.1145/641914.641918 |title=Comments on "The Case for the Reduced Instruction Set Computer," by Patterson and Ditzel|first1=Douglas |last1=Clark |first2=William |last2=Strecker |date=September 1980 |journal= ACM SIGARCH Computer Architecture News|volume=8 |issue=6 |pages=34–38 |doi=10.1145/641914.641918 |s2cid=14939489 |url-access=subscription }}</ref> A major point of contention was that implementing the instructions outside of the processor meant it would spend much more time reading those instructions from memory, thereby slowing overall performance no matter how fast the CPU itself ran.<ref name=comments/> Proponents pointed out that simulations clearly showed the number of instructions was not much greater, especially when considering compiled code.<ref name=risc/>
 
The debate raged until the first commercial RISC designs emerged in the second half of the 1980s, which easily outperformed the most complex designs from other companies. By the late 1980s it was over; even DEC was abandoning microcode for their [[DEC Alpha]] designs, and CISC processors switched to using hardwired circuitry, rather than microcode, to perform many functions. For example, the [[Intel 80486]] uses hardwired circuitry to fetch and decode instructions, using microcode only to execute instructions; register-register move and arithmetic instructions required only one microinstruction, allowing them to be completed in one clock cycle.<ref>{{cite conference|url=https://ieeexplore.ieee.org/document/63682|title=The execution pipeline of the Intel i486 CPU|book-title= Digest of Papers Compcon Spring '90. Thirty-Fifth IEEE Computer Society International Conference on Intellectual Leverage|publisher=[[IEEE]]|isbn=0-8186-2028-5|___location=San Francisco, CA|doi=10.1109/CMPCON.1990.63682|url-access=subscription}}</ref> The [[Pentium Pro]]'s fetch and decode hardware fetches instructions and decodes them into series of micro-operations that are passed on to the execution unit, which schedules and executes the micro-operations, possibly doing so [[out-of-order execution|out-of-order]]. Complex instructions are implemented by microcode that consists of predefined sequences of micro-operations.<ref>{{cite web|url=http://stffrdhrn.github.io/content/2019/Intel_PentiumPro.pdf|title=Pentium Pro Processor At 150, 166, 180, and 200 MHz|publisher=[[Intel]]|date=November 1995|type=Datasheet}}</ref>
 
Some processor designs use machine code that runs in a special mode, with special instructions, available only in that mode, that have access to processor-dependent hardware, to implement some low-level features of the instruction set. The DEC Alpha, a pure RISC design, used [[PALcode]] to implement features such as [[translation lookaside buffer]] (TLB) miss handling and interrupt handling,<ref name="axp-architecture-manual">{{cite book|url=http://bitsavers.org/pdf/dec/alpha/Sites_AlphaAXPArchitectureReferenceManual_2ed_1995.pdf|title=Alpha AXP Architecture Reference Manual|edition=Second|chapter=Part I / Common Architecture, Chapter 6 Common PALcode Architecture|publisher=[[Digital Press]]|date=1995|isbn=1-55558-145-5}}</ref> as well as providing, for Alpha-based systems running [[OpenVMS]], instructions requiring interlocked memory access that are similar to instructions provided by the [[VAX]] architecture.<ref name="axp-architecture-manual" /> CMOS [[IBM System/390]] CPUs, starting with the G4 processor, and [[z/Architecture]] CPUs use [[millicode]] to implement some instructions.<ref>{{cite journal|last=Rogers|first=Bob|title=The What and Why of zEnterprise Millicode|journal=IBM Systems Magazine|date=Sep–Oct 2012|url=http://www.ibmsystemsmag.com/mainframe/administrator/performance/millicode_rogers/|archive-url=https://web.archive.org/web/20121009085728/http://www.ibmsystemsmag.com/mainframe/administrator/performance/millicode_rogers/|archive-date=October 9, 2012|url-status=dead}}</ref>
Line 381 ⟶ 383:
==External links==
{{Wiktionary}}
{{External links|date=February 2017}}
* [http://c2.com/cgi/wiki?WritableInstructionSetComputer Writable Instruction Set Computer]
* [http://www.research.ibm.com/journal/rd/102/ibmrd1002F.pdf Capacitor Read-only Store]
 
* [https://web.archive.org/web/20050124004424/http://www-03.ibm.com/ibm/history/exhibits/attic3/attic3_016.html Transformer Read-only Store]
* [http://people.cs.clemson.edu/~mark/uprog.html A Brief History of Microprogramming]
* [https://lists.debian.org/debian-user/2013/09/msg00126.html Intel processor microcode security update] (fixes the issues when running 32-bit virtual machines in PAE mode)
* [https://web.archive.org/web/20150907195925/http://inertiawar.com/microcode/hawkes_intel_microcode.pdf Notes on Intel Microcode Updates], March 2013, by Ben Hawkes, archived from the original on September 7, 2015
* [https://web.archive.org/web/20030309102752/http://www.eetimes.com/news/97/963news/hole.html Hole seen in Intel's bug-busting feature], ''[[EE Times]]'', 2002, by Alexander Wolfe, archived from the original on March 9, 2003
* [http://www.securiteam.com/securityreviews/5FP0M1PDFO.html Opteron Exposed: Reverse Engineering AMD K8 Microcode Updates], July 26, 2004
* [https://ieeexplore.ieee.org/document/8662722 WepSIM: An Online Interactive Educational Simulator Integrating Microdesign, Microprogramming, and Assembly Language Programming], July 26, 2022
 
{{Processor technologies}}