tb_dir:=				../../tb
tb_file:=				../../tb/tb.v

top_module:=			tb
wave_file:=				verilog.fsdb
compile_flag:=			-l compile.log									\
						-R -full64 -fsdb									\
						-v2005 +v2k -sverilog +systemverilogext+sv		\
						-lca -debug_all	-kdb							\
						-LDFLAGS -Wl,-E 								\
						+vcs+lic+wait +notimingchecks 					\
						+define+DUMP_ENABLE								\
						-v ../../tb/prim_sim.v			\



verdi_flag:=			+v2k -sverilog +systemverilogext+sv 			\
						+define+DUMP_ENABLE								\
						-v ../../tb/prim_sim.v

vcs:
	vcs		\
	$(compile_flag)		\
	$(tb_file)			\
	../../project/src/riscv_ae250/riscv_ae250.vo		\
	../../project/src/riscv_ae250/demo.v 				\
	-top $(top_module)					

revcs: rm-vcs vcs

vd:
	verdi 				\
	$(verdi_flag)		\
	$(tb_file)			\
	../../project/src/riscv_ae250/riscv_ae250.vo		\
	../../project/src/riscv_ae250/demo.v 				\
	-top $(top_module)	\
	-ssf $(wave_file)	\
	&
revd: rm-vd vd


rm-log:
	rm -rf *.log
rm-vcs:
	rm -rf simv.daidir simv csrc flist.txt $(swMem)
rm-vd:
	rm -rf flist.txt verdiLog novas_dump.log
clean: rm-log rm-vcs rm-vd
	rm -rf novas.conf novas.rc ucli.key verilog.fsdb
	