B3.3.1 Find the Corners

EasyImplement12 minIcarus Verilog · serverReview the topic

Work out what a FIFO four entries deep must do at each of its corners. Then sort each corner as an end, a seam or a corner in time.

Hardware context: A FIFO four entries deep. Corner lists for queues, counters and buffers.

The FIFO of the lesson: four entries deep, empty after reset. A push is taken when it is not full, and a pop when it is not empty. Both may happen in one clock, each decided by the count before it. A push at the n-th clock writes the value 16 + n.

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

Replace each unresolved value of 255 with your result.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
CodeKind of corner
1An end of a range
2A seam: two events in one clock
3A corner in time
EntryYour decision
PUSHES_TO_FULLFrom empty, how many pushes in a row make the FIFO full?
AFTER_BOTH_EMPTYEntries after a push and a pop in one clock, starting empty.
AFTER_BOTH_FULLEntries after a push and a pop in one clock, starting full.
AFTER_BOTH_MIDEntries after a push and a pop in one clock, starting with 2.
AFTER_POP_EMPTYEntries after a pop alone, starting empty.
AFTER_PUSH_FULLEntries after a push alone, starting full.
WRAP_PUSHStarting empty, with a pop after every push, which push (counting from 1) writes slot 0 for the second time?
AFTER_RESETEntries straight after a reset while 3 were inside.
OLDESTPushes at clocks 1, 2 and 3 (values 17, 18, 19), then one pop. The oldest entry, in decimal?
KIND_POP_EMPTYKind of corner: a pop when empty.
KIND_BOTH_FULLKind of corner: a push and a pop together when full.
KIND_RESETKind of corner: reset while the FIFO holds data.
MIN_CLOCKSThe same rules, but DEPTH entries deep, one push or pop per clock. From empty, you fill it and push once more, then drain it and pop once more. How many clocks?

Examples

Example 1

PUSHES TO FULL
Input
From empty, how many pushes in a row make the FIFO full?
Output
matches = 1

Full means four entries, so four pushes.

Example 2

AFTER BOTH EMPTY
Input
Entries after a push and a pop in one clock, starting empty.
Output
matches = 1

At empty the pop is refused and the push is taken.

Example 3

AFTER BOTH FULL
Input
Entries after a push and a pop in one clock, starting full.
Output
matches = 1

At full the push is refused and the pop is taken.

Constraints and Contract

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

Hints

Hint 1

A push and a pop in one clock are each decided by the count before it.

Hint 2

Every end is tested at the end and one step beyond it.

Hint 3

Ends are values, seams are pairs of events, corners in time are about when.

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

17 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

PUSHES TO FULL

Input
From empty, how many pushes in a row make the FIFO full?
Expected output
matches = 1

Full means four entries, so four pushes.

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

Icarus Verilog · server