import re with open('code_compression_intro_V2.html', 'r', encoding='utf-8') as f: code_html = f.read() with open('interrupt_realtime_wingsemi.html', 'r', encoding='utf-8') as f: interrupt_html = f.read() start_idx = interrupt_html.find('
第二项核心技术

中断实时性增强技术

通过自定义指令集优化压栈出栈,并行处理上下文切换,打破传统 RISC-V 中断响应瓶颈,实现微秒级确定性响应。

''' code_html = code_html.replace('代码密度增强技术\n ', '知识中心\n ') code_html = code_html.replace('超越行业标杆 ARM 的技术突破', '隼瞻科技 核心技术解析') code_html = re.sub(r'针对 RISC-V 指令集特性深度优化.*代码密度表现。', '探索基于 RISC-V 架构的突破性创新,从超越行业标杆的代码密度增强技术,到实现微秒级响应的中断实时性增强技术,我们致力于从底层架构实现超凡性能优化。', code_html, flags=re.DOTALL) # also replace the code compression section start to give it a title code_html = code_html.replace('', '''
第一项核心技术

代码密度增强技术

''') target = '' new_html = code_html.replace(target, transition_html + '\n' + interrupt_sections + '\n' + target) with open('knowledge_center.html', 'w', encoding='utf-8') as f: f.write(new_html) print('Merge successful')