Read the recorded runs of the two-cache lab of module S9. Count what sharing costs, tell true sharing from false, and choose how a cache subsystem would be checked.
Hardware context: The two-hart and two-cache lab models of module S9; ap_soc v1.5 has one core and no cache. Counting what sharing costs and choosing a method.
The lab of S9.3 has two caches, A and B, kept coherent by MSI over one bus. Each line holds two bytes, x and y. Its recorded runs are below. ap_soc has one core and no cache, so none of this runs on the chip of this track.
This worksheet uses named constants. The first three entries show how to record your decisions.
Replace each unresolved value of 65535 with your result.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Run | Steps | Bus commands | Flushes |
|---|---|---|---|
| shared | 8 | 6 | 3 |
| falseSharing | 4 | 4 | 3 |
| padded | 2 | 1 | 0 |
s1 A write x=01 bus=write-miss from=memory wb=- A=M B=I mem=0000
s2 B write y=02 bus=write-miss from=A wb=A A=I B=M mem=0001
s3 A write x=03 bus=write-miss from=B wb=B A=M B=I mem=0201
s4 B write y=04 bus=write-miss from=A wb=A A=I B=M mem=0203
bus commands=4 flushes=3
| Code | How to check the cache subsystem |
|---|---|
| 1 | Agent-driven: bus agents in the cores' seats, a reference model of memory fed by their transactions |
| 2 | Model-driven: an instruction-level model for each core runs real programs |
| 3 | Both, in that order |
| Code | Kind of sharing |
|---|---|
| 1 | True sharing: both cores use the same byte |
| 2 | False sharing: different bytes of the same line |
| 3 | No sharing |
| Entry | Your decision |
|---|---|
| SHARED_CMDS | Bus commands of the shared run. |
| FALSE_CMDS | Bus commands of the falseSharing run. |
| PADDED_CMDS | Bus commands when x and y sit in different lines (padded). |
| FALSE_KIND | A writes x and B writes y, both in one line. |
| TRUE_KIND | A writes x, then B reads x. |
| CORNER_WAY | You must make both cores hit one line in the same cycle, again and again. |
| REAL_WAY | You want to know that real code runs right on the subsystem. |
| PLAN_WAY | The plan for a whole verification campaign of a cache subsystem. |
| FALSE_AT | Bus commands if A and B take turns writing x and y of one line, WRITES writes in all, from no copy. By the MSI rule of the lab, every write misses. |
Examples
Example 1
SHARED CMDS- Input
Bus commands of the shared run.
- Output
matches = 1
Read the last line of the run.
Example 2
FALSE CMDS- Input
Bus commands of the falseSharing run.
- Output
matches = 1
Each write finds the line in the other cache and takes it away.
Example 3
PADDED CMDS- Input
Bus commands when x and y sit in different lines (padded).
- Output
matches = 1
Each core keeps its own line; only the first write misses.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For FALSE_AT, enter a constant expression using WRITES. Only this entry changes with the parameter. The supported integer range is 2 through 10, inclusive.
Hints
Hint 1
The last line of each run holds the counts.
Hint 2
Same byte: true sharing. Same line only: false.
Hint 3
Aim with agents; confirm with models.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
13 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 1 problem on this path