diff --git a/sv-parser-pp/src/preprocess.rs b/sv-parser-pp/src/preprocess.rs index e0a6c99..92f4b5c 100644 --- a/sv-parser-pp/src/preprocess.rs +++ b/sv-parser-pp/src/preprocess.rs @@ -1550,4 +1550,21 @@ mod tests { testfile_contents("timescale.sv") ); } // }}} + + #[test] + fn unconnected_drive() { // {{{ + let include_paths = [testfile_path("")]; + let (ret, _) = preprocess( + testfile_path("unconnected_drive.sv"), + &HashMap::new(), + &include_paths, + false, + false, + ) + .unwrap(); + assert_eq!( + ret.text(), + testfile_contents("unconnected_drive.sv") + ); + } // }}} } diff --git a/sv-parser-pp/testcases/unconnected_drive.sv b/sv-parser-pp/testcases/unconnected_drive.sv new file mode 100644 index 0000000..e48f549 --- /dev/null +++ b/sv-parser-pp/testcases/unconnected_drive.sv @@ -0,0 +1,13 @@ +// IEEE1800-2017 Clause 22.9 +// The directive `unconnected_drive takes one of two arguments - pull1 or +// pull 0. When pull1 is specified, unconnected ports are pulled down. It is +// advisable to pair each `unconnected_drive with a +// `nounconnected_drive, but it is not required. The latest occurrence of +// either directive in the source controls what happens to unconnected ports. +// These directives shall be specified outside the design element declarations. +// The `resetall directive includes the effects of a `nounconnected +// directive. +`unconnected_drive pull0 +`unconnected_drive pull1 +`nounconnected_drive +// This file should be emitted from the preprocessor unchanged.