home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / usefulinfo / text / arm600 < prev    next >
Encoding:
Text File  |  1994-10-15  |  21.4 KB  |  524 lines

  1.  
  2.                      ARM600 : Risc Goes OOP
  3.  
  4.  
  5.  
  6.  
  7. Apple's investment in Advanced RISC Machines was seen as a
  8.     purely financial investment, but the ARM600 object
  9.       orientated processor is making pundits reassess
  10.                          the move.
  11.  
  12.  
  13.  
  14.      The Acorn RISC Machine, one of the  world's  first  (if
  15. not   the   first)   commercially   available   32-bit  RISC
  16. processors, designed by the Cambridge, U.K.,  computer  firm
  17. Acorn has gone through three major revisions over the years.
  18. With the ARM2 and the ARM3 still  the  engines  for  Acorn's
  19. Archimedes  range of home  and educational computers and its
  20. UNIX workstations. In addition, VLSI  Technology,  the  U.S.
  21. silicon  foundry  that fabricated the ARM for Acorn, as been
  22. selling the same RISC chip as  an  embedded  controller  for
  23. drives and graphics accelerators.
  24.  
  25.      Earlier in 1991, Acorn intrigued industry observers  by
  26. `spinning  off'  the  ownership  and  development of the ARM
  27. architecture into a separate company, called  Advanced  RISC
  28. Machines,  which  is  jointly  owned by Acorn/Olivetti, VLSI
  29. Technology, and, of all people, Apple. Of all people because
  30. Apple  had  until  then  been  seen  wholly committed to the
  31. Motorola 680x0 chip family. Apple denied at  the  time  that
  32. its  ARM  involvement  was  anything  but  a bit of blue-sky
  33. research, but  then,  only  a  few  months  later  came  the
  34. bombshell:  Apple  and  IBM  (of  all  people)  had forged a
  35. strategic alliance to develop a future  range  of  computers
  36. based  on  a new object-orientated operating system, and not
  37. based on Motorola 680x0 processors
  38.  
  39.      The  ARM600,  which  features  low  power  consumption,
  40. suitable  for battery portables, and a highly innovative on-
  41. chip  memory  management  unit  (MMU)  to  provide  hardware
  42. support   for   an   object-orientated   operating   system.
  43. Interested readers are referred to  an  article  by  Apple's
  44. Larry  Tesler  in  the  September  1991  issue of Scientific
  45. American.
  46.  
  47. The ARM6 Macro Cell
  48.  
  49.      Advanced RISC  Machines,  based  in  Swaffham  Bulbeck,
  50. outside  Cambridge, inherited most of the team that designed
  51. the original ARM chips, the notable  exception  being  Steve
  52. Furber,  who is now a professor at Manchester University but
  53. maintains productive links with the company.  The  company's
  54. strategic  aim is to design, thought not manufacture, custom
  55. processors  and  application-specific  integrated   circuits
  56. (ASICs)  based  on  its RISC CPU, with a particular focus on
  57. the embedded-controller market. The first step in  realising
  58.  
  59.  
  60.  
  61. ARM600 - RISC Goes OOP                                page 1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. this strategy was to fine-tune the original ARM architecture
  71. into what is now called the ARM6 (the last  Acorn-originated
  72. revision was the ARM3).
  73.  
  74.      The ARM6 is not a chip, but a macrocell, stored in  the
  75. Compass  CAD  system  (supplied  by  VLSI  Technology)  that
  76. Advanced RISC Machines uses to design its chips. This  means
  77. that  the ARM6 is a standard VLSI circuit layout that can be
  78. called up and incorporated into larger chip designs, just as
  79. you  might  include  a source file in a Pascal program -- an
  80. off the peg CPU subunit, if  you  like.  The  simplest  chip
  81. incorporating  the  ARM6  will be called the ARM60, which is
  82. just an ARM6 cell with pads added to join it to the  outside
  83. world.   The  ARM60  is  compatible  with  and  functionally
  84. equivalent to the  old  ARM2  chip:  it  lacks  the  on-chip
  85. processor cache of the ARM3.
  86.  
  87.      Advanced RISC Machines intends to produce a  family  of
  88. chips  based  around  the  ARM6  macrocell  core, with other
  89. components added as required. For example, the ARM600 is  an
  90. ARM6  cell,  a  processor  cache, and an MMU. Other products
  91. will be customised ASICs, which might contain an  ARM6  core
  92. and, say, D/A convertors or serial communications drivers on
  93. a single chip.
  94.  
  95.      What makes this strategy viable is the  simplicity  and
  96. the   resulting   small   die   size  of  the  original  ARM
  97. architecture.  In  1985,  Acorn  had  in   mind   a   32-bit
  98. replacement  for  the defunct 6502 chip, the mainstay of the
  99. early personal computers from the Apple II to the  Commodore
  100. Pet  to  the  Acorn  BBC  Micro  itself.   The goal was high
  101. execution speed, fast interrupt response,  and  low  silicon
  102. cost at the expense of fancy types of instructions. A purist
  103. interpretation of the RISC philosophy  resulted  in  a  chip
  104. with  only  10  types of instructions. no microcode ROM, and
  105. only 25,000 transistors, at the time when Motorola was using
  106. 200,000 transistors in its 68020.
  107.  
  108.      Those original ARM chips, fabricated in  3-micron  CMOS
  109. technology,  would  fit  on  a  7-millimetre  die. Six years
  110. later, Advanced RISC Machines can have the  ARM6  fabricated
  111. in  1-micron CMOS and have it occupy a silicon area of about
  112. 2.8mm square, which can be tucked away neatly in one  corner
  113. of  an  average-size  die, leaving plenty of room for custom
  114. circuitry. The ARM6 can be clocked at 20 to 25 MHz, compared
  115. to the 5 MHz of the original ARM chips, giving a performance
  116. of over 20 million instructions per second (MIPS).
  117.  
  118.      The ARM6 is  designed  to  be  fabricated  using  fully
  119. static  CMOS  devices so that you can slow down or even stop
  120. the clock during any phase of its operation and then restart
  121. it  with  no  loss  of  data.  When  stopped,  the processor
  122. consumes only  a  few  microamperes  due  to  some  residual
  123. leakage  in  the transistors. A system designer can stop the
  124.  
  125.  
  126.  
  127. ARM600 - RISC Goes OOP                                page 2
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. clock whenever the CPU  is  idling  and  thus  reduce  power
  137. consumption  substantially,  a  feature that will make ARM6-
  138. based chips suitable for hand-held battery-powered  portable
  139. computers.  Even  though the ARM6 is by no means the fastest
  140. RISC design nowadays, it offers substantially  better  MIPS-
  141. to-watt and MIPS-to-dollar ratios than its rivals.
  142.  
  143.      To prepare for the future, Advanced RISC  Machines  has
  144. enhanced  the  ARM6  architecture slightly while maintaining
  145. code  compatibility  with  earlier  ARM  chips.   The   most
  146. significant  difference  between  the original ARM chips and
  147. the ARM6 is that the ARM6 has a  full  32-bit  address  bus,
  148. while  the  original  ARM  chips use only 26 bits. Two extra
  149. signal lines, called PROG32 and DATA32, have been  added  to
  150. switch   between   three  operating  configurations:  32-bit
  151. program and 32-bit data, 26-bit program and 32-bit data, and
  152. 26-bit   program  and  26-bit  data  (to  run  the  old  ARM
  153. programs).
  154.  
  155.      One consequence of longer addresses is that  the  flags
  156. can  no  longer  be  held in the first 6 bits of the program
  157. counter. A separate current-program-status register has been
  158. added,  making  17  rather  than 16 registers visible to the
  159. programmer.  Another  new  signal,  called  BIGEND,  toggles
  160. between  `big-endian'  and  `little-endian' byte ordering --
  161. the price of admission to a cosmopolitan club that  includes
  162. Apple and IBM?
  163.  
  164.      Other subtle modifications improve  the  way  the  ARM6
  165. works  in virtual memory systems, correcting deficiencies in
  166. the old ARM chips. A virtual memory system is one  in  which
  167. disk space (or other external storage) is employed to extend
  168. the computer's apparent memory capacity. When the  processor
  169. tries  to  read  a  word from a memory address that does not
  170. exist because that  data  is  actually  stored  on  disk,  a
  171. hardware  exception  (usually  called  a page fault) occurs.
  172. This exception causes the processor to jump  to  a  software
  173. service  routine that reads a new page from disk into memory
  174. and then to return and repeat the interrupted instruction to
  175. read the now-present data.
  176.  
  177.      Unlike the original  ARM  chips,  the  ARM  can  handle
  178. exceptions  (e.g.,  page  faults) in the supervisor mode and
  179. the user mode. This is essential  for  running  fault-driven
  180. virtual memory operating systems.
  181.  
  182.      Another refinement is only half implemented. Older  ARM
  183. chips  could  accept  a  Data  Abort signal caused by a page
  184. fault only if they received it during the first  half  of  a
  185. memory  cycle.  This  put  rather stringent demands on cache
  186. timings, because a cache lookup has to be  completed  before
  187. you  can  look  into external memory, discover that the data
  188. doesn't exist, and issue an Abort signal right up to the end
  189. of  a memory cycle during single data transfers (LDR and STR
  190.  
  191.  
  192.  
  193. ARM600 - RISC Goes OOP                                page 3
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. instructions), but in so doing, it forces the Abort  service
  203. routine  to  perform extra cleanup operations. The ARM6 does
  204. not yet allow you to exploit this  feature  to  relax  cache
  205. timings, but future versions will.
  206.  
  207.      To prepare programmers for its coming, the ARM6  has  a
  208. LATEABT  signal  line  that,  when  active,  simulates  late
  209. Aborts. You can incorporate the extra cleanup  code  now  so
  210. that  your  programs  will  execute  correctly  on  the next
  211. generation of chips. Pulling  LATEABT  low  makes  the  ARM6
  212. compatible with earlier chips.
  213.  
  214. The ARM600 Processor
  215.  
  216.      The ARM600 CPU is made up an ARM6  core  surrounded  by
  217. three  extra  on-chip functional units: the processor cache,
  218. the write buffer, and the MMU. Like the old ARM3  chip,  the
  219. ARM600  has  a  4Kb on-chip cache RAM that can hold data and
  220. instructions. The cache contains 256 lines of  4  words  (16
  221. bytes), organised into four blocks of 64 lines; that is, its
  222. a 64-way set-associative cache.
  223.  
  224.      As with the most modern RAM designs, this cache employs
  225. differential  sense  amplifiers  to minimise its cycle time,
  226. but these analog devices consume a lot of power. To  further
  227. reduce  power  consumption, the ARM600 chip switches off the
  228. sense amps after the first access  during  sequential  cache
  229. accesses -- a nice detail.
  230.  
  231.      The write buffer provides a way to further  improve  to
  232. CPU  throughput  without  forcing  you to use expensive fast
  233. memory. The write-through cache  writes  into  this  on-chip
  234. buffer,  which has room for two write operations of 8 words,
  235. rather than directly into external memory. The write  buffer
  236. will complete the writes to external memory in its own time,
  237. and the RISC core is free to execute the next instruction.
  238.  
  239.      By far the most intriguing aspect of the ARM600 chip is
  240. the MMU, which provides a fairly conventional virtual memory
  241. controller but a radical scheme for partitioning  memory  on
  242. object-orientated   lines.   The   MMU   translates  virtual
  243. addresses generated in the CPU into physical data addresses,
  244. and it also controls memory access permissions.
  245.  
  246.      The virtual memory  scheme  works  through  translation
  247. tables  stored  in  physical memory, and these table entries
  248. are cached in an on-chip translation lookaside buffer (TLB).
  249. The  virtual  address  space  can  be mapped either into 1Mb
  250. sections, which only requires a one-level table  lookup,  or
  251. in  pages,  which require a two-level lookup. The ARM600 MMU
  252. supports two page sizes: small pages of 4Kb or  large  pages
  253. of 64Kb. Large pages allow single table entries to map large
  254. data objects, which helps keep the translation tables small.
  255.  
  256.  
  257.  
  258.  
  259. ARM600 - RISC Goes OOP                                page 4
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      When the CPU,  requests  a  memory  access,  the  MMU's
  269. access-control  logic  first  looks  in  the TLB to see if a
  270. translation for the virtual  address  exists  among  the  32
  271. cached   entries.   If  there  is  a  TLB  `hit'  (i.e.  the
  272. translation is already in the TLB, which should be the  case
  273. for  most accesses), the access-control logic checks whether
  274. the access is permitted. If it is, the  physical  addres  is
  275. output immediately.
  276.  
  277.      If the TLB `misses', the MMU computes an index into the
  278. translation  table,  offset  from an address held in the on-
  279. chip translation table base register. If  this  translation-
  280. table  entry  is  for  a  section,  it will contain the base
  281. address of the section, which  is  combined  with  an  index
  282. contained  in  the  virtual  address  to  give  the physical
  283. address. If the translation table entry is for  a  page,  it
  284. contains  the base address of another table, the page table,
  285. and a second lookup is required to get the physical address.
  286. In  both  cases, permission is checked before the access can
  287. proceed, and the TLB is updated with the resulting  physical
  288. address, overwriting the existing entry.
  289.  
  290.      The ARM designers have incorporated a neat  trick  into
  291. the  MMU  to  allow  more  efficient  `table  walking' (i.e.
  292. traversing chains of indirect pointers). The MMU  traps  all
  293. data  accesses  that  are  not  aligned  on word boundaries,
  294. raising a hardware alignment fault (this does not  apply  to
  295. instruction  fetches  or  to  byte-accessing  instructions).
  296. Because table entries are always word aligned, the bottom  2
  297. bits  of  a valid table address should always be 0. By using
  298. an address whose bottom 2 bits are not 0 to mark the end  of
  299. a  chain  of  pointers, you can detect the end of a table by
  300. the alignment fault it produces. This eliminates  having  to
  301. make  a  time-consuming  check  for the end of a table after
  302. each link traversal.
  303.  
  304. Object-orientated Memory
  305.  
  306.      Even though the virtual memory functions of the  ARM600
  307. MMU is sophisticated but conventional, the access-permission
  308. function is something rather  new.  Permissions  are  mapped
  309. separately   from   virtual   addresses,  and  they  can  be
  310. manipulated independently  of  them.  Additionally,  address
  311. faults  (e.g.  page  faults)  are  handled  separately  from
  312. permission faults via different hardware signals.
  313.  
  314.      The MMU maps permissions using domains, each  of  which
  315. is  a  contiguous  area of virtual memory. Domains are quite
  316. distinct from sections and pages, which  are  just  unit  in
  317. which a domain's virtual memory is managed.
  318.  
  319.      There are 16 such domains, and each  one  has  a  2-bit
  320. field  in the MMU's domain access control register to define
  321. its access type. These bits are used  to  classify  programs
  322.  
  323.  
  324.  
  325. ARM600 - RISC Goes OOP                                page 5
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. that use the domains as either clients (users of the domain)
  335. or managers (controllers of the domain). Clients always have
  336. their  access  permissions  checked,  and  a domain fault is
  337. raised if they are not valid. Managers are not checked,  and
  338. they  can  access  their  domain.  A  manager can define the
  339. permissions  for  its  own   domain   and   give   different
  340. permissions  to  different clients. A client task may have a
  341. different set of permissions for each domain  it  uses,  and
  342. this set of permissions is called the task's environment.
  343.  
  344.      This   may   all   sound   rather   puzzling,    adding
  345. complications  to  an  already  far-from-simple  system. The
  346. purpose of permission mapping only starts  to  become  clear
  347. when  you  think  about  the requirements of a truly object-
  348. orientated operating system.
  349.  
  350.      n an object-orientated programming system, all data  is
  351. encapsulated  in  coherent memory objects, and these objects
  352. must be  manipulated  by  particular  programs,  called  the
  353. methods of the class to which the object belongs. Its is not
  354. difficult to see how  hardware-enforced  client  permissions
  355. can  be used to protect objects from access by methods other
  356. than their own. Domains would be used to  distinguish  types
  357. of object -- in effect, a hardware expression of classes.
  358.  
  359.      Many object-orientated programming researchers favour a
  360. secondary-storage  scheme  called a persistent object store.
  361. Objects  become  entities  with   their   own   life   span,
  362. independent  of  the invocation of a particular application.
  363. When you are not using them, they live on disk, and when you
  364. are  not  using  them,  they  live in memory. The transition
  365. between these two states is  transparent.  If  you  need  to
  366. access  an  object  that  is  not in memory, this secondary-
  367. storage scheme brings the object into  memory  without  your
  368. having  to issue a load command or type a filename. In fact,
  369. the concept of a file and the distinction between files  and
  370. memory variables disappear altogether.
  371.  
  372.      Some PC application systems, such as  Borland's  VROOM,
  373. possess  a persistent aspect (i.e., for code, not data), but
  374. real persistence should  be  a  property  of  the  operating
  375. system itself. The ARM600 MMU can offer hardware support for
  376. such a  persistent  object-orientated  operating  system  by
  377. combining  its  virtual memory and permission-mapping roles.
  378. Such an operating system would be fault-driven: the  raising
  379. and subsequent correction of address, permission, and domain
  380. faults is what drives your computation.
  381.  
  382.      There  is  more,  however.  In  a  persistent   object-
  383. orientated  operating  system, garbage collection becomes an
  384. important issue. In any system that permits  dynamic  (i.e.,
  385. run-time)  allocation  of  memory,  the  heap  fills up with
  386. objects that are no longer being used, and the system  would
  387. grind  to  a  halt  when no new objects could be created (or
  388.  
  389.  
  390.  
  391. ARM600 - RISC Goes OOP                                page 6
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. paged in) were it not for garbage  collection.   Traditional
  401. garbage-collection  algorithms  involve  temporarily halting
  402. the system and scanning  through  memory  to  release  space
  403. occupied  by `dead' objects.  You will be familiar with this
  404. annoying interruption if you've done serious programming  in
  405. Lisp or Smalltalk.
  406.  
  407.      The latest algorithms advocate the  use  of  concurrent
  408. garbage  collection.  A garbage-collection manager runs as a
  409. background task, reclaiming dead objects  as  soon  as  they
  410. become  inaccessible  (i.e., when nothing else in the system
  411. points to them). This is preferable  in  interactive,  real-
  412. time  systems  with  GUIs,  where  a  sudden freezing of the
  413. system would be most disconcerting.
  414.  
  415.      One way of implementing concurrent  garbage  collection
  416. is  to  divide  memory into a live region, where computation
  417. occurs, and a  dead  region,  where  garbage  collection  is
  418. continually  proceeding.  One  technique is to make the live
  419. region a narrow window that  moves  cyclically  through  the
  420. memory  space,  leaving a dead region behind it. The problem
  421. is that a few (if the algorithm  is  correctly  tuned)  live
  422. objects  are  likely to be left stranded in the dead region,
  423. still pointed  to  be  objects  in  the  live  region.  Such
  424. stranded  objects  have  illegal  addresses  and must not be
  425. accessed (or even referred to).
  426.  
  427.      A permission-mapping MMU like that in the  ARM600  chip
  428. can  prevent such accesses by raising a permission fault. To
  429. recover from such a fault, the operating system rescues  the
  430. stranded  object  by  copying it into the live region, where
  431. the requested access can proceed normally. The ARM600 chip's
  432. domain  system  suggests a separate, concurrent manager task
  433. to collect garbage in each domain. It makes possible the use
  434. of a second chip as a parallel garbage-collection processor.
  435.  
  436.      From the looks of things,  you  might  wonder  how  any
  437. memory  access  ever  succeeds.   In practice, most accesses
  438. succeed immediately, from the TLB, and the system  has  been
  439. highly  optimised  to  make  the most likely cases the least
  440. time-consuming. The MMU can also reduce  power  consumption.
  441. Cycling  the fast RAM of the TLB consumes most of the power.
  442. So, the address (as opposed to permission)  segment  of  the
  443. TLB is turned on only in the case of a main cache miss.
  444.  
  445. Boundary-Scan Testing
  446.  
  447.      The ARM600  chip  (and  all  its  future  siblings)  is
  448. noteworthy   in   another  respect,  because  Advanced  RISC
  449. Machines has adopted the IEEE's  Joint  Testy  Action  Group
  450. (JTAG)   standard  for  testing  circuits  by  boundary-scan
  451. methods. Modern VLSI chips are becoming too complex to  test
  452. by the old method of prodding their pins with a logic probe.
  453. They have too many pins that you cannot reach when the  chip
  454.  
  455.  
  456.  
  457. ARM600 - RISC Goes OOP                                page 7
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. is inserted in a circuit board.
  467.  
  468.      Boundary-scanning   involves    designing    additional
  469. components  into  a  chip's layout, which will typically use
  470. about 5 percent of the total silicon area.  Each pad on  the
  471. silicon  die (which will ultimately be connected to a pin on
  472. the chip package) is associated with a  boundary-scan  cell,
  473. whose  main  active  component is a shift register. An outer
  474. circuit ring connects all these cells to four pins that make
  475. up the test access port. Using a special serial protocol, an
  476. engineer can send signals down the  TAP  and  read  out  the
  477. state of the other pins or drive any pin to a desired state.
  478. The protocol allows the TAPs of several chips  to  be  daisy
  479. chained,  so  you can test or drive the pins of a collection
  480. of  chips  installed  in  a  circuit  board.  Boundary  scan
  481. promises  to  revolutionise  the  field  of circuit testing,
  482. debugging, and diagnostics.
  483.  
  484.      The JTAG protocol specifies that  each  chip  using  it
  485. much  have  a unique manufacturer and device ID implanted in
  486. it,  which  means  that  smart  software  will  be  able  to
  487. identify,  exercise,  and  diagnose  board-level products in
  488. their normal working environment. So, the days  of  worrying
  489. about  whose drive controller chip or universal asynchronous
  490. receiver/transmitter is used in  your  clone  board  may  be
  491. numbered.   Advanced  RISC  Machines  is  only  one  of  the
  492. companies to adopt the standard, but it is hoped  the  whole
  493. industry will embrace it in the near future.
  494.  
  495.      The ARM600  chip  demonstrates  once  again  that  U.K.
  496. companies  can  devise  leading-edge technology, even if the
  497. finance has to come from Italy and the  U.S.  (the  City  of
  498. London  has  abandoned even the pretense of supporting high-
  499. tech ventures). If Apple  builds  the  ARM600  chip  into  a
  500. product,  it  will be the first design win for a British CPU
  501. in the volume market.
  502.  
  503.  
  504. Compiled from BYTE (December 1991) magazine
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523. ARM600 - RISC Goes OOP                                page 8
  524.