1
0
mirror of synced 2026-01-22 02:36:00 +00:00
Rupert Swarbrick 044ca9dde4 Add support for SystemVerilog-style `define to Verilog frontend
This patch should support things like

  `define foo(a, b = 3, c)   a+b+c

  `foo(1, ,2)

which will evaluate to 1+3+2. It also spots mistakes like

  `foo(1)

(the 3rd argument doesn't have a default value, so a call site is
required to set it).

Most of the patch is a simple parser for the format in preproc.cc, but
I've also taken the opportunity to wrap up the "name -> definition"
map in a type, rather than use multiple std::map's.

Since this type needs to be visible to code that touches defines, I've
pulled it (and the frontend_verilog_preproc declaration) out into a
new file at frontends/verilog/preproc.h and included that where
necessary.

Finally, the patch adds a few tests in tests/various to check that we
are parsing everything correctly.
2020-03-27 16:08:26 +00:00
..
2019-11-21 16:33:20 -08:00
2019-07-09 22:44:39 +02:00
2019-11-18 04:16:48 +01:00
2019-12-11 16:52:37 -08:00
2020-02-03 21:29:54 +01:00
2019-05-06 16:03:15 +02:00
2020-03-16 07:52:58 +00:00
2019-04-21 11:40:20 +02:00
2020-03-13 15:00:18 +01:00
2020-03-13 15:00:18 +01:00
2020-03-13 15:00:18 +01:00
2019-06-27 11:20:15 -07:00
2019-06-21 12:31:04 -07:00
2020-02-27 10:17:29 -08:00
2019-06-27 11:02:52 -07:00
2019-06-12 08:34:06 -07:00
2019-08-22 16:18:07 -07:00
2019-06-20 12:43:59 -07:00
2020-03-11 06:51:03 -07:00
2019-12-30 14:56:14 -08:00
2019-11-21 21:06:28 +00:00