S9.3.2 Next State for Each Access

MediumImplement22 minIcarus Verilog · serverReview the topic

Step two MESI caches through an access script and record each state, bus command and data source.

Hardware context: Two MESI cache lines on a snoop bus model. Multicore cache controller design

Caches A and B run the MESI rules of S9.3 on one block X. Both start Invalid. Accesses happen one at a time in the order given.

This worksheet uses named constants. The first three entries show how to record your decisions.

Replace each unresolved value of 255 with your decision.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
StepAccess
1B reads X
2B writes X
3A reads X
4A writes X
5B writes X
6B evicts X
7A reads X
8B reads X
9A evicts X
CodeStateBus commandData from
0Inonememory
1Sread misscache A
2Ewrite misscache B
3Minvalidateno data moves

A state entry means the state at the end of that step. A count counts read misses, write misses and invalidates placed on the bus.

EntryYour decision
B_1B state after step 1
BUS_2Bus command in step 2
FROM_3Data source in step 3
A_3A state after step 3
B_3B state after step 3
BUS_4Bus command in step 4
B_4B state after step 4
BUS_5Bus command in step 5
FROM_5Data source in step 5
A_5A state after step 5
WB_6Does step 6 write the block back? Enter 1 for yes, 0 for no
A_7A state after step 7
FROM_7Data source in step 7
A_8A state after step 8
FROM_8Data source in step 8
WB_9Does step 9 write the block back? Enter 1 for yes, 0 for no
COUNTBus commands in steps 1 through 9
A_7_RULESIf both caches ran the whole script with MSI rules instead, what would A's state be after step 7? MESI is 1 for MESI rules and 0 for MSI.

Examples

Example 1

B 1
Input
B state after step 1
Output
matches = 1

No other cache raises the shared line, so B takes the clean private state, E.

Example 2

BUS 2
Input
Bus command in step 2
Output
matches = 1

B holds E, so the write upgrades to M without a bus command.

Example 3

FROM 3
Input
Data source in step 3
Output
matches = 1

B holds the only up-to-date copy, so B flushes it.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For A_7_RULES, enter a constant expression using MESI. Only this entry changes with the parameter. The supported integer range is 0 through 1, inclusive.
  • Stay inside your module: hierarchical names, $root, force, release, bind and defparam are refused.

Hints

Hint 1

Write A and B side by side after every step.

Hint 2

Before each miss, find any Modified copy: it must supply the data.

Hint 3

A hit or a write-back places no coherence command.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

18 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 2 problems on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

B 1

Input
B state after step 1
Expected output
matches = 1

No other cache raises the shared line, so B takes the clean private state, E.

Run samples executes all 3 public checks. Check all tests runs 18 checks on the server.

Icarus Verilog · server