S1.3.1 Wire the Top Level from the Table

EasyImplement18 minIcarus Verilog · serverReview the topic

Two delivered blocks and one connection table. Write the top level that joins three instances, with the right parameters.

Hardware context: A delivered IP block and the files that come with it. IP intake and SoC integration

An integrator receives two blocks and a table. The table says which instances to make and how to wire them.

Write the top level. It contains three instances and one wire. It contains no logic of its own.

Signals in the Timeline

SignalWidthRole
step12input of each check
Full specification
Delivered blockParameterPorts
ip_counterWIDTH, the bits of the counter. The default is 4.clk; rst_n, a reset that is active at 0; enable; count, WIDTH bits wide; wrap
ip_compareWIDTH, the bits of both inputs. The default is 2.value and level, each WIDTH bits wide; at_or_above

ip_counter adds 1 at each rising clock edge with enable at 1. Its wrap output is 1 while enable is 1 and the count is at its largest value. ip_compare raises at_or_above while value is at least level.

InstanceBlockWIDTHConnections
u_fastip_counter2It counts while run is 1. Its count is fast_count.
u_slowip_counter3It counts while the wrap output of u_fast is 1. Its count is slow_count. Its own wrap output stays open.
u_alarmip_compare3It compares slow_count with level. Its output is alarm.

Both counters use the clock clk. The port reset of the top level is active at 1. The counters want a reset that is active at 0.

Examples

Example 1

Reset
Input
Reset
Output
fast_count = 0, slow_count = 0, alarm = 0

Reset clears both counters. The slow count of 0 is below the level of 1.

Example 2

First Run Edge
Input
First run edge
Output
fast_count = 1, slow_count = 0, alarm = 0

One run edge moves the fast counter to 1.

Example 3

An Edge with Run at 0
Input
An edge with run at 0
Output
fast_count = 1, slow_count = 0, alarm = 0

With run at 0 nothing moves.

Constraints and Contract

  • Keep module tick_top and its ports. Do not redefine ip_counter or ip_compare.
  • Use instances and wires only. A port connection may invert a signal with the ! operator.

Hints

Hint 1

Write one instance at a time, in the order of the table.

Hint 2

Pass WIDTH to every instance. Each block has a different default.

Hint 3

Check the sense of the reset at each counter.

What the grader checks: The steps check the three outputs after resets, pauses, level changes and long runs. They do not check timing or area.

123 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

Reset

Input
Reset
Expected output
fast_count = 0, slow_count = 0, alarm = 0

Reset clears both counters. The slow count of 0 is below the level of 1.

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

Icarus Verilog · server