yosys/kernel
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
..
bitpattern.h Removed unnecessary cast. 2015-09-01 12:40:36 +02:00
calc.cc Fix mingw compile issue (2nd attempt) 2017-02-23 14:21:02 +01:00
cellaigs.cc Use more ID::{A,B,Y,blackbox,whitebox} 2019-08-15 14:50:10 -07:00
cellaigs.h Fixed trailing whitespaces 2015-07-02 11:14:30 +02:00
celledges.cc Use more ID::{A,B,Y,blackbox,whitebox} 2019-08-15 14:50:10 -07:00
celledges.h Consistent use of 'override' for virtual methods in derived classes. 2018-07-20 23:51:06 -07:00
celltypes.h Use more ID::{A,B,Y,blackbox,whitebox} 2019-08-15 14:50:10 -07:00
consteval.h Revert "SigSet<Cell*> to use stable compare class" 2019-09-13 09:49:15 -07:00
cost.h Use ID() in kernel/*, add simple ID:: hack (to be improved upon later) 2019-08-11 11:39:46 +02:00
driver.cc Add YS_ prefix to macros, add explanation and apply to older version as well 2020-03-13 17:19:54 +01:00
hashlib.h Add hashlib "<container>::element(int n)" methods 2019-03-14 22:04:42 +01:00
log.cc Add YS_ prefix to macros, add explanation and apply to older version as well 2020-03-13 17:19:54 +01:00
log.h exclude clang from checking 2020-03-13 17:23:27 +01:00
macc.h Use more ID::{A,B,Y,blackbox,whitebox} 2019-08-15 14:50:10 -07:00
modtools.h Consistent use of 'override' for virtual methods in derived classes. 2018-07-20 23:51:06 -07:00
register.cc Add ScriptPass::run_nocheck and use for abc9 2020-03-09 14:34:22 +00:00
register.h Add ScriptPass::run_nocheck and use for abc9 2020-03-09 14:34:22 +00:00
rtlil.cc Add support for SystemVerilog-style `define to Verilog frontend 2020-03-27 16:08:26 +00:00
rtlil.h Add support for SystemVerilog-style `define to Verilog frontend 2020-03-27 16:08:26 +00:00
satgen.h Use more ID::{A,B,Y,blackbox,whitebox} 2019-08-15 14:50:10 -07:00
sigtools.h Spacing 2019-09-13 16:30:44 -07:00
timinginfo.h Small fixes 2020-02-27 10:29:53 -08:00
utils.h Fixed trailing whitespaces 2015-07-02 11:14:30 +02:00
yosys.cc Update Copyright 2020-03-16 16:28:25 +01:00
yosys.h log_dump() to support State enum 2019-10-02 17:49:07 -07:00