Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix integer bug #15

Open
wants to merge 1 commit into
base: test_all_elements
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ __pycache__/
.log
log*
.nfs*
sanity_test/
sanity_test/
/result
/log
command.md
validate.py
57 changes: 49 additions & 8 deletions scripts/create_test_integer/create_test_common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import random

from scripts.test_common_info import is_overlap

Expand Down Expand Up @@ -908,7 +909,12 @@ def generate_tests_vvvxvi(instr, f, rs1_val, rs2_val, lmul, instr_suffix='vv', g
num_elem = int((vlen * lmul / vsew))
if num_elem == 0:
return 0
loop_num = int(min(len(rs1_val), len(rs2_val)) / num_elem)
# Push some values util loop_num >= 1
while(len(rs1_val)<num_elem or len(rs1_val)%num_elem!=0):
rs1_val.append(random.randint(0,2**(vsew-1)))
while(len(rs2_val)<num_elem or len(rs2_val)%num_elem!=0):
rs2_val.append(random.randint(0,2**(vsew-1)))
loop_num = int(max(len(rs1_val), len(rs2_val)) / num_elem)
step_bytes = int(vlen * lmul / 8)
if generate_vv:
print(" #-------------------------------------------------------------", file=f)
Expand Down Expand Up @@ -966,7 +972,12 @@ def generate_tests_vw(f, rs1_val, rs2_val, instr, lmul, instr_suffix='vv', gener
num_elem = int((vlen * lmul / vsew))
if num_elem == 0:
return 0
loop_num = int(min(len(rs1_val), len(rs2_val)) / num_elem)
# Push some values util loop_num >= 1
while(len(rs1_val)<num_elem or len(rs1_val)%num_elem!=0):
rs1_val.append(random.randint(0,2**(vsew-1)))
while(len(rs2_val)<num_elem or len(rs2_val)%num_elem!=0):
rs2_val.append(random.randint(0,2**(vsew-1)))
loop_num = int(max(len(rs1_val), len(rs2_val)) / num_elem)
step_bytes = int(vlen * lmul / 8)
step_bytes_double = step_bytes * 2
print(" #-------------------------------------------------------------", file=f)
Expand Down Expand Up @@ -1033,7 +1044,12 @@ def generate_tests_vwmacc(f, rs1_val, rs2_val, instr, lmul, instr_suffix='vv', g
num_elem = int((vlen * lmul / vsew))
if num_elem == 0:
return 0
loop_num = int(min(len(rs1_val), len(rs2_val)) / num_elem)
# Push some values util loop_num >= 1
while(len(rs1_val)<num_elem or len(rs1_val)%num_elem!=0):
rs1_val.append(random.randint(0,2**(vsew-1)))
while(len(rs2_val)<num_elem or len(rs2_val)%num_elem!=0):
rs2_val.append(random.randint(0,2**(vsew-1)))
loop_num = int(max(len(rs1_val), len(rs2_val)) / num_elem)
step_bytes = int(vlen * lmul / 8)
step_bytes_double = step_bytes * 2
print(" #-------------------------------------------------------------", file=f)
Expand Down Expand Up @@ -1077,7 +1093,12 @@ def generate_tests_muladd(instr, f, rs1_val, rs2_val, lmul):
num_elem = int((vlen * lmul / vsew))
if num_elem == 0:
return 0
loop_num = int(min(len(rs1_val), len(rs2_val)) / num_elem)
# Push some values util loop_num >= 1
while(len(rs1_val)<num_elem or len(rs1_val)%num_elem!=0):
rs1_val.append(random.randint(0,2**(vsew-1)))
while(len(rs2_val)<num_elem or len(rs2_val)%num_elem!=0):
rs2_val.append(random.randint(0,2**(vsew-1)))
loop_num = int(max(len(rs1_val), len(rs2_val)) / num_elem)
step_bytes = int(vlen * lmul / 8)
print(" #-------------------------------------------------------------", file=f)
print(" # VV Tests", file=f)
Expand Down Expand Up @@ -1122,7 +1143,12 @@ def generate_tests_vmadc(instr, f, rs1_val, rs2_val, lmul, generate_vi = True):
num_elem = int((vlen * lmul / vsew))
if num_elem == 0:
return 0
loop_num = int(min(len(rs1_val), len(rs2_val)) / num_elem)
# Push some values util loop_num >= 1
while(len(rs1_val)<num_elem or len(rs1_val)%num_elem!=0):
rs1_val.append(random.randint(0,2**(vsew-1)))
while(len(rs2_val)<num_elem or len(rs2_val)%num_elem!=0):
rs2_val.append(random.randint(0,2**(vsew-1)))
loop_num = int(max(len(rs1_val), len(rs2_val)) / num_elem)
step_bytes = int(vlen * lmul / 8)
print(" #-------------------------------------------------------------", file=f)
print(" # VV Tests", file=f)
Expand Down Expand Up @@ -1255,7 +1281,12 @@ def generate_tests_vadc(instr, f, rs1_val, rs2_val, lmul, generate_vi=True):
num_elem = int((vlen * lmul / vsew))
if num_elem == 0:
return 0
loop_num = int(min(len(rs1_val), len(rs2_val)) / num_elem)
# Push some values util loop_num >= 1
while(len(rs1_val)<num_elem or len(rs1_val)%num_elem!=0):
rs1_val.append(random.randint(0,2**(vsew-1)))
while(len(rs2_val)<num_elem or len(rs2_val)%num_elem!=0):
rs2_val.append(random.randint(0,2**(vsew-1)))
loop_num = int(max(len(rs1_val), len(rs2_val)) / num_elem)
step_bytes = int(vlen * lmul / 8)
print(" #-------------------------------------------------------------", file=f)
print(" # VV Tests", file=f)
Expand Down Expand Up @@ -1311,7 +1342,12 @@ def generate_tests_vvmvxmvim(instr, f, rs1_val, rs2_val, lmul, generate_vv=True,
num_elem = int((vlen * lmul / vsew))
if num_elem == 0:
return 0
loop_num = int(min(len(rs1_val), len(rs2_val)) / num_elem)
# Push some values util loop_num >= 1
while(len(rs1_val)<num_elem or len(rs1_val)%num_elem!=0):
rs1_val.append(random.randint(0,2**(vsew-1)))
while(len(rs2_val)<num_elem or len(rs2_val)%num_elem!=0):
rs2_val.append(random.randint(0,2**(vsew-1)))
loop_num = int(max(len(rs1_val), len(rs2_val)) / num_elem)
step_bytes = int(vlen * lmul / 8)
if generate_vv:
print(" #-------------------------------------------------------------", file=f)
Expand Down Expand Up @@ -1383,7 +1419,12 @@ def generate_tests_nvvnvxnvi(instr, f, rs1_val, rs2_val, lmul):
num_elem = int((vlen * lmul / vsew))
if num_elem == 0:
return 0
loop_num = int(min(len(rs1_val), len(rs2_val)) / num_elem)
# Push some values util loop_num >= 1
while(len(rs1_val)<num_elem or len(rs1_val)%num_elem!=0):
rs1_val.append(random.randint(0,2**(vsew-1)))
while(len(rs2_val)<num_elem or len(rs2_val)%num_elem!=0):
rs2_val.append(random.randint(0,2**(vsew-1)))
loop_num = int(max(len(rs1_val), len(rs2_val)) / num_elem)
step_bytes = int(vlen * lmul / 8)
print(" #-------------------------------------------------------------", file=f)
print(" # VV Tests", file=f)
Expand Down