Unverified Commit f5d61ee3 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub
Browse files

Don't toggle top.cpp clock and reset on same cycle (#1820) (#1823)



Change top.cpp to deassert reset one time unit before the clock asserts.
This avoids a Verilator simultation issue in top.cpp where the eval()
function is only called once per simultation loop.  If the clock and
reset are both changed and eval() is only called once, then any
combinational update due to a change in reset is not visible to the
sequential logic.  This avoids issues where the downstream compilation
utilities move synchronous reset logic outside of an always block that
describes a synchronous reset flip flop.

Reset now deasserts on time unit 10 and the clock ticks on time unit
11.

h/t @albert-magyar

Signed-off-by: default avatarSchuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit ac094a5e

)

Co-authored-by: default avatarSchuyler Eldridge <schuyler.eldridge@sifive.com>
parent 3f987c97
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment