DescriptionQ907
Q907DVASIC interview problem
Constrain and cover an ASCII palindrome checker
TechniquesDVConstrained randomCoverageASCIIReference model
DifficultyHard
TopicConstraints
LanguageSystemVerilog
Requirements5 checkpoints
01
Problem
Create constrained-random stimulus, a software-style oracle, and a functional-coverage model for a checker that ignores non-alphanumeric ASCII, folds letter case, and tests the remaining sequence for a palindrome.
Example input and output
Use this case to check your interpretationInput
byte_count=32; raw ASCII bytes spell "A man, a plan, a canal: Panama!"Output
request_error=0; filtered sequence=AMANAPLANACANALPANAMA; filtered_len=21; palindrome=1Explanation
Spaces and punctuation are removed and lowercase letters are folded to uppercase, leaving a case-insensitive palindrome.
02
Requirements (5)
- Retain only ASCII letters and digits, fold letters to one case, and classify an empty filtered sequence as a palindrome.
- Construct legal palindromes and targeted non-palindromes while also varying uppercase, lowercase, digits, punctuation, and nonprintable bytes.
- For byte_count above 32, predict request_error high and a zero palindrome result.
- Compare legal requests only at done and detect missing or duplicate completion pulses.
- Define coverpoints for raw and filtered length, result, character mix, parity, and punctuation-heavy case-insensitive matches; connecting and sampling the covergroup is a testbench follow-up.
