-
Notifications
You must be signed in to change notification settings - Fork 32
/
makefile
150 lines (129 loc) · 4.95 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
###########################################################################
# Makefile Created By Dr. Rashed Z. Bhatti #
# Date Created 10/18/2007 #
# Last Modified 10/18/2007 #
###########################################################################
# This is a general purpose makefile to compile and run #
# Cadence NCSIM simulations #
# #
# To compile #
# ---------- #
# %> make #
# #
# To run simulation in console mode #
# --------------------------------- #
# %> make sim #
# #
# To run simulation in gui mode #
# ----------------------------- #
# %> make simg #
# #
# Directory Stucture #
# ------------------ #
# This makefile assumes the following directory structure : #
# #
# ./ -- current directory, simulation is going to run from here #
# ./work -- Cadence work library to compile the design #
# ./design -- holds all design verilog files #
# ./tb -- holds testbench file(s) #
# ./include -- files included in the verilog files using include command #
# ./scripts -- holds tcl run scripts for simulation control #
# ./etc -- keep all auxiliary files in this directory #
# #
###########################################################################
#
# Setup environment variables to point the Cadence instal directories
# and license files etc
# source ~ee577/vlsi_tools.csh
# top level module
TOP = tb
# List of the design files
DESIGN_FILES = ./design/*.v
# List of the testbench files
TB_FILES = ./tb/*.v
INCLUDE_DIRECTORY = ./include
# GUI simulation script file
SIM_SCRIPT_FILE_GUI = ./scripts/runscript.tcl
# Non GUI simulation script file
SIM_SCRIPT_FILE_NO_GUI = ./scripts/runscript_nogui.tcl
# ncvlog switch
NCVLOG_SWITCHES = \
-STATUS \
-MESSAGES \
-UPDATE \
-INCDIR $(INCLUDE_DIRECTORY)
#ncelab switches
NCELAB_SWITCHES = \
-ACCESS +rwc \
-NCFATAL INVSUP \
-NCFATAL CUNOTB \
-ERRORMAX 5 \
-UPDATE \
-MESSAGES \
-loadpli $(DENALI)/verilog/libdenpli.so:den_PLIPtr \
-loadpli1 $(PWD)/fileio.so:bstrap \
-TIMESCALE '1ps/1ps' \
-LIBVERBOSE
# ncsim simulation switches for console simulation
NCSIM_SWITCHES_NO_GUI = \
-STATUS \
-NOCOPYRIGHT \
-MESSAGES \
-NCFATAL INVSUP \
-NOWARN DLBRLK \
-TCL \
-NOLOG \
-NOKEY \
-INPUT $(SIM_SCRIPT_FILE_NO_GUI)
# ncsim switches for GUI simulations
NCSIM_SWITCHES_GUI = \
-STATUS \
-NOCOPYRIGHT \
-MESSAGES \
-NCFATAL INVSUP \
-NOWARN DLBRLK \
-TCL \
-NOLOG \
-NOKEY \
-INPUT $(SIM_SCRIPT_FILE_GUI) \
-GUI
all : elab~ $(DESIGN_FILES)
# analyze all the design and testbench files
ana~ : $(DESIGN_FILES) $(TB_FILES)
for f in $(DESIGN_FILES); do ncvlog $(NCVLOG_SWITCHES) -work work $$f ; done
for f in $(TB_FILES); do ncvlog $(NCVLOG_SWITCHES) -work work $$f ; done
@touch ana~
# elaborate the top module
elab~ : ana~
ncelab $(NCELAB_SWITCHES) work.$(TOP)
@touch elab~
# run simulation without gui
sim : elab~
ncsim $(NCSIM_SWITCHES_NO_GUI) $(TOP)
# run simulation with gui
simg : elab~
ncsim $(NCSIM_SWITCHES_GUI) $(TOP)
# clean the library to have a clean start
clean :
@rm -rf `find . -name '*~'`
@rm -rf work
@rm -rf ncsim*
@rm -rf *.log
@mkdir work
@echo 'All set for a clean start'
# create directory structure
dir : cds.lib hdl.var
@mkdir work
@mkdir design
@mkdir tb
@mkdir include
@mkdir scripts
@mkdir etc
@echo 'Directory structure for simulation is created'
# create the basic cds.lib file
cds.lib :
@echo 'DEFINE work work' > cds.lib
@echo 'DEFINE osu018_stdcells /auto/home-scf-06/ee577/design_pdk/osu_stdcells/lib/tsmc018/lib/INCA_libs/osu018_stdcells' >> cds.lib
# create a blank hdl.var
hdl.var :
@echo '# Hello Cadence' > hdl.var