-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Included new file gpio_cover.cfg to add the gpio_straps_if cover assertions in the database - Added the configuration file above into the gpio_sim_cfg.hjson - Included the commit from PR: 25868 about straps verification, from this point, only needs to review these files: - new file: hw/ip/gpio/dv/cov/gpio_cover.cfg - modified: hw/ip/gpio/dv/gpio_sim_cfg.hjson (Inclusion about the gpio_cover.cfg) - modified: hw/ip/gpio/dv/env/gpio_env_cov.sv - new file: hw/ip/gpio/dv/interfaces/gpio_straps_if.sv (New cover properties included) Signed-off-by: Marcelo Carvalho Faleiro de Almeida <[email protected]>
- Loading branch information
1 parent
29d7b87
commit 85ab23a
Showing
6 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright lowRISC contributors (OpenTitan project). | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Enables the coverage for gpio_straps_if cover assertions. | ||
+module gpio_straps_if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CAPI=2: | ||
# Copyright lowRISC contributors (OpenTitan project). | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
name: "lowrisc:dv:gpio_if:0.1" | ||
description: "GPIO Interfaces" | ||
filesets: | ||
files_dv: | ||
depend: | ||
- lowrisc:ip:gpio:0.1 | ||
files: | ||
- gpio_straps_if.sv | ||
file_type: systemVerilogSource | ||
|
||
targets: | ||
default: | ||
filesets: | ||
- files_dv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright lowRISC contributors (OpenTitan project). | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// interface : gpio_straps_if | ||
`ifndef GPIO_STRAPS_IF_SV | ||
`define GPIO_STRAPS_IF_SV | ||
|
||
import gpio_pkg::*; | ||
|
||
// Interface definition | ||
interface gpio_straps_if(); | ||
|
||
logic clk; | ||
logic rst_n; | ||
logic strap_en; // Signal to enable straps | ||
gpio_straps_t sampled_straps; // Sampled gpio_i snapshot data from GPIO (DUT) | ||
|
||
modport straps_port_in(input clk, | ||
input rst_n, | ||
input strap_en, | ||
output sampled_straps); | ||
|
||
modport straps_port_out(output clk, | ||
output rst_n, | ||
output strap_en, | ||
input sampled_straps); | ||
|
||
// Sequence to capture the timing relationship between strap_en and strap_data | ||
sequence strap_data_timing_seq; | ||
@(posedge clk) strap_en ##1 sampled_straps.data; | ||
endsequence | ||
|
||
// Property for the strap_data timing | ||
property strap_data_timing_prop; | ||
strap_data_timing_seq; | ||
endproperty | ||
|
||
// Cover the property | ||
COV_STRAP_DATA_TIMING: cover property (strap_data_timing_prop); | ||
|
||
// Sequence to capture the timing relationship between rst_n and strap_en | ||
sequence reset_timing_seq; | ||
@(posedge clk) rst_n ##1 strap_en; | ||
endsequence | ||
|
||
// Property for the reset timing | ||
property reset_timing_prop; | ||
reset_timing_seq; | ||
endproperty | ||
|
||
// Cover the property | ||
COV_STRAP_RST_TIMING: cover property (reset_timing_prop); | ||
|
||
// Additional checks for early strap_en | ||
property strap_en_too_early_prop; | ||
@(posedge clk) rst_n ##[1:$] strap_en; | ||
endproperty | ||
|
||
COV_STRAP_EN_TIMING: cover property (strap_en_too_early_prop); | ||
|
||
endinterface : gpio_straps_if | ||
|
||
`endif // GPIO_STRAPS_IF_SV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters