B-Lang-org/bsc

bsc does not update generated verilog/sim when BSV preprocessor macros changed

開放

#290 建立於 2021年1月8日

 (1 則留言) (0 個反應) (0 位負責人)Haskell (178 個分叉)batch import
good first issue

倉庫指標

星標
 (1,108 顆星)
PR 合併指標
 (平均合併 17天 1小時) (30 天內合併 18 個 PR)

描述

package A;

module mkA();
`ifdef MY_MACRO
// behavior 1
rule behavior_1;
$display("behavior 1");
endrule
`else
// behavior 2
rule behavior_2;
$display("behavior 2");
endrule
`endif
endmodule
endpackage

If I first run

bsc -verilog -g mkA -D MY_MACRO  A.bsv

the generated verilog is based on the code in "behavior 1" block. But then, if I subsequently run:

bsc -u -verilog -g mkA A.bsv

The module is not recompiled and the Verilog is still based on "behavior 1" block. I expect bsc to analyze the module again and re-generate the verilog based on "behavior 2".

I need to manually remove the .bo files and rerun bsc to get the expected behavior.

貢獻者指南