From e95fe646a31805d00baa612f904f38fbe0d57476 Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Wed, 24 Aug 2016 12:52:24 -0700 Subject: [PATCH] mem_gen failure doesn't create the target --- vsim/Makefrag-verilog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vsim/Makefrag-verilog b/vsim/Makefrag-verilog index add63f01..349b1e3b 100644 --- a/vsim/Makefrag-verilog +++ b/vsim/Makefrag-verilog @@ -13,9 +13,11 @@ $(generated_dir)/%.v $(generated_dir)/%.conf : $(generated_dir)/%.fir $(FIRRTL_J mkdir -p $(dir $@) $(FIRRTL) -i $< -o $@ -X verilog --replSeqMem -c:$(MODEL):-o:$(generated_dir)/$(MODEL).$(CONFIG).conf -$(generated_dir)/$(MODEL).$(CONFIG).behav_srams.v : $(generated_dir)/$(MODEL).$(CONFIG).v $(generated_dir)/$(MODEL).$(CONFIG).conf $(mem_gen) +$(generated_dir)/$(MODEL).$(CONFIG).behav_srams.v : $(generated_dir)/$(MODEL).$(CONFIG).conf $(mem_gen) cd $(generated_dir) && \ - $(mem_gen) $(generated_dir)/$(MODEL).$(CONFIG).conf >> $@ + rm -f $@ && \ + $(mem_gen) $(generated_dir)/$(MODEL).$(CONFIG).conf >> $@.tmp && \ + mv $@.tmp $@ $(generated_dir)/consts.$(CONFIG).vh: $(generated_dir)/$(MODEL).$(CONFIG).prm echo "\`ifndef CONST_VH" > $@