Derivgen.pl produces incorrect derived config files when changed parameter is a substring of other parameters
Created by: jordancarlin
While working on #840 (closed), I created a derived config with the following parameters:
deriv noS_rv32gc rv32gc
S_SUPPORTED 0
SSTC_SUPPORTED 0
VIRTMEM_SUPPORTED 0
SVINVAL_SUPPORTED 0
SVADU_SUPPORTED 0
Unexpectedly, this caused the produced configuration to set several other parameters to 0 as well. In addition to the expected ones, it also set ZBS_SUPPORTED
, BUS_SUPPORTED
, and VECTORED_INTERRUPTS_SUPPORTED
to 0.
Turning on the debugging print line, we can see that these all matched with S_SUPPORTED
Hit: new line in /home/jcarlin/cvw/config/deriv/noS_rv32gc/config.vh for S_SUPPORTED is localparam logic S_SUPPORTED = 0; // Supervisor mode
Hit: new line in /home/jcarlin/cvw/config/deriv/noS_rv32gc/config.vh for SSTC_SUPPORTED is localparam logic SSTC_SUPPORTED = 0; // Supervisor-mode timer interrupts
Hit: new line in /home/jcarlin/cvw/config/deriv/noS_rv32gc/config.vh for SVINVAL_SUPPORTED is localparam logic SVINVAL_SUPPORTED = 0;
Hit: new line in /home/jcarlin/cvw/config/deriv/noS_rv32gc/config.vh for SVADU_SUPPORTED is localparam logic SVADU_SUPPORTED = 0;
Hit: new line in /home/jcarlin/cvw/config/deriv/noS_rv32gc/config.vh for S_SUPPORTED is localparam logic BUS_SUPPORTED = 0;
Hit: new line in /home/jcarlin/cvw/config/deriv/noS_rv32gc/config.vh for VIRTMEM_SUPPORTED is localparam logic VIRTMEM_SUPPORTED = 0;
Hit: new line in /home/jcarlin/cvw/config/deriv/noS_rv32gc/config.vh for S_SUPPORTED is localparam logic VECTORED_INTERRUPTS_SUPPORTED = 0;
Seeing as all of the incorrectly set parameters end with S_SUPPORTED
(ZBS_SUPPORTED), I assume the script is simply finding the matching substring while missing the rest of the string before it.