mirror of
https://github.com/YosysHQ/yosys
synced 2025-12-31 08:19:55 +00:00
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. |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| abc9.v | ||
| abc9.ys | ||
| async.sh | ||
| async.v | ||
| attrib05_port_conn.v | ||
| attrib05_port_conn.ys | ||
| attrib07_func_call.v | ||
| attrib07_func_call.ys | ||
| autoname.ys | ||
| bug1496.ys | ||
| bug1531.ys | ||
| bug1614.ys | ||
| bug1710.ys | ||
| bug1745.ys | ||
| bug1781.ys | ||
| chparam.sh | ||
| constcomment.ys | ||
| constmsk_test.v | ||
| constmsk_test.ys | ||
| constmsk_testmap.v | ||
| deminout_unused.ys | ||
| elab_sys_tasks.sv | ||
| elab_sys_tasks.ys | ||
| equiv_opt_multiclock.ys | ||
| exec.ys | ||
| gzip_verilog.v.gz | ||
| gzip_verilog.ys | ||
| help.ys | ||
| hierarchy.sh | ||
| hierarchy_defer.ys | ||
| ice40_mince_abc9.ys | ||
| logger_error.ys | ||
| logger_nowarning.ys | ||
| logger_warn.ys | ||
| logger_warning.ys | ||
| mem2reg.ys | ||
| muxcover.ys | ||
| muxpack.v | ||
| muxpack.ys | ||
| peepopt.ys | ||
| pmgen_reduce.ys | ||
| pmux2shiftx.v | ||
| pmux2shiftx.ys | ||
| reg_wire_error.sv | ||
| reg_wire_error.ys | ||
| run-test.sh | ||
| scratchpad.ys | ||
| script.ys | ||
| sformatf.ys | ||
| shregmap.v | ||
| shregmap.ys | ||
| signext.ys | ||
| specify.v | ||
| specify.ys | ||
| src.ys | ||
| submod.ys | ||
| submod_extract.ys | ||
| sv_defines.ys | ||
| sv_defines_dup.ys | ||
| sv_defines_mismatch.ys | ||
| sv_defines_too_few.ys | ||
| sv_implicit_ports.sh | ||
| svalways.sh | ||
| wreduce.ys | ||
| write_gzip.ys | ||