@@ -30,55 +30,55 @@ def __init__(self):
30
30
31
31
@vsc .constraint
32
32
def rvc_csr_c (self ):
33
- # Registers specified by the three-bit rs1’ , rs2’ , and rd’
34
- with vsc .implies (self .format .inside (vsc .rangelist (riscv_instr_format_t .CIW_FORMAT ,
33
+ # Registers specified by the three-bit rs1, rs2, and rd
34
+ with vsc .if_then (self .format .inside (vsc .rangelist (riscv_instr_format_t .CIW_FORMAT ,
35
35
riscv_instr_format_t .CL_FORMAT ,
36
36
riscv_instr_format_t .CS_FORMAT ,
37
37
riscv_instr_format_t .CB_FORMAT ,
38
38
riscv_instr_format_t .CA_FORMAT ))):
39
- with vsc .implies (self .has_rs1 == 1 ):
39
+ with vsc .if_then (self .has_rs1 == 1 ):
40
40
self .rs1 .inside (vsc .rangelist (riscv_reg_t .S0 , riscv_reg_t .S1 , riscv_reg_t .A0 ,
41
41
riscv_reg_t .A1 , riscv_reg_t .A2 , riscv_reg_t .A3 ,
42
42
riscv_reg_t .A4 , riscv_reg_t .A5 ))
43
- with vsc .implies (self .has_rs2 == 1 ):
43
+ with vsc .if_then (self .has_rs2 == 1 ):
44
44
self .rs2 .inside (vsc .rangelist (riscv_reg_t .S0 , riscv_reg_t .S1 , riscv_reg_t .A0 ,
45
45
riscv_reg_t .A1 , riscv_reg_t .A2 , riscv_reg_t .A3 ,
46
46
riscv_reg_t .A4 , riscv_reg_t .A5 ))
47
- with vsc .implies (self .has_rd == 1 ):
47
+ with vsc .if_then (self .has_rd == 1 ):
48
48
self .rd .inside (vsc .rangelist (riscv_reg_t .S0 , riscv_reg_t .S1 , riscv_reg_t .A0 ,
49
49
riscv_reg_t .A1 , riscv_reg_t .A2 , riscv_reg_t .A3 ,
50
50
riscv_reg_t .A4 , riscv_reg_t .A5 ))
51
51
# _ADDI16SP is only valid when rd == SP
52
- with vsc .implies (self .instr_name == riscv_instr_name_t .C_ADDI16SP ):
52
+ with vsc .if_then (self .instr_name == riscv_instr_name_t .C_ADDI16SP ):
53
53
self .rd == riscv_reg_t .SP
54
- with vsc .implies (self .instr_name .inside (vsc .rangelist (riscv_instr_name_t .C_JR ,
54
+ with vsc .if_then (self .instr_name .inside (vsc .rangelist (riscv_instr_name_t .C_JR ,
55
55
riscv_instr_name_t .C_JALR ))):
56
56
self .rs1 != riscv_reg_t .ZERO
57
57
self .rs2 == riscv_reg_t .ZERO
58
58
59
59
@vsc .constraint
60
60
def imm_val_c (self ):
61
- with vsc .implies (self .imm_type .inside (vsc .rangelist (imm_t .NZIMM , imm_t .NZUIMM ))):
61
+ with vsc .if_then (self .imm_type .inside (vsc .rangelist (imm_t .NZIMM , imm_t .NZUIMM ))):
62
62
self .imm [5 :0 ] != 0
63
- with vsc .implies (self .instr_name == riscv_instr_name_t .C_LUI ):
63
+ with vsc .if_then (self .instr_name == riscv_instr_name_t .C_LUI ):
64
64
self .imm [31 :5 ] == 0
65
- with vsc .implies (self .instr_name .inside (vsc .rangelist (riscv_instr_name_t .C_SRAI ,
65
+ with vsc .if_then (self .instr_name .inside (vsc .rangelist (riscv_instr_name_t .C_SRAI ,
66
66
riscv_instr_name_t .C_SRLI ,
67
67
riscv_instr_name_t .C_SLLI ))):
68
68
self .imm [31 :5 ] == 0
69
- with vsc .implies (self .instr_name == riscv_instr_name_t .C_ADDI4SPN ):
69
+ with vsc .if_then (self .instr_name == riscv_instr_name_t .C_ADDI4SPN ):
70
70
self .imm [1 :0 ] == 0
71
71
72
72
# C_JAL is RV32C only instruction
73
73
@vsc .constraint
74
74
def jal_c (self ):
75
- with vsc .implies (self .XLEN != 32 ):
75
+ with vsc .if_then (self .XLEN != 32 ):
76
76
self .instr_name != riscv_instr_name_t .C_JAL
77
77
78
78
# Avoid generating HINT or illegal instruction by default as it's not supported by the compiler
79
79
@vsc .constraint
80
80
def no_hint_illegal_instr_c (self ):
81
- with vsc .implies (self .instr_name .inside (vsc .rangelist (riscv_instr_name_t .C_ADDI ,
81
+ with vsc .if_then (self .instr_name .inside (vsc .rangelist (riscv_instr_name_t .C_ADDI ,
82
82
riscv_instr_name_t .C_ADDIW ,
83
83
riscv_instr_name_t .C_LI ,
84
84
riscv_instr_name_t .C_LUI ,
@@ -90,12 +90,12 @@ def no_hint_illegal_instr_c(self):
90
90
riscv_instr_name_t .C_ADD ,
91
91
riscv_instr_name_t .C_LWSP ))):
92
92
self .rd != riscv_reg_t .ZERO
93
- with vsc .implies (self .instr_name == riscv_instr_name_t .C_JR ):
93
+ with vsc .if_then (self .instr_name == riscv_instr_name_t .C_JR ):
94
94
self .rs1 != riscv_reg_t .ZERO
95
- with vsc .implies (self .instr_name .inside (vsc .rangelist (riscv_instr_name_t .C_ADD ,
95
+ with vsc .if_then (self .instr_name .inside (vsc .rangelist (riscv_instr_name_t .C_ADD ,
96
96
riscv_instr_name_t .C_MV ))):
97
97
self .rs2 != riscv_reg_t .ZERO
98
- with vsc .implies (self .instr_name == riscv_instr_name_t .C_LUI ):
98
+ with vsc .if_then (self .instr_name == riscv_instr_name_t .C_LUI ):
99
99
self .rd != riscv_reg_t .SP
100
100
101
101
def set_imm_len (self ):
0 commit comments