From 921064c20044f72a64bec12dbd73103bdd3f45e3 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 18 Dec 2013 13:21:02 +0100 Subject: Added support for macro arguments --- tests/simple/macros.v | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/simple/macros.v (limited to 'tests/simple/macros.v') diff --git a/tests/simple/macros.v b/tests/simple/macros.v new file mode 100644 index 00000000..e2025717 --- /dev/null +++ b/tests/simple/macros.v @@ -0,0 +1,9 @@ +module test(a, y); +`define MSB_LSB_SEP : +`define get_msb(off, len) ((off)+(len)-1) +`define get_lsb(off, len) (off) +`define sel_bits(offset, len) `get_msb(offset, len) `MSB_LSB_SEP `get_lsb(offset, len) +input [31:0] a; +output [7:0] y; +assign y = a[`sel_bits(16, 8)]; +endmodule -- cgit v1.2.3