constructive computer architecture: fifo lab comments revisiting cf fifos andy wright 6.175 ta...

11
Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014 http://csg.csail.mit.edu/6.175 L14-1

Upload: bertram-bryan

Post on 21-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

Constructive Computer Architecture:

FIFO Lab CommentsRevisiting CF FIFOs

Andy Wright6.175 TA

October 20, 2014 http://csg.csail.mit.edu/6.175 L14-1

Page 2: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

Notes

The FIFO lab has been gradedEveryone did a great job on the conflicting, pipeline, and bypass FIFOsAll difficulties came from the Conflict-Free FIFO and the discussion questions

October 20, 2014 L14-2http://csg.csail.mit.edu/6.175

Page 3: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

What is a Conflict-Free FIFO?

Is it a FIFO with a conflict matrix filled with CFs? Not really...

Is it a FIFO that, in its typical use, doesn’t impose any more conflicts than necessary? Yes!

October 20, 2014 L14-3http://csg.csail.mit.edu/6.175

Page 4: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

Typical FIFO use

Enqueuing: check notFull and call enq(x)

Dequeuing: check notEmpty and call first and deq

Clearing: call clear

These are the methods that commonly appear in the same rule A CF FIFO says enqueuing and dequeuing rules will

have no scheduling conflict imposed by the FIFO. {notFull, enq} CF {notEmpty, first, deq}

October 20, 2014 L14-4http://csg.csail.mit.edu/6.175

Page 5: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

Sequential FIFO Execution

1. enq(1)2. first3. deq4. enq(2)5. clear6. enq(3)7. enq(4)8. first9. deq

October 20, 2014 L14-5http://csg.csail.mit.edu/6.175

What is the state of the fifo here?

Assume FIFO is empty initially

What does first return?

How many elements are in the FIFO at the end?

How many clock cycles does this take?Should that change the answer to these questions?

Page 6: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

Concurrent FIFO ExecutionWith Clock Cycles

1. enq(1)2. first3. deq4. enq(2)5. clear6. enq(3)7. enq(4)8. first9. deq

October 20, 2014 L14-6http://csg.csail.mit.edu/6.175

Clock cycle boundary

1. enq(1)2. first3. deq4. enq(2)5. clear6. enq(3)7. enq(4)8. first9. deq

If these are both valid executions for a given FIFO, they should produce the same results.

Page 7: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

Concurrent FIFO ExecutionClear-Enq Interactions

1. enq(1)2. first3. deq4. enq(2)5. clear6. enq(3)7. enq(4)8. first9. deq

October 20, 2014 L14-7http://csg.csail.mit.edu/6.175

1. enq(1)2. first3. deq4. enq(2)5. clear6. enq(3)7. enq(4)8. first9. deq

What should clear and enq do when they happen in the same cycle?

If both executions are valid, then the action has to be dynamic based on the order.

Page 8: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

Can we detect the order of methods firing?

In order for a method to know if it fired after another method fired, it has to always be scheduled after that methodIf you want two methods to be able to tell if either of them came after the other, they have to conflict They will never fire in the same cycle

making this problem of who fired first trivial...

October 20, 2014 L14-8http://csg.csail.mit.edu/6.175

Page 9: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

Concurrent FIFO ExecutionCF FIFO solution

1. enq(1)2. first3. deq4. enq(2)5. clear6. enq(3)7. enq(4)8. first9. deq

October 20, 2014 L14-9http://csg.csail.mit.edu/6.175

1. enq(1)2. first3. deq4. enq(2)5. clear6. enq(3)7. enq(4)8. first9. deq

Invalid Execution

Force enq < clear

Page 10: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

What does a CF FIFO do?

It allows the most flexible scheduling constraints possible while still requiring all valid concurrent executions to match the expected result from sequential execution. That is why {enq, deq} < clear and

not {enq, deq} CF clear

October 20, 2014 L14-10http://csg.csail.mit.edu/6.175

Page 11: Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright 6.175 TA October 20, 2014

What about the canonicalize rule?

What happens if you have: {enq, deq} < canonicalize < clear

If deq and clear occur in the same rule, that rule conflicts with canonicalize. This may or may not be a problem depending on the exact use.

{enq, deq} < clear < canonicalize canonicalize can always fire at the end of

the cycle independent of how enq, deq, and clear are used in rules

October 20, 2014 L14-11http://csg.csail.mit.edu/6.175