# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

set workroot [file dirname [info script]]

send_msg "Designcheck 1-1" INFO "Checking design"

# Ensure the design meets timing
set slack_ns [get_property SLACK [get_timing_paths -delay_type min_max]]
send_msg "Designcheck 1-2" INFO "Slack is ${slack_ns} ns."

if [expr {$slack_ns < 0}] {
  send_msg "Designcheck 1-3" ERROR "Timing failed. Slack is ${slack_ns} ns."
}

# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

set workroot [file dirname [info script]]

send_msg "Designcheck 1-1" INFO "Checking design"

# Ensure the design meets timing
set slack_ns [get_property SLACK [get_timing_paths -delay_type min_max]]
send_msg "Designcheck 1-2" INFO "Slack is ${slack_ns} ns."

if [expr {$slack_ns < 0}] {
  # TODO: Make this check an ERROR again as soon as we have fixed our timing,
  # see https://github.com/lowRISC/opentitan/issues/2508.
  send_msg "Designcheck 1-3" WARNING "Timing failed. Slack is ${slack_ns} ns."
}

Create bitstreams with failing timing
[top_earlgrey] Create bitstreams with failing timing

We currently check for timing failures before creating a bitstream,
which is a good thing (TM). However, currently the FPGA design fails
timing. To buy us time investigating the best mitigation for that we
allow the design to fail timing.

Tracked in #2508

Signed-off-by: Philipp Wagner <5a4b10454c30419e54a1570be358a516ff84bb63@lowrisc.org>
