predefineSvCov Add simple testcase.

This commit is contained in:
damc 2022-11-08 20:25:30 +01:00
parent 6c28a6157d
commit 6b3b3ee903
3 changed files with 62 additions and 0 deletions

View File

@ -1135,6 +1135,16 @@ mod tests {
); );
} // }}} } // }}}
#[test]
#[ignore = "Coverage constants not implemented, yet."]
fn coverage_constants() { // {{{
let (ret, _) = preprocess_usualargs("coverage_constants.sv").unwrap();
assert_eq!(
ret.text(),
testfile_contents("expected/coverage_constants.sv")
);
} // }}}
#[test] #[test]
fn default_nettype() { // {{{ fn default_nettype() { // {{{
let (ret, _) = preprocess_usualargs("default_nettype.sv").unwrap(); let (ret, _) = preprocess_usualargs("default_nettype.sv").unwrap();

View File

@ -0,0 +1,26 @@
// IEEE1800-2017 Clause 40.3.1
// The following predefined `define macros represent basic real-time coverage
// capabilities accessible directly from SystemVerilog:
// Coverage control
localparam int SV_COV_START = `SV_COV_START; // 0
localparam int SV_COV_STOP = `SV_COV_STOP; // 1
localparam int SV_COV_RESET = `SV_COV_RESET; // 2
localparam int SV_COV_CHECK = `SV_COV_CHECK; // 3
// Scope definition (hierarchy traversal/accumulation type)
localparam int SV_COV_MODULE = `SV_COV_MODULE; // 10
localparam int SV_COV_HIER = `SV_COV_HIER; // 11
// Coverage type identification
localparam int SV_COV_ASSERTION = `SV_COV_ASSERTION; // 20
localparam int SV_COV_FSM_STATE = `SV_COV_FSM_STATE; // 21
localparam int SV_COV_STATEMENT = `SV_COV_STATEMENT; // 22
localparam int SV_COV_TOGGLE = `SV_COV_TOGGLE; // 23
// Status results
localparam int SV_COV_OVERFLOW = `SV_COV_OVERFLOW; // -2
localparam int SV_COV_ERROR = `SV_COV_ERROR; // -1
localparam int SV_COV_NOCOV = `SV_COV_NOCOV; // 0
localparam int SV_COV_OK = `SV_COV_OK; // 1
localparam int SV_COV_PARTIAL = `SV_COV_PARTIAL; // 2

View File

@ -0,0 +1,26 @@
// IEEE1800-2017 Clause 40.3.1
// The following predefined `define macros represent basic real-time coverage
// capabilities accessible directly from SystemVerilog:
// Coverage control
localparam int SV_COV_START = 0; // 0
localparam int SV_COV_STOP = 1; // 1
localparam int SV_COV_RESET = 2; // 2
localparam int SV_COV_CHECK = 3; // 3
// Scope definition (hierarchy traversal/accumulation type)
localparam int SV_COV_MODULE = 10; // 10
localparam int SV_COV_HIER = 11; // 11
// Coverage type identification
localparam int SV_COV_ASSERTION = 20; // 20
localparam int SV_COV_FSM_STATE = 21; // 21
localparam int SV_COV_STATEMENT = 22; // 22
localparam int SV_COV_TOGGLE = 23; // 23
// Status results
localparam int SV_COV_OVERFLOW = -2; // -2
localparam int SV_COV_ERROR = -1; // -1
localparam int SV_COV_NOCOV = 0; // 0
localparam int SV_COV_OK = 1; // 1
localparam int SV_COV_PARTIAL = 2; // 2