Future Global-Clock Functions
Read the value of the next global tick with $future_gclk, $rising_gclk, $falling_gclk, $steady_gclk and $changing_gclk, and know where they are illegal.
You Will Be Able To
- Predict the five future functions on a trace, and when the action block runs.
- Write a rule that is decided at the tick before a change.
- Name the places where a future function is illegal.
- Tell the standard's behaviour from what Verilator 5.052 prints.
- Lesson
- A6.4
- Time
- 25 min
- Runs on
- Verilator
- Check
- 5 questions
A rule from a clock-gating spec: sig may change only together with a falling edge of clk. Written with the past functions, it is checked one global tick after the change. The future functions state it at the tick before the change, which reads closer to the spec.
At each tick, a future function reads the sample of the next global tick. At the last tick of a run there is no next tick yet.
$future_gclk: The Value at the Next Global Tick
$future_gclk(v) is the sampled value of v at the next global tick. The other four future functions are built on it.
The attempt is still decided at its own tick, as if the future value were known. The tool can only know it one tick later, so the action block waits for the next global tick.
- Clock / reset
- Step
- Data
- Control
- The attempt before
The attempt at 15 sees 1 now and 2 at 25. It passes.
- The attempt
At 25 the attempt sees
inchigh andcntat 2. It needs the sample ofcntat 35. - The future sample
At 35
cntis still 2, not 3. The attempt that started at 25 fails, and its failure time is 25. - The action block
The action block runs at 35, so
$timein it prints 35.
Read the diagram as text
- tick 15: inc = 1, cnt = 1: passes at 25
- tick 25: inc = 1, cnt = 2
- tick 35: cnt = 2 (expected 3)
- action block: runs at 35
- tick 25 → tick 35: reads the future sample
- tick 35 → action block: verdict known
IEEE 1800-2023 16.9.4. With a future function, the action block runs at the global tick after the attempt.
$rising_gclk: Bit 0 Will Go to 1
$rising_gclk(v) is true when bit 0 of v changes to 1 at the next global tick. It is $rose moved one tick earlier.
Use it when a condition must hold at the tick before a rise. For example, "a request may rise only while the block is not busy" checks busy before the rise.
Past form
assert property (@($global_clock)
$rose(req) |-> !$past(busy));
Waits for the tick that sees the rise, then looks back at busy.
Future form
assert property (@($global_clock)
$rising_gclk(req) |-> !busy);
Decided at the tick before the rise. busy is read at its own tick.
$falling_gclk: Bit 0 Will Go to 0
$falling_gclk(v) is true when bit 0 of v changes to 0 at the next global tick. Like $fell, it ignores every other bit.
$steady_gclk: The Same Value at the Next Tick
$steady_gclk(v) is true when the sampled value of v at the next global tick equals the value now. The standard compares the whole expression, every bit.
Standard (IEEE 1800-2023 16.9.4)
// data goes from 4 to 6
$steady_gclk(data) // false
$changing_gclk(data) // true
The whole value is compared. 4 and 6 differ.
Verilator 5.052 (measured)
// data goes from 4 to 6
$steady_gclk(data) // true
$changing_gclk(data) // false
Only bit 0 is compared, and bit 0 stays 0. Use these two functions on one-bit signals here.
$changing_gclk: The Value Will Change
$changing_gclk(v) is !$steady_gclk(v). It makes a natural trigger: "if sig is about to change, clk is about to fall".
Where a Future Function Is Illegal
A future function may appear only inside a sequence or property expression of a concurrent assertion. Two more rules: no nesting, and no assertion that also has a sequence match item.
| Use | Standard | Verilator 5.052 (measured) |
|---|---|---|
always @(posedge sys) y <= $future_gclk(x); | illegal: procedural code | compile error |
else $display("%0d", $rising_gclk(x)); | illegal: action block | compile error |
disable iff ($rising_gclk(x)) | illegal: not a sequence or property expression | accepted on the global clock |
$future_gclk(y && $rising_gclk(x)) | illegal: nested | accepted |
(x, note()) |-> $rising_gclk(y) | illegal: a sequence match item | accepted |
x |=> $future_gclk(y) | legal | accepted |
$rising_gclk(a) |-> $falling_gclk(b) | legal: two calls, neither inside the other | accepted |
IEEE 1800-2023 16.9.4. The tool column was measured on 2026-11-12 (tools/probes/sva-w1b/departures.mjs).
A sequence match item is the list after a comma inside a sequence: (x, v = d) or (x, note()). The implication |=> is not one, so x |=> $future_gclk(y) is legal.
The past functions have none of these limits. $past_gclk and the others work in procedural code and in action blocks.
Where the Tool and the Standard Part
Verilator 5.052 gets the future functions right in one setting: an assertion clocked by the global clock itself. There, $steady_gclk and $changing_gclk still need one-bit signals. Every example in this lesson stays in that setting.
$future_gclk(d) in an assertion on a slow clockStandard behaviour, derived by hand from IEEE 1800-2023 16.9.4 (docs/sva-standard-traces, sva-155b). The last row was measured: Verilator 5.052 reads the sample at the assertion's own edge.
| Case | Standard | Verilator 5.052 (measured) |
|---|---|---|
| an assertion on a clock slower than the global clock | the next global tick's sample; the action runs at that tick | the sample at the assertion's own edge; the action runs at once |
$steady_gclk or $changing_gclk of a vector | every bit counts | bit 0 only |
$future_gclk(d) == d at the first tick | no extra report | one extra failure at the first global tick |
tools/probes/sva-w1b/departures.mjs measures each row.
Try It
The two rules print at the same times, but they fail in different attempts. The future rule fails at 35 and 105, the ticks before each bad change. Its action waits one tick.
The past rule must compare with a previous tick. At the very first tick it compares with the declared value. The future rule has no such corner. Move sig = 1 to #18 and predict both outputs.
t=45 fut: sig changes with no falling clk t=45 past: sig changed with no falling clk t=115 fut: sig changes with no falling clk t=115 past: sig changed with no falling clkCheck Yourself
Common Mistakes
Wrong Read the time printed by the action block as the time of the failing attempt.
An assertion with a future function runs its action one global tick after the attempt.
Fix Subtract one global tick to find the attempt, or print $past_gclk values to see what it saw.
Wrong Mix a future trigger with a past check in one rule.
They read different ticks, so the rule compares the wrong pair of samples.
Fix Use a future function on both sides, or a past function on both sides.
$changing_gclk(sig) |-> $fell_gclk(clk)$changing_gclk(sig) |-> $falling_gclk(clk)Wrong Call $rising_gclk in an action block or a disable iff to report what comes next.
Future functions are legal only in sequence and property expressions; some tools still accept these uses.
Fix Report with $past_gclk and $sampled in the action block, which runs at the next tick anyway.
Remember
- The five future functions read the sample at the next global tick.
- An attempt is decided at its own tick; its action block runs one global tick later.
$rising_gclkand$falling_gclkread bit 0;$steady_gclkand$changing_gclkread the whole value.- Future functions belong only in sequence and property expressions, never nested or with match items.
- On Verilator 5.052, clock such assertions by the global clock and use one-bit signals with steady and changing.