VCS ——Makfile脚本的书写

1 .创建 makefile 脚本

在相应目录下,创建一个Makefile脚本文件:

touch Makefile

2. 用gvim编辑器书写Makefile脚本

gvim Makefile
.PHONY:com sim dve clean

#------------define name--------------------
OUTPUT=sim_fsm_moore
ALL_DEFINE= +define+DUMP_VPD

#-------------vpd name----------------------
VPD_NAME= +vpdfile+$(OUTPUT).vpd

#-------------complie command switch---------------
VCS = vcs -full64		
	-sverilog     		
    -f file_path.list	
	+v2k			    
	$(ALL_DEFINE)		
	$(VPD_NAME)		    
    -debug_all		    
	-timescale=1ns/1ps	
	-o $(OUTPUT)		
    -l com.log		


#--------------Simulation command switch-----------
SIM = ./$(OUTPUT)  		
      $(VPD_NAME)		
      -l $(OUTPUT).log

#--------------DVE command switch-----------------
DVE = dve -vpd $(OUTPUT).vpd &

# --------------Start complie----------------------
com :
	$(VCS) 


#---------------Start simulation------------------
sim :
	$(SIM)

#---------------Start DVE-------------------------
dve :
	$(DVE)

#---------------Start clean----------------------
clean: 
	rm -rf ./csrc *.daidir *.log *.vpd *.vdb simv* *.key *race.out* ./DVE*
经验分享 程序员 微信小程序 职场和发展