S3.12.2 Parity or ECC Here

EasyImplement12 minIcarus Verilog · serverReview the topic

Choose the protection of six memories of a chip, and count what each choice stores.

Hardware context: A memory of four words, each 8 data bits with one even-parity bit beside them, and an error injector, as test code. Parity protection of caches and other memories that hold copies

A team protects its memories by one rule. A memory whose contents are also kept somewhere else needs only to notice an error: it gets parity, one bit for each byte, and fetches the data again. A memory that holds the only copy must repair an error: it gets SEC-DED. A memory in which a wrong bit does no harm gets nothing. Enter the choices as numbers: 0 for nothing, 1 for parity, 2 for SEC-DED.

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

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification

Enter every answer as a whole number. For a yes or no question, enter 1 for yes and 0 for no.

EntryYour decision
INSTRUCTION_CACHEAn instruction cache. Every block in it is a copy of the program in flash. Which protection?
MAIN_SRAMThe SRAM with the variables of the program. Which protection?
PARITY_WORD_BITSHow many bits does a memory with parity store for a word of 32 bits?
SECDED_WORD_BITSHow many bits does a memory with SEC-DED store for a word of 32 bits?
TLB_ENTRIESA TLB. Its entries are copies of page-table entries in memory. Which protection?
WRITE_BACK_CACHEA data cache that keeps written data until the block leaves. That data is not in memory yet. Which protection?
FRAME_OF_DEMOA buffer of pixels for a demo screen. One wrong pixel for one frame is accepted. Which protection?
PARITY_SEES_TWOTwo bits of one byte flip. Does parity notice?
SECDED_SEES_TWOTwo bits of one word flip. Does SEC-DED notice?
SECDED_BITS_64How many check bits does SEC-DED need for a word of 64 bits?
SCRUB_PASS_MSA scrubber repairs one word every millisecond. The memory has 200 words. How many milliseconds does one pass take?
SECDED_CHECK_BITSA word has DATA_BITS data bits, a power of two. Give the number of check bits of a SEC-DED code for it.

Examples

Example 1

INSTRUCTION CACHE
Input
An instruction cache. Every block in it is a copy of the program in flash. Which protection?
Output
matches = 1

The flash still has the block. Notice the error, and fetch the block again.

Example 2

MAIN SRAM
Input
The SRAM with the variables of the program. Which protection?
Output
matches = 1

It is the only copy. An error must be repaired.

Example 3

PARITY WORD BITS
Input
How many bits does a memory with parity store for a word of 32 bits?
Output
matches = 1

One parity bit for each of the four bytes.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For SECDED_CHECK_BITS, enter a constant expression using DATA_BITS. Only this entry changes with the parameter. The supported integer range is 4 through 128, inclusive.

Hints

Hint 1

If the data can be fetched again, noticing is enough: parity.

Hint 2

Then an error must be repaired: SEC-DED.

Hint 3

Parity adds one bit for each byte. SEC-DED adds the position bits and one overall parity.

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

12 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 3 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

INSTRUCTION CACHE

Input
An instruction cache. Every block in it is a copy of the program in flash. Which protection?
Expected output
matches = 1

The flash still has the block. Notice the error, and fetch the block again.

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

Icarus Verilog · server