FeatMgr Command Line Interface

FeatMgr can be configured from the command line through the FeatMgrBuilder class using the CliAdapter class.

-h, –help

show this help message and exit

–tohost_nonzero_terminate, -tnt

Spike option to be forwarded. Ends simulation immediately when tohost becomes nonzero.

–counter_event_path

path to counter event file, used to randomize events in counter files

–run_intent_checker, -ric

Run the intent checker on the test if Spike is used as the ISS

–max_logger_file_gb

Max size of testlog file in GB

–test_priv_mode

Specify privilege mode for the test to be forced. e.g. –test_priv_mode user. Legal values are: user, super, machine

–test_paging_mode

Specify paging mode for the test to be forced. e.g. –test_paging_mode sv57

–test_paging_g_mode

Specify g-stage paging mode for the test to be forced. e.g. –test_paging_g_mode sv57

–test_env

Specify environment for the test to be forced. e.g. –test_env bare_metal

–test_env_any

Allow test environment to be randomly selected between bare_metal and virtualized if any is specified

–test_secure_mode

Specify secure mode for the test to be forced. e.g. –test_secure_mode random If random or any is selected then the probability of secure mode is 20%%

–tohost

Hardcoded address for tohost and HTIF IO section; Leaving blank uses value in memap, if none in memmap puts as variables at end of os_code

–eot_pass_value

Sets the end of test pass value; defaults to 1

–eot_fail_value

Sets the end of test fail value; defaults to 1

–mp

Overrides MP enablement in cpuconfig file or overridden in test file. Legal values are: ‘on’, ‘off’

–mp_mode

Overrides MP mode provided in cpuconfig file or overridden in test file. Legal values are: ‘simultaneous’, ‘parallel’

–parallel_scheduling_mode

Overrides parallel scheduling mode provided in cpuconfig file or overridden in test file. Legal values are: ‘round_robin’, ‘exhaustive’

–num_cpus

Overrides number of CPUs provided in cpuconfig file or overridden in test file. Legal values are positive integers

–single_assembly_file, -saf

Indicates that all assembly is written to a single file. Ignoring this option means writing to a handful of .inc files

–force_alignment

Forces all data and code to be byte-aligned; Removes –misaligned from spike run_iss’s args

–c_used

Use C sections when generating code

–small_bss

Sets bss section to 1200 4kb page instead of default

–big_bss

Sets bss section to 3080 4kb pages instead of default

–big_endian, -big_e

Mode for enabling big-endian for cross-compilers and ISS

–more_os_pages

Ask riescued to generate more code and os_stack pages for long tests

–add_gcc_cstdlib_sections

Add a gcc cstdlib section to the test for each library function as GCC likes to do.

–addrgen_limit_indices

Limit addrgen to not generate more than 4 addresses with the same index

–code_offset

Specify code offset where the test code should start. Default: Randomized 0-140h

–randomize_code_location

Randomize the code location in the test. Default: follows .text section

–repeat_times, -rt

Number of times each discrete test should be run

–private_maps

Setup isolated page map address spaces

–cfile

Use runtime c-files that must be specified with this arg. Can be specified multiple times

–enable_machine_paging

Enable Machine privilege + paging mode for the test. Guest paging mode disabled

–fe_tb, -fe_tb

Special considerations for FE testbench. They really can’t know taken vs not-taken branches. So, jump to passed|failed is same for them. So, making passed=failed label

–wysiwyg

‘What You See Is What You Get mode; no OS code is added, only the test code is executed as it is. Intended for environments not monitoring tohost writes

–linux_mode

Generate riescued OS code and prepare test to run it in the Linux environment. Runs endlessly

–bringup_pagetables

Implies –wysiwyg and –addrgen_limit_indices, but enables switch to super and paging in the loader code

–reserve_partial_phys_memory

By default, Riescue-D will only reserve full physical address size specified by ;page_mapping(pagesize) or ;random_addr(size). If you want Riescued to only reserve 4kb size for all the addresses, use this option

–all_4kb_pages

Ask riescued to generate all 4KB pages

–disallow_mmio

Disallow MMIO in the test

–addrgen_limit_way_predictor_multihit, -ag_limit_wp_multihit

Limit addrgen to not generate address with multi-hit in the way predictor

–deleg_excp_to, -deleg_excp_to

Specify privilege where exceptions are handled. Default: machine or super (random)

–switch_to_machine_page, -switch_to_machine_page

Specify the page where the handler will return control after using ecall function 0xf0010001

–switch_to_super_page, -switch_to_super_page

Specify the page where the handler will return control after using ecall function 0xf0010002

–switch_to_user_page, -switch_to_user_page

Specify the page where the handler will return control after using ecall function 0xf0010003

–user_interrupt_table

Overrides jump to default interrupt table with user symbol ‘USER_INTERRUPT_TABLE’

–excp_hooks, -excp_hooks

Insert exception handler hooks. RiescueD will call excp_handler_pre: and excp_handler_post: functions right before entering the exception hndler and after before returning from exception handler respectively

–interrupts_enabled, -ie

Enable interrupts

–skip_instruction_for_unexpected

Ambigious name - this should be something like ‘ignore unexpected exceptions’.

–disable_wfi_wait, -disable_wfi_wait

[Required for MP spike runs] Disable wfi wait in sync loops.

–setup_pmp

Ask riescued to setup PMP registers

–needs_pma

Indicates if the test wants to enable PMA functionality of Riescue-D

–num_pmas

Number of PMACFG registers implemented. Default is 16. Changing this number requires an update in the whisper_config.json

–vmm_hooks, -vmm_hooks

Insert vmm hooks in the virtualized mode. RiescueD will call vmm_handler_pre: and vmm_handler_post: functions before launching the guest and after exiting from guest respectively

–setup_stateen

Ask riescued to setup stateen registers as per smstateen extension

–csr_init

Initialize a CSR with a value. Format: ‘csr_name=value’ or ‘csr_number=value’. Can be specified multiple times. Example: –csr_init mstatus=0x8000 –csr_init 0x300=0x1

–csr_init_mask

Initialize a CSR using read-modify-write with a mask. Format: ‘csr_name=mask=value’ or ‘csr_number=mask=value’. Can be specified multiple times. Example: –csr_init_mask mstatus=0x8000=0x8000

–no_random_csr_reads, -no_random_csr_reads

Disable random CSR read randomization that happens in the OS scheduler code

–max_random_csr_reads, -max_random_csr_read

Maximum number of CSRs read to inject for the randomization. Default: 16. Minimum: 3.

–random_machine_csr_list, -random_machine_csr_list

List csr name that the CSR read randomization logic must include when OS is in machine mode. Specify list this: –random_machine_csr_list mstatus,mcause FIXME: use choices

–random_supervisor_csr_list, -random_supervisor_csr_list

List csr name that the CSR read randomization logic must include when OS is in supervisor/machine mode. Specify list this: –random_supervisor_csr_list sstatus,scause

–random_user_csr_list, -random_user_csr_list

List csr name that the CSR read randomization logic must include when OS is in user/supervisor/machine mode. Specify list this: –random_supervisor_csr_list fcsr,time

–medeleg

Override medeleg when –test_env supervisor/user

–mideleg

Override mideleg when –test_env supervisor/user

–hedeleg

Override hedeleg when ‘–test_env supervisor/user’ and ‘–test_env virtualized’ in VS mode OS

–hideleg

Override hideleg when ‘–test_env supervisor/user’ and ‘–test_env virtualized’ in VS mode OS

–menvcfg

Override menvcfg value to write in loader

–henvcfg

Override henvcfg value to write in loader

–senvcfg

Override senvcfg value to write in loader. Default 0x0.

–secure_access_probability, -sap

Probability of secure access in the test. Default is 30%%

–secure_pt_probability

Probability of secure pagetable in the test

–a_d_bit_randomization

Probability of randomizing A and D bits in page table entries (0-100)

–pbmt_ncio_randomization

Probability of randomizing PBMT NC vs IO bits in page table entries (0-100)