Fix the verbose logging issue, fix coverage/waveform options (#235)

This commit is contained in:
taoliug 2019-08-13 10:23:07 -07:00 committed by udinator
parent 97105f42b1
commit 9309621f04
3 changed files with 18 additions and 13 deletions

View file

@ -34,12 +34,12 @@ LSF_CMD :=
# Privileged CSR YAML description file
CSR_FILE := ${DV_DIR}/riscv_dv_extension/csr_description.yaml
# Address that privileged CSR test will write to to indicate end of test
# Pass/fail signature address at the end of test
END_SIGNATURE_ADDR := 0x8ffffffc
# Value written to END_SIGNATURE_ADDR that indicates test success
PASS_VAL := 0x1
PASS_VAL := 0x1
# Value written to END_SIGNATURE_ADDR that indicates test failure
FAIL_VAL := 0x0
FAIL_VAL := 0x0
SHELL=/bin/bash
@ -53,11 +53,14 @@ clean:
rm -rf ${OUT}
# Common options for all targets
COMMON_OPTS=--seed=${SEED} \
--test=${TEST} \
--testlist=${DV_DIR}/riscv_dv_extension/testlist.yaml \
--iterations=${ITERATIONS}
#--verbose=${VERBOSE}
COMMON_OPTS:=--seed=${SEED} \
--test=${TEST} \
--testlist=${DV_DIR}/riscv_dv_extension/testlist.yaml \
--iterations=${ITERATIONS}
ifeq ($(VERBOSE), 1)
COMMON_OPTS+=--verbose
endif
# Options used for privileged CSR test generation
CSR_OPTS=--csr_yaml=${CSR_FILE} \
@ -118,8 +121,8 @@ rtl_sim:
--steps=sim \
${COMMON_OPTS} \
--simulator=${SIMULATOR} \
--en_cov=${COV} \
--en_wave=${WAVES} \
--en_cov ${COV} \
--en_wave ${WAVES} \
--sim_opts="+end_signature_addr=${END_SIGNATURE_ADDR} +pass_val=${PASS_VAL} +fail_val=${FAIL_VAL}" \
${SIM_OPTS}

View file

@ -45,7 +45,7 @@ def process_cmd(keyword, cmd, opts, enable):
Processed command
"""
if enable == "1":
return re.sub(keyword, opts, cmd)
return re.sub(keyword, opts.rstrip(), cmd)
else:
return re.sub(keyword, "", cmd)
@ -165,6 +165,7 @@ def rtl_sim(sim_cmd, test_list, output_dir, bin_dir, lsf_cmd, seed, opts, verbos
for test in test_list:
for i in range(test['iterations']):
rand_seed = get_seed(seed)
sim_cmd = re.sub("<seed>", str(rand_seed), sim_cmd)
sim_dir = output_dir + ("/%s.%d" %(test['test'], i))
run_cmd(("mkdir -p %s" % sim_dir))
os.chdir(sim_dir)
@ -174,7 +175,6 @@ def rtl_sim(sim_cmd, test_list, output_dir, bin_dir, lsf_cmd, seed, opts, verbos
cmd = lsf_cmd + " " + sim_cmd.rstrip() + \
(" +UVM_TESTNAME=%s " % test['rtl_test']) + \
(" +bin=%s " % binary) + \
(" +ntb_random_seed=%d " % rand_seed) + \
(" -l sim.log ")
print("Running %s with %s" % (test['rtl_test'], binary))
if verbose:
@ -250,7 +250,7 @@ parser.add_argument("--simulator_yaml", type=str, default="yaml/rtl_simulation.y
help="RTL simulator setting YAML")
parser.add_argument("--iss", type=str, default="spike",
help="Instruction set simulator")
parser.add_argument("--verbose", type=int, default=0,
parser.add_argument("-v", "--verbose", dest="verbose", action="store_true",
help="Verbose logging")
parser.add_argument("--cmp_opts", type=str, default="",
help="Compile options for the generator")
@ -267,6 +267,7 @@ parser.add_argument("--lsf_cmd", type=str, default="",
command is not specified")
args = parser.parse_args()
parser.set_defaults(verbose=False)
cwd = os.path.dirname(os.path.realpath(__file__))
# Create the output directory

View file

@ -36,6 +36,7 @@
sim:
cmd: >
<out>/vcs_simv +vcs+lic+wait <sim_opts> <wave_opts> <cov_opts>
+ntb_random_seed=<seed>
cov_opts: >
-cm line+tgl+assert+fsm+branch
-cm_dir <out>/test.vdb