Description
The formal library draws a clock gate as an AND gate. Write the model that behaves like the real cell.
Replace the AND-gate model of a clock-gating cell with a model of the real cell. The real cell is a latch, open while the clock is low, followed by an AND gate. The bench counts four ticks per clock cycle.
Pinned interface
| Port | Direction | Bits |
|---|---|---|
| clk | input | 1 |
| rst | input | 1 |
| want | input | 1 |
| tk | output | 2 |
| en | output | 1 |
| gclk | output | 1 |
Full specification
The real cell is a latch followed by an AND gate. The latch is open while clk1 is low and closed while clk1 is high. So the gated clock is high for a whole high phase or not at all.
The bench has one clock. It counts four ticks per clk1 cycle: clk1 is high in ticks 0 and 1 and low in ticks 2 and 3. In this block the enable en may change at any tick, also in the high phase.
Replace the AND model below the marked line. Keep the ports and the lines above the mark. The judge proves three hidden properties of the real cell on your model. It also checks that a late enable and a late disable are both reachable.
Write a latch as a register that loads while its gate is open. This engine accepts no latches.
| The real cell | On the tick model |
|---|---|
gclk is low while clk1 is low | no gclk in ticks 2 and 3 |
| The enable is taken in the low phase | gclk at tick 0 is en as it was at tick 3 |
| The pulse does not change in the high phase | gclk at tick 1 is also en as it was at tick 3 |
| Execution rule | Meaning |
|---|---|
| Interface | Use the pinned port names, directions and bit widths shown above. Observed state and tracker outputs are not environment inputs. |
| Sampling | One positive edge of clk; binary values. Non-overlapping implication observes the next sample. Reset and initialization follow the source and contract above. |
| Submission | Submit RTL using the starter’s format. The checks apply to this stated model and scope. |
| How this is graded | The reference obligations, independent reachability checks and fault checks must all succeed. An unresolved proof or resource limit is inconclusive and is never a rated miss. |
Measured Counterexample
FAIL · bmc · depth 12 · smtbmc yices · 1089 ms
This measured failing run uses the published interface. Follow the sampled violation back to the preceding inputs and state. The worked solution below explains the required behaviour and the failure mechanisms.
Samples from the measured run. Free input lanes are shaded; the terminal VCD record is omitted.
Sample 5: tk=0, en=0, gclk=0. Previous sample: tk=3, en=1. The enable was high at tick 3, the last tick of the low phase. The real cell holds that value, so the gated clock must be high at tick 0. This model follows the enable as it is now.
Examples
A Late Enable
en rises at tick 1 of a cycle.
No gclk in that cycle. A full pulse in ticks 0 and 1 of the next cycle.
The latch was closed when the enable arrived. It opens in the low phase and holds the value through the next high phase.
Requirements
- Use the published ports and widths. The checker and the DUT variants are owned by the judge.
- Do not add assumptions unless the statement explicitly asks for one. A passing assertion without a reachable trigger is insufficient.
Hints
Hint 1
Decide in which ticks the latch may take a new value of en.
Hint 2
Check your model on two cases: en rises at tick 1, and en falls at tick 1.
Hint 3
Use the latch model in the lab of F10.3.
Single clock, binary values, synchronous reset. The judge checks the pinned interface, reachability and the declared proof or bound. UNKNOWN, resource limits and timeouts remain inconclusive.
INCONCLUSIVE never counts as acceptance or a rated miss. Run previews the same checks that Submit uses.
More problems on this topic