diff options
author | whitequark <whitequark@whitequark.org> | 2021-01-25 10:36:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-25 10:36:07 +0000 |
commit | ffbd813a8c640f5653a0b8e9f54acbe398c2cf2e (patch) | |
tree | d980214299059206316ef11a904f050c15d0f1ed /tests | |
parent | 410ea422429aa31e5b5af7628d6126a3d3884512 (diff) | |
parent | 4fadcc8f25d5ef1e494aa7d5e49d893afdaa1705 (diff) | |
download | yosys-ffbd813a8c640f5653a0b8e9f54acbe398c2cf2e.tar.gz yosys-ffbd813a8c640f5653a0b8e9f54acbe398c2cf2e.tar.bz2 yosys-ffbd813a8c640f5653a0b8e9f54acbe398c2cf2e.zip |
Merge pull request #2550 from zachjs/macro-arg-spaces
verilog: allow spaces in macro arguments
Diffstat (limited to 'tests')
-rw-r--r-- | tests/simple/macro_arg_spaces.sv | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/simple/macro_arg_spaces.sv b/tests/simple/macro_arg_spaces.sv new file mode 100644 index 000000000..75c4cd136 --- /dev/null +++ b/tests/simple/macro_arg_spaces.sv @@ -0,0 +1,28 @@ +module top( + input wire [31:0] i, + output wire [31:0] x, y, z +); + +`define BAR(a) a +`define FOO(a = function automatic [31:0] f) a + +`BAR(function automatic [31:0] a); + input [31:0] i; + a = i * 2; +endfunction + +`FOO(); + input [31:0] i; + f = i * 3; +endfunction + +`FOO(function automatic [31:0] b); + input [31:0] i; + b = i * 5; +endfunction + +assign x = a(i); +assign y = f(i); +assign z = b(i); + +endmodule |