[#74021] add source comment at the beginning of the SAIF file
This commit is contained in:
parent
9a3c6fda91
commit
29b341ac93
|
|
@ -186,6 +186,7 @@ void VerilatedSaif::openNextImp(bool incFilename) {
|
|||
}
|
||||
|
||||
void VerilatedSaif::initializeSaifFileContents() {
|
||||
printStr("// Generated by verilated_saif\n");
|
||||
printStr("(SAIFILE\n");
|
||||
printStr("(SAIFVERSION \"2.0\")\n");
|
||||
printStr("(DIRECTION \"backward\")\n");
|
||||
|
|
|
|||
|
|
@ -73,7 +73,9 @@ class SAIFParser:
|
|||
file_contents = ''
|
||||
|
||||
with open(saif_filename, 'r', encoding="utf8") as saif_file:
|
||||
file_contents = saif_file.read()
|
||||
content = saif_file.readlines()
|
||||
filtered_lines = [line for line in content if not line.strip().startswith('//')]
|
||||
file_contents = ''.join(filtered_lines)
|
||||
|
||||
tokens = file_contents.replace('(', ' ( ').replace(')', ' ) ').split()
|
||||
num_of_tokens = len(tokens)
|
||||
|
|
|
|||
Loading…
Reference in New Issue