合并bacon_dev分支的修改:1.增加寻找超出指定执行周期的指令;2.删除汇编中不需要的代码;3.增加协议的细节内容

This commit is contained in:
2025-03-03 10:59:07 +08:00
parent 7f123244be
commit c64df6956d
4 changed files with 95 additions and 306 deletions

View File

@@ -42,6 +42,20 @@ def search_custom_inst(logdata, opcode, funct, xd = 0, xs1 = 0, xs2 = 0, xd_filt
else:
pass
def search_ins_cycle_gt(logdata, s_cycle):
lines = logdata
prev_line = None
prev_time = 0
for line in lines:
line = line.rstrip()
cur_time = re.findall(r"C0:[\ \d]{11}", line)
cur_time = int(cur_time[0][3:])
deltime = cur_time - prev_time
if (deltime >= s_cycle) and (prev_line != None):
print(f'T:{deltime}', prev_line)
prev_time = cur_time
prev_line = line
def get_bit_pos(val):
bits_pos = list()
@@ -65,9 +79,12 @@ if __name__ == '__main__':
with open(logfile_path, 'rt') as logfile:
logdata = logfile.readlines()
filter = 1<<7
search_ins_cycle_gt(logdata, 2)
'''
filter = (1<<7)
print(f'custom0-ins: clear roccs int flag, bit filter:', get_bit_pos(filter))
search_custom_inst(logdata, 0xb, 0x17, xs1=1, xs1_filter=filter)
'''
'''
filter = (1<<10) | (1 << 7) | (1 << 2) | (1 << 1)