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

Add support for Zfinx and Zfh extension #67

Merged
merged 18 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion riscv_ctg/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def gen_bitmanip_dataset(bit_width,sign=True):
# increment each value in dataset, increment each value in dataset, add them to the dataset
return dataset + [x - 1 for x in dataset] + [x+1 for x in dataset] + dataset0

template_fnames = ["template.yaml","imc.yaml","fd.yaml"]
template_fnames = ["template.yaml","imc.yaml","fd.yaml","inx.yaml"]

template_files = [os.path.join(root,"data/"+f) for f in template_fnames]

Expand Down
16 changes: 12 additions & 4 deletions riscv_ctg/ctg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from math import *
from riscv_ctg.__init__ import __version__

def create_test(usage_str, node,label,base_isa,max_inst, op_template, randomize, out_dir, xlen, flen):
def create_test(usage_str, node,label,base_isa,max_inst, op_template, randomize, out_dir, xlen, flen, inxFlag):
iflen = 0
if 'mnemonics' not in node and 'csr_comb' not in node:
logger.warning("Neither mnemonics nor csr_comb node not found in covergroup: " + str(label))
Expand All @@ -42,7 +42,7 @@ def gen_test(op_node, opcode):
fprefix = os.path.join(out_dir,str(label))
logger.info('Generating Test for :' + str(label) +"-" + opcode)
formattype = op_node['formattype']
gen = Generator(formattype,op_node,opcode,randomize,xlen,flen,iflen,base_isa)
gen = Generator(formattype,op_node,opcode,randomize,xlen,flen,iflen,base_isa,inxFlag)
op_comb = gen.opcomb(node)
val_comb = gen.valcomb(node)
instr_dict = gen.correct_val(
Expand Down Expand Up @@ -100,7 +100,7 @@ def gen_test(op_node, opcode):
logger.info('Writing tests for csr_comb')
csr_comb_gen.write_test(fprefix, node, usage_str, label, csr_comb_instr_dict)

def ctg(verbose, out, random ,xlen_arg,flen_arg, cgf_file,num_procs,base_isa, max_inst):
def ctg(verbose, out, random ,xlen_arg,flen_arg, cgf_file,num_procs,base_isa, max_inst,inxFlag):
logger.level(verbose)
logger.info('****** RISC-V Compliance Test Generator {0} *******'.format(__version__ ))
logger.info('Copyright (c) 2020, InCore Semiconductors Pvt. Ltd.')
Expand All @@ -123,9 +123,17 @@ def ctg(verbose, out, random ,xlen_arg,flen_arg, cgf_file,num_procs,base_isa, ma
usage_str = const.usage.safe_substitute(base_isa=base_isa, \
cgf=cgf_argument, version = __version__, time=mytime, \
randomize=randomize_argument,xlen=str(xlen_arg))
# ---------------------------------
# IITM Changes
# This <inxFlag> is introduced to handle the template conflict over float instructions
# ---------------------------------
if inxFlag:
const.template_files.remove([fd for fd in const.template_files if "fd.yaml" in fd][0])
else:
const.template_files.remove([fd for fd in const.template_files if "inx.yaml" in fd][0])
op_template = utils.load_yamls(const.template_files)
cgf = expand_cgf(cgf_file,xlen,flen)
pool = mp.Pool(num_procs)
results = pool.starmap(create_test, [(usage_str, node,label,base_isa,max_inst, op_template,
randomize, out_dir, xlen, flen) for label,node in cgf.items()])
randomize, out_dir, xlen, flen, inxFlag) for label,node in cgf.items()])
pool.close()
Loading
Loading