From f76f9bb88b147ce708bc9cb825c9a3cbce0997ea Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Fri, 19 Apr 2019 14:31:21 -0400 Subject: [PATCH] added test coverage for task and function bodies being one statement --- test/basic/tf_block.sv | 14 ++++++++++++++ test/basic/tf_block.v | 15 +++++++++++++++ test/basic/tf_block_tb.v | 1 + 3 files changed, 30 insertions(+) create mode 100644 test/basic/tf_block.sv create mode 100644 test/basic/tf_block.v create mode 100644 test/basic/tf_block_tb.v diff --git a/test/basic/tf_block.sv b/test/basic/tf_block.sv new file mode 100644 index 0000000..f76e3fd --- /dev/null +++ b/test/basic/tf_block.sv @@ -0,0 +1,14 @@ +module top; + function [2:0] f; + input [2:0] n; + n += 1; + return n + 3; + endfunction + task t; + $display("hello"); + $display("world"); + endtask + initial t(); + initial $display("f(0) = ", f(0)); + initial $display("f(1) = ", f(1)); +endmodule diff --git a/test/basic/tf_block.v b/test/basic/tf_block.v new file mode 100644 index 0000000..d8a3569 --- /dev/null +++ b/test/basic/tf_block.v @@ -0,0 +1,15 @@ +module top; + function [2:0] f; + input [2:0] n; + f = n + 4; + endfunction + task t; + begin + $display("hello"); + $display("world"); + end + endtask + initial t(); + initial $display("f(0) = ", f(0)); + initial $display("f(1) = ", f(1)); +endmodule diff --git a/test/basic/tf_block_tb.v b/test/basic/tf_block_tb.v new file mode 100644 index 0000000..d11c69f --- /dev/null +++ b/test/basic/tf_block_tb.v @@ -0,0 +1 @@ +// intentionally empty