Skip to content

Commit

Permalink
[CTG] Add cli param env_dir
Browse files Browse the repository at this point in the history
Signed-off-by: MingZhu Yan <yanmingzhu@iscas.ac.cn>
  • Loading branch information
trdthg committed Oct 25, 2024
1 parent 37dc852 commit edef7ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions riscv-ctg/riscv_ctg/ctg.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ 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,inxFlag):
def ctg(verbose, out, env_dir, 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.')
logger.info('All Rights Reserved.')
logger.info("Copying env folder to Output directory.")
env_dir = os.path.expanduser("~/riscv-arch-test/riscv-test-suite/env")
env_dir = os.path.expanduser(env_dir)
if not os.path.exists(env_dir):
shutil.copytree(const.env,env_dir)
xlen = int(xlen_arg)
Expand Down
5 changes: 3 additions & 2 deletions riscv-ctg/riscv_ctg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@click.version_option(prog_name="RISC-V Compliance Test Generator",version=__version__)
@click.option('--verbose', '-v', default='error', help='Set verbose level', type=click.Choice(['info','error','debug','warning'],case_sensitive=False))
@click.option('--out-dir', '-d', default='./', type=click.Path(resolve_path=True,writable=True), help='Output directory path')
@click.option('--env-dir', '-e', default='~/riscv-arch-test/riscv-test-suite/env', type=click.Path(resolve_path=True,writable=True), help='Env directory path')
@click.option('--randomize','-r', default=False , is_flag='True', help='Randomize Outputs.')
@click.option('--cgf','-cf',multiple=True,type=click.Path(exists=True,resolve_path=True,readable=True),help="Path to the cgf file(s). Multiple allowed.")
@click.option('--procs','-p',type=int,default=1,help='Max number of processes to spawn')
Expand All @@ -20,11 +21,11 @@
hardware.",default='32')
@click.option("--inst",type=int,help="Maximum number of Macro Instances per test.")
@click.option("--z-inx", '-ix', type=bool, default='False', help="If the extension is Z*inx then pass True otherwise defaulted to False")
def cli(verbose, out_dir, randomize , cgf,procs,base_isa, flen,inst,z_inx):
def cli(verbose, out_dir, env_dir, randomize , cgf,procs,base_isa, flen,inst,z_inx):
if not os.path.exists(out_dir):
os.mkdir(out_dir)
if '32' in base_isa:
xlen = 32
elif '64' in base_isa:
xlen = 64
ctg(verbose, out_dir, randomize ,xlen, int(flen), cgf,procs,base_isa,inst,z_inx)
ctg(verbose, out_dir, env_dir, randomize ,xlen, int(flen), cgf,procs,base_isa,inst,z_inx)

0 comments on commit edef7ac

Please sign in to comment.