S3.1.1 Pick the Memory

EasyImplement12 minIcarus Verilog · serverReview the topic

Ten storage jobs on a chip, and six kinds of storage. Give each job the kind that fits it.

Hardware context: The memories of ap_soc side by side: a ROM, a register file of flip-flops and the on-chip SRAM. Choosing memories for a chip and sizing a boot ROM

A design team lists what the chip must store. For each job, enter the code of the kind of memory that fits best. Decide by three questions: must the content survive with the power off, must a program be able to change it, and how large is it.

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
CodeKind of memory
1ROM: fixed when the chip is made
2SRAM on the chip
3Flash
4One-time programmable bits
5DRAM, in chips of its own
6A register file or plain flip-flops
EntryYour decision
FIRST_CODEThe first instructions after a reset. They never change for the life of the chip.
STACKThe working data of a program on a small chip: 64 KiB, written all the time.
PRODUCT_CODEThe program of the product. It must survive with the power off, and the maker updates it twice a year.
DEVICE_KEYA secret key of 256 bits. The factory writes it once, and nothing may ever change it.
PHONE_MEMORYFour gigabytes of working memory for a phone.
CPU_REGISTERSThirty-two words inside the processor. Two are read and one is written in every clock cycle.
CACHE_DATAThe 32 KiB of copies that a cache keeps beside the processor.
VERSION_FLOORA count of eight bits that may only go up, and must survive with the power off.
FAULT_LOGA log of the last hundred faults. It must survive a power cut, and the service desk erases it.
SMALL_QUEUEFour bytes that a serial port holds between the wire and the bus.
WORKING_MEMORYA design needs SIZE_KIB kibibytes of working memory. Exercise rule of this worksheet: up to 1024 KiB fits on the chip as SRAM, and anything larger is DRAM. Enter the code.

Examples

Example 1

FIRST CODE
Input
The first instructions after a reset. They never change for the life of the chip.
Output
matches = 1

Fixed for ever, and needed before anything else works: a ROM, code 1.

Example 2

STACK
Input
The working data of a program on a small chip: 64 KiB, written all the time.
Output
matches = 1

Read and written at full speed, and it may be lost with the power: SRAM on the chip, code 2.

Example 3

PRODUCT CODE
Input
The program of the product. It must survive with the power off, and the maker updates it twice a year.
Output
matches = 1

It must survive and be changed now and then: flash, code 3.

Constraints and Contract

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

Hints

Hint 1

Ask first whether the content must still be there after the power was off.

Hint 2

Never, once, now and then, or in every cycle.

Hint 3

A few bytes, some kibibytes, or gigabytes.

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

11 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

FIRST CODE

Input
The first instructions after a reset. They never change for the life of the chip.
Expected output
matches = 1

Fixed for ever, and needed before anything else works: a ROM, code 1.

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

Icarus Verilog · server