


































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



































Chameli Devi Group of Ins�tu�ons
Department of Computer Science and Engineering
Subject Notes
Subject Code: CS-6001 Subject Name: Advanced Computer Architecture
UNIT-
Flynn's Classifica�on
Flynn’s classifica�on dis�nguishes mul�-processor computer architectures according to two independent dimensions of Instruc�on stream and Data stream. An instruc�on stream is sequence of instruc�ons executed by machine. And a data stream is a sequence of data including input, par�al or temporary results used by instruc�on stream. Each of these dimensions can have only one of two possible states: Single or Mul�ple. Flynn’s classifica�on depends on the dis�nc�on between the performance of control unit and the data processing unit rather than its opera�onal and structural interconnec�ons. Following are the four category of Flynn classifica�on and characteris�c feature of each of them.
a) Single Instruc�on Stream, Single Data Stream (SISD)
The figure 1.1 is represents an organiza�on of simple SISD computer having one control unit, one processor unit and single memory unit.
Instruc�on Data
Stream Stream
Figure 1.1: SISD processor organiza�ons
b) Single Instruc�on Stream, Mul�ple Data Stream (SIMD) processors
Figure 1.2: SIMD processor organiza�ons
C) Mul�ple Instruc�on Stream, Single Data Stream (MISD)
Figure 1.3: MISD processor organiza�ons
d) Mul�ple Instruc�on Stream, Mul�ple Data Stream (MIMD)
The processor cycles required for each instruc�on (CPI) can be a�ributed to cycles needed for instruc�on decode and execu�on (p), and cycles needed for memory references (m* k).
The total �me needed to execute a program can then be rewri�en as
T = Ic* (p + mk)τ
Parallel Computer Models
Mul�processor and Mul�computer
Two categories of parallel computers are discussed below namely shared common memory or unshared distributed memory.
Shared Memory Mul�processor
Uniform Memory Access (UMA):
Figure 1.5: Shared Memory (UMA)
Non-Uniform Memory Access (NUMA):
If cache coherency is maintained, then may also be called CC-NUMA - Cache Coherent NUMA
Figure 1.6: Shared Memory (NUMA)
The COMA model (Cache only Memory Access): The COMA model is a special case of NUMA machine in which the distributed main memories are converted to caches. All caches form a global address space and there is no memory hierarchy at each processor node.
Advantages:
Disadvantages:
Distributed Memory
Like shared memory systems, distributed memory systems vary widely but share a common characteris�c. Distributed memory systems require a communica�on network to connect inter-processor memory.
Figure 1.9: Configura�ons of SIMD Computers
These processors consist of a number of memory modules which can be either global or dedicated to each processor. Thus the main memory is the aggregate of the memory modules. These Processing elements and memory unit communicate with each other through an interconnec�on network. SIMD processors are especially designed for performing vector computa�ons. SIMD has two basic architectural organiza�ons
a. Array processor using random access memory
b. Associa�ve processors using content addressable memory.
Data and Resource Dependence
Data dependence : The ordering rela�onship between statements is indicated by the data dependence. Five type of data dependence are defined below:
Consider the following fragment of any program: S1 Load R1, A
S2 Add R2, R
S3 Move R1, R
S4 Store B, R
Control Dependence : This refers to the situa�on where the order of the execu�on of statements cannot be determined before run �me. For example all condi�on statement, where the flow of statement depends on the output. Different paths taken a�er a condi�onal branch may depend on the data hence we need to eliminate this data dependence among the instruc�ons. This dependence also exists between opera�ons performed in successive itera�ons of looping procedure. Control dependence o�en prohibits parallelism from being exploited.
Control-independent example:
for (i=0;i<n;i++) {
a[i] = c[i];
if (a[i] < 0) a[i] = 1;
}
Control-dependent example:
for (i=1;i<n;i++) {
if (a[i-1] < 0) a[i] = 1;
}
Control dependence also avoids parallelism to being exploited. Compilers are used to eliminate this control dependence and exploit the parallelism.
Resource dependence:
Data and control dependencies are based on the independence of the work to be done. Resource independence is concerned with conflicts in using shared resources, such as registers, integer and floa�ng point ALUs, etc. ALU conflicts are called ALU dependence. Memory (storage) conflicts are called storage dependence.
Hardware and So�ware Parallelism
Hardware parallelism is defined by machine architecture and hardware mul�plicity i.e., func�onal parallelism �mes the processor parallelism .It can be characterized by the number of instruc�ons that can be issued per machine cycle. If a processor issues k instruc�ons per machine cycle, it is called a k-issue processor. Conven�onal processors are one-issue machines. This provides the user the informa�on about peak a�ainable performance.
So�ware Parallelism
So�ware parallelism is defined by the control and data dependence of programs, and is revealed in the program’s flow graph i.e., it is defined by dependencies within the code and is a func�on of algorithm, programming style, and compiler op�miza�on.
Program par��oning and scheduling
Scheduling and alloca�on is a highly important issue since an inappropriate scheduling of tasks can fail to exploit the true poten�al of the system and can offset the gain from paralleliza�on, A parallel program, therefore, can be represented by a node- and edge-weighted directed acyclic graph (DAG), in which the node weights represent task processing �mes and the edge weights represent data dependencies as well as the communica�on �mes between tasks. In dynamic scheduling only, a few assump�ons about the parallel program can be made before execu�on, and thus, scheduling decisions have to be made on-the-fly. The goal of a dynamic scheduling algorithm as such includes not only the minimiza�on of the program comple�on �me but also the minimiza�on of the scheduling overhead which cons�tutes a significant por�on of the cost paid for running the scheduler. In general dynamic scheduling is an NP hard problem.
Grain size and latency
It corresponds to execu�on of essen�ally independent jobs or programs on a parallel computer. This is prac�cal for a machine with a small number of powerful processors, but imprac�cal for a machine with a large number of simple processors (since each processor would take too long to process a single job).
Communica�on Latency
Balancing granularity and latency can yield be�er performance. Various latencies a�ributed to machine architecture, technology, and communica�on pa�erns used. Latency imposes a limi�ng factor on machine scalability. Ex. Memory latency increases as memory capacity increases, limi�ng the amount of memory that can be used with a given tolerance for communica�on latency.
Inter-processor Communica�on Latency
Communica�on Pa�erns
Program Graphs and Packing
A program graph is similar to a dependence graph Nodes = { (n,s) }, where n = node name, s = size (larger s = larger grain size).
Edges = {(v, d)}, where v = variable being “communicated,” and d = communica�on delay.
Packing two (or more) nodes produces a node with a larger grain size and possibly more edges to other nodes. Packing is done to eliminate unnecessary communica�on delays or reduce overall scheduling overhead.
Scheduling
A schedule is a mapping of nodes to processors and start �mes such that communica�on delay requirements are observed, and no two nodes are execu�ng on the same processor at the same �me. Some general scheduling goals:
Grain packing may poten�ally eliminate interprocessor communica�on, but it may not always produce a shorter schedule. By duplica�ng nodes (that is, execu�ng some instruc�ons on mul�ple processors), we may eliminate some interprocessor communica�on, and thus produce a shorter schedule.
Program flow mechanism
Conven�onal machines used control flow mechanism in which order of program execu�on explicitly stated in user programs. Dataflow machines which instruc�ons can be executed by determining operand availability.
Data Flow Features
No need for shared memory program counter control sequencer Special mechanisms are required to detect
data availability match data tokens with instruc�ons needing them enable chain reac�on of asynchronous instruc�on execu�on
A Dataflow Architecture – 1 The Arvind machine (MIT) has N PEs and an N -by –N interconnec�on network. Each PE has a token-matching mechanism that dispatches only instruc�ons with data tokens available. Each datum is tagged with
Tagged tokens enter PE through local path (pipelined), and can also be communicated to other PEs through the rou�ng network. Instruc�on addresses effec�vely replace the program counter in a control flow machine. Context iden�fier effec�vely replaces the frame base register in a control flow machine. Since the dataflow machine matches the data tags from one instruc�on with successors, synchronized instruc�on execu�on is implicit.
Demand-Driven Mechanisms
Data-driven machines select instruc�ons for execu�on based on the availability of their operands; this is essen�ally a bo�om-up approach.
Demand-driven machines take a top-down approach, a�emp�ng to execute the instruc�on (a demander) that yields the final result. This triggers the execu�on of instruc�ons that yield its operands, and so forth. The demand-driven approach matches naturally with func�onal programming languages (e.g. LISP and SCHEME).
Pa�ern driven computers: An instruc�on is executed when we obtain a par�cular data pa�erns as output. There are two types of pa�ern driven computers
String-reduc�on model: each demander gets a separate copy of the expression string to evaluate each reduc�on step has an operator and embedded reference to demand the corresponding operands each operator is suspended while arguments are evaluated
Graph-reduc�on model: expression graph reduced by evalua�on of branches or sub-graphs, possibly in parallel, with demanders given pointers to results of reduc�ons. Based on sharing of pointers to arguments; traversal and reversal of pointers con�nues un�l constant arguments are encountered.
System interconnect architecture
Various types of interconnec�on networks have been suggested for SIMD computers. These are basically classified have been classified on network topologies into two categories namely
Sta�c versus Dynamic Networks
The topological structure of an SIMD array processor is mainly characterized by the data rou�ng network used in interconnec�ng the processing elements.
The topological structure of an SIMD array processor is mainly characterized by the data rou�ng network used in the interconnec�ng the processing elements.
Network proper�es and rou�ng
The goals of an interconnec�on network are to provide low-latency high data transfer rate wide communica�on bandwidth. Analysis includes latency bisec�on bandwidth data- rou�ng func�ons scalability of parallel architecture These Network usually represented by a graph with a finite number of nodes linked by directed or undirected edges.
Sta�c interconnec�on networks
Sta�c interconnec�on networks for elements of parallel systems (ex. processors, memories) are based on fixed connec�ons that cannot be modified without a physical re-designing of a system. Sta�c interconnec�on networks can have many structures such as a linear structure (pipeline), a matrix, a ring, a torus, a complete connec�on structure, a tree, a star, a hyper-cube.
In linear and matrix structures, processors are interconnected with their neighbors in a regular structure on a plane. A torus is a matrix structure in which elements at the matrix borders are connected in the frame of the same lines and columns. In a complete connec�on structure, all elements (ex. processors) are directly interconnected (point-to-point)
Figure 1.11: Linear structure (pipeline) of interconnec�ons in a parallel system
Figure 1.12: 2D Torus Figure 1.13: Matrix
Figure 1.14: A complete interconnec�on Figure 1.15: A Ring Figure 1.16: A Chordal Ring
In a tree structure, system elements are set in a hierarchical structure from the root to the leaves, see the figure below. All elements of the tree (nodes) can be processors or only leaves are processors and the rest of nodes are linking elements, which intermediate in transmissions. If from one node, 2 or more connec�ons go to different nodes towards the leaves - we say about a binary or k-nary tree. If from one node, more than one connec�on goes to the neighboring node, we speak about a fat tree. A binary tree, in which in the direc�on of
the root, the number of connec�ons between neighboring nodes increases twice, provides a uniform transmission throughput between the tree levels, a feature not available in a standard tree.
Figure 1.17: Binary tree Figure 1.18: Fat tree
In a hypercube structure, processors are interconnected in a network, in which connec�ons between processors correspond to edges of an n-dimensional cub.
Dynamic interconnec�on networks
Dynamic interconnec�on networks between processors enable changing (reconfiguring) of the connec�on structure in a system. It can be done before or during parallel program execu�on. So, we can speak about sta�c or dynamic connec�on reconfigura�on.
The dynamic networks are those networks where the route through which data move from one PE to another is established at the �me communica�on has to be performed. Usually all processing elements are equidistant and an interconnec�on path is established when two processing element want to communicate by use of switches. Such systems are more difficult to expand as compared to sta�c network. Examples: Bus-based, Crossbar, Mul�stage Networks. Here the Rou�ng is done by comparing the bit-level representa�on of source and des�na�on addresses. If there is a match goes to next stage via pass- through else in case of it mismatch goes via cross-over using the switch.
There are two classes of dynamic networks namely
Single Stage Networks
A single stage switching network with N input selectors (IS) and N output selectors (OS). Here at each network stage there is a 1- to-D demul�plexer corresponding to each IS such that 1<D<N and each OS is an M-to- mul�plexer such that 1<M<=N. Cross bar network is a single stage network with D=M=N. In order to establish a desired connec�ng path different path control signals will be applied to all IS and OS selectors. The single stage network is also called as re-circula�ng network as in this network connec�on the single data items may have to re-circulate several �me through the single stage before reaching their final des�na�ons.
Mul�stage Networks
Many stages of interconnected switches form a mul�stage SIMD network. It is basicaaly consist of three characteris�c features
Many stages of interconnected switches form a mul�stage SIMD networks. Eachbox is essen�ally an interchange device with two inputs and two outputs. The four possible states of a switch box are which are shown in figure.
A two func�on switch can assume only two possible state namely state or exchange states. However a four func�on switch box can be any of four possible states. A mul�stage network is capable of connec�ng any input terminal to any output terminal. Mul�-stage networks are basically constructed by so called shuffle- exchange switching element, which is basically a 2 x 2 crossbar. Mul�ple layers of these elements are connected and form the network.
Figure 1.19: A two-by-two switching box and its four interconnec�on states
A mul�stage network is capable of connec�ng an arbitrary input terminal to an arbitrary output terminal.
Bus networks
A bus is the simplest type of dynamic interconnec�on networks. It cons�tutes a common data transfer path for many devices. Depending on the type of implemented transmissions we have serial busses and parallel busses. The devices connected to a bus can be processors, memories, I/O units, as shown in the figure below.
Figure 1.20: A diagram of a system based on a single bus Figure 1.21: A diagram of a system based on a mul�bus
Only one device connected to a bus can transmits data. Many devices can receive data. In the last case we speak about a mul�cast transmission. If data are meant for all devices connected to a bus we speak about a broadcast transmission. Accessing the bus must be synchronized. It is done with the use of two methods: a token method and a bus arbiter method. With the token method, a token (a special control message or signal) is circula�ng between the devices connected to a bus and it gives the right to transmit to the bus to a single device at a �me.
Instruc�on Set Architectures
The instruc�on set, also called instruc�on set architecture (ISA), is part of a computer that pertains to programming, which is basically machine language. The instruc�on set provides commands to the processor, to tell it what it needs to do. The instruc�on set consists of addressing modes, instruc�ons, na�ve data types, registers, memory architecture, interrupt, and excep�on handling, and external I/O.
Examples of instruc�on set
Computers are classified on the basis on instruc�on set they have as:
CISC Scalar Processors
CISC (Complex Instruc�on Set Computer): CISC based computer will have shorter programs which are made up of symbolic machine language. A Complex Instruc�on Set Computer (CISC) supplies a large number of complex instruc�ons at the assembly language level. During the early years, memory was slow and expensive and the programming was done in assembly language. Since memory was slow and instruc�ons could be retrieved up to 10 �mes faster from a local ROM than from main memory, programmers tried to put as many instruc�ons as possible in a microcode.
Figure 2.1: (a) CSIC Architecture (b) RSIC Architecture
RISC Scalar Processors
RISC (Reduced Instruc�on Set Computer): RISC is a type of microprocessor that has a rela�vely limited number of instruc�ons. It is designed to perform a smaller number of types of computer instruc�ons so that it can operate at a higher speed (perform more million instruc�ons per second, or millions of instruc�ons per second). Earlier, computers used only 20% of the instruc�ons, making the other 80% unnecessary. One advantage of reduced instruc�on set computers is that they can execute their instruc�ons very fast because the instruc�ons are so simple.
Advantages:
Difference between CISC and RISC
VLIW Architecture
Very long instruc�on word (VLIW) describes a computer processing architecture in which a language compiler or pre-processor breaks program instruc�on down into basic opera�ons that can be performed by the processor in parallel (that is, at the same �me).
VLIW is some�mes viewed as the next step beyond the reduced instruc�on set compu�ng (RISC) architecture, which also works with a limited set of rela�vely basic instruc�ons and can usually execute more than one instruc�on at a �me (a characteris�c referred to as superscalar ).
The main advantage of VLIW processors is that complexity is moved from the hardware to the so�ware, which means that the hardware can be smaller, cheaper, and require less power to operate.
Figure 2.2: A VLIW processor architecture and instruc�on format Figure 2.3: Pipeline execu�on
Pipelining in VLIW Processors
Decoding of instruc�ons is easier in VLIW than in superscalars, because each “region” of an instruc�on word is usually limited as to the type of instruc�on it can contain.
VLIW Opportuni�es
“Random” parallelism among scalar opera�ons is exploited in VLIW, instead of regular parallelism in a vector or SIMD machine.
The efficiency of the machine is en�rely dictated by the success, or “goodness,” of the compiler in planning the opera�ons to be placed in the same instruc�on words.
Different implementa�ons of the same VLIW architecture may not be binary-compa�ble with each other, resul�ng in different latencies.
Memory Hierarchy
of references. Frequently used informa�on is found in the lower levels in order to minimize the effec�ve access �me of the memory hierarchy.
Figure 2.5: The inclusion property and data transfer between adjacent levels
The following three principles which led to an effec�ve implementa�on memory hierarchy for a system are:
1 Make the Common Case Fast: This principle says the data which is more frequently used should be kept in faster device. It is based on a fundamental law, called Amdahl’s Law, which states that the performance improvement to be gained from using some faster mode of execu�on is limited by the frac�on of the �me the faster mode can be used. Thus if faster mode use rela�vely less frequent data then most of the �me faster mode device will not be used hence the speed up achieved will be less than if faster mode device is more frequently used.
2. Principle of Locality: It is very common trend of Programs to reuse data and instruc�ons that are used recently. Based on this observa�on comes important program property called locality of references: the instruc�ons and data in a program that will be used in the near future is based on its accesses in the recent past. There is a famous 40/10 rule that comes from empirical observa�on is:
"A program spends 40% of its �me in 10% of its code"
These locali�es can be categorized of three types :
a. Temporal locality : states that data items and code that are recently accessed are likely to be accessed in the near future. Thus if loca�on M is referenced at �me t, then it (loca�on M) will be referenced again at some �me t+Dt.
b. Spa�al locality : states that items try to reside in proximity in the memory i.e., the items whose addresses are near to each other are likely to be referred together in �me. Thus we can say memory accesses are clustered with respect to the address space. Thus if loca�on M is referenced at �me t, then another loca�on M±Dm will be referenced at �me t+Dt.
c. Sequen�al locality: Programs are stored sequen�ally in memory and normally these programs has sequen�al trend of execu�on. Thus we say instruc�ons are stored in memory in certain array pa�erns and are accessed sequen�ally one memory loca�ons a�er another. Thus if loca�on M is referenced at �me t, then loca�ons M+1, M+2, … will be referenced at �me t+Dt, t+Dt’, etc. In each of these pa�erns, both Dm and Dt are “small.” H&P suggest that 90 percent of the execu�on �me in most programs is spent execu�ng only 10 percent of the code.
3. Smaller is Faster: Smaller pieces of hardware will generally be faster than larger pieces.
This according to above principles suggested that one should try to keep recently accessed items in the fastest memory. While designing the memory hierarchy following points are always considered
Inclusion property: If a value is found at one level, it should be present at all of the levels below it.
The implica�on of the inclusion property is that all items of informa�on in the “innermost” memory level (cache) also appear in the outer memory levels. The inverse, however, is not necessarily true. That is, the presence of a data item in level Mi+1 does not imply its presence in level Mi. We call a reference to a missing item a “miss.”
The Coherence Property
The value of any data should be consistent at all level. The inclusion property is, of course, never completely true, but it does represent a desired state. That is, as informa�on is modified by the processor, copies of that informa�on should be placed in the appropriate loca�ons in outer memory levels. The requirement that copies
of data items at successive memory levels be consistent is called the “coherence property.”
Coherence Strategies
Write-through
As soon as a data item in M i is modified, immediate update of the corresponding data item(s) in M i+1, Mi+ … Mn is required. This is the most aggressive (and expensive) strategy.
Write-back
The update of the data item in M i+1 corresponding to a modified item in Mi is not updated unit it (or the block/page/etc. in M i that contains it) is replaced or removed. This is the most efficient approach, but cannot be used (without modifica�on) when mul�ple processors share Mi+1, …, Mn.
Memory Capacity Planning:
The performance of a memory hierarchy is determined by the effec�ve access �me (Teff) to any level in the hierarchy. It depends on the hit ra�o and access frequencies at successive levels.
Hit Ra�o (h): is a concept defined for any two adjacent levels of a memory hierarchy. When an informa�on item found in Mi, it is a hit, otherwise, a miss. The hit ra�o (hi) at Mi is the probability that an informa�on item will be found in Mi. the miss ra�o at Mi is defined as 1-hi.
The access frequency to Mi is defined as
fi= (1-h1)(1-h2)….(1-hi)
Effec�ve Access Time (Teff):
In prac�ce, we wish to achieve as high a hit ra�o as possible at M1. Every �me a miss occurs, a penalty must be paid to access the next higher level of memory. The Teff of a memory hierarchy is given by:
n
T (^) eff. =∑ f (^) i .t (^) i
i=
=h 1 t 1 + (1-h 1 ) h^2 t 2 + (1-h^1 ) (1-h 2 ) h 3 t 3 +………+ (1-h 1 ) (1-h 2 )…… (1-h^ n-1) t^ n
Hierarchy Op�miza�on:
The total cost of a memory hierarchy is es�mated as:
n
C (^) total=∑ C (^) i .S (^) i
i=
Interleaved memory organiza�on- memory interleaving
It is a technique for compensa�ng the rela�vely slow speed of DRAM (Dynamic RAM). In this technique, the main memory is divided into memory banks which can be accessed individually without any dependency on the other.
High-Order Interleaving
Arguably the most “natural” arrangement would be to use bus lines A26-A27 as the module determiner. In other words, we would feed these two lines into a 2-to-4 decoder, the outputs of which would be connected to the Chip Select pins of the four memory modules. If we were to do this, the physical placement of our system addresses would be as follows: