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
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Step | Access |
|---|---|
| 1 | B reads X |
| 2 | B writes X |
| 3 | A reads X |
| 4 | A writes X |
| 5 | B writes X |
| 6 | B evicts X |
| 7 | A reads X |
| 8 | B reads X |
| 9 | A evicts X |
| Code | State | Bus command | Data from |
|---|---|---|---|
| 0 | I | none | memory |
| 1 | S | read miss | cache A |
| 2 | E | write miss | cache B |
| 3 | M | invalidate | no 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.
| Entry | Your decision |
|---|---|
| B_1 | B state after step 1 |
| BUS_2 | Bus command in step 2 |
| FROM_3 | Data source in step 3 |
| A_3 | A state after step 3 |
| B_3 | B state after step 3 |
| BUS_4 | Bus command in step 4 |
| B_4 | B state after step 4 |
| BUS_5 | Bus command in step 5 |
| FROM_5 | Data source in step 5 |
| A_5 | A state after step 5 |
| WB_6 | Does step 6 write the block back? Enter 1 for yes, 0 for no |
| A_7 | A state after step 7 |
| FROM_7 | Data source in step 7 |
| A_8 | A state after step 8 |
| FROM_8 | Data source in step 8 |
| WB_9 | Does step 9 write the block back? Enter 1 for yes, 0 for no |
| COUNT | Bus commands in steps 1 through 9 |
| A_7_RULES | If 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