代写EECS 370 Final Exam Winter 2021代写R编程

EECS 370 Final Exam

Winter 2021

Question 1: Short Question Multiple Choice

[11 points - 1pt per question. Honor code + 10 were given]

1.  Honor Code Signature

2.  Having a pipeline with more stages will (always/sometimes/never) decrease the overall execution time.

3.  Given the same set of instructions, a pipeline that uses detect and stall will

sometimes perform. better than a pipeline that uses detect and forward with speculate and squash. Assume both pipelines have the same clock period and are identical in every way except how hazards are handled. (True/False)

4.  A pipeline that uses speculate and squash to handle control hazards could have

0 squashes if all branches are predicted correctly. (True/False)

5.  Caches are an important part of computers because they generally store more memory relative to the hard disk and have very little latency. (True/False).

6.  A fully associative cache will (always/sometimes/never) require more tag bits per entry as the cache size gets larger, given that all cache sizes are powers of 2.

7.  A write-through cache system will (always/sometimes/never) write to both cache and memory.

8.  A cache with very large block sizes will generally have less compulsory misses than a cache with smaller block sizes. (True/False)

9.  SRAM will have higher costs to make but will generally also have higher latency compared to DRAM and the disk. (True/False)

10. The TLB lookup could happen in the pipeline after the virtual address is calculated and before the memory reference is executed. (True/False)

11. The translation look-aside buffer will often have a hit rate that is greater than 90%. (True/False)

12. The number of instructions will (increase/stay the same/decrease) in a detect and stall pipeline if data and control hazards are present.

13. Caches are generally an (SRAM/DRAM) device.

14. Implementing spatial locality in a cache will result in less cache misses than

implementing temporal locality when accessing every element only once in the array incrementally. (True/False)

15.A direct mapped cache will only check (a) (single/multiple/all) tag(s) to see if it matches with the required memory address.

16. The total size of a multi level page table could be greater than the size of a single level page table. (True/False)

Question 2: Detecting Hazards in LC2K Code (Version 1) [12 points]

Suppose the following LC2K assembly code is run through the 5-stage pipeline from lecture until it halts.


1. Select all registers that cause a RAW (Read after write) data hazard in a

detect and stall pipeline. Assume that data hazards are resolved with detect     and stall. Assume that control hazards are resolved with detect and stallData hazards can only occur from instructions that are executed. [3 pts]

a.  reg0 b.  reg1 c.  reg2 d.  reg3 e.  reg4 f.   reg5 g.  reg6 h.  reg7

2.  Using detect and stall to resolve data hazards, and detect and stall to

haza(reso)lrd(ve)sc?o[3(n)t pt(ro)lsh]azards, what is the number of stalls that occur only due to data

3. Multipart Question: Using detect and forward to resolve data hazards, and  predict not taken to resolve control hazards. Answer the statements below. [6 pts]

a.  How many cycles are required to empty out the pipeline (at the end of a program) [1.5]

b.  How many instructions are run in this program? [1.5]

c.  With parts a) and b) in mind, how many cycles does the program take to run? [3]

Question 2: Detecting Hazards in LC2K Code (Version 2) [12 points]

Suppose the following LC2K assembly code is run through the 5-stage pipeline from lecture until it halts.

1. Select all registers that cause a RAW (Read after write) data hazard in a detect and stall pipeline. Assume that data hazards are resolved with detect and stall. Assume that control hazards are resolved with detect and stallData hazards can only occur from instructions that are executed. [3 pts]

a.  reg0 b.  reg1 c.  reg2 d.  reg3 e.  reg4 f.   reg5 g.  reg6 h.  reg7

2.  Using detect and stall to resolve data hazards, and detect and stall to

haza(reso)lrd(ve)sc?o[3(n)t pt(ro)lsh]azards, what is the number of stalls that occur only due to data

3. Multipart Question: Using detect and forward to resolve data hazards, and  predict not taken to resolve control hazards. Answer the statements below. [6 pts]

d.  How many cycles are required to empty out the pipeline (at the end of a program) [1.5]

e.  How many instructions are run in this program? [1.5]

f.   With parts a) and b) in mind, how many cycles does the program take to run? [3]

Question 2: Detecting Hazards in LC2K Code (Version 3) [12 points]

Suppose the following LC2K assembly code is run through the 5-stage pipeline from lecture until it halts.

1. Select all registers that cause a RAW (Read after write) data hazard in a detect and stall pipeline. Assume that data hazards are resolved with detect and stall. Assume that control hazards are resolved with detect and stallData hazards can only occur from instructions that are executed. [3 pts]

a.  reg0 b.  reg1 c.  reg2 d.  reg3 e.  reg4 f.   reg5 g.  reg6 h.  reg7

2.  Using detect and stall to resolve data hazards, and detect and stall to

haza(reso)lrd(ve)sc?o[3(n)t pt(ro)lsh]azards, what is the number of stalls that occur only due to data

3. Multipart Question: Using detect and forward to resolve data hazards, and  predict not taken to resolve control hazards. Answer the statements below. [6 pts]

g.  How many cycles are required to empty out the pipeline (at the end of a program) [1.5]

h.  How many instructions are run in this program? [1.5]

i.   With parts a) and b) in mind, how many cycles does the program take to run? [3]

Question 3: Pipeline Datapath Design [15 points - Each blank 0.75 point]

In order to speed up pointer dereferences, Salar adds two instructions to LC2K with the following semantics:

Pointer Load Word

plw regA regB offset // regB = memory[ memory[regA + offset]  ]

Pointer Store Word

psw regA regB offset // memory[ memory[regA + offset]  ] = regB

Salar also breaks up the memory stage of the 5-stage pipeline into two stages:  MEM1 and MEM2.

In MEM1, plw and psw load the pointer from memory. lw and sw access data memory in MEM1. In MEM2, plw loads the data from the pointer address in memory. psw stores the value of regB   to the pointer address in memory.

Q3.1) Salar provisions one data memory read/write port that allows only one read or write in any cycle.  This introduces a structural hazard:  MEM1 and MEM2 cannot access data memory in   the same cycle.

We use detect and stall to address this hazard by stalling the IF and ID stages and inserting

Noop(s) into the id_ex register.  All the data forwarding is also done to EX stage. We want to     simulate our new pipeline, similar to project 3.  Below, complete the C expression so that the    bool is true if and only if our simulated pipeline should stall for the structural hazard.  Use the    pipeline registers, constants, variables, and helper functions from the Simulation Appendix at the end of the problem.

bool stall_for_structural_hazard =

( opcode( if_id.instr ) == PLW

|| opcode(  (1)  ) == (2)

|| opcode(  (3)  ) == (4)

|| opcode(  (5)  ) == (6) )

&&

( opcode(  (7)  ) == (8)

|| opcode(  (9)  ) == (10) );

(1) (2) (3) (4) (5)

(6)   (7)   (8)   (9)   (10)

Q3.2) Our new instructions also introduce data hazard(s) that require a stall.  Below, complete the C expression so that the bool is true if and only if our simulated pipeline should stall for a   new data hazard.  As before, we stall the IF and ID stages and insert Noop(s) into the id_ex register.  This expression should NOT account for the pre-existing data hazard stall due to LW.

bool stall_for_new_data_hazard =

( opcode(id_ex.instr) == PLW

&& regA(if_id.instr) != -1

&& regA(if_id.instr) == regB(id_ex.instr) )

||

( opcode(id_ex.instr) == PLW

&& regB(if_id.instr) != -1

&& regB(if_id.instr) == regB(id_ex.instr) )

||

( opcode( (1) ) == (2)

&& (3) != -1

&& (4) == (5) )

||

( opcode( (6) ) == (7)

&& (8) != -1

&& (9) == (10) );

(1)   (2)   (3)   (4)   (5)   (6)   (7)   (8)   (9)   (10)

Simulation Appendix:

 


Question 4: Pipeline Performance (Version 1) [14 points]

Consider a 1GHz version of an LC2K pipelined processor (as described in class, using detect-and-forward as well as predicting not-taken). You have been     looking into designing a new, 1.4GHz version of the processor.

●   However, this higher frequency has come at the cost of increasing the number of cycles for all operations in the ALU to complete by one. So, our new pipeline now has 6 stages (IF, ID, EX1, EX2, MEM, and WB).

●   The processor is still fully pipelined, and every other stage works exactly the

same. Branches are resolved in the MEM stage and data is always forwarded to EX1 stage.

●   Assume a benchmark with the following characteristics will be run on the original


15% instructions are loads

●   20% instructions are stores


   30% instructions are adds

●   25% instructions are nors

●   10% instructions are branches

●   30% of instructions are dependent on the instruction immediately in front of them

●   10% of instructions are not dependent on the instruction immediately in front of them but are dependent on the instruction after that

●   For the above two lines you may assume that they are true no matter what instructions are involved.

●   The distribution of immediate and non immediate dependencies are exclusive from each other.

●   30% branches are taken.

In summary, we have two processors:


● Original: 1.0 GHz, 5 stages


●   New: 1.4GHz, 6 stages

Answer the following questions 

1.  Assuming no control or data hazards, what is the execution time of the two processors (Assume 100 instructions)? [2]

Processor

CPI

Execution Time

Original

 

 

New

 

 

2.  What is the CPI of the new processor (Taking data and control hazards into account, and now assuming infinite instructions)? [3]



3.  Explain the impact of adding the extra stage to the new processor on control hazards and data hazards (Consider the impact of the new cycle on control   hazards and data hazards separately) [3]

4.  Now consider an LC2K program with the following characteristics –

● 15% instructions are loads

● 20% instructions are stores


   30% instructions are adds

●   25% instructions are nors

●   10% instructions are branches

●   30% of the instructions are dependent on the instruction immediately in     front of them. You may assume this is true no matter what instructions are involved.

●   30% of the branches are taken

●   (Note that percentage of each instruction and dependencies is the same as the new pipeline)

●   You may assume that infinite instructions are being executed

i)        What would be the expected CPI of your program using

detect-and-forward to resolve data dependencies and detect-and-stall for branches? Assume we are using the OLD pipeline (the one described in class). Clearly show your work. [3]

ii)        What would be the expected CPI of your program using

detect-and-forward to resolve data dependencies and predict-not-taken for branches? Assume we are using the OLD pipeline (the one described in class). Clearly show your work. [3]



热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图