Files

9 lines
487 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 期望:编译通过;VAR_TEMP 每周期重置,VAR 跨周期持久
- FB Foo`tmp`VAR_TEMP 初值 100)每周期重置 → `tmp := tmp + 1` 恒为 101
`persist`VAR)跨周期累积 1、2、3…
`out = tmp * 100 + persist` = 10101、10102、10103…
- MAIN`t`(VAR_TEMP 初值 5)每周期重置 → `t := t + 1` 恒为 6
- 全局 `a = f.out + t`:周期 1/2/3 = 10107 / 10108 / 10109(差 1 仅来自 persist
tmp 与 t 若不重置则偏差 100 / 1)