lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame^] | 1 | #################################################################################################### |
| 2 | ## Copyright lowRISC contributors. ## |
| 3 | ## Licensed under the Apache License, Version 2.0, see LICENSE for details. ## |
| 4 | ## SPDX-License-Identifier: Apache-2.0 ## |
| 5 | #################################################################################################### |
| 6 | ## Entry point test Makefile forr building and running tests. ## |
| 7 | ## These are generic set of option groups that apply to all testbenches. ## |
| 8 | ## This flow requires the following options to be set: ## |
| 9 | ## DV_DIR - current dv directory that contains the test Makefile ## |
| 10 | ## DUT_TOP - top level dut module name ## |
| 11 | ## TB_TOP - top level tb module name ## |
| 12 | ## DOTF - .f file used for compilation ## |
| 13 | ## COMPILE_KEY - compile option set ## |
| 14 | ## TEST_NAME - name of the test to run - this is supplied on the command line ## |
| 15 | #################################################################################################### |
| 16 | DV_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) |
| 17 | export DUT_TOP := gpio |
| 18 | export TB_TOP := tb |
| 19 | FUSESOC_CORE := lowrisc:dv:gpio_sim:0.1 |
| 20 | COMPILE_KEY ?= default |
| 21 | |
| 22 | #################################################################################################### |
| 23 | ## A D D I N D I V I D U A L T E S T S B E L O W ## |
| 24 | #################################################################################################### |
| 25 | TEST_NAME ?= gpio_sanity |
| 26 | UVM_TEST ?= gpio_base_test |
| 27 | UVM_TEST_SEQ ?= gpio_base_vseq |
| 28 | |
| 29 | ifeq (${TEST_NAME},gpio_sanity) |
| 30 | UVM_TEST_SEQ = gpio_sanity_vseq |
| 31 | endif |
| 32 | |
| 33 | ifeq (${TEST_NAME},gpio_sanity_no_pullup) |
| 34 | UVM_TEST_SEQ = gpio_sanity_vseq |
| 35 | RUN_OPTS += +active_high_pullup=0 |
| 36 | endif |
| 37 | |
| 38 | ifeq (${TEST_NAME},gpio_csr_hw_reset) |
| 39 | UVM_TEST_SEQ = gpio_csr_vseq |
| 40 | RUN_OPTS += +csr_hw_reset |
| 41 | RUN_OPTS += +en_scb=0 |
| 42 | endif |
| 43 | |
| 44 | ifeq (${TEST_NAME},gpio_csr_rw) |
| 45 | UVM_TEST_SEQ = gpio_csr_vseq |
| 46 | RUN_OPTS += +csr_rw |
| 47 | RUN_OPTS += +en_scb=0 |
| 48 | endif |
| 49 | |
| 50 | ifeq (${TEST_NAME},gpio_csr_bit_bash) |
| 51 | UVM_TEST_SEQ = gpio_csr_vseq |
| 52 | RUN_OPTS += +csr_bit_bash |
| 53 | RUN_OPTS += +en_scb=0 |
| 54 | endif |
| 55 | |
| 56 | ifeq (${TEST_NAME},gpio_csr_aliasing) |
| 57 | UVM_TEST_SEQ = gpio_csr_vseq |
| 58 | RUN_OPTS += +csr_aliasing |
| 59 | RUN_OPTS += +en_scb=0 |
| 60 | endif |
| 61 | |
| 62 | ifeq ($(TEST_NAME),gpio_random_dout_din) |
| 63 | UVM_TEST_SEQ = gpio_random_dout_din_vseq |
| 64 | endif |
| 65 | |
| 66 | ifeq ($(TEST_NAME),gpio_random_dout_din_no_pullup) |
| 67 | UVM_TEST_SEQ = gpio_random_dout_din_vseq |
| 68 | RUN_OPTS += +active_high_pullup=0 |
| 69 | endif |
| 70 | |
| 71 | ifeq ($(TEST_NAME),gpio_dout_din_regs_random_rw) |
| 72 | UVM_TEST_SEQ = gpio_dout_din_regs_random_rw_vseq |
| 73 | endif |
| 74 | |
| 75 | ifeq ($(TEST_NAME),gpio_intr_rand_pgm) |
| 76 | UVM_TEST_SEQ = gpio_intr_rand_pgm_vseq |
| 77 | endif |
| 78 | |
| 79 | ifeq ($(TEST_NAME),gpio_rand_intr_trigger) |
| 80 | UVM_TEST_SEQ = gpio_rand_intr_trigger_vseq |
| 81 | endif |
| 82 | |
| 83 | ifeq ($(TEST_NAME),gpio_intr_with_filter_rand_intr_event) |
| 84 | UVM_TEST_SEQ = gpio_intr_with_filter_rand_intr_event_vseq |
| 85 | RUN_OPTS += +en_scb=0 |
| 86 | RUN_OPTS += +zero_delays=1 |
| 87 | endif |
| 88 | |
| 89 | #################################################################################################### |
| 90 | ## Include the tool Makefile below ## |
| 91 | ## Dont add anything else below it! ## |
| 92 | #################################################################################################### |
| 93 | include ${DV_DIR}/../../../dv/tools/Makefile |
| 94 | |