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

Commit

Permalink
Merge pull request #75 from riscv-software-src/fix-op-gen
Browse files Browse the repository at this point in the history
Fix op gen
  • Loading branch information
neelgala authored Aug 16, 2023
2 parents 6c38f9a + e41de5f commit 95bec38
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 57 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.11.1] - 2023-08-15
- Fixed hex values handling for K extensions
- Fixed set indexing error during opcomb gen
- Fixed whitespaces on empty lines in yaml template files.

## [0.11.0] - 2022-12-11
- Added support for csr_comb test generation

Expand Down
2 changes: 1 addition & 1 deletion riscv_ctg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__author__ = """InCore Semiconductors Pvt Ltd"""
__email__ = '[email protected]'
__version__ = '0.11.0'
__version__ = '0.11.1'
6 changes: 3 additions & 3 deletions riscv_ctg/data/fd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ fcvt.s.wu:
val_offset:$val_offset; rmval:$rm_val; correctval:??; testreg:$testreg;
fcsr_val: $fcsr*/
TEST_FPIO_OP($inst, $rd, $rs1, $rm_val, $fcsr, $correctval, $valaddr_reg, $val_offset, $flagreg, $swreg, $testreg,$load_instr)
fcvt.d.w:
sig:
stride: 2
Expand Down Expand Up @@ -1681,7 +1681,7 @@ fcvt.s.l:
val_offset:$val_offset; rmval:$rm_val; correctval:??; testreg:$testreg;
fcsr_val: $fcsr*/
TEST_FPIO_OP($inst, $rd, $rs1, $rm_val, $fcsr, $correctval, $valaddr_reg, $val_offset, $flagreg, $swreg, $testreg,$load_instr)
fcvt.s.lu:
sig:
stride: 2
Expand All @@ -1708,4 +1708,4 @@ fcvt.s.lu:
val_offset:$val_offset; rmval:$rm_val; correctval:??; testreg:$testreg;
fcsr_val: $fcsr*/
TEST_FPIO_OP($inst, $rd, $rs1, $rm_val, $fcsr, $correctval, $valaddr_reg, $val_offset, $flagreg, $swreg, $testreg,$load_instr)
9 changes: 0 additions & 9 deletions riscv_ctg/data/imc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ add:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -36,7 +35,6 @@ sub:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -58,7 +56,6 @@ addw:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -79,7 +76,6 @@ subw:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -100,7 +96,6 @@ and:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -121,7 +116,6 @@ or:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -142,7 +136,6 @@ slt:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -163,7 +156,6 @@ sltu:
rs1_val_data: 'gen_usign_dataset(xlen) + gen_sp_dataset(xlen,False)'
rs2_val_data: 'gen_usign_dataset(xlen) + gen_sp_dataset(xlen,False)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand Down Expand Up @@ -1455,7 +1447,6 @@ c.nop:
rs1_data: "['x0']"
rs1_val_data: "[0]"
template: |-
// $comment
// opcode:$inst; immval:$imm_val
TEST_CNOP_OP($inst, $testreg, $imm_val, $swreg, $offset)
Expand Down
25 changes: 1 addition & 24 deletions riscv_ctg/data/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,6 @@ clz:
rd_op_data: *all_regs
rs1_val_data: 'gen_usign_dataset(xlen)+gen_sign_dataset(xlen)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -1498,7 +1497,6 @@ clzw:
rd_op_data: *all_regs
rs1_val_data: 'gen_sign_dataset(xlen)+gen_usign_dataset(xlen)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -1516,7 +1514,6 @@ cpop:
rd_op_data: *all_regs
rs1_val_data: 'gen_usign_dataset(xlen)+gen_sign_dataset(xlen)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -1534,7 +1531,6 @@ cpopw:
rd_op_data: *all_regs
rs1_val_data: 'gen_sign_dataset(xlen)+gen_usign_dataset(xlen)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -1552,7 +1548,6 @@ ctz:
rd_op_data: *all_regs
rs1_val_data: 'gen_usign_dataset(xlen)+gen_sign_dataset(xlen)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -1570,7 +1565,6 @@ ctzw:
rd_op_data: *all_regs
rs1_val_data: 'gen_usign_dataset(xlen)+gen_sign_dataset(xlen)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -1590,7 +1584,6 @@ max:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_bitmanip_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_bitmanip_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand Down Expand Up @@ -1636,7 +1629,6 @@ maxu:
rs1_val_data: 'gen_usign_dataset(xlen) + gen_bitmanip_dataset(xlen,False)'
rs2_val_data: 'gen_usign_dataset(xlen) + gen_bitmanip_dataset(xlen,False)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand Down Expand Up @@ -1682,7 +1674,6 @@ min:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_bitmanip_dataset(xlen,True)'
rs2_val_data: 'gen_sign_dataset(xlen) + gen_bitmanip_dataset(xlen,True)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand Down Expand Up @@ -1728,7 +1719,6 @@ minu:
rs1_val_data: 'gen_usign_dataset(xlen) + gen_bitmanip_dataset(xlen,False)'
rs2_val_data: 'gen_usign_dataset(xlen) + gen_bitmanip_dataset(xlen,False)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -1755,7 +1745,6 @@ urcrsa16:
rs2_h2_val_data: 'gen_usign_dataset(16)'
rs2_h3_val_data: 'gen_usign_dataset(16)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand Down Expand Up @@ -1799,7 +1788,6 @@ orc.b:
rd_op_data: *all_regs
rs1_val_data: 'gen_sign_dataset(xlen)+gen_usign_dataset(xlen)+[16909320,33818625,67633410,134283780,72624976414508040,145249888404506625,290483284134592770,576744443617542660]'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -1823,7 +1811,6 @@ orn:
rs1_val_data: 'gen_usign_dataset(xlen) + gen_bitmanip_dataset(xlen,False)'
rs2_val_data: 'gen_usign_dataset(xlen) + gen_bitmanip_dataset(xlen,False)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -1850,7 +1837,6 @@ ukcrsa16:
rs2_h2_val_data: 'gen_usign_dataset(16)'
rs2_h3_val_data: 'gen_usign_dataset(16)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_PKRR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $rs1, $swreg, $offset, $testreg)
Expand All @@ -1877,7 +1863,6 @@ stas16:
rs2_h2_val_data: 'gen_sign_dataset(16)'
rs2_h3_val_data: 'gen_sign_dataset(16)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand Down Expand Up @@ -1925,7 +1910,6 @@ rev8:
rd_op_data: *all_regs
rs1_val_data: 'gen_sign_dataset(xlen)+gen_usign_dataset(xlen)+gen_bitmanip_dataset(xlen,False)+[16909320,33818625,67633410,134283780,72624976414508040,145249888404506625,290483284134592770,576744443617542660]'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
LI($rs1,$rs1_val)
Expand Down Expand Up @@ -1953,7 +1937,6 @@ ror:
rs1_val_data: 'gen_sign_dataset(xlen) + gen_sp_dataset(xlen,True)'
rs2_val_data: 'gen_usign_dataset(ceil(log(xlen,2)))'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -1980,7 +1963,6 @@ urstas16:
rs2_h2_val_data: 'gen_usign_dataset(16)'
rs2_h3_val_data: 'gen_usign_dataset(16)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand All @@ -2007,7 +1989,6 @@ kstas16:
rs2_h2_val_data: 'gen_sign_dataset(16)'
rs2_h3_val_data: 'gen_sign_dataset(16)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_PKRR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $rs1, $swreg, $offset, $testreg)
Expand Down Expand Up @@ -2060,7 +2041,7 @@ rori:
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val; immval:$imm_val
TEST_IMM_OP( $inst, $rd, $rs1, $correctval, $rs1_val, $imm_val, $swreg, $offset, $testreg)
roriw:
sig:
stride: 1
Expand Down Expand Up @@ -2201,7 +2182,6 @@ sext.b:
rd_op_data: *all_regs
rs1_val_data: 'gen_sign_dataset(xlen)+gen_usign_dataset(xlen)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -2219,7 +2199,6 @@ sext.h:
rd_op_data: *all_regs
rs1_val_data: 'gen_sign_dataset(xlen)+gen_usign_dataset(xlen)+[65408]'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand Down Expand Up @@ -2314,7 +2293,6 @@ zext.h:
rd_op_data: *all_regs
rs1_val_data: 'gen_usign_dataset(xlen)+[65408]'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; dest:$rd; op1val:$rs1_val;
TEST_RD_OP($inst, $rd, $rs1, $correctval, $rs1_val, $swreg, $offset, $testreg)
Expand All @@ -2338,7 +2316,6 @@ clmul:
rs1_val_data: 'gen_sign_dataset(xlen)+gen_usign_dataset(xlen)'
rs2_val_data: 'gen_sign_dataset(xlen)+gen_usign_dataset(xlen)'
template: |-
// $comment
// opcode: $inst ; op1:$rs1; op2:$rs2; dest:$rd; op1val:$rs1_val; op2val:$rs2_val
TEST_RR_OP($inst, $rd, $rs1, $rs2, $correctval, $rs1_val, $rs2_val, $swreg, $offset, $testreg)
Expand Down
Loading

0 comments on commit 95bec38

Please sign in to comment.