2015-07-28 09:23:31 +02:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Verilog Generation
|
|
|
|
#--------------------------------------------------------------------
|
2016-09-19 22:46:45 +02:00
|
|
|
firrtl = $(generated_dir)/$(long_name).fir
|
|
|
|
verilog = $(generated_dir)/$(long_name).v
|
|
|
|
|
2016-03-06 02:19:53 +01:00
|
|
|
# If I don't mark these as .SECONDARY then make will delete these internal
|
|
|
|
# files.
|
2016-09-19 22:46:45 +02:00
|
|
|
.SECONDARY: $(firrtl) $(verilog)
|
2016-09-15 02:33:39 +02:00
|
|
|
|
2017-02-03 04:24:55 +01:00
|
|
|
$(generated_dir)/%.fir $(generated_dir)/%.d: $(FIRRTL_JAR) $(chisel_srcs) $(bootrom_img)
|
2016-03-06 02:19:53 +01:00
|
|
|
mkdir -p $(dir $@)
|
2017-12-13 03:46:51 +01:00
|
|
|
cd $(base_dir) && $(SBT) "runMain $(PROJECT).Generator $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)"
|
2016-03-06 02:19:53 +01:00
|
|
|
|
2016-11-25 10:50:01 +01:00
|
|
|
$(generated_dir)/%.v $(generated_dir)/%.conf: $(generated_dir)/%.fir $(FIRRTL_JAR)
|
2016-03-06 02:19:53 +01:00
|
|
|
mkdir -p $(dir $@)
|
2018-03-07 19:22:38 +01:00
|
|
|
$(FIRRTL) -i $< -o $(generated_dir)/$*.v -X verilog --infer-rw $(MODEL) --repl-seq-mem -c:$(MODEL):-o:$(generated_dir)/$*.conf -faf $(generated_dir)/$*.anno.json
|
2016-09-06 23:48:28 +02:00
|
|
|
|
2016-09-19 22:23:17 +02:00
|
|
|
$(generated_dir)/$(long_name).behav_srams.v : $(generated_dir)/$(long_name).conf $(mem_gen)
|
2016-09-06 23:48:28 +02:00
|
|
|
cd $(generated_dir) && \
|
2016-08-24 21:52:24 +02:00
|
|
|
rm -f $@ && \
|
2016-09-19 22:23:17 +02:00
|
|
|
$(mem_gen) $(generated_dir)/$(long_name).conf >> $@.tmp && \
|
2016-08-24 21:52:24 +02:00
|
|
|
mv $@.tmp $@
|
2016-03-06 02:19:53 +01:00
|
|
|
|
2014-09-01 05:26:55 +02:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Run
|
|
|
|
#--------------------------------------------------------------------
|
2017-03-30 08:46:18 +02:00
|
|
|
.PRECIOUS: $(output_dir)/%.vpd
|
2014-09-01 05:26:55 +02:00
|
|
|
|
2016-08-16 07:03:03 +02:00
|
|
|
$(output_dir)/%.run: $(output_dir)/% $(simv)
|
2018-03-08 07:59:04 +01:00
|
|
|
cd $(sim_dir) && $(exec_simv) +permissive +max-cycles=$(timeout_cycles) +permissive-off $< 2> /dev/null 2> $@ && [ $$PIPESTATUS -eq 0 ]
|
2015-07-13 23:54:26 +02:00
|
|
|
|
2016-08-16 07:03:03 +02:00
|
|
|
$(output_dir)/%.out: $(output_dir)/% $(simv)
|
2018-03-08 07:59:04 +01:00
|
|
|
cd $(sim_dir) && $(exec_simv) +permissive +verbose +max-cycles=$(timeout_cycles) +permissive-off $< $(disasm) $@ && [ $$PIPESTATUS -eq 0 ]
|
2014-09-01 05:26:55 +02:00
|
|
|
|
2016-08-16 07:03:03 +02:00
|
|
|
$(output_dir)/%.vcd: $(output_dir)/% $(simv_debug)
|
2018-03-08 07:59:04 +01:00
|
|
|
cd $(sim_dir) && $(exec_simv_debug) +permissive +verbose +vcdfile=$@ +max-cycles=$(timeout_cycles) +permissive-off $< $(disasm) $(patsubst %.vcd,%.out,$@) && [ $$PIPESTATUS -eq 0 ]
|
2014-09-01 05:26:55 +02:00
|
|
|
|
2016-08-16 07:03:03 +02:00
|
|
|
$(output_dir)/%.vpd: $(output_dir)/% $(simv_debug)
|
2018-03-08 07:59:04 +01:00
|
|
|
cd $(sim_dir) && $(exec_simv_debug) +permissive +verbose +vcdplusfile=$@ +max-cycles=$(timeout_cycles) +permissive-off $< $(disasm) $(patsubst %.vpd,%.out,$@) && [ $$PIPESTATUS -eq 0 ]
|
2014-09-01 05:26:55 +02:00
|
|
|
|
2016-08-16 07:03:03 +02:00
|
|
|
$(output_dir)/%.saif: $(output_dir)/% $(simv_debug)
|
2018-03-08 07:59:04 +01:00
|
|
|
cd $(sim_dir) && rm -f $(output_dir)/pipe-$*.vcd && vcd2saif -input $(output_dir)/pipe-$*.vcd -pipe "$(exec_simv_debug) +permissive +verbose +vcdfile=$(output_dir)/pipe-$*.vcd +max-cycles=$(bmark_timeout_cycles) +permissive-off $<" -output $@ > $(patsubst %.saif,%.out,$@) 2>&1
|
2014-09-01 05:26:55 +02:00
|
|
|
|
2015-09-10 07:37:47 +02:00
|
|
|
run: run-asm-tests run-bmark-tests
|
|
|
|
run-debug: run-asm-tests-debug run-bmark-tests-debug
|
2015-07-13 23:54:26 +02:00
|
|
|
run-fast: run-asm-tests-fast run-bmark-tests-fast
|
2014-09-01 05:26:55 +02:00
|
|
|
|
2015-07-13 23:54:26 +02:00
|
|
|
.PHONY: run-asm-tests run-bmark-tests
|
|
|
|
.PHONY: run-asm-tests-debug run-bmark-tests-debug
|
|
|
|
.PHONY: run run-debug run-fast
|
2014-09-01 05:26:55 +02:00
|
|
|
|
|
|
|
junk += $(output_dir)
|