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
| Signal | Width | Role |
|---|---|---|
step | 12 | input of each check |
Full specification
| Delivered block | Parameter | Ports |
|---|---|---|
| ip_counter | WIDTH, 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_compare | WIDTH, 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.
| Instance | Block | WIDTH | Connections |
|---|---|---|---|
| u_fast | ip_counter | 2 | It counts while run is 1. Its count is fast_count. |
| u_slow | ip_counter | 3 | It counts while the wrap output of u_fast is 1. Its count is slow_count. Its own wrap output stays open. |
| u_alarm | ip_compare | 3 | It 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