From 466301c9c921a36f43e3831a8fcb10a1784959fb Mon Sep 17 00:00:00 2001 From: damc Date: Tue, 26 Jul 2022 11:24:39 +0200 Subject: [PATCH] ppTests celldefine --- sv-parser-pp/src/preprocess.rs | 17 +++++++++++++++++ sv-parser-pp/testcases/celldefine.sv | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 sv-parser-pp/testcases/celldefine.sv diff --git a/sv-parser-pp/src/preprocess.rs b/sv-parser-pp/src/preprocess.rs index 8fea4d6..de326d1 100644 --- a/sv-parser-pp/src/preprocess.rs +++ b/sv-parser-pp/src/preprocess.rs @@ -1117,6 +1117,23 @@ mod tests { ); } // }}} + #[test] + fn celldefine() { // {{{ + let include_paths = [testfile_path("")]; + let (ret, _) = preprocess( + testfile_path("celldefine.sv"), + &HashMap::new(), + &include_paths, + false, + false, + ) + .unwrap(); + assert_eq!( + ret.text(), + testfile_contents("celldefine.sv") + ); + } // }}} + #[test] fn ifdef_nested() { // {{{ let (ret, _) = preprocess( diff --git a/sv-parser-pp/testcases/celldefine.sv b/sv-parser-pp/testcases/celldefine.sv new file mode 100644 index 0000000..779f8f7 --- /dev/null +++ b/sv-parser-pp/testcases/celldefine.sv @@ -0,0 +1,13 @@ +// IEEE1800-2017 Clause 22.10 +// The directives `celldefine and `endcelldefine tag modules as cell modules. +// Cells are used by certain PLI routines and may be useful for applications +// such as delay calculations. It is advisable to pair each `celldefine with an +// `endcelldefine, but it is not required. The latest occurrence of either +// directive in the source controls whether modules are tagged as cell modules. +// More than one of these pairs may appear in a single source description. +// These directives may appear anywhere in the source description, but it is +// recommended that the directives be specified outside any design elements. +// The `resetall directive includes the effects of a `endcelldefine directive. +`celldefine +`endcelldefine +// This file should be emitted from the preprocessor unchanged.