OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sim/] [bin/] [Makefile] - Blame information for rev 485

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 julius
######################################################################
2
####                                                              ####
3
####  ORPSoCv2 Testbenches Makefile                               ####
4
####                                                              ####
5
####  Description                                                 ####
6
####  ORPSoCv2 Testbenches Makefile, containing rules for         ####
7
####  configuring and running different tests on the current      ####
8
####  ORPSoC(v2) design.                                          ####
9
####                                                              ####
10
####  To do:                                                      ####
11
####                                                              ####
12
####  Author(s):                                                  ####
13 360 julius
####      - Julius Baxter, julius@opencores.org                   ####
14 6 julius
####                                                              ####
15
####                                                              ####
16
######################################################################
17
####                                                              ####
18 348 julius
#### Copyright (C) 2009,2010 Authors and OPENCORES.ORG            ####
19 6 julius
####                                                              ####
20
#### This source file may be used and distributed without         ####
21
#### restriction provided that this copyright statement is not    ####
22
#### removed from the file and that any derivative work contains  ####
23
#### the original copyright notice and the associated disclaimer. ####
24
####                                                              ####
25
#### This source file is free software; you can redistribute it   ####
26
#### and/or modify it under the terms of the GNU Lesser General   ####
27
#### Public License as published by the Free Software Foundation; ####
28
#### either version 2.1 of the License, or (at your option) any   ####
29
#### later version.                                               ####
30
####                                                              ####
31
#### This source is distributed in the hope that it will be       ####
32
#### useful, but WITHOUT ANY WARRANTY; without even the implied   ####
33
#### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ####
34
#### PURPOSE.  See the GNU Lesser General Public License for more ####
35
#### details.                                                     ####
36
####                                                              ####
37
#### You should have received a copy of the GNU Lesser General    ####
38
#### Public License along with this source; if not, download it   ####
39
#### from http://www.opencores.org/lgpl.shtml                     ####
40
####                                                              ####
41
######################################################################
42
 
43 360 julius
# Name of the directory we're currently in
44
CUR_DIR=$(shell pwd)
45 6 julius
 
46 360 julius
# The root path of the whole project
47
PROJECT_ROOT ?=$(CUR_DIR)/../..
48 6 julius
 
49 362 julius
DESIGN_NAME=orpsoc
50
RTL_TESTBENCH_TOP=$(DESIGN_NAME)_testbench
51
# Top level files for DUT and testbench
52
DUT_TOP=$(RTL_VERILOG_DIR)/$(DESIGN_NAME)_top/$(DESIGN_NAME)_top.v
53
BENCH_TOP=$(BENCH_VERILOG_DIR)/$(DESIGN_NAME)_testbench.v
54
 
55 360 julius
# Need this for individual test variables to not break
56
TEST ?= or1200-simple
57 6 julius
 
58 468 julius
TESTS ?= or1200-simple \
59
        or1200-basic \
60
        or1200-cbasic \
61
        or1200-dctest \
62
        or1200-float \
63
        or1200-mmu  \
64
        or1200-except \
65
        or1200-mac \
66
        or1200-ffl1 \
67
        or1200-linkregtest \
68
        or1200-tick \
69
        or1200-ticksyscall \
70
        uart-simple
71 6 julius
 
72 360 julius
# Gets turned into verilog `define
73
SIM_TYPE=RTL
74 6 julius
 
75 360 julius
# Paths to other important parts of this test suite
76
RTL_DIR = $(PROJECT_ROOT)/rtl
77
RTL_VERILOG_DIR = $(RTL_DIR)/verilog
78
RTL_VERILOG_INCLUDE_DIR = $(RTL_VERILOG_DIR)/include
79
#RTL_VHDL_DIR = $(RTL_DIR)/vhdl
80 6 julius
 
81 360 julius
PROJECT_VERILOG_DEFINES=$(RTL_VERILOG_INCLUDE_DIR)/$(DESIGN_NAME)-defines.v
82
# Detect technology to use for the simulation
83 468 julius
DESIGN_DEFINES=$(shell cat $(PROJECT_VERILOG_DEFINES) | \
84
        sed s://.*::g | sed s:\`:\#:g | sed 's:^[ ]*::' | \
85
        awk '{print};/^\#define/{printf "_%s=%s\n",$$2,$$2}' | \
86
        grep -v PERIOD | cpp -P | sed s:^_::g | sed s:=$$::g )
87 6 julius
 
88 360 julius
# Rule to look at what defines are being extracted from main file
89
print-defines:
90
        @echo echo; echo "\t### Design defines ###"; echo
91
        @echo "\tParsing "$(PROJECT_VERILOG_DEFINES)" and exporting:"
92
        @echo $(DESIGN_DEFINES)
93 6 julius
 
94 360 julius
# Simulation directories
95
SIM_DIR ?=$(PROJECT_ROOT)/sim
96 362 julius
SIM_VLT_DIR ?=$(SIM_DIR)/vlt
97 360 julius
RTL_SIM_DIR=$(SIM_DIR)
98
RTL_SIM_RUN_DIR=$(RTL_SIM_DIR)/run
99
RTL_SIM_BIN_DIR=$(RTL_SIM_DIR)/bin
100
RTL_SIM_RESULTS_DIR=$(RTL_SIM_DIR)/out
101 6 julius
 
102 360 julius
# Testbench paths
103 6 julius
BENCH_DIR=$(PROJECT_ROOT)/bench
104
BENCH_VERILOG_DIR=$(BENCH_DIR)/verilog
105 403 julius
BENCH_VERILOG_INCLUDE_DIR=$(BENCH_VERILOG_DIR)/include
106 360 julius
#BENCH_VHDL_DIR=$(BENCH_DIR)/vhdl
107 362 julius
BENCH_SYSC_DIR=$(BENCH_DIR)/sysc
108
BENCH_SYSC_SRC_DIR=$(BENCH_SYSC_DIR)/src
109
BENCH_SYSC_INCLUDE_DIR=$(BENCH_SYSC_DIR)/include
110 360 julius
 
111 362 julius
 
112 360 julius
# System software dir
113 6 julius
SW_DIR=$(PROJECT_ROOT)/sw
114 360 julius
# BootROM code, which generates a verilog array select values
115
BOOTROM_FILE=bootrom.v
116
BOOTROM_SW_DIR=$(SW_DIR)/bootrom
117
BOOTROM_SRC=$(shell ls $(BOOTROM_SW_DIR)/* | grep -v $(BOOTROM_FILE))
118
BOOTROM_VERILOG=$(BOOTROM_SW_DIR)/$(BOOTROM_FILE)
119
$(BOOTROM_VERILOG): $(BOOTROM_SRC)
120
        $(Q)echo; echo "\t### Generating bootup ROM ###"; echo
121
        $(Q)$(MAKE) -C $(BOOTROM_SW_DIR) $(BOOTROM_FILE)
122 6 julius
 
123 360 julius
# Suffix of file to check after each test for the string
124
TEST_OUT_FILE_SUFFIX=-general.log
125
TEST_OK_STRING=8000000d
126 6 julius
 
127 360 julius
# Dynamically generated verilog file defining configuration for various things
128
TEST_DEFINES_VLG=test-defines.v
129 57 julius
# Set V=1 when calling make to enable verbose output
130
# mainly for debugging purposes.
131
ifeq ($(V), 1)
132
Q=
133 360 julius
QUIET=
134 57 julius
else
135 360 julius
Q ?=@
136
QUIET=-quiet
137 57 julius
endif
138
 
139 360 julius
# Modelsim variables
140
MGC_VSIM=vsim
141
MGC_VLOG_COMP=vlog
142
MGC_VHDL_COMP=vcom
143
MODELSIM=modelsim
144 6 julius
 
145 360 julius
# Icarus variables
146
ICARUS_COMPILE=iverilog
147
ICARUS_RUN=vvp
148
ICARUS_SCRIPT=icarus.scr
149
ICARUS_SIM_EXE=vlogsim.elf
150
ICARUS=icarus
151 58 julius
 
152 360 julius
#Default simulator is Icarus Verilog
153
# Set SIMULATOR=modelsim to use Modelsim
154
# Set SIMULATOR=ncverilog to use Cadence's NC-Verilog - TODO
155
# Set SIMULATOR=icarus to use Icarus Verilog (Default)
156 68 julius
 
157 58 julius
SIMULATOR ?= $(ICARUS)
158
 
159 360 julius
# VPI debugging interface variables
160
VPI_SRC_C_DIR=$(BENCH_VERILOG_DIR)/vpi/c
161 397 julius
VPI_SRC_VERILOG_DIR=$(BENCH_VERILOG_DIR)/vpi/verilog
162 360 julius
VPI_SRCS=$(shell ls $(VPI_SRC_C_DIR)/*.[ch])
163 58 julius
 
164 360 julius
# Modelsim VPI compile variables
165
MODELTECH_VPILIB=msim_jp_vpi.sl
166
# Icarus VPI compile target
167
ICARUS_VPILIB=jp_vpi
168 58 julius
 
169 360 julius
#
170
# Modelsim-specific settings
171
#
172
VOPT_ARGS=$(QUIET) -suppress 2241
173 55 julius
# If VCD dump is desired, tell Modelsim not to optimise
174
# away everything.
175
ifeq ($(VCD), 1)
176 485 julius
# If certain versions of modelsim don't have the vopt executable, define
177
# MGC_NO_VOPT=1 when running.
178
ifeq ($(MGC_NO_VOPT), 1)
179
MGC_VSIM_ARGS +=-voptargs="+acc=rnp"
180
MGC_VOPT_CMD=echo
181
MGC_VSIM_TGT=orpsoc_testbench
182
else
183 360 julius
VOPT_ARGS=+acc=rnpqv
184 485 julius
MGC_VOPT_CMD= vopt $(QUIET) $(RTL_TESTBENCH_TOP) $(VOPT_ARGS) -o tb
185
MGC_VSIM_TGT=tb
186 55 julius
endif
187 485 julius
 
188
else
189
 
190
ifeq ($(MGC_NO_VOPT), 1)
191
MGC_VSIM_ARGS += -vopt
192
MGC_VOPT_CMD=echo
193
MGC_VSIM_TGT=orpsoc_testbench
194
else
195
VOPT_ARGS=+acc=rnpqv
196
MGC_VOPT_CMD= vopt $(QUIET) $(RTL_TESTBENCH_TOP) $(VOPT_ARGS) -o tb
197
MGC_VSIM_TGT=tb
198
endif
199
 
200
 
201
endif
202 360 julius
# VSIM commands
203
# Suppressed warnings - 3009: Failed to open $readmemh() file
204 475 julius
# Suppressed warnings - 3009: Module 'blah' does not have a `timescale
205
#                       directive in effect, but previous modules do.
206
# Suppressed warnings - 8598: Non-positive replication multiplier inside
207
#                       concat. Replication will be ignored
208 485 julius
MGC_VSIM_ARGS +=  -suppress 7 -suppress 3009 -suppress 8598 -c $(QUIET) \
209 475 julius
                -do "set StdArithNoWarnings 1; run -all; exit"
210 397 julius
# Options required when VPI option used
211 360 julius
ifeq ($(VPI), 1)
212 397 julius
MGC_VPI_LIB=$(VPI_SRC_C_DIR)/$(MODELTECH_VPILIB)
213
MGC_VSIM_ARGS += -pli $(VPI_SRC_C_DIR)/$(MODELTECH_VPILIB)
214
 
215
ICARUS_VPI_LIB=$(VPI_SRC_C_DIR)/$(ICARUS_VPILIB)
216
ICARUS_VPI_ARGS=-M$(VPI_SRC_C_DIR) -m$(ICARUS_VPILIB)
217 58 julius
endif
218 397 julius
# Rule to make the VPI library for Modelsim
219
$(MGC_VPI_LIB): $(VPI_SRCS)
220 360 julius
        $(MAKE) -C $(VPI_SRC_C_DIR) $(MODELTECH_VPILIB)
221 58 julius
 
222 397 julius
# Rule to make VPI library for Icarus Verilog
223
$(ICARUS_VPI_LIB): $(VPI_SRCS)
224 360 julius
        $(MAKE) -C $(VPI_SRC_C_DIR) $(ICARUS_VPILIB)
225 77 rherveille
 
226 397 julius
# Manually add the VPI bench verilog path
227
BENCH_VERILOG_SRC_SUBDIRS += $(VPI_SRC_VERILOG_DIR)
228
 
229 360 julius
#
230
# Verilog DUT source variables
231
#
232
# A list of paths under rtl/verilog we wish to exclude for module searching
233
VERILOG_MODULES_EXCLUDE=  include components
234 475 julius
VERILOG_MODULES_EXCLUDE_LIST_E=$(shell for exclude in \
235
                $(VERILOG_MODULES_EXCLUDE); do echo "-e $$exclude"; done)
236
RTL_VERILOG_MODULES=$(shell ls $(RTL_VERILOG_DIR) | grep -v \
237
                        $(VERILOG_MODULES_EXCLUDE_LIST_E) )
238 360 julius
# Specific files to exclude, currently none.
239
#VERILOG_EXCLUDE=
240 475 julius
#VERILOG_EXCLUDE_LIST_E=$(shell for exclude in $(VERILOG_EXCLUDE); \
241
                do echo "-e $$exclude"; done)
242 360 julius
# List of verilog source files, minus excluded files
243 475 julius
#RTL_VERILOG_SRC=$(shell for module in $(RTL_VERILOG_MODULES); do \
244
        if [ -d $(RTL_VERILOG_DIR)/$$module ]; then \
245
                ls $(RTL_VERILOG_DIR)/$$module/*.v | grep -v \
246
                        $(VERILOG_EXCLUDE_LIST_E); \
247
        fi; done)
248 360 julius
# List of verilog source files, ignoring excludes
249 475 julius
RTL_VERILOG_SRC=$(shell for module in $(RTL_VERILOG_MODULES); do \
250
        if [ -d $(RTL_VERILOG_DIR)/$$module ]; then \
251
                ls $(RTL_VERILOG_DIR)/$$module/*.v; \
252
        fi; done)
253 6 julius
 
254 360 julius
# List of verilog includes
255
RTL_VERILOG_INCLUDES=$(shell ls $(RTL_VERILOG_INCLUDE_DIR)/*.*)
256 6 julius
 
257 360 julius
print-verilog-src:
258
        @echo echo; echo "\t### Verilog source ###"; echo
259
        @echo $(RTL_VERILOG_SRC)
260 51 julius
 
261 360 julius
# Rules to make RTL we might need
262
# Expects modules, if they need making, to have their top verilog file to
263
# correspond to their module name, and the directory should have a make file
264
# and rule which works for this command.
265
# Add name of module to this list, currently only does verilog ones.
266
# Rule 'rtl' is called just before generating DUT modelsim compilation script
267
RTL_TO_CHECK=
268
rtl:
269
        $(Q)for module in $(RTL_TO_CHECK); do \
270
                $(MAKE) -C $(RTL_VERILOG_DIR)/$$module $$module.v; \
271
        done
272 6 julius
 
273 55 julius
#
274 360 julius
# VHDL DUT source variables
275 55 julius
#
276 360 julius
# VHDL modules
277
#RTL_VHDL_MODULES=$(shell ls $(RTL_VHDL_DIR))
278
# VHDL sources
279 475 julius
#RTL_VHDL_SRC=$(shell for module in $(RTL_VHDL_MODULES); do \
280
        if [ -d $(RTL_VHDL_DIR)/$$module ]; then \
281
                ls $(RTL_VHDL_DIR)/$$module/*.vhd; \
282
        fi; done)
283 360 julius
#print-vhdl-src:
284
#       @echo echo; echo "\t### VHDL modules and source ###"; echo
285
#       @echo "modules: "; echo $(RTL_VHDL_MODULES); echo
286
#       @echo "source: "$(RTL_VHDL_SRC)
287 6 julius
 
288 40 julius
 
289 360 julius
# Testbench verilog source
290 475 julius
BENCH_VERILOG_SRC=$(shell ls $(BENCH_VERILOG_DIR)/*.v | grep -v \
291
        $(DESIGN_NAME)_testbench )
292 40 julius
 
293 362 julius
print-bench-src:
294
        $(Q)echo "\tBench verilog source"; \
295
        echo $(BENCH_VERILOG_SRC)
296
 
297 360 julius
# Testbench source subdirectory detection
298 475 julius
BENCH_VERILOG_SRC_SUBDIRS +=$(shell for file in `ls $(BENCH_VERILOG_DIR)`; do \
299
        if [ -d $(BENCH_VERILOG_DIR)/$$file ]; then \
300
                echo $(BENCH_VERILOG_DIR)/$$file; \
301
        fi; done)
302 40 julius
 
303 360 julius
# Compile script generation rules:
304 40 julius
 
305 475 julius
modelsim_dut.scr: rtl $(RTL_VERILOG_SRC) $(RTL_VERILOG_INCLUDES) \
306
                        $(BOOTROM_VERILOG)
307 360 julius
        $(Q)echo "+incdir+"$(RTL_VERILOG_INCLUDE_DIR) > $@;
308
        $(Q)echo "+incdir+"$(BOOTROM_SW_DIR) >> $@;
309 403 julius
        $(Q)echo "+incdir+"$(BENCH_VERILOG_INCLUDE_DIR) >> $@;
310 360 julius
        $(Q)echo "+libext+.v" >> $@;
311 475 julius
        $(Q)for module in $(RTL_VERILOG_MODULES); do \
312
                if [ -d $(RTL_VERILOG_DIR)/$$module ]; then \
313
                        echo "-y " $(RTL_VERILOG_DIR)/$$module >> $@; \
314
                fi; done
315 360 julius
        $(Q)echo >> $@
316 6 julius
 
317 360 julius
modelsim_bench.scr: $(BENCH_VERILOG_SRC)
318
        $(Q)echo "+incdir+"$(BENCH_VERILOG_DIR) > $@;
319 475 julius
        $(Q)for path in $(BENCH_VERILOG_SRC_SUBDIRS); do \
320
                echo "+incdir+"$$path >> $@; \
321
        done
322
        $(Q)for path in $(BENCH_VERILOG_SRC_SUBDIRS); do \
323
                echo "-y "$$path >> $@; \
324
        done
325 360 julius
        $(Q)echo "+incdir+"$(RTL_VERILOG_INCLUDE_DIR) >> $@;
326
        $(Q)echo "+libext+.v" >> $@;
327
        $(Q)for vsrc in $(BENCH_VERILOG_SRC); do echo $$vsrc >> $@; done
328
        $(Q)echo >> $@
329 6 julius
 
330 360 julius
# Compile DUT into "work" library
331
work: modelsim_dut.scr #$(RTL_VHDL_SRC)
332
        $(Q)if [ ! -e $@ ]; then vlib $@; fi
333
#       $(Q)echo; echo "\t### Compiling VHDL design library ###"; echo
334
#       $(Q)vcom -93 $(QUIET) $(RTL_VHDL_SRC)
335
        $(Q)echo; echo "\t### Compiling Verilog design library ###"; echo
336
        $(Q)vlog $(QUIET) -f $< $(DUT_TOP)
337 6 julius
 
338 360 julius
# Single compile rule
339
.PHONY : $(MODELSIM)
340 397 julius
$(MODELSIM): modelsim_bench.scr $(TEST_DEFINES_VLG) $(MGC_VPI_LIB) work
341 360 julius
        $(Q)echo; echo "\t### Compiling testbench ###"; echo
342 362 julius
        $(Q)vlog $(QUIET) -nologo -incr $(BENCH_TOP) -f $<
343 485 julius
        $(Q)$(MGC_VOPT_CMD)
344 360 julius
        $(Q)echo; echo "\t### Launching simulation ###"; echo
345 485 julius
        $(Q)vsim $(VOPT_ARGS) $(MGC_VSIM_ARGS) $(MGC_VSIM_TGT)
346 6 julius
 
347 360 julius
#
348
# Icarus Verilog simulator build and run rules
349
#
350
.PHONY: $(ICARUS_SCRIPT)
351 475 julius
$(ICARUS_SCRIPT):  $(RTL_VERILOG_SRC) $(RTL_VERILOG_INCLUDES) \
352
                $(BOOTROM_VERILOG) $(BENCH_VERILOG_SRC)
353 360 julius
        $(Q)echo "# Icarus Verilog simulation script" > $@
354
        $(Q)echo "# Auto generated. Any alterations will be written over!" >> $@
355
        $(Q)echo "+incdir+"$(RTL_VERILOG_INCLUDE_DIR) > $@;
356
        $(Q)echo "+incdir+"$(BENCH_VERILOG_DIR) >> $@;
357
        $(Q)echo "+incdir+"$(BOOTROM_SW_DIR) >> $@;
358 475 julius
        $(Q)for path in $(BENCH_VERILOG_SRC_SUBDIRS); do \
359
                echo "+incdir+"$$path >> $@; \
360
        done
361
        $(Q)for path in $(BENCH_VERILOG_SRC_SUBDIRS); do \
362
                echo "-y "$$path >> $@; \
363
        done
364
        $(Q)for module in $(RTL_VERILOG_MODULES); do \
365
                echo "-y " $(RTL_VERILOG_DIR)/$$module >> $@; \
366
        done
367 362 julius
        $(Q)echo "-y" $(BENCH_VERILOG_DIR) >> $@;
368
        $(Q)echo $(BENCH_TOP) >> $@;
369 360 julius
        $(Q) echo >> $@
370 6 julius
 
371 360 julius
# Icarus design compilation rule
372
$(ICARUS_SIM_EXE): $(ICARUS_SCRIPT) $(TEST_DEFINES_VLG)
373
        $(Q)echo; echo "\t### Compiling ###"; echo
374
        $(Q) $(ICARUS_COMPILE) -s$(RTL_TESTBENCH_TOP) -c $< -o $@
375 49 julius
 
376 360 julius
# Icarus simulation run rule
377
$(ICARUS): $(ICARUS_SIM_EXE) $(ICARUS_VPI_LIB)
378
        $(Q)echo; echo "\t### Launching simulation ###"; echo
379
        $(Q) $(ICARUS_RUN) $(ICARUS_VPI_ARGS) -l ../out/$(ICARUS_RUN).log $<
380 63 julius
 
381 49 julius
 
382
 
383 360 julius
.PHONY: rtl-test
384 425 julius
rtl-test: clean-sim-test-sw sw-vmem clean-test-defines $(TEST_DEFINES_VLG) \
385 360 julius
        $(SIMULATOR)
386 6 julius
 
387 360 julius
# Run an RTL test followed by checking of generated results
388
rtl-test-with-check: rtl-test
389
        $(Q)$(MAKE) check-test-log; \
390
        if [ $$? -ne 0 ]; then \
391
                echo; echo "\t### "$(TEST)" test FAIL ###"; echo; \
392
        else \
393
                echo; echo "\t### "$(TEST)" test OK ###"; echo; \
394
        fi
395 6 julius
 
396 360 julius
# Do check, don't print anything out
397
rtl-test-with-check-no-print: rtl-test check-test-log
398 6 julius
 
399 360 julius
# Main RTL test loop
400
rtl-tests:
401
        $(Q)for test in $(TESTS); do \
402
                export TEST=$$test; \
403
                $(MAKE) rtl-test-with-check-no-print; \
404
                if [ $$? -ne 0 ]; then break; fi; \
405
                echo; echo "\t### $$test test OK ###"; echo; \
406 6 julius
        done
407
 
408
 
409 360 julius
.PHONY: check-test-log
410
check-test-log:
411
        $(Q)echo "#!/bin/bash" > $@
412
        $(Q)echo "function check-test-log { if [ \`grep -c -i "$(TEST_OK_STRING)" "$(RTL_SIM_RESULTS_DIR)"/"$(TEST)$(TEST_OUT_FILE_SUFFIX)"\` -gt 0 ]; then return 0; else return 1; fi; }" >> $@
413
        $(Q)echo "check-test-log" >> $@
414
        $(Q)chmod +x $@
415
        $(Q) echo; echo "\t### Checking simulation results for "$(TEST)" test ###"; echo;
416
        $(Q)./$@
417 6 julius
 
418 403 julius
# Include the test-defines.v generation rule
419
include ../bin/definesgen.inc
420 6 julius
 
421 403 julius
#
422
# Software make rules (called recursively)
423
#
424 51 julius
 
425 403 julius
# Path for the current test
426 393 julius
TEST_SW_DIR=$(SW_DIR)/tests/$(shell echo $(TEST) | cut -d "-" -f 1)/sim
427 6 julius
 
428 468 julius
# This file name corresponds to the VMEM file the RAM models will attempt to
429
# load via $readmemh().
430
SIM_VMEM_IMAGE ?=sram.vmem
431 6 julius
 
432 468 julius
ifeq ($(USER_ELF),)
433
ELF_FILE=$(TEST_SW_DIR)/$(TEST).elf
434
else
435
ELF_FILE=$(USER_ELF)
436
ELF_FILE_NOTDIR=$(notdir $(USER_ELF))
437
ELF_FILE_NOTDIR_BASENAME=$(basename $(ELF_FILE_NOTDIR))
438
endif
439 6 julius
 
440 468 julius
# Rules allowing user to specify a pre-existing VMEM file to load into the
441
# simulation, instead of compiling a test.
442
ifeq ($(USER_VMEM),)
443
VMEM_FILE=$(TEST_SW_DIR)/$(TEST).vmem
444
.PHONY: $(VMEM_FILE)
445
 
446
 
447
# If USER_ELF was specified, then we need a slightly different way of
448
# generating the VMEM file from it than a usual test
449
ifeq ($(USER_ELF),)
450
$(SIM_VMEM_IMAGE): $(VMEM_FILE)
451 360 julius
        $(Q)if [ -L $@ ]; then unlink $@; fi
452 468 julius
        $(Q)if [ -e $@ ]; then rm $@; fi
453 360 julius
        $(Q)ln -s $< $@
454 468 julius
else
455
$(SIM_VMEM_IMAGE): $(USER_ELF)
456
        $(Q)$(MAKE) -C $(SW_DIR)/lib \
457
        USER_ELF_BIN=`pwd`/$(ELF_FILE_NOTDIR_BASENAME).bin \
458
        USER_ELF_VMEM=`pwd`/$(ELF_FILE_NOTDIR_BASENAME).vmem \
459
        gen-user-elf-vmem
460
        $(Q)cp -v $(ELF_FILE_NOTDIR_BASENAME).vmem $@
461 6 julius
 
462 468 julius
TEST=$(ELF_FILE_NOTDIR_BASENAME)
463
endif
464
 
465
else
466
VMEM_FILE=$(USER_VMEM)
467
USER_VMEM_NOTDIR=$(notdir $(USER_VMEM))
468
TEST=$(basename $(USER_VMEM_NOTDIR))
469
 
470
$(SIM_VMEM_IMAGE): $(VMEM_FILE)
471
        cp -v $< $@
472
 
473
endif
474
 
475
 
476
 
477
 
478
.PHONY : sw-vmem sw-elf
479
sw-vmem: $(SIM_VMEM_IMAGE)
480
 
481 360 julius
$(TEST_SW_DIR)/$(TEST).vmem:
482
        $(Q) echo; echo "\t### Compiling software ###"; echo;
483
        $(Q)$(MAKE) -C $(TEST_SW_DIR) $(TEST).vmem
484 63 julius
 
485 425 julius
# Compile ELF and copy it here
486 468 julius
sw-elf: $(ELF_FILE)
487 425 julius
        $(Q)cp -v $< .
488
 
489
$(TEST_SW_DIR)/$(TEST).elf:
490
        $(Q) echo; echo "\t### Compiling software ###"; echo;
491
        $(Q)$(MAKE) -C $(TEST_SW_DIR) $(TEST).elf
492
 
493
 
494 397 julius
# Rule to force generation of the processed orpsoc-defines.h file
495
processed-verilog-headers-in-c-for-vlt:
496
        $(Q)$(MAKE) -C $(SW_DIR)/lib processed-verilog-headers
497
# Now copy the file into the Verilated model build path
498
        $(Q)cp $(SW_DIR)/lib/include/orpsoc-defines.h $(SIM_VLT_DIR)
499
 
500 435 julius
# Create test software disassembly
501
 
502
sw-dis: $(TEST_SW_DIR)/$(TEST).dis
503
        $(Q)cp -v $< .
504
 
505
$(TEST_SW_DIR)/$(TEST).dis:
506
        $(Q)$(MAKE) -C $(TEST_SW_DIR) $(TEST).dis
507
 
508
 
509 360 julius
#
510
# Cleaning rules
511
#
512 362 julius
clean: clean-sim clean-sim-test-sw clean-bootrom clean-vlt clean-out clean-sw
513 63 julius
 
514 360 julius
clean-sim:
515
        $(Q) echo; echo "\t### Cleaning simulation run directory ###"; echo;
516
        $(Q)rm -rf *.* lib_* work transcript check-test-log
517 468 julius
        $(Q) if [ -e $(VPI_SRC_C_DIR) ]; then \
518
                $(MAKE) -C $(VPI_SRC_C_DIR) clean; \
519
        fi
520 6 julius
 
521 360 julius
clean-bootrom:
522
        $(MAKE) -C $(BOOTROM_SW_DIR) clean
523 6 julius
 
524 360 julius
clean-out:
525
        $(Q)rm -rf $(RTL_SIM_RESULTS_DIR)/*.*
526 6 julius
 
527 363 julius
# Clean away verilator build path and objects in SystemC path
528 362 julius
clean-vlt:
529
        $(Q)rm -rf $(SIM_VLT_DIR)
530 475 julius
        $(Q)$(MAKE) -C $(BENCH_SYSC_SRC_DIR) -f \
531
                $(BENCH_SYSC_SRC_DIR)/Modules.make clean
532 362 julius
 
533 360 julius
clean-test-defines:
534
        $(Q)rm -f $(TEST_DEFINES_VLG)
535 6 julius
 
536 360 julius
clean-sim-test-sw:
537 468 julius
        $(Q)if [ -L $(SIM_VMEM_IMAGE) ]; then unlink $(SIM_VMEM_IMAGE); fi
538 6 julius
 
539
clean-sw:
540 360 julius
        $(Q) echo; echo "\t### Cleaning simulation sw directories ###"; echo;
541 449 julius
        $(Q) $(MAKE) -C $(SW_DIR)/lib distclean
542 6 julius
 
543 36 julius
clean-rtl:
544 360 julius
        $(Q) echo; echo "\t### Cleaning generated verilog RTL ###"; echo;
545
        for module in $(RTL_TO_CHECK); do \
546
                $(MAKE) -C $(RTL_VERILOG_DIR)/$$module clean; \
547
        done
548 44 julius
 
549 360 julius
# Removes any checked out RTL
550
distclean: clean
551
        $(Q) echo; echo "\t### Cleaning generated verilog RTL ###"; echo;
552
        $(Q)for module in $(RTL_TO_CHECK); do \
553
                $(MAKE) -C $(RTL_VERILOG_DIR)/$$module distclean; \
554
        done
555 362 julius
 
556
################################################################################
557
# Verilator model build rules
558
################################################################################
559
 
560
VLT_EXE=Vorpsoc_top
561
VLT_SCRIPT=verilator.scr
562
 
563
# Script for Verilator
564 475 julius
$(SIM_VLT_DIR)/$(VLT_SCRIPT): $(RTL_VERILOG_SRC) $(RTL_VERILOG_INCLUDES) \
565
                                $(BOOTROM_VERILOG)
566 362 julius
        $(Q)echo "\tGenerating Verilator script"
567
        $(Q)echo "# Verilator sources script" > $@
568
        $(Q)echo "# Auto generated. Any alterations will be written over!" >> $@
569
        $(Q)echo "+incdir+"$(RTL_VERILOG_INCLUDE_DIR) > $@;
570
        $(Q)echo "+incdir+"$(BOOTROM_SW_DIR) >> $@;
571
        $(Q)echo "+incdir+"$(SIM_RUN_DIR) >> $@;
572 475 julius
        $(Q)for module in $(RTL_VERILOG_MODULES); do \
573
                echo "-y " $(RTL_VERILOG_DIR)/$$module >> $@; \
574
        done
575 362 julius
        $(Q)echo $(DUT_TOP) >> $@;
576
        $(Q) echo >> $@
577
 
578
 
579
SYSC_LIB_ARCH_DIR=$(shell ls $$SYSTEMC | grep "lib-")
580
 
581
 
582
# List of System C models - use this list to link the sources into the Verilator
583
# build directory
584
SYSC_MODELS=OrpsocAccess MemoryLoad
585
 
586 363 julius
ifdef VLT_LINT
587
VLT_FLAGS +=--lint-only
588
endif
589
 
590 362 julius
ifdef VLT_DEBUG
591
VLT_DEBUG_COMPILE_FLAGS = -g
592
# Enabling the following generates a TON of debugging
593
# when running verilator. Not so helpful.
594 363 julius
#VLT_FLAGS = --debug --dump-tree
595 362 julius
VLT_SYSC_DEBUG_DEFINE = VLT_DEBUG=1
596
endif
597
 
598 363 julius
# This will build a verilator model that will generate profiling information
599
# suitable for gprof
600
# Run it through gprof after exection with: gprof Vorpsoc_top > gprof.out
601
# then run this through the Verilator tool with:
602
# verilator_profcfunc gprof.out > vprof.out
603
ifdef VLT_EXECUTION_PROFILE_BUILD
604
VLT_CPPFLAGS +=-g -pg
605
# Maybe add these to VLT_CPPFLAGS: -ftest-coverage -fprofile-arcs
606
VLT_FLAGS +=-profile-cfuncs
607
endif
608
 
609
# If set on the command line we build the cycle accurate model which will
610
# generate verilator-specific profiling information. This is useful for
611
# checking the efficiency of the model - not really useful for checking code
612
# or the function of the model.
613
ifdef VLT_DO_PERFORMANCE_PROFILE_BUILD
614 475 julius
VLT_CPPFLAGS += -fprofile-generate -fbranch-probabilities -fvpt \
615
                -funroll-loops -fpeel-loops -ftracer
616 362 julius
else
617
VLT_CPPFLAGS +=-fprofile-use -Wcoverage-mismatch
618
endif
619
 
620 363 julius
# Set VLT_IN_GDB=1 when making if going to run the cycle accurate model
621
# executable in GDB.
622 362 julius
ifdef VLT_IN_GDB
623
VLT_CPPFLAGS +=-g -O0
624
else
625
# The default optimisation flag applied to all of the cycle accurate model files
626
VLT_CPPFLAGS +=-O3
627
endif
628
 
629
# VCD Enabled by default when building, enable it at runtime
630
VLT_FLAGS +=-trace
631
TRACE_FLAGS=-DVM_TRACE=1 -I${SYSTEMPERL}/src
632
 
633 363 julius
# Verilator tuning
634
# Inlining:
635
VLT_FLAGS +=--inline-mult 1
636
# Optimisation option for Verilator scripts
637
VLT_FLAGS +=-O3
638 475 julius
# X-assign - at reset, all signals are set to random values, helps find
639
# reset bugs
640 363 julius
VLT_FLAGS +=-x-assign unique
641
 
642 362 julius
VLT_TRACEOBJ = verilated_vcd_c
643
 
644 363 julius
 
645 362 julius
# This is the list of extra models we'll issue make commands for
646
# Included is the SystemPerl trace model
647
SYSC_MODELS_BUILD=$(SYSC_MODELS) $(VLT_TRACEOBJ)
648
 
649
# List of sources for rule sensitivity
650
SYSC_MODEL_SOURCES=$(shell ls $(BENCH_SYSC_SRC_DIR)/*.cpp)
651
SYSC_MODEL_SOURCES +=$(shell ls $(BENCH_SYSC_INCLUDE_DIR)/*.h)
652
 
653 475 julius
VLT_MODULES_OBJS=$(shell for mod in $(SYSC_MODELS_BUILD); do \
654
                echo $(SIM_VLT_DIR)/$$mod.o; \
655
        done)
656 362 julius
 
657 475 julius
VLT_MODEL_LINKS=$(shell for SYSCMODEL in $(SYSC_MODELS); do \
658
                echo $(SIM_VLT_DIR)/$$SYSCMODEL.cpp; \
659
        done)
660 362 julius
 
661
# Make Verilator build path if it doesn't exist
662
$(SIM_VLT_DIR):
663
        mkdir -p $@
664
 
665
# Dummy files the RTL requires: timescale.v
666
DUMMY_FILES_FOR_VLT=$(SIM_VLT_DIR)/timescale.v
667
$(DUMMY_FILES_FOR_VLT):
668
        $(Q)for file in $@; do if [ ! -e $$file ]; then touch $$file; fi; done
669
 
670 397 julius
build-vlt: rtl $(SIM_VLT_DIR) $(DUMMY_FILES_FOR_VLT) $(VLT_MODEL_LINKS) \
671
        processed-verilog-headers-in-c-for-vlt  $(SIM_VLT_DIR)/$(VLT_EXE)
672 362 julius
 
673
# Main Cycle-accurate build rule
674
prepare-vlt: build-vlt
675
        @echo;echo "\tCycle-accurate model compiled successfully"
676
        @echo;echo "\tRun the executable with the -h option for usage instructions:";echo
677
        $(SIM_VLT_DIR)/$(VLT_EXE) -h
678
        @echo;echo
679
 
680 475 julius
$(SIM_VLT_DIR)/$(VLT_EXE): $(SIM_VLT_DIR)/lib$(VLT_EXE).a \
681
                                $(SIM_VLT_DIR)/OrpsocMain.o
682
# Final linking of the simulation executable. Order of libraries here is
683
# important!
684 362 julius
        $(Q)echo; echo "\tGenerating simulation executable"; echo
685 475 julius
        $(Q)cd $(SIM_VLT_DIR) && \
686
                g++ $(VLT_DEBUG_COMPILE_FLAGS) \
687
                $(VLT_CPPFLAGS) -I$(BENCH_SYSC_INCLUDE_DIR) -I$(SIM_VLT_DIR) \
688
                -I$(VERILATOR_ROOT)/include -I$(SYSTEMC)/include -o $(VLT_EXE) \
689
                -L. -L$(BENCH_SYSC_SRC_DIR) -L$(SYSTEMC)/$(SYSC_LIB_ARCH_DIR) \
690
                OrpsocMain.o -l$(VLT_EXE) -lmodules -lsystemc
691 362 julius
 
692 475 julius
# Now compile the top level systemC "testbench" module from the systemC source
693
# path
694 362 julius
$(SIM_VLT_DIR)/OrpsocMain.o: $(BENCH_SYSC_SRC_DIR)/OrpsocMain.cpp
695
        @echo; echo "\tCompiling top level SystemC testbench"; echo
696 475 julius
        cd $(SIM_VLT_DIR) && \
697
        g++ $(VLT_DEBUG_COMPILE_FLAGS) $(VLT_CPPFLAGS) $(TRACE_FLAGS) \
698
        -I$(BENCH_SYSC_INCLUDE_DIR) -I$(SIM_VLT_DIR) \
699
        -I$(VERILATOR_ROOT)/include -I$(SYSTEMC)/include -c \
700
        $(BENCH_SYSC_SRC_DIR)/OrpsocMain.cpp
701 362 julius
 
702 475 julius
$(SIM_VLT_DIR)/lib$(VLT_EXE).a: $(SIM_VLT_DIR)/$(VLT_EXE)__ALL.a \
703
                $(VLT_MODULES_OBJS) $(SIM_VLT_DIR)/verilated.o
704
# Now archive all of the libraries from verilator witht he other modules we
705
# might have
706 362 julius
        @echo; echo "\tArchiving libraries into lib"$(VLT_EXE)".a"; echo
707
        $(Q)cd $(SIM_VLT_DIR) && \
708
        cp $(VLT_EXE)__ALL.a lib$(VLT_EXE).a && \
709
        ar rcs lib$(VLT_EXE).a verilated.o; \
710
        for SYSCMODEL in $(SYSC_MODELS_BUILD); do \
711
                ar rcs lib$(VLT_EXE).a $$SYSCMODEL.o; \
712
        done
713
 
714
$(SIM_VLT_DIR)/verilated.o: $(SYSC_MODEL_SOURCES)
715
        @echo; echo "\tCompiling verilated.o"; echo
716
        $(Q)cd $(SIM_VLT_DIR) && \
717
        export CXXFLAGS=$(VLT_DEBUG_COMPILE_FLAGS); \
718
        export USER_CPPFLAGS="$(VLT_CPPFLAGS)"; \
719
        export USER_LDDFLAGS="$(VLT_CPPFLAGS)"; \
720
        $(MAKE) -f $(VLT_EXE).mk verilated.o
721
 
722
print-sysmod-objs:
723
        $(Q)echo $(VLT_MODULES_OBJS):
724
 
725
$(VLT_MODULES_OBJS):
726
# Compile the module files
727
        @echo; echo "\tCompiling SystemC models"
728
        $(Q)cd $(SIM_VLT_DIR) && \
729
        for SYSCMODEL in $(SYSC_MODELS_BUILD); do \
730
                echo;echo "\t$$SYSCMODEL"; echo; \
731
                export CXXFLAGS=$(VLT_DEBUG_COMPILE_FLAGS); \
732
                export USER_CPPFLAGS="$(VLT_CPPFLAGS) -I$(BENCH_SYSC_INCLUDE_DIR)"; \
733
                export USER_LDDFLAGS="$(VLT_CPPFLAGS)"; \
734
                 $(MAKE) -f $(VLT_EXE).mk $$SYSCMODEL.o; \
735
        done
736
 
737 475 julius
$(SIM_VLT_DIR)/$(VLT_EXE)__ALL.a: $(SIM_VLT_DIR)/$(VLT_EXE).mk \
738
                $(SYSC_MODEL_SOURCES)
739 362 julius
        @echo; echo "\tCompiling main design"; echo
740
        $(Q)cd $(SIM_VLT_DIR) && \
741
        export USER_CPPFLAGS="$(VLT_CPPFLAGS)"; \
742
        export USER_LDDFLAGS="$(VLT_CPPFLAGS)"; \
743
        $(MAKE) -f $(VLT_EXE).mk $(VLT_EXE)__ALL.a
744
 
745 475 julius
$(SIM_VLT_DIR)/$(VLT_EXE).mk: $(SIM_VLT_DIR)/$(VLT_SCRIPT) \
746
                $(BENCH_SYSC_SRC_DIR)/libmodules.a
747 362 julius
# Now call verilator to generate the .mk files
748
        $(Q)echo; echo "\tGenerating makefiles with Verilator"; echo
749
        $(Q)cd $(SIM_VLT_DIR) && \
750 475 julius
        verilator -language 1364-2001 --top-module orpsoc_top -Mdir . -sc \
751
        $(VLT_FLAGS) -I$(BENCH_SYSC_INCLUDE_DIR) -I$(BENCH_SYSC_SRC_DIR) \
752
        -f $(SIM_VLT_DIR)/$(VLT_SCRIPT)
753 362 julius
 
754
# SystemC modules library
755
$(BENCH_SYSC_SRC_DIR)/libmodules.a:
756
        @echo; echo "\tCompiling SystemC modules"; echo
757
        $(Q)export VLT_CPPFLAGS="$(VLT_CPPFLAGS)"; \
758 475 julius
        $(MAKE) -C $(BENCH_SYSC_SRC_DIR) \
759
        -f $(BENCH_SYSC_SRC_DIR)/Modules.make $(VLT_SYSC_DEBUG_DEFINE)
760 362 julius
 
761
print-vlt-model-link-paths:
762
        $(Q)echo $(VLT_MODEL_LINKS)
763
 
764
$(VLT_MODEL_LINKS):
765
# Link all the required system C model files into the verilator work dir
766 476 julius
        $(Q)for SYSCMODEL in $(SYSC_MODELS); do \
767 362 julius
                if [ ! -e $(SIM_VLT_DIR)/$$SYSCMODEL.cpp ]; then \
768 476 julius
                echo \
769
        "\tLinking SystemC model $$SYSCMODEL  Verilator model build path"; \
770 475 julius
                        ln -s $(BENCH_SYSC_SRC_DIR)/$$SYSCMODEL.cpp \
771
                                $(SIM_VLT_DIR)/$$SYSCMODEL.cpp; \
772
                        ln -s $(BENCH_SYSC_INCLUDE_DIR)/$$SYSCMODEL.h \
773
                                $(SIM_VLT_DIR)/$$SYSCMODEL.h; \
774 362 julius
                fi; \
775
        done
776
 
777
 
778
################################################################################
779
# Verilator model test rules
780
################################################################################
781
 
782 425 julius
vlt-test: build-vlt clean-sim-test-sw sw-vmem
783 362 julius
        $(SIM_VLT_DIR)/$(VLT_EXE) $(TEST)
784
 
785
vlt-tests:
786
        $(Q)for test in $(TESTS); do \
787
                export TEST=$$test; \
788
                $(MAKE) vlt-test; \
789
                if [ $$? -ne 0 ]; then break; fi; \
790
                echo; echo "\t### $$test test OK ###"; echo; \
791
        done
792
 
793
 
794
 
795
###############################################################################
796
# Verilator profiled model build rules
797
###############################################################################
798 476 julius
# To run this, first run a "make prepare-vlt-profiled"
799 362 julius
# This new make target copies athe results of the profiling back to the right
800
# paths before we create everything again
801
###############################################################################
802
.PHONY: prepare-vlt-profiled
803 363 julius
prepare-vlt-profiled: $(SIM_VLT_DIR)/OrpsocMain.gcda \
804
        clean-vlt-after-profile-run \
805
        rtl $(SIM_VLT_DIR) $(DUMMY_FILES_FOR_VLT) $(VLT_MODEL_LINKS) \
806
        $(SIM_VLT_DIR)/$(VLT_EXE)
807 362 julius
 
808
$(SIM_VLT_DIR)/OrpsocMain.gcda: $(SIM_VLT_DIR)/$(VLT_EXE)-for-profiling
809 397 julius
        $(MAKE) -C $(SW_DIR)/apps/dhry dhry.elf NUM_RUNS=5000
810
        $(SIM_VLT_DIR)/$(VLT_EXE) -f $(SW_DIR)/apps/dhry/dhry.elf
811 362 julius
 
812 363 julius
# Clean all compiled things
813
clean-vlt-after-profile-run:
814
        $(Q)echo "\tCleaning away compiled cycle-accurate files"
815
        $(Q)rm -f $(SIM_VLT_DIR)/*.[oa] $(SIM_VLT_DIR)/$(VLT_EXE)
816
        $(Q)rm -f $(BENCH_SYSC_SRC_DIR)/*.[oa]
817
 
818
#.PHONY: $(SIM_VLT_DIR)/$(VLT_EXE)-for-profiling
819 362 julius
$(SIM_VLT_DIR)/$(VLT_EXE)-for-profiling:
820 363 julius
        $(MAKE) build-vlt VLT_DO_PERFORMANCE_PROFILE_BUILD=1
821 362 julius
 
822
.PHONY: vlt-restore-profileoutput
823
vlt-restore-profileoutput:
824
        @echo;echo "\tRestoring profiling outputs"; echo
825
        $(Q)mkdir -p ../vlt
826
        $(Q)cp /tmp/*.gc* $(SIM_VLT_DIR)
827
        $(Q)cp /tmp/*.gc* $(BENCH_SYSC_SRC_DIR)
828 363 julius
 
829
 
830
lint-vlt: $(SIM_VLT_DIR) rtl $(DUMMY_FILES_FOR_VLT) $(SIM_VLT_DIR)/$(VLT_SCRIPT)
831
        $(Q)echo; echo "\tLinting design with Verilator"; echo
832
        $(Q)cd $(SIM_VLT_DIR) && \
833 475 julius
        verilator -language 1364-2001 --top-module orpsoc_top --lint-only \
834
        -Mdir . -sc $(VLT_FLAGS) -I$(BENCH_SYSC_INCLUDE_DIR) \
835
        -I$(BENCH_SYSC_SRC_DIR) -f $(SIM_VLT_DIR)/$(VLT_SCRIPT)
836 425 julius
 
837
################################################################################
838
# Architectural simulator test rules
839
################################################################################
840
 
841
ARCH_SIM_EXE ?=or32-elf-sim
842 475 julius
ARCH_SIM_CFG ?= ../bin/refdesign-or1ksim.cfg
843 425 julius
ARCH_SIM_OPTS ?= -q
844
 
845
.PHONY: rtl-test
846
sim-test: clean-sim-test-sw sw-elf
847 431 julius
        $(Q)echo; echo "\t### Launching simulation ###"; echo
848 425 julius
        $(Q)$(ARCH_SIM_EXE) $(ARCH_SIM_OPTS) -f $(ARCH_SIM_CFG) $(TEST).elf > \
849
        $(RTL_SIM_RESULTS_DIR)/$(TEST)$(TEST_OUT_FILE_SUFFIX)
850
 
851
# Run tests in simulation, check output
852
sim-test-with-check: sim-test check-test-log
853
 
854
# Main architectural simulations test loop
855
sim-tests:
856
        $(Q)for test in $(TESTS); do \
857
                export TEST=$$test; \
858
                $(MAKE) sim-test-with-check; \
859
                if [ $$? -ne 0 ]; then break; fi; \
860
                echo; echo "\t### $$test test OK ###"; echo; \
861
        done

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.