diff --git a/riscof/cli.py b/riscof/cli.py index c1a9d11..b1dbf3a 100644 --- a/riscof/cli.py +++ b/riscof/cli.py @@ -260,8 +260,10 @@ def testlist(ctx,config,work_dir,suite,env): @click.option('--no-ref-run',is_flag=True,help="Do not run tests on Reference") @click.option('--no-dut-run',is_flag=True,help="Do not run tests on DUT") @click.option('--no-clean',is_flag=True,help="Do not clean work directory(if exists).") +@click.option('--gen-sig-header',is_flag=True,help="Run tests on the Reference Model and Generate Signature Header File for the Self-Checking Tests.") +@click.option('--self-check',is_flag=True,help="Self-Checking Mode: Run tests on the DUT using already generated Signature Files.") @click.pass_context -def run(ctx,config,work_dir,suite,env,no_browser,dbfile,testfile,no_ref_run,no_dut_run,no_clean): +def run(ctx,config,work_dir,suite,env,no_browser,dbfile,testfile,no_ref_run,no_dut_run,no_clean, gen_sig_header, self_check): exitcode = 0 clean = (testfile is not None or dbfile is not None or no_clean) setup_directories(work_dir,clean) @@ -297,7 +299,7 @@ def run(ctx,config,work_dir,suite,env,no_browser,dbfile,testfile,no_ref_run,no_d with open(ctx.obj.platform_file, "r") as platfile: pspecs = platfile.read() - cntr_args = [dbfile,testfile,no_ref_run,no_dut_run] + cntr_args = [dbfile,testfile,no_ref_run,no_dut_run, gen_sig_header, self_check] report_objects = {} report_objects['date'] = (datetime.now( diff --git a/riscof/framework/main.py b/riscof/framework/main.py index 3661229..361efb8 100644 --- a/riscof/framework/main.py +++ b/riscof/framework/main.py @@ -175,7 +175,7 @@ def run(dut, base, dut_isa_spec, dut_platform_spec, work_dir, cntr_args): :param dut_platform_spec: The absolute path to the checked yaml containing the DUT platform specification. - :param cntr_args: dbfile, testfile, no_ref_run, no_dut_run + :param cntr_args: dbfile, testfile, no_ref_run, no_dut_run, gen_sig_file, self_check :type dut_platform_spec: str @@ -194,10 +194,12 @@ def run(dut, base, dut_isa_spec, dut_platform_spec, work_dir, cntr_args): ispec = utils.load_yaml(dut_isa_spec) pspec = utils.load_yaml(dut_platform_spec) - if cntr_args[2]: + if cntr_args[2] or cntr_args[5]: + if cntr_args[5]: + logger.info("Running Tests in SELF-CHECKING MODE...") logger.info("Running Build for DUT") dut.build(dut_isa_spec, dut_platform_spec) - elif cntr_args[3]: + elif cntr_args[3] or cntr_args[4]: logger.info("Running Build for Reference") base.build(dut_isa_spec, dut_platform_spec) else: diff --git a/riscof/framework/test.py b/riscof/framework/test.py index e0660b0..60f5936 100644 --- a/riscof/framework/test.py +++ b/riscof/framework/test.py @@ -409,7 +409,7 @@ def run_tests(dut, base, ispec, pspec, work_dir, cntr_args): :param pspec: The platform specifications of the DUT. - :param cntr_args: dbfile, testfile, no_ref_run, no_dut_run + :param cntr_args: dbfile, testfile, no_ref_run, no_dut_run, gen_sig_file, self_check :type ispec: dict @@ -433,14 +433,17 @@ def run_tests(dut, base, ispec, pspec, work_dir, cntr_args): base_test_list[entry]['work_dir'] = os.path.join(node['work_dir'],'ref') os.makedirs(base_test_list[entry]['work_dir'], exist_ok=True) results = [] - if cntr_args[2]: + if cntr_args[2] or cntr_args[5]: logger.info("Running Tests on DUT.") dut.runTests(dut_test_list) logger.info("Tests run on DUT done.") raise SystemExit(0) - elif cntr_args[3]: + elif cntr_args[3] or cntr_args[4]: logger.info("Running Tests on Reference Model.") base.runTests(base_test_list) + if cntr_args[4]: + base.genSigheader(base.name, test_list) + logger.info("Signature Header File Generated.") logger.info("Tests run on Reference done.") raise SystemExit(0) else: