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

[ISAC] - PTE Permissions Check Function and prev. instr. csr track func Updated #563

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
rename the old function to old_csr_val for better readability and als…
…o update this to be used in the val comb for better cross coverpoints
  • Loading branch information
MuhammadHammad001 committed Dec 4, 2024
commit 9ea9d9fa17e74997decfe202c5fa46ad3cb87251
9 changes: 6 additions & 3 deletions riscv-isac/riscv_isac/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,7 @@ def compute_per_line(queue, event, cgf_queue, stats_queue, cgf, xlen, flen, addr
old_csr_regfile[i] = int(csr_regfile[i],16)
else:
old_csr_regfile[i] = csr_regfile[i]

def old_fn_csr_comb_covpt(csr_reg):
return old_csr_regfile[csr_reg]

Expand Down Expand Up @@ -1072,7 +1073,9 @@ def get_pte_prop(prop_name, pte_addr):

return 1


globals()['get_addr'] = check_label_address
globals()['old_csr_val'] = old_fn_csr_comb_covpt
globals()['get_mem_val'] = get_mem_val
globals()['get_pte'] = get_pte
globals()['get_pte_prop'] = get_pte_prop
Expand Down Expand Up @@ -1206,7 +1209,7 @@ def get_key_from_value(dictionary, target_value):
return key
return None
#check the old_csr_value only for the register of interest
pattern_csr = r'old\("([^"]+)"\)'
pattern_csr = r'old_csr_val\("([^"]+)"\)'
match = re.search(pattern_csr, coverpoints)
if match:
required_csr = match.group(1)
Expand All @@ -1217,7 +1220,7 @@ def get_key_from_value(dictionary, target_value):
coverpoints,
{
"__builtins__":None,
"old": old_fn_csr_comb_covpt,
"old_csr_val": old_fn_csr_comb_covpt,
"write": write_fn_csr_comb_covpt,
"get_addr": check_label_address,
"get_mem_val":get_mem_val,
Expand Down Expand Up @@ -1248,7 +1251,7 @@ def get_key_from_value(dictionary, target_value):
coverpoints,
{
"__builtins__":None,
"old": old_fn_csr_comb_covpt,
"old_csr_val": old_fn_csr_comb_covpt,
"write": write_fn_csr_comb_covpt,
"get_addr": check_label_address,
"get_mem_val":get_mem_val,
Expand Down