Week 6 Flashcards

1.9-1.12, 2.8-2.14 (78 cards)

1
Q

workload

A
  • To evaluate two computer systems, a user compares the execution time of the workload on both computers
  • typically specifies the programs and their relative frequencies, either collection of actual programs run or constructed
  • usually made of a set of benchmarks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

benchmark

A
  • A program selected for use in comparing computer performance
  • hopefully will predict performance of actual workload
  • will vary from one another to reflect different types of programs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Million instructions per second (MIPS)

A
  • A measurement of program execution speed based on the number of millions of instructions
  • computed as instruction count / execution time * 10^6.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Amdahl’s law definition

A
  • rule stating that the performance enhancement possible with an improvement is limited by the amount the feature is used
  • gives execution time of the program after making an improvement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

harvard architecture

A
  • A computer using similar separate memories
  • used today in a different sense to describe machines with a single main memory but with separate caches for instructions and data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Fallacy: The performance enhancement possible with a given improvement is __.

A
  • limited by the amount that the improved feature is used
  • ex. total runtime is 100 sec, can improve 60 sec portion, best case runtime is still 40 sec
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Amdahl’s law formula

A

exec. time after improvement =
exec. time affected by improvement / amount of improvement + unaffected time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Fallacy: Designing for performance and designing for energy efficiency are __.

A
  • unrelated goals (they aren’t!)
  • since energy is less power over time, faster applications usually take less energy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Fallacy: computers at low utilization use __.

A
  • little power (they don’t!)
  • every computer still has a minimum benchmark regardless of how much it’s being utilized, hard to lower it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

It’s important to use all __ when predicting performance

A
  • of the factors
  • ex. just one clock rate may not accurately predict performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

the only valid and and unimpeachable measure of performance is __.

A
  • execution time
  • just one individual component in the execution time equation is not enough to predict performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

procedure

A
  • A stored subroutine that performs a specific task based on the parameters with which it is provided
  • used to structure/reuse procedure (functions are procedures)
  • one way to implement abstraction in software
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

branch-and-link instruction

A
  • An instruction that branches to an address and simultaneously saves the address of the following instruction in a register (LR or X30 in LEGv8)
  • written as BL in assembly code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

caller

A
  • The program that instigates a procedure and provides the necessary parameter values
  • puts parameters in X0 - X7 and uses BL x to branch to procedure x
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

callee

A
  • A procedure that executes a series of stored instructions based on parameters provided by the caller and then returns control to the caller
  • returns control with BR LR in assembly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

return address

A
  • A link to the calling site that allows a procedure to return to the proper address
  • in LEGv8 it is stored in register LR (X30)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

program counter

A
  • The register containing the address of the instruction in the program being executed next
  • abbreviated as PC in assembly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

stack

A
  • A data structure for spilling registers organized as a last-in- first-out queue
  • used when we need more than certain amount of parameters
  • is a region in memory, NOT registers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

stack pointer

A
  • A value denoting the most recently allocated address in a stack that shows where registers should be spilled or where old register values can be found. - In LEGv8, it is register SP
  • convention is to SUBTRACT address as you add elements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

push

A

add element to stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

pop

A

remove element from stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

global pointer

A

The register that is reserved to point to static/global data within a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

procedure frame/activation record

A

The segment of the stack containing a procedure’s saved registers and local variables (ex. array, floats)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

text segment

A

portion of an object file or the corresponding section of the program’s virtual address space that contains executable instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
steps of a procedure (6 total)
- put parameters where procedure can access them - transfer control to procedure - acquire storage for procedure - perform the task - Put the result in a place where the calling program can access it. - Return control to the point of origin
26
how registers are used with procedures
- X0 - X7 is where parameters go and where returning values go - LR (X30) is for the return address register to return to point of origin
27
command line for saving a value in a parameter register
ex. passing in value saved in X19 ADD X0, X19, XZR saves X19 in X0 for a function
28
temporary vs. saved registers for procedures
- temp. registers are X9-X17, callee doesn't preserve value before function - saved registers are X19-X28, callee saves and restores value via stack from before function
29
how computer deals with registers when functions are called within functions
- callee/caller pushes any registers it used onto the stack - once nested call finishes they get loaded into original registers again
30
frame pointer (FP)
- A value denoting the location of the saved registers and local variables for a given procedure - more stable since stack moves constantly - can use FP plus offset to access things on stack
31
order of memory (from down to up)
reserved space, text segment, static data, dynamic data, stack - dynamic grows upwards, stack grows downwards (towards each other)
32
American Standard Code for Information Interchange (ASCII)
- 8-bit bytes to represent characters (text and special characters) - upper/lowercase letters are exactly 32 bits apart (upper is smaller)
33
LDURB/STURB
- LDURB loads a byte from memory, placing it in the rightmost 8 bits of a register - STURB takes a byte from the rightmost 8 bits of a register and writes it to memory - can extract a byte from a double word (which 8 bytes) LDURB X9,[X0,#0] // Read byte from source STURB X9,[X1,#0] // Write byte to destination s
34
Unicode
- a universal encoding of the alphabets of most human languages - Java uses unicode for characters and 16 bits - a single unicode is a block that is a collection of symbols (ex. Latin)
35
half words
- 16 bit quantities - a block (their name for a collection of symbols) of unicode is 16 bits
36
load half (LDURH)
loads a halfword from memory, placing it in the rightmost 16 bits of a register LDURH X19, [X0,#0] // Read halfword (16 bits) from source
37
store half (STURH)
takes a halfword from the rightmost 16 bits of a register and writes it to memory STURH X9, [X1,#0] // Write halfword (16 bits) to dest.
38
storing strings in Java vs. C
- in C strings are null terminated array of characters (char is 8 bits) - in Java come from String class, have variable that saves string length (char is 16 bit unsigned int) - Java has unicode built in which takes more space than 8 bits
39
move wide with zeros (MOVZ)
- moves a smaller value to a larger destination, filling the extra bits with zeros - can be used to move a 16-bit constant into a register and make other bits 0 - good for when constant can't fit into 12 bits
40
move wide with keep (MOVK)
- moves a smaller value to a larger destination without changing the other bits - can be used to move a 16-bit constant into a register - good for when constant can't fit into 12 bits
41
PC-relative addressing
- An addressing regime in which the address is the sum of the program counter (PC) and a constant in the instruction - used primarily with conditional instructions
42
immediate addressing
The operand is a constant within the instruction itself
43
register addressing
The operand is a register
44
base addressing/displacement addressing
The operand is at the memory location whose address is the sum of a register and a constant in the instruction
45
addressing mode
One of several addressing regimes delimited by their varied use of operands and/or addresses
46
MOVZ X9, 255, LSL 16 (example)
transfers the 16-bit immediate constant field value into the second quadrant from the right (specified by the instruction LSL 16) of a 64-bit register, filling the other 48 bits with 0s
47
MOVK X9, 255, LSL 0
transfers the 16-bit immediate constant into the last 16 bits (specified by the instruction LSL 0) of a 64-bit register, leaving the other bits unchanged
48
how to load a large constant into a register (bigger than 16 bits)
look at constant in binary, load into register with MOVK in 16 bit chunks
49
the order you shift bits in with MOVZ/MOVK
from right to left by multiples of 8 - ex. LSL 16 will start at the byte 3rd from right
50
B-type
- register that consists of 6 bits for the operation field and the rest of the bits for the address field - order is (simplified) opcode then rest
51
CB-type (conditional branch)
- specifies one operand in addition to the branch address - simplest version only leaves 19 bits for the branch address (where a program jumps to when branching)
52
what to do when branch address is bigger than 19 bits (can't fit in traditional CB-type)
- specify register that always gets added to the branch offset - (where instruction goes next) program counter = register + branch offset
53
branch offset
value that determines the target address of a branch instruction relative to the current program counter (PC)
54
branch address
the target location in memory where program execution will jump to when a branch instruction is executed
55
how PC-relative addressing "stretches out" LEGv8 instructions
- having PC-relative addressing refer to the number of words to the next instruction instead of the number of bytes - ex. 19-bit field can branch four times as far by interpreting the field as a relative word address
56
branching far away
- assembler comes to the rescue - it inserts an unconditional branch to the branch target, and inverts the condition so that the conditional branch decides whether to skip the unconditional branch
57
parallel execution
- easier when tasks are independent, but often they need to cooperate - when multiple tasks are completed simultaneously
58
data race
- where the results of the program can change depending on how events happen to occur - aka not synchronizing tasks that are supposed to collaborate
59
load exclusive register (LDXR)/store exclusive register (STXR) relationship
- instructions are used in sequence - if memory location specified by the load exclusive are changed before the store exclusive to the same address occurs, then the store exclusive fails and does not write the value to memory
60
store exclusive register (STXR)
- defined to both store the value of a (presumably different) register in memory and to change the value of another register to a 0 if it succeeds and to a 1 if it fails - specifies three registers: one to hold the address, one to indicate whether the atomic operation failed or succeeded, and one to hold the value to be stored in memory if it succeeded
61
format of LDXR/SDXR
again: LDXR X10,[X20,#0] // load exclusive STXR X23, X9, [X20] // store exclusive CBNZ X9, again // branch if store fails ADD X23, XZR, X10 // put loaded value in X23
62
assembly language
A symbolic language that can be translated into binary machine language
62
when to use primitives like LDXR/SDXR
- When in a parallel program the cooperating threads need synchronization to get proper behavior for reading and writing shared data - Multiple processes, regardless of whether processes are from a single processor or from multiple processors
63
symbol table
- a table that matches names of labels to the addresses of the memory words that instructions occupy - used by assemblers to make assembly language into binary
64
linker/link editor
- takes all the independently assembled machine language programs and "stitches" them together - saves resources by only recompiling/reassembling section that was changed - produces an executable file
65
executable file
- A functional program in the format of an object file that contains no unresolved references, usually containing symbol tables/debugging info - Relocation information may be included for the loader that puts it into memory
66
loader
- A systems program that places an object program in main memory so that it is ready to execute - An executable file is executed after a loader places the file into main memory
67
dynamically linked libraries (DLLs)
- Library routines that are linked to a program during execution - require additional space for the information needed for dynamic linking, but do not require that whole libraries be copied or linked.
68
four steps of translation hierarchy
compiler assembler linker loader
69
compiler
transforms the a program into an assembly language program
70
assembler
- converts an assembly language program to an object file in machine language - like the middleman between high level language and machine code - will accept numbers in a variety of bases
71
object file
a combination of machine language instructions, data, and information needed to place instructions properly in memory
72
MOV instruction
ex. MOV X9, XZR - moves the value from XZR into X9 - used to move register values when needed for another function call, when initializing variables
73
reminder about STUR
STUR X0, [X11, #0] stores the value in X0 at X11 + the offset (offset is 0 in this case)
74
CMP instruction
ex. CMP X9, X1 // compare i to size B.LT loop1 // if (i < size) go to loop1 - CMP compares two registers according to B statement right after
75
how to push onto stack (look at 2.8.2)
76
how to pop onto stack (look at 2.8.2)
77
how assembly language works with pointers vs. arrays
- when iterating with pointers, must add bytes according to size of variable it's holding (arrays usually convert to bytes and then add one to iterate after) - MOV moves elements of an array into different locations, moves pointers with pointers