Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' into Z_inx
Browse files Browse the repository at this point in the history
Signed-off-by: Umer Shahid <[email protected]>
  • Loading branch information
UmerShahidengr authored Jul 18, 2024
2 parents e85e2d3 + 3ed8269 commit 0bbc4af
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions riscv_ctg/data/imc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,7 @@ c.jr:
isa:
- IC
formattype: 'crformat'
ea_align_data: '[0,1]'
rs1_val_data: 'gen_sign_dataset(xlen)+ gen_sp_dataset(xlen)'
rs2_val_data: 'gen_sign_dataset(xlen)+ gen_sp_dataset(xlen)'
template: |-
Expand All @@ -1880,6 +1881,7 @@ c.jalr:
isa:
- IC
formattype: 'crformat'
ea_align_data: '[0,1]'
rs1_val_data: 'gen_sign_dataset(xlen)+ gen_sp_dataset(xlen)'
rs2_val_data: 'gen_sign_dataset(xlen)+ gen_sp_dataset(xlen)'
template: |-
Expand Down
4 changes: 2 additions & 2 deletions riscv_ctg/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def __init__(self,fmt,opnode,opcode,randomization, xl, fl, ifl ,base_isa_str,inx
self.inxFlag = inxFlag
self.is_sgn_extd = is_sgn_extd

if opcode in ['sw', 'sh', 'sb', 'lw', 'lhu', 'lh', 'lb', 'lbu', 'ld', 'lwu', 'sd',"jal","beq","bge","bgeu","blt","bltu","bne","jalr","flw","fsw","fld","fsd","flh","fsh","c.lbu","c.lhu","c.lh","c.sb","c.sh","c.flw"]:
if opcode in ['sw', 'sh', 'sb', 'lw', 'lhu', 'lh', 'lb', 'lbu', 'ld', 'lwu', 'sd',"jal","beq","bge","bgeu","blt","bltu","bne","jalr","c.jalr","c.jr","flw","fsw","fld","fsd","flh","fsh","c.lbu","c.lhu","c.lh","c.sb","c.sh","c.flw"]:
self.val_vars = self.val_vars + ['ea_align']
self.template = opnode['template']
self.opnode = opnode
Expand Down Expand Up @@ -1449,4 +1449,4 @@ def __write_test__(self, file_name,node,label,instr_dict, op_node, usage_str):
sign.append("#ifdef rvtest_gpr_save\n"+signode_template.substitute(
{'n':32,'label':"gpr_save",'sz':'XLEN/32'})+"\n#endif\n")
with open(file_name,"w") as fd:
fd.write(usage_str + test_template.safe_substitute(data='\n'.join(data),test=test,sig='\n'.join(sign),isa=op_node_isa,opcode=opcode,extension=extension,label=label))
fd.write(usage_str + test_template.safe_substitute(data='\n'.join(data),test=test,sig='\n'.join(sign),isa=op_node_isa,opcode=opcode,extension=extension,label=label))
16 changes: 16 additions & 0 deletions sample_cgfs/rv32i_priv.cgf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ misalign1-jalr:
'imm_val%2 == 1 and ea_align == 1': 0
'imm_val%2 == 0 and ea_align == 1': 0

misalign1-cjalr:
config:
- check ISA:=regex(.*I.*C.*); def rvtest_mtrap_routine=True
mnemonics:
c.jalr: 0
val_comb:
'ea_align == 1': 0

misalign1-cjr:
config:
- check ISA:=regex(.*I.*C.*); def rvtest_mtrap_routine=True
mnemonics:
c.jr: 0
val_comb:
'ea_align == 1': 0

misalign-jal:
config:
- check ISA:=regex(.*I.*C.*)
Expand Down
16 changes: 16 additions & 0 deletions sample_cgfs/rv64i_priv.cgf
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ misalign1-jalr:
val_comb:
'ea_align == 1': 0

misalign1-cjalr:
config:
- check ISA:=regex(.*I.*C.*); def rvtest_mtrap_routine=True
mnemonics:
c.jalr: 0
val_comb:
'ea_align == 1': 0

misalign1-cjr:
config:
- check ISA:=regex(.*I.*C.*); def rvtest_mtrap_routine=True
mnemonics:
c.jr: 0
val_comb:
'ea_align == 1': 0

misalign-jal:
config:
- check ISA:=regex(.*I.*C.*)
Expand Down

0 comments on commit 0bbc4af

Please sign in to comment.