From d1dd0cec65836b36a54249287b75248bd0700f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCllner?= Date: Tue, 16 Jan 2024 22:11:00 +0100 Subject: [PATCH] generator.py: Drop toint() of integer value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The recently introduced toint() function does not accept arguments of type int and will trigger an exception in this case. This leads to an always crashing code path in generator.py, where rm_dict[] maps the rounding mode string to an integer, that is then passed to toint(). There are several ways to address this (e.g. mapping to a string, or making toint() more robust), but dropping the call to toint() is obviously the right thing to do. Signed-off-by: Christoph Müllner --- riscv_ctg/generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv_ctg/generator.py b/riscv_ctg/generator.py index 035b97d5..3cf19fe0 100644 --- a/riscv_ctg/generator.py +++ b/riscv_ctg/generator.py @@ -800,7 +800,7 @@ def eval_inst_coverage(coverpoints,instr): else: var_dict['imm_val'] = toint(instr['imm_val']) elif key == 'rm_val': - var_dict['rm_val'] = toint(rm_dict[instr['rm_val']]) + var_dict['rm_val'] = rm_dict[instr['rm_val']] else: var_dict[key] = toint(instr[key]) for key in self.op_vars: