版本协议

Public Domain

标签
标准版
#第八届立创电赛#基于RISC-V内核的生理信号加速SoC及FPGA的原型设计

创建时间:1年前

视频

  • 基于RISC-V内核的生理信号加速SoC及FPGA的原型设计-功能介绍.mp4

  • 基于RISC-V内核的生理信号加速SoC及FPGA的原型设计-项目详解.mp4

描述

<div class="document"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #000000;">* 1、项目功能介绍</span></h3> <hr class="horizontal-splitline normal-bold-2"> <p align="justify"> </p> <p><span style="color: #000000; font-family: 'andale mono', monospace;">  本项目设计了一种应用于心脏骤停场合的智能生理信号分析加速SoC,采用基于卷积神经网络算法和近似熵算法的组合算法程序以实现心电分类诊断和减少室颤误判的效果。本项目自研了一套生理信号专用的MCU级别的SOC开发板,专门用于部署生理信号的分析。该开发板不仅仅能用于除颤仪,也可以用在绝大多数需要处理生理一维信号的医疗器械上。</span></p> <div> <p align="justify"><span style="font-family: 'andale mono', monospace;">  本项目所设计的开发板包含的功能有:熵计算加速、CNN 计算加速、定点浮点乘法加速等。可以将原本在单片机上需要数秒乃至数小时计算完成的熵算法以及一维卷积神经网络算法加速到单片机算力可以接受的水平。</span></p> <p><span style="font-family: 'andale mono', monospace;">  本项目设计的开发板采用 RISC-V 指令集的 CPU内核,其型号为 E203,并自主设计了生理信号处理专用协处理器。协处理器包含熵计算加速器、向量乘法计算加速器、定点乘法加速器、浮点乘法器等等生理信号加速专用电路。在本SOC配套的 SDK测试中,进行了250点的近似熵计算,对于纯软件计算,提速约 34 倍,利用加速器计算部分提速约 1700 倍。在一个典型的 CNN心电识别网络中,利用加速版本计算的程序提速约 33 倍。</span></p> </div> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #000000;">*2、项目属性</span></h3> <hr class="horizontal-splitline normal-bold-2"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">本项目为原创项目。</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">* 3、开源协议</h3> <hr class="horizontal-splitline normal-bold-2"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">请输入内容…</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">注:利他即利己,请认真阅读下述内容。</span></p> <ol style="line-height: 1.8;"> <li class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-hanging-indent-1.6em" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">拥抱开源,赋予项目无限价值。建议项目核心功能开源80%以上;</span></li> <li class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-hanging-indent-1.6em" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">若某一部分功能不可替代且删掉之后项目无法解决对应的问题,则这一部分实现的功能就是项目的核心功能;比如设计了一台电子负载且设计了一款上位机软件监控功率变化,则电子负载为核心功能,上位机软件为辅助功能;比如电子负载中使用了一款隔离485模块与上位机通信,则此485模块实现的通讯功能为辅助功能;</span></li> <li class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-hanging-indent-1.6em" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">项目应选择适合自己的<span style="text-decoration: underline;"><a href="/posts/98fdb2accd754af7b51990790db3b47a" target="_blank">开源协议</a></span>,若项目引用其他开源项目,应注明来源并遵循原作者的开源协议规定;原创项目推荐使用GPL3.0开源协议;</span></li> <li class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-hanging-indent-1.6em" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">直接引用开源项目的原电路或原代码实现的功能不可作为自己项目的核心功能、使用市场上通用模块直接实现的功能不可作为自己项目的核心功能。</span></li> </ol> <p style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*4、硬件部分</h3> <hr class="horizontal-splitline normal-bold-2"> <p><span style="font-family: 宋体;">  为了验证</span> SOC <span style="font-family: 宋体;">的相关功能,本文特别设计了功能完整的</span> FPGA <span style="font-family: 宋体;">验证板。如</span><span style="font-family: 宋体;">图</span> 3 <span style="font-family: 宋体;">所示,该验证板主要由电源模块、</span>flash<span style="font-family: 宋体;">、</span>DDR<span style="font-family: 宋体;">、晶振、通信串口等部分组成。</span><span style="font-family: 宋体;">能够与心电采集模块和电除颤电路通信并共同完成自动诊断和电除颤抢救任务。</span><span style="font-family: 宋体;">为了保证</span> FPGA <span style="font-family: 宋体;">和</span> DDR <span style="font-family: 宋体;">能正常工作,其电源模块可以提供</span> 1V<span style="font-family: 宋体;">、</span>1.5V<span style="font-family: 宋体;">、</span>1.8V<span style="font-family: 宋体;">、</span>3.3V <span style="font-family: 宋体;">等电压,并严格按照</span> FPGA <span style="font-family: 宋体;">上电顺序的要求上电。</span></p> <p> </p> <p align="center"><img src="//image.lceda.cn/pullimage/7VsrXTeMkauO4U9OiuDH0ANbi1CJrLwNgDQyZchp.png"></p> <p align="center">设计图</p> <p align="center"><img src="//image.lceda.cn/pullimage/sb1I69bAVPaco3QSkJedYpiwNQpIldGdZY6lStyw.png"></p> <p align="center">实物图</p> <p style="text-align: left;" align="center">  具体电路设计见附件的原理图文件。</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*5、软件部分</h3> <hr class="horizontal-splitline normal-bold-2"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p><span style="font-family: 宋体;"> 本</span><span style="font-family: 宋体;">项目</span><span style="font-family: 宋体;">利用熵和</span> <span style="font-family: Calibri;">CNN </span><span style="font-family: 宋体;">设计了一种融合算法,其区别于传统心电分类程序,能在胸外按压过程中防止误判心电信号为室颤,以达到提高救治效率的效果。</span></p> <p><span style="font-family: 宋体;"> 由于生理系统具有明显的非线性性质</span><span style="font-family: Calibri;">,</span><span style="font-family: 宋体;">因此非线性分析方法可能有助于更好地揭示其特性与机理。从工程技术上看</span><span style="font-family: Calibri;">,</span><span style="font-family: 宋体;">常常需要研究信号性质的动态变化</span><span style="font-family: Calibri;">,</span><span style="font-family: 宋体;">因而十分需要只要较短数据就能表现信号特点的动力学参数。从这一要求上看</span><span style="font-family: Calibri;">,Rncus </span><span style="font-family: 宋体;">在</span><span style="font-family: Calibri;">1991 </span><span style="font-family: 宋体;">年提出的近似熵</span><span style="font-family: Calibri;">(Apporxiantte Entopy,</span><span style="font-family: 宋体;">简记</span><span style="font-family: Calibri;">ApEn)</span><span style="font-family: 宋体;">是一个值得注意的参数。故本文选用近似熵算法作为诊断手段之一。</span></p> <p><span style="font-family: 宋体;">此外,本</span><span style="font-family: 宋体;">项目</span><span style="font-family: 宋体;">还结合了卷积神经网络(</span><span style="font-family: Calibri;">CNN</span><span style="font-family: 宋体;">)算法,可以对心电信号做进一步地分类。本文所述的自动心电诊断模块区别于传统 </span><span style="font-family: Calibri;">CNN </span><span style="font-family: 宋体;">方法,采用 </span><span style="font-family: Calibri;">CNN </span><span style="font-family: 宋体;">与熵值判定相结合的方式,提升了在急救场合中对含有同频段伪迹噪声的心电分类准确率。</span></p> <p><span style="font-family: 宋体;"> 传统的心脏骤停急救设备往往在施救者在进行胸外按压的时候不进行</span> <span style="font-family: Calibri;">ECG </span><span style="font-family: 宋体;">的自动诊断,且在自动诊断的时候要求施救者中断胸外按压,影响抢救效率。其原因在于胸外按压会产生严重的伪迹,该伪迹的频谱与正常心电的频谱大幅度重合,采用传统算法难以滤除。本文中的设计采用卷积神经网络算法和近似熵算法结合的方式,可利用二者的优势,规避二者的缺点。由于心肺复苏过程中的心电信号数据难以获取,因此难以找到足够的数据给神经网络训练。在缺少足够训练集的情况下,依靠人为加噪难以提高室颤的识别准确率,而单独通过熵来判断室颤只能进行二分类且抗干扰性能差。</span></p> <p><span style="font-family: 宋体;"> 该算法可以高效利用协处理器,本文基于该算法自主设计了一套</span> <span style="font-family: Calibri;">CNN </span><span style="font-family: 宋体;">以及近似熵计算库,可以通过搭载本文所设计的协处理器的 </span><span style="font-family: Calibri;">CPU </span><span style="font-family: 宋体;">运行。</span></p> <p><span style="font-family: 宋体;"> 本设计采用</span> E203 <span style="font-family: 宋体;">内核作为</span> SOC <span style="font-family: 宋体;">的</span> CPU<span style="font-family: 宋体;">,利用</span> nice <span style="font-family: 宋体;">接口扩展协处理器。协处理器由指令解码单元、执行状态机、熵计算加速单元、</span>CNN <span style="font-family: 宋体;">向量计算</span><span style="font-family: 宋体;">单元、单周期定点乘法器组成,设计框图如下图</span> <span style="font-family: 宋体;">所示:</span></p> <p><img src="//image.lceda.cn/pullimage/AMLEfQ8C6VkUtCgc4u13zkDXk0IRIF45G8Fym7IR.png"></p> <p align="justify">                                             <span style="font-family: 宋体;">协处理器总体设计框图</span></p> <p align="justify"><span style="font-family: 宋体;">  当程序调用协处理器时,</span>CPU <span style="font-family: 宋体;">会拉高</span> nice <span style="font-family: 宋体;">接口的</span> nice_req_valid <span style="font-family: 宋体;">信号线请求</span><span style="font-family: 宋体;">握手,协处理器在空闲的情况下会将</span> nice_req_ready <span style="font-family: 宋体;">拉高完成握手,并从指令预</span><span style="font-family: 宋体;">取单元中获取指令,状态机会根据指令解码单元解码出的数据和指令调用相应的</span><span style="font-family: 宋体;">执行单元执行指令,指令执行完成后,状态机会把</span> nice <span style="font-family: 宋体;">接口的</span> nice_rsp_valid <span style="font-family: 宋体;">线拉高请求握手。</span></p> <p align="justify"><span style="font-family: 黑体;">协处理器指令集以及指令解码单元的设计</span></p> <p><span style="font-family: Times New Roman;">    E203</span><span style="font-family: 宋体;">处理器的</span><span style="font-family: Times New Roman;">nice</span><span style="font-family: 宋体;">指令编码如表</span><span style="font-family: 宋体;">所示:</span></p> <p align="center"><span style="font-family: Times New Roman;"> nice</span><span style="font-family: 宋体;">指令编码</span></p> <table> <tr> <td width="78"> <p><span style="font-family: 宋体;">比特位</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">31-25</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">24-20</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">19-15</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">14</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">13</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">12</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">11-7</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">6-0</span></p> </td> </tr> <tr> <td width="78"> <p><span style="font-family: 宋体;">功能</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">func7</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">rs2</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">rs1</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">xd</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">xs1</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">xs2</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">rd</span></p> </td> <td width="78"> <p><span style="font-family: Times New Roman;">opcode</span></p> </td> </tr> </table> <p><span style="font-family: 宋体;">   其中,</span><span style="font-family: Times New Roman;">func7</span><span style="font-family: 宋体;">为指令编码空间,最多支持额外译码出</span><span style="font-family: Times New Roman;">128</span><span style="font-family: 宋体;">条指令;</span><span style="font-family: Times New Roman;">rs2</span><span style="font-family: 宋体;">和</span><span style="font-family: Times New Roman;">rs1</span><span style="font-family: 宋体;">为寄存器索引;</span><span style="font-family: Times New Roman;">xd</span><span style="font-family: 宋体;">指示该指令是否需要将结果写回至</span><span style="font-family: Times New Roman;">rd</span><span style="font-family: 宋体;">索引的寄存器;</span><span style="font-family: Times New Roman;">xs1</span><span style="font-family: 宋体;">和</span><span style="font-family: Times New Roman;">xs2</span><span style="font-family: 宋体;">分别指示是否需要读取</span><span style="font-family: Times New Roman;">rs1</span><span style="font-family: 宋体;">和</span><span style="font-family: Times New Roman;">rs2</span><span style="font-family: 宋体;">索引的寄存器;</span><span style="font-family: Times New Roman;">opcode</span><span style="font-family: 宋体;">是操作码。</span></p> <p><span style="font-family: 宋体;">指令解码单元由组合逻辑电路和一个</span><span style="font-family: Times New Roman;">D</span><span style="font-family: 宋体;">触发器组成,其逻辑框图如图所示:</span></p> <p><img src="//image.lceda.cn/pullimage/QF0rbOFrEZO99CbgX8KjRY7TcPr6fS0B385OjytF.png"></p> <p align="center"> <span style="font-family: 宋体;">指令解码单元的设计框图</span></p> <p><span style="font-family: 宋体;">协处理器支持执行指令的同时预取一条指令,通过相等比较器判断指令的各部分是否有效,将判断信号送入与门获得某指令的预取信号。在协处理器成功握手后,通过</span><span style="font-family: Times New Roman;">D</span><span style="font-family: 宋体;">触发器输出该指令的执行信号。该逻辑可以保证协处理器可以在一条指令执行完成后立即执行下一条指令。</span></p> <p><span style="font-family: 宋体;">  协处理器一共设有</span><span style="font-family: Times New Roman;">7</span><span style="font-family: 宋体;">条指令,如下表所示:</span></p> <p align="center"> <span style="font-family: 宋体;">协处理器的指令集列表</span></p> <table> <tr> <td> <p><span style="font-family: 宋体;">指令</span></p> </td> <td width="129"> <p><span style="font-family: 宋体;">操作数</span><span style="font-family: Times New Roman;">1</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">操作数</span><span style="font-family: Times New Roman;">2</span></p> </td> <td width="76"> <p><span style="font-family: 宋体;">写回值</span></p> </td> <td> <p><span style="font-family: 宋体;">功能</span></p> </td> </tr> <tr> <td> <p><span style="font-family: Times New Roman;">custom_lbuf_apen</span></p> </td> <td width="129"> <p><span style="font-family: 宋体;">地址</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">无</span></p> </td> <td width="76"> <p><span style="font-family: Times New Roman;">1</span></p> </td> <td> <p><span style="font-family: 宋体;">熵计算加速器写入原始数据</span></p> </td> </tr> <tr> <td> <p><span style="font-family: Times New Roman;">custom_lth_apen</span></p> </td> <td width="129"> <p><span style="font-family: 宋体;">阈值</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">无</span></p> </td> <td width="76"> <p><span style="font-family: Times New Roman;">2</span></p> </td> <td> <p><span style="font-family: 宋体;">熵计算加速器写入阈值</span></p> </td> </tr> <tr> <td> <p><span style="font-family: Times New Roman;">custom_calu_apen</span></p> </td> <td width="129"> <p><span style="font-family: 宋体;">写回首地址</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">无</span></p> </td> <td width="76"> <p><span style="font-family: Times New Roman;">3</span></p> </td> <td> <p><span style="font-family: 宋体;">熵计算加速器工作一次</span></p> </td> </tr> <tr> <td> <p><span style="font-family: Times New Roman;">custom_lker_cnn</span></p> </td> <td width="129"> <p><span style="font-family: 宋体;">卷积核首地址</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">卷积核长度</span></p> </td> <td width="76"> <p><span style="font-family: Times New Roman;">4</span></p> </td> <td> <p><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">向量计算单元加载卷积核</span></p> </td> </tr> <tr> <td> <p><span style="font-family: Times New Roman;">custom_calcu_cnn</span></p> </td> <td width="129"> <p><span style="font-family: 宋体;">序列首地址</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">无</span></p> </td> <td width="76"> <p><span style="font-family: 宋体;">结果</span></p> </td> <td> <p><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">向量计算单元计算一次</span></p> </td> </tr> <tr> <td> <p><span style="font-family: Times New Roman;">custom_multi</span></p> </td> <td width="129"> <p><span style="font-family: 宋体;">变量</span><span style="font-family: Times New Roman;">1</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">变量</span><span style="font-family: Times New Roman;">2</span></p> </td> <td width="76"> <p><span style="font-family: 宋体;">积</span></p> </td> <td> <p><span style="font-family: 宋体;">进行一次定点乘法计算</span></p> </td> </tr> <tr> <td> <p><span style="font-family: Times New Roman;">custom_multi_f</span></p> </td> <td width="129"> <p><span style="font-family: 宋体;">变量</span><span style="font-family: Times New Roman;">1</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">变量</span><span style="font-family: Times New Roman;">2</span></p> </td> <td width="76"> <p><span style="font-family: 宋体;">积</span></p> </td> <td> <p><span style="font-family: 宋体;">进行一次浮点乘法计算</span></p> </td> </tr> </table> <p><span style="font-family: 宋体;">  其中,熵计算加速器具有三条操作指令,分别为</span><span style="font-family: Times New Roman;">custom_lbuf_apen</span><span style="font-family: 宋体;">、</span><span style="font-family: Times New Roman;">custom_lth_apen</span><span style="font-family: 宋体;">、</span><span style="font-family: Times New Roman;">custom_calu_apen</span><span style="font-family: 宋体;">。程序进行熵计算时,首先需要调用</span><span style="font-family: Times New Roman;">custom_lbuf_apen</span><span style="font-family: 宋体;">指令将待计算熵的序列的首地址写入熵计算加速器,然后调用</span><span style="font-family: Times New Roman;">custom_lth_apen</span><span style="font-family: 宋体;">指令设置熵计算中的阈值,随后不断调用</span><span style="font-family: Times New Roman;">custom_calu_apen</span><span style="font-family: 宋体;">指令获取计算结果。</span></p> <p><span style="font-family: Times New Roman;">    CNN</span><span style="font-family: 宋体;">向量计算单元一共有两条指令,分别为</span><span style="font-family: Times New Roman;">custom_lker_cnn</span><span style="font-family: 宋体;">、</span><span style="font-family: Times New Roman;">custom_calcu_cnn</span><span style="font-family: 宋体;">。卷积神经网络推理程序在进行卷积乘法运算时,调用</span><span style="font-family: Times New Roman;">custom_lker_cnn</span><span style="font-family: 宋体;">将卷积核加载进单元,随后不断调用</span><span style="font-family: Times New Roman;">custom_calcu_cnn</span><span style="font-family: 宋体;">计算向量乘法以达到卷积计算的目的。</span></p> <p><span style="font-family: 宋体;">由于在绝大多数信号的处理算法中,需要大量的乘法运算,而本文使用的</span><span style="font-family: Times New Roman;">CPU</span><span style="font-family: 宋体;">内核属于低功耗</span><span style="font-family: Times New Roman;">CPU</span><span style="font-family: 宋体;">,没有单周期乘法器和浮点计算单元,为了防止乘法计算拖累算法整体计算速度,影响协处理器的加速效果,本文为协处理器添加了两条乘法指令用于定点和浮点计算:</span><span style="font-family: Times New Roman;">custom_multi</span><span style="font-family: 宋体;">、</span><span style="font-family: Times New Roman;">custom_multi_f</span><span style="font-family: 宋体;">。</span></p> <p align="justify"><span style="font-family: 黑体;">执行状态机的设计</span></p> <p><span style="font-family: 宋体;">  本文所设计的协处理器包含多项功能,虽然其功能差别巨大,但是每个功能的执行状态总可以分解为表</span><span style="font-family: Times New Roman;">3</span><span style="font-family: 宋体;">中</span><span style="font-family: Times New Roman;">8</span><span style="font-family: 宋体;">个状态的一个,因此,协处理器的所有指令通过指令执行信号复用</span><span style="font-family: Times New Roman;">8</span><span style="font-family: 宋体;">个状态。</span></p> <p align="center"> <span style="font-family: 宋体;">执行状态机的</span><span style="font-family: Times New Roman;">8</span><span style="font-family: 宋体;">个状态</span></p> <table> <tr> <td width="91"> <p><span style="font-family: 宋体;">状态</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行功能</span></p> </td> </tr> <tr> <td width="91"> <p><span style="font-family: Times New Roman;">IDLE</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行状态机处于空闲状态,此时状态机等待预取指令。</span></p> </td> </tr> <tr> <td width="91"> <p><span style="font-family: Times New Roman;">LOAD</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行状态机</span><span style="font-family: Times New Roman;">Load</span><span style="font-family: 宋体;">地址操作数。</span></p> </td> </tr> <tr> <td width="91"> <p><span style="font-family: Times New Roman;">READ</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行状态机通过</span><span style="font-family: Times New Roman;">ICB</span><span style="font-family: 宋体;">总线读取数据。</span></p> </td> </tr> <tr> <td width="91"> <p><span style="font-family: Times New Roman;">WREG</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行状态机向子单元的寄存器写入数据。</span></p> </td> </tr> <tr> <td width="91"> <p><span style="font-family: Times New Roman;">CALU</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行状态机操控子单元进行计算。</span></p> </td> </tr> <tr> <td width="91"> <p><span style="font-family: Times New Roman;">WAIT</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行状态机等待子单元计算完成或者数据稳定。</span></p> </td> </tr> <tr> <td width="91"> <p><span style="font-family: Times New Roman;">WMEM</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行状态机通过</span><span style="font-family: Times New Roman;">ICB</span><span style="font-family: 宋体;">总线写入数据。</span></p> </td> </tr> <tr> <td width="91"> <p><span style="font-family: Times New Roman;">RSP</span></p> </td> <td width="619"> <p><span style="font-family: 宋体;">执行状态机拉高</span><span style="font-family: Times New Roman;">nice_rsp_valid</span><span style="font-family: 宋体;">请求握手。</span></p> </td> </tr> </table> <p><span style="font-family: 宋体;">  状态机采用三段式编写,状态跳转采用组合逻辑电路实现,状态输出采用时序逻辑电路实现,状态机大致工作逻辑如下所述。</span></p> <p><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">、当状态机处于</span><span style="font-family: Times New Roman;">IDLE</span><span style="font-family: 宋体;">状态时,状态机会等待</span><span style="font-family: Times New Roman;">nice</span><span style="font-family: 宋体;">接口的</span><span style="font-family: Times New Roman;">nice_req_ready</span><span style="font-family: 宋体;">信号拉高,随后根据预取的指令类型跳转到下一个状态;</span></p> <p><span style="font-family: Times New Roman;">2</span><span style="font-family: 宋体;">、当状态机处于</span><span style="font-family: Times New Roman;">LOAD</span><span style="font-family: 宋体;">状态时,状态机会将地址预加载到</span><span style="font-family: Times New Roman;">DMA</span><span style="font-family: 宋体;">单元,同时拉高</span><span style="font-family: Times New Roman;">nice_mem_holdup</span><span style="font-family: 宋体;">,随后跳转到</span><span style="font-family: Times New Roman;">READ</span><span style="font-family: 宋体;">状态;</span></p> <p><span style="font-family: Times New Roman;">3</span><span style="font-family: 宋体;">、当状态机处于</span><span style="font-family: Times New Roman;">READ</span><span style="font-family: 宋体;">状态时,状态机会通过</span><span style="font-family: Times New Roman;">DMA</span><span style="font-family: 宋体;">从</span><span style="font-family: Times New Roman;">ICB</span><span style="font-family: 宋体;">读取指定长度的数据,随后根据指令寄存器的内容跳转到</span><span style="font-family: Times New Roman;">RSP</span><span style="font-family: 宋体;">或者</span><span style="font-family: Times New Roman;">WAIT</span><span style="font-family: 宋体;">状态。</span></p> <p><span style="font-family: Times New Roman;">4</span><span style="font-family: 宋体;">、当状态机处于</span><span style="font-family: Times New Roman;">WREG</span><span style="font-family: 宋体;">状态时,状态机会根据指令向子单元的寄存器写入数据,随后跳转到</span><span style="font-family: Times New Roman;">RSP</span><span style="font-family: 宋体;">状态。</span></p> <p><span style="font-family: Times New Roman;">5</span><span style="font-family: 宋体;">、当状态机处于</span><span style="font-family: Times New Roman;">CALU</span><span style="font-family: 宋体;">状态时,状态机会根据指令向子单元的寄存器写入数据,随后根据指令寄存器的内容跳转到</span><span style="font-family: Times New Roman;">WAIT</span><span style="font-family: 宋体;">或者</span><span style="font-family: Times New Roman;">RSP</span><span style="font-family: 宋体;">状态。</span></p> <p><span style="font-family: Times New Roman;">6</span><span style="font-family: 宋体;">、</span><span style="font-family: Times New Roman;">WAIT</span><span style="font-family: 宋体;">状态用于等待子单元计算完成或者数据稳定。该状态使用移位寄存器进行计数,通过判定某一位是否为</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">判断是否需要继续等待,随后根据指令寄存器的内容跳转到</span><span style="font-family: Times New Roman;">WMEM</span><span style="font-family: 宋体;">或者</span><span style="font-family: Times New Roman;">RSP</span><span style="font-family: 宋体;">状态。</span></p> <p><span style="font-family: Times New Roman;">7</span><span style="font-family: 宋体;">、当状态机处于</span><span style="font-family: Times New Roman;">WMEM</span><span style="font-family: 宋体;">状态时,状态机会通过</span><span style="font-family: Times New Roman;">DMA</span><span style="font-family: 宋体;">单元向</span><span style="font-family: Times New Roman;">ICB</span><span style="font-family: 宋体;">总线写入计算结果数据,随后跳转回到</span><span style="font-family: Times New Roman;">CALU</span><span style="font-family: 宋体;">状态进行下一条计算。</span></p> <p><span style="font-family: Times New Roman;">8</span><span style="font-family: 宋体;">、当状态机处于</span><span style="font-family: Times New Roman;">RSP</span><span style="font-family: 宋体;">状态时,状态机会向</span><span style="font-family: Times New Roman;">nice_icb_rsp_rdata</span><span style="font-family: 宋体;">寄存器写入指令写回值。随后跳转到</span><span style="font-family: Times New Roman;">IDLE</span><span style="font-family: 宋体;">状态结束一条指令的执行。</span></p> <p> </p> <p align="justify"><span style="font-family: 黑体;">可裁剪熵计算加速单元的设计</span></p> <p><span style="font-family: 宋体;">  熵计算加速单元的架构如图所示:</span></p> <p><img src="//image.lceda.cn/pullimage/af6R2qN9KhyMcrlIrBDa4Yuj6az5DQ82Pu6FnPrr.png"></p> <p align="center"> <span style="font-family: 宋体;">熵计算加速器的架构</span></p> <p><span style="font-family: 宋体;">熵计算加速单元包含向量计算单元阵列、并行计算控制器、向量重构器、寄存器组以及读写控制器。其对外接口如表所示:</span></p> <p align="center"> <span style="font-family: 宋体;">熵计算加速器的对外接口</span></p> <table> <tr> <td width="122"> <p><span style="font-family: 宋体;">接口名称</span></p> </td> <td width="67"> <p><span style="font-family: 宋体;">位宽</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">接口功能</span></p> </td> </tr> <tr> <td width="122"> <p><span style="font-family: Times New Roman;">clk</span></p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">1</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块的时钟端口</span></p> </td> </tr> <tr> <td width="122"> <p>rst_n</p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">1</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块的复位端口</span></p> </td> </tr> <tr> <td width="122"> <p>reg_cs</p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">1</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块寄存器读写使能端口</span></p> </td> </tr> <tr> <td width="122"> <p>reg_wr</p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">1</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块寄存器的写有效端口</span></p> </td> </tr> <tr> <td width="122"> <p>reg_rd</p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">1</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块寄存器的读有效端口</span></p> </td> </tr> <tr> <td width="122"> <p>reg_wr_addr</p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">10</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块寄存器的写地址端口</span></p> </td> </tr> <tr> <td width="122"> <p>reg_rd_addr</p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">10</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块寄存器的读地址端口</span></p> </td> </tr> <tr> <td width="122"> <p>reg_data_in</p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">32</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块寄存器的数据输入端口</span></p> </td> </tr> <tr> <td width="122"> <p>reg_data_out</p> </td> <td width="67"> <p><span style="font-family: Times New Roman;">32</span></p> </td> <td width="520"> <p><span style="font-family: 宋体;">加速器模块寄存器的数据输出端口</span></p> </td> </tr> </table> <p><span style="font-family: 宋体;">  熵计算加速单元的控制完全通过读写寄存器完成,加速器内部寄存器组的寻址范围为</span><span style="font-family: Times New Roman;">0-(APEN_DATA_LEN+1)</span><span style="font-family: 宋体;">,其中</span><span style="font-family: Times New Roman;">APEN_DATA_LEN</span><span style="font-family: 宋体;">是向量计算单元的个数,可以通过修改</span><span style="font-family: Times New Roman;">APEN_DATA_LEN</span><span style="font-family: 宋体;">这个参数裁剪熵计算加速器。</span></p> <p><span style="font-family: 宋体;">数据寄存器组的地址范围为</span><span style="font-family: Times New Roman;">0-(APEN_DATA_LEN-1)</span><span style="font-family: 宋体;">,这个寄存器组的作用是存储待计算的原始数据序列。由于这个寄存器组数量较多,为了保证运行效率,不可以采用</span><span style="font-family: Times New Roman;">CPU</span><span style="font-family: 宋体;">依次读写的方式,需要通过</span><span style="font-family: Times New Roman;">DMA</span><span style="font-family: 宋体;">写入。</span></p> <p><span style="font-family: 宋体;">  地址为</span><span style="font-family: Times New Roman;">APEN_DATA_LEN</span><span style="font-family: 宋体;">的寄存器是阈值寄存器。其寄存的是熵算法中的阈值。</span></p> <p><span style="font-family: 宋体;">控制寄存器和状态寄存器共用地址</span><span style="font-family: Times New Roman;">APEN_DATA_LEN+1</span><span style="font-family: 宋体;">,控制寄存器只写,状态寄存器只读。控制寄存器和状态寄存器的功能编码如表所示:</span></p> <p align="center"> <span style="font-family: 宋体;">控制寄存器的功能编码</span></p> <table> <tr> <td width="77"> <p><span style="font-family: 宋体;">比特位</span></p> </td> <td width="64"> <p><span style="font-family: Times New Roman;">31-12</span></p> </td> <td width="264"> <p><span style="font-family: Times New Roman;">11</span></p> </td> <td width="107"> <p><span style="font-family: Times New Roman;">10-1</span></p> </td> <td width="196"> <p><span style="font-family: Times New Roman;">0</span></p> </td> </tr> <tr> <td width="77"> <p><span style="font-family: 宋体;">功能</span></p> </td> <td width="64"> <p><span style="font-family: 宋体;">保留</span></p> </td> <td width="264"> <p><span style="font-family: 宋体;">计算维度(</span><span style="font-family: Times New Roman;">0</span><span style="font-family: 宋体;">为</span><span style="font-family: Times New Roman;">2</span><span style="font-family: 宋体;">维,</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">为</span><span style="font-family: Times New Roman;">3</span><span style="font-family: 宋体;">维)</span></p> </td> <td width="107"> <p><span style="font-family: 宋体;">计算编号</span></p> </td> <td width="196"> <p><span style="font-family: 宋体;">写</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">电路开始工作</span></p> </td> </tr> </table> <p align="center"> <span style="font-family: 宋体;">状态寄存器的功能编码</span></p> <table> <tr> <td width="78"> <p><span style="font-family: 宋体;">比特位</span></p> </td> <td width="64"> <p><span style="font-family: Times New Roman;">31-23</span></p> </td> <td width="217"> <p><span style="font-family: Times New Roman;">22-13</span></p> </td> <td width="56"> <p><span style="font-family: Times New Roman;">12</span></p> </td> <td width="106"> <p><span style="font-family: Times New Roman;">11</span></p> </td> <td width="90"> <p><span style="font-family: Times New Roman;">10-1</span></p> </td> <td width="97"> <p><span style="font-family: Times New Roman;">0</span></p> </td> </tr> <tr> <td width="78"> <p><span style="font-family: 宋体;">功能</span></p> </td> <td width="64"> <p><span style="font-family: 宋体;">保留</span></p> </td> <td width="217"> <p><span style="font-family: 宋体;">向量距离大于阈值的个数</span></p> </td> <td width="56"> <p><span style="font-family: 宋体;">保留</span></p> </td> <td width="106"> <p><span style="font-family: 宋体;">计算维度</span></p> </td> <td width="90"> <p><span style="font-family: 宋体;">计算编号</span></p> </td> <td width="97"> <p><span style="font-family: 宋体;">是否空闲</span></p> </td> </tr> </table> <p><span style="font-family: 宋体;">  外部电路在调用熵计算加速单元计算前,需要向控制寄存器对应位置写入必须要的计算信息,并在最低位写</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">。加速单元检测到控制寄存器的最低位为</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">后,会立即开始一次计算,同时将控制寄存器的最低位写</span><span style="font-family: Times New Roman;">0</span><span style="font-family: 宋体;">,状态寄存器的最低位写</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">。完成计算后,加速单元会重新把状态寄存器的最低位置</span><span style="font-family: Times New Roman;">0</span><span style="font-family: 宋体;">。</span></p> <p><span style="font-family: 宋体;">  模块还自带一个由组合逻辑电路设计的向量重构路由器,其作用是将原始数据序列重构成</span><span style="font-family: Times New Roman;">2</span><span style="font-family: 宋体;">维或者</span><span style="font-family: Times New Roman;">3</span><span style="font-family: 宋体;">维的向量组。并根据控制寄存器中的计算编号,提供相应的数据给距离计算单元。</span></p> <p align="justify"><strong><span style="font-family: 黑体;">向量距离计算单元设计</span></strong></p> <p><span style="font-family: 宋体;">近似熵算法中,向量距离的定义如式所示:</span></p> <p align="center"><img src="//image.lceda.cn/pullimage/UPJJpl454wJVSUW0NaavAzuI1VRUxNhH3SuX01br.png"></p> <p><span style="font-family: 宋体;">  其中</span><span style="font-family: Times New Roman;">X</span><span style="font-family: 宋体;">是重构后的</span><span style="font-family: Times New Roman;">m</span><span style="font-family: 宋体;">维向量组,</span><span style="font-family: Times New Roman;">x</span><span style="font-family: 宋体;">是原始序列,</span><span style="font-family: Times New Roman;">d</span><span style="font-family: 宋体;">是向量之间的距离,则距离为向量</span><span style="font-family: Times New Roman;">X[i]</span><span style="font-family: 宋体;">、</span><span style="font-family: Times New Roman;">X[j]</span><span style="font-family: 宋体;">中对应元素差值的绝对值最大的一个。</span></p> <p><span style="font-family: 宋体;">  向量距离计算单元由两级流水线组成。流水线的第一级是数据选择器,其功能是选择数据输出给下一级,以</span><span style="font-family: Times New Roman;">3</span><span style="font-family: 宋体;">维向量距离计算为例,其工作时序如图所示:</span></p> <p><img src="//image.lceda.cn/pullimage/PIecbYB8a4hxVdxLQ2Kp9EyGVmo7TnooABcTidah.png"></p> <p align="center"> <span style="font-family: 宋体;">向量距离计算单元流水线第一级时序图</span></p> <p><span style="font-family: 宋体;">外部电路通过拉高</span><span style="font-family: Times New Roman;">in_valid</span><span style="font-family: 宋体;">激活流水线第一级工作。此时该流水线会把</span><span style="font-family: Times New Roman;">idle</span><span style="font-family: 宋体;">线拉低,指示外部电路本级流水线忙。若和下级流水线握手成功,则会根据计数器输出待计算的数据给流水线下一级。</span></p> <p><span style="font-family: 宋体;">流水线的第二级是计算电路,其功能是找到第一级流水线工作周期内所提供数据的差的最大绝对值,这个最大绝对值就是向量的距离。时序图如图所示:</span></p> <p><img src="//image.lceda.cn/pullimage/IucwWTve1R9iA3gz8ffbdQgJm74Qz4PmwlxP1L4c.png"></p> <p align="center"><span style="font-family: 宋体;">向量距离计算单元流水线第二级时序图</span></p> <p><span style="font-family: 宋体;">流水线的第二级电路在和第一级电路成功握手后,会依次根据第一级电路送入的数据算出元素差值的绝对值最大的一个。当其</span><span style="font-family: Times New Roman;">in_valid</span><span style="font-family: 宋体;">线被拉低后,计算结果将会被锁存</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">个时钟周期。</span></p> <p> </p> <p align="justify"><span style="font-family: 黑体;">可裁剪一维</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 黑体;">向量计算单元的设计</span></p> <p><span style="font-family: 宋体;">向量计算单元的架构如图所示:</span></p> <p align="center"><img src="//image.lceda.cn/pullimage/1J7ruU6LUngkbEKn6N65BDiuPXImvVKRZojKusgq.png"></p> <p align="center"> <span style="font-family: 宋体;">向量计算单元的架构</span></p> <p><span style="font-family: 宋体;">  由于</span><span style="font-family: Times New Roman;">E203</span><span style="font-family: 宋体;">的</span><span style="font-family: Times New Roman;">ICB</span><span style="font-family: 宋体;">总线的带宽限制,采用并行计算的方法并不能有效提高计算效率,因此,本设计在向量计算单元上放弃多单元并行计算而采用长流水线计算的方法。该单元由对外接口、数据拆分器、并行多乘法器、数据选择器、累加器流水线组成。</span></p> <p align="justify"><strong> <span style="font-family: 宋体;">向量计算单元的流水线和对外接口设计</span></strong></p> <p><span style="font-family: 宋体;">该单元的对外接口每次只提取一个数据,因此一个时钟周期只会产生一个乘法结果,因此需要流水线进行累加处理。并行多乘法器每执行完成一次后,数据选择器将会筛选出有用的数据送入累加流水线。</span></p> <p><span style="font-family: 宋体;">向量计算单元的对外接口如表所示:</span></p> <p align="center"><span style="font-family: 宋体;">向量计算单元的对外接口</span></p> <table> <tr> <td width="129"> <p><span style="font-family: 宋体;">接口名称</span></p> </td> <td width="254"> <p><span style="font-family: 宋体;">位宽</span></p> </td> <td width="325"> <p><span style="font-family: 宋体;">接口功能</span></p> </td> </tr> <tr> <td width="129"> <p>sclk</p> </td> <td width="254"> <p><span style="font-family: Times New Roman;">1</span></p> </td> <td width="325"> <p><span style="font-family: 宋体;">加速单元的时钟</span></p> </td> </tr> <tr> <td width="129"> <p>Seq_ori</p> </td> <td width="254"> <p>DATA_WIDTH * MAX_CONV_KERNEL_LEN</p> </td> <td width="325"> <p><span style="font-family: 宋体;">原始序列</span></p> </td> </tr> <tr> <td width="129"> <p>Seq_ker</p> </td> <td width="254"> <p>DATA_WIDTH * MAX_CONV_KERNEL_LEN</p> </td> <td width="325"> <p><span style="font-family: 宋体;">卷积核序列</span></p> </td> </tr> <tr> <td width="129"> <p>KernelLen</p> </td> <td width="254"> <p><span style="font-family: Times New Roman;">8</span></p> </td> <td width="325"> <p><span style="font-family: 宋体;">卷积核的长度</span></p> </td> </tr> <tr> <td width="129"> <p>Datavalid</p> </td> <td width="254"> <p><span style="font-family: Times New Roman;">1</span></p> </td> <td width="325"> <p><span style="font-family: 宋体;">数据有效</span></p> </td> </tr> <tr> <td width="129"> <p>Result</p> </td> <td width="254"> <p>DATA_WIDTH</p> </td> <td width="325"> <p><span style="font-family: 宋体;">卷积计算结果</span></p> </td> </tr> </table> <p> </p> <p><span style="font-family: 宋体;">  其中</span>DATA_WIDTH<span style="font-family: 宋体;">是乘法器的数据位宽,</span>MAX_CONV_KERNEL_LEN<span style="font-family: 宋体;">是向量计算单元支持的最大卷积核长度,可以通过修改</span>MAX_CONV_KERNEL_LEN<span style="font-family: 宋体;">达到裁剪向量计算单元的目的。</span></p> <p align="justify"> <span style="font-family: 黑体;">近似熵计算库设计</span></p> <p><span style="font-family: 宋体;">  近似熵库具体计算流程如图所示,计算前需要进行初始化处理,即赋值比例、计算标准差和阈值。之后进行数组的重构,即重构</span>m<span style="font-family: 宋体;">维度数组</span><span style="font-family: 宋体;">(</span><span style="font-family: 宋体;">共有</span>n-m+1<span style="font-family: 宋体;">个</span><span style="font-family: Times New Roman;">m</span><span style="font-family: 宋体;">维度向量</span><span style="font-family: 宋体;">)和</span>m<span style="font-family: Times New Roman;">+1</span><span style="font-family: 宋体;">维度数组</span><span style="font-family: 宋体;">。随后计算</span><span style="font-family: Times New Roman;">m</span><span style="font-family: 宋体;">维和</span><span style="font-family: Times New Roman;">m+1</span><span style="font-family: 宋体;">维向量的距离,并求得对平均值。最后对平均值做差,得到近似熵的结果,可根据该结果判断病人的身体状态。</span></p> <p align="center"><img src="//image.lceda.cn/pullimage/tBSwW0pAwcEId6YjrV5p5wyoeKu86MGIraCnOzsp.png"></p> <p align="center"> <span style="font-family: 宋体;">近似熵计算流程图</span></p> <p align="justify">CNN<span style="font-family: 黑体;">推理库设计</span></p> <p><span style="font-family: Times New Roman;">     CNN</span><span style="font-family: 宋体;">库采用</span><span style="font-family: Times New Roman;">C</span><span style="font-family: 宋体;">语言编写,采用面向对象的思想进行编程。每个</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">网络将定义为一个</span><span style="font-family: Times New Roman;">C</span><span style="font-family: 宋体;">结构体,实例化的时候设置其参数即可自动化地进行推理。</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">结构的定义如下:</span></p> <p>typedef struct CNN_NET</p> <p>{</p> <p>int LayerAmount;</p> <p>int kernelAmount[CNN_LAYER_MAX];</p> <p>int kernelLen[CNN_LAYER_MAX];</p> <p>int PoollingMode[CNN_LAYER_MAX];</p> <p>int PaddingAmount[CNN_LAYER_MAX];</p> <p>CALU_TYPE* pOriginalData;</p> <p>int OriginalDatalen;</p> <p>CALU_TYPE* Kernel0BuffStartAddr[CNN_LAYER_MAX];</p> <p>}CNN_NET;</p> <p><span style="font-family: 宋体;">  其中,</span><span style="font-family: Times New Roman;">LayerAmount</span><span style="font-family: 宋体;">代表</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">网络的层数;</span>kernelAmount<span style="font-family: 宋体;">数组存储每层的卷积核数量;</span>kernelLen<span style="font-family: 宋体;">数据存储每层的卷积核长度;</span>PoollingMode<span style="font-family: 宋体;">数组存储每层的池化方式;</span>PaddingAmount<span style="font-family: 宋体;">数据存储每层的预</span><span style="font-family: Times New Roman;">padding</span><span style="font-family: 宋体;">数量;</span>pOriginalData<span style="font-family: 宋体;">是一个指针,指向原始数据序列的数组;</span>OriginalDatalen<span style="font-family: 宋体;">是原始数据序列的长度;</span>Kernel0BuffStartAddr<span style="font-family: 宋体;">是一个指针数组,用于存储每层卷积核的起始地址。</span></p> <p><span style="font-family: Times New Roman;">    CNN</span><span style="font-family: 宋体;">推理库暴露给用户的函数有:</span></p> <p>void CNN_RunAllLayer_inst(CNN_NET* Net_inst);</p> <p>void CNN_Calurelu(CALU_TYPE* NetBuff, int len);</p> <p>CALU_TYPE CNN_Calculate_Full_Connection(CALU_TYPE* NetBuff, CALU_TYPE* ParaBuff, int len);</p> <p><span style="font-family: 宋体;">  其中,</span>CNN_RunAllLayer_inst<span style="font-family: 宋体;">函数是根据</span>CNN_NET<span style="font-family: 宋体;">示例化后的变量配置自动依次计算各个卷积层,</span>CNN_Calurelu<span style="font-family: 宋体;">函数是计算</span><span style="font-family: Times New Roman;">relu</span><span style="font-family: 宋体;">激活函数,</span>CNN_Calculate_Full_Connection<span style="font-family: 宋体;">函数用于计算全连接层。</span></p> <p><span style="font-family: 宋体;">本推理库的卷积部分采用乒乓机制存储临时数据,规避传统</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">推理库动辄采用动态内存的方法,更适合在无操作系统的单片机上运行。其包含的</span><span style="font-family: Times New Roman;">API</span><span style="font-family: 宋体;">函数有:</span></p> <p>int Conv_SetPaddingLen(int PaddingLen);</p> <p>int Conv_SetStride(int stride);</p> <p>int Conv_SetSeqLen(int len);</p> <p>int Conv_LoadOriSeqToCache(CALU_TYPE*  OriDataBuff, int OriDataLen);</p> <p>int Conv_LoadKernel(CALU_TYPE*  KernelBuff, int KernelLen);</p> <p>void Conv_ClearConvCache(void);</p> <p>int Conv_RunningConvolution(int StartPoint);</p> <p>int Conv_RunningPooling(int PoolingMode, int PoolingLen);</p> <p>void Conv_LayerEnd(void);</p> <p><span style="font-family: 宋体;">  其中,</span>Conv_SetPaddingLen<span style="font-family: 宋体;">函数的功能是设置</span><span style="font-family: Times New Roman;">Padding</span><span style="font-family: 宋体;">长度;</span>Conv_SetStride<span style="font-family: 宋体;">函数的功能是设置卷积步长;</span><span style="font-family: Times New Roman;">Conv_SetSeqLen</span><span style="font-family: 宋体;">函数的功能是设置原始序列长度;</span><span style="font-family: Times New Roman;">Conv_LoadOriSeqToCache</span><span style="font-family: 宋体;">的功能是加载原始数据序列;</span><span style="font-family: Times New Roman;">Conv_LoadKernel</span><span style="font-family: 宋体;">函数的功能是加载卷积核;</span> Conv_ClearConvCache<span style="font-family: 宋体;">函数的功能是清零缓存;</span><span style="font-family: Times New Roman;">Conv_RunningConvolution</span><span style="font-family: 宋体;">函数的功能是进行一层卷积运算;</span><span style="font-family: Times New Roman;">Conv_RunningPooling</span><span style="font-family: 宋体;">函数的功能是进行一层池化运算;</span><span style="font-family: Times New Roman;">Conv_LayerEnd</span><span style="font-family: 宋体;">函数的功能是结束一层运算。</span></p> <p> </p> <p><span style="font-size: 24px;"><strong><span style="font-family: 宋体;">功能仿真和整体测试结果</span></strong></span></p> <p align="justify">SOC<span style="font-family: 黑体;">验证和测试</span></p> <p><span style="font-family: 宋体;">将工程综合成比特流载入型号为</span><span style="font-family: Times New Roman;">XC7A100T</span><span style="font-family: 宋体;">的</span><span style="font-family: Times New Roman;">FPGA</span><span style="font-family: 宋体;">开发板中。编写一个卷积神经网络测试心电的用例和近似熵计算测试用例,每个测试用例均有纯软件版本和调用加速器的版本,</span></p> <p><span style="font-family: 宋体;">其中</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">心电分类的测试结果如图所示:</span></p> <p align="center"><img src="//image.lceda.cn/pullimage/mbuZLz5bzgssmwkBE2txE2GQjfcrbvbdGQdLzlwI.png"></p> <p align="center"><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">心电分类的测试结果</span></p> <p><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">采用两层网络结构,原始数据是</span><span style="font-family: Times New Roman;">1000</span><span style="font-family: 宋体;">点采样率</span><span style="font-family: Times New Roman;">200Hz</span><span style="font-family: 宋体;">的心电采样序列,第一层网络是卷积层,采用</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">个长度为</span><span style="font-family: Times New Roman;">9</span><span style="font-family: 宋体;">的卷积核,第二层是全连接层,参数序列长度为</span><span style="font-family: Times New Roman;">992</span><span style="font-family: 宋体;">。测试结果表明,在这个简单卷积神经网络的测试中,硬件加速版本的程序相比纯软件计算版本的程序提速约</span><span style="font-family: Times New Roman;">33</span><span style="font-family: 宋体;">倍。这意味着在低功耗单片机上难以实时运行的神经网络心电分类程序,在本</span><span style="font-family: Times New Roman;">SOC</span><span style="font-family: 宋体;">上仅仅只需要几毫秒。</span></p> <p><span style="font-family: 宋体;">近似熵算法的测试结果如图所示:</span></p> <p align="center"><img src="//image.lceda.cn/pullimage/Y7huaqdFI7dpUOoovNnHkkcQF6FEuEuaiOfu0gQT.png"></p> <p align="center"> <span style="font-family: 宋体;">近似</span><span style="font-family: 宋体;">熵算法的测试结果</span></p> <p><span style="font-family: 宋体;">该近似熵计算程序采用</span><span style="font-family: Times New Roman;">250</span><span style="font-family: 宋体;">点序列,测试结果表明,在采用该算法的近似熵计算测试中,硬件加速版本的程序相比纯软件计算版本的程序提速约</span><span style="font-family: Times New Roman;">34</span><span style="font-family: 宋体;">倍。在</span><span style="font-family: Times New Roman;">16M</span><span style="font-family: 宋体;">主频下,协处理器将原本需要数秒计算时间的</span><span style="font-family: Times New Roman;">250</span><span style="font-family: 宋体;">点近似熵算法优化到了区区几十毫秒。</span></p> <p><span style="font-family: 宋体;">在上位机和协处理器联调过程中</span><span style="font-family: 宋体;">,为了提高分类精度和方便移植网络,以及测试</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">加速效果的下限,我们没有采用上述测试</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">网络,而是更换了一个具有</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">层卷积层、</span><span style="font-family: Times New Roman;">3</span><span style="font-family: 宋体;">层全连接层的结构,并将心电采样点数缩减到了</span><span style="font-family: Times New Roman;">250</span><span style="font-family: 宋体;">点。由于全连接层过多,频繁读内存的延迟会拖累算法整体计算速度,</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">加速效果降低为</span><span style="font-family: Times New Roman;">18</span><span style="font-family: 宋体;">倍左右</span><span style="font-family: 宋体;">,如图所示:</span></p> <p align="center"><img src="//image.lceda.cn/pullimage/0rzXknYHbT4AlWXIrlQCTe82RhER8cw3SqbTwsnS.png"></p> <p align="center"> <span style="font-family: 宋体;">上位机和协处理器联调</span></p> <p align="justify"><span style="font-family: 宋体;">  由于全连接层占大多数的网络结构只是权宜之计,大多数网络依然会采用卷积层丰富的结构,因此基本可以判定</span><span style="font-family: Times New Roman;">18</span><span style="font-family: 宋体;">倍是协处理器在</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">维</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">计算加速的下限。</span></p> <p><span style="font-family: 宋体;">  综上,本项目s的协处理器可以有效加速近似熵算法和一维卷积神经网络算法,有效解决熵和</span><span style="font-family: Times New Roman;">CNN</span><span style="font-family: 宋体;">融合算法计算量过大的问题,并且这两种算法可以应用于多种生理信号的分析,因此该协处理器的应用范围广泛,市场前景明朗。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*6、BOM清单</h3> <hr class="horizontal-splitline normal-bold-2"> <table width="822"> <tr> <td width="137" height="18">Comment</td> <td width="137">Description</td> <td width="137">Designator</td> <td width="137">Footprint</td> <td width="137">LibRef</td> <td width="137">Quantity</td> </tr> <tr> <td width="137" height="37">0.1uF</td> <td width="137">贴片陶瓷电容0603</td> <td width="137">C1, C2, C3, C4, C7, C10, C23, C99, C128</td> <td width="137">LC-0603_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">9</td> </tr> <tr> <td width="137" height="18">0.1uF</td> <td width="137">贴片陶瓷电容0402</td> <td width="137">C5, C6</td> <td width="137">LC-0402_C</td> <td width="137">CAP_0402</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="18">16pF</td> <td width="137">贴片陶瓷电容0603</td> <td width="137">C8, C11, C12</td> <td width="137">LC-0603_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">3</td> </tr> <tr> <td width="137" height="18">10uF</td> <td width="137">贴片陶瓷电容0603</td> <td width="137">C9, C13</td> <td width="137">LC-0603_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="221">100nF/16V</td> <td width="137">贴片陶瓷电容0402</td> <td width="137">C14, C15, C16, C17, C18, C19, C20, C21, C22, C27, C28, C29, C32, C33, C34, C35, C36, C37, C38, C39, C40, C41, C42, C43, C44, C45, C46, C47, C48, C49, C50, C51, C55, C58, C59, C69, C70, C71, C72, C73, C79, C80, C84, C85, C86, C87</td> <td width="137">LC-0402_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">46</td> </tr> <tr> <td width="137" height="18">100nF/16V</td> <td width="137">贴片陶瓷电容0603</td> <td width="137">C88</td> <td width="137">LC-0603_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">100uF/25V</td> <td width="137"> </td> <td width="137">C89</td> <td width="137">CAP-SMD_BD6.3-L6.6-W6.6-FD</td> <td width="137">CAP_ELEC</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">100uF</td> <td width="137">贴片陶瓷电容1206</td> <td width="137">C90, C91</td> <td width="137">LC-1206_C</td> <td width="137">CAP_1206</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="55">22uF</td> <td width="137">贴片陶瓷电容0805</td> <td width="137">C92, C93, C94, C95, C105, C107, C108, C110, C111, C113</td> <td width="137">LC-0805_C</td> <td width="137">CAP_0805</td> <td align="right" width="137">10</td> </tr> <tr> <td width="137" height="18">22pF</td> <td width="137">贴片陶瓷电容0603</td> <td width="137">C96</td> <td width="137">LC-0603_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">22uF/16V</td> <td width="137">贴片陶瓷电容1206</td> <td width="137">C97, C98</td> <td width="137">LC-1206_C</td> <td width="137">CAP_1206</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="18">470nF</td> <td width="137">贴片陶瓷电容0603</td> <td width="137">C100</td> <td width="137">LC-0603_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">22nF</td> <td width="137">贴片陶瓷电容0603</td> <td width="137">C101, C102, C103, C104</td> <td width="137">LC-0603_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">4</td> </tr> <tr> <td width="137" height="18">100nF</td> <td width="137">贴片陶瓷电容0805</td> <td width="137">C106, C109, C112</td> <td width="137">LC-0805_C</td> <td width="137">CAP_0805</td> <td align="right" width="137">3</td> </tr> <tr> <td width="137" height="18">1uF</td> <td width="137">贴片陶瓷电容0603</td> <td width="137">C114, C115</td> <td width="137">LC-0603_C</td> <td width="137">CAP_0603</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="37">100nF/50V</td> <td width="137">Capacitor</td> <td width="137">C116, C117, C118, C125</td> <td width="137">LC-0603_C</td> <td width="137">CAP</td> <td align="right" width="137">4</td> </tr> <tr> <td width="137" height="18">0.1uF/16V</td> <td width="137">Capacitor</td> <td width="137">C119, C122</td> <td width="137">LC-0603_C</td> <td width="137">Cap</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="37">10pF/16V</td> <td width="137">Capacitor</td> <td width="137">C120, C121, C126, C127</td> <td width="137">LC-0603_C</td> <td width="137">CAP</td> <td align="right" width="137">4</td> </tr> <tr> <td width="137" height="18">1nF/2KV</td> <td width="137">Capacitor</td> <td width="137">C123</td> <td width="137">LC-1206_C</td> <td width="137">CAP</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">1uF/16V</td> <td width="137">Capacitor</td> <td width="137">C124</td> <td width="137">LC-0603_C</td> <td width="137">CAP</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">5103308-1</td> <td width="137"> </td> <td width="137">CN10</td> <td width="137">IDC-TH_5103308-1</td> <td width="137">5103308-1</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">10uF/16V</td> <td width="137"> </td> <td width="137">CT1</td> <td width="137">LC-CASE-B_3528</td> <td width="137">ELECTRO1</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">LED_0603</td> <td width="137">贴片LED_0603</td> <td width="137">D1</td> <td width="137">LC-0603_LED_S3</td> <td width="137">LED_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">SMBJ5.0A</td> <td width="137">瞬态抑制二极管</td> <td width="137">D2, D8, D9</td> <td width="137">LC-SMB(DO-214AA)_S4</td> <td width="137">TVS</td> <td align="right" width="137">3</td> </tr> <tr> <td width="137" height="18">RED</td> <td width="137">贴片LED_0603</td> <td width="137">D3, D4, D5, D6, D7</td> <td width="137">LC-0603_LED_S3</td> <td width="137">LED_0603</td> <td align="right" width="137">5</td> </tr> <tr> <td width="137" height="37">HX25003-2A</td> <td width="137"> </td> <td width="137">FAN1, ISO1, P4</td> <td width="137">CONN-TH_2P-P2.50_HX25003-2A</td> <td width="137">HX25003-2A</td> <td align="right" width="137">3</td> </tr> <tr> <td width="137" height="18">BLM18PG221SN1</td> <td width="137"> </td> <td width="137">FB1, FB2</td> <td width="137">LC-0603_L</td> <td width="137">FB0603</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="18">Header 4</td> <td width="137">Header, 4-Pin</td> <td width="137">GND</td> <td width="137">HDR1X4</td> <td width="137">Header 4</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">HR911105A</td> <td width="137"> </td> <td width="137">J1</td> <td width="137">RJ45_HR911105A</td> <td width="137">HR911105A</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">MTB110-14S</td> <td width="137"> </td> <td width="137">JTAG1</td> <td width="137">IDC-TH_MTB110-14S</td> <td width="137">JTAG_14P</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="55">1.5uH</td> <td width="137"> </td> <td width="137">L1</td> <td width="137">IND-SMD_L7.0-W6.6_MCW-0650-220</td> <td width="137">LOOP_0650</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="55">4.7uH</td> <td width="137"> </td> <td width="137">L2, L3, L4</td> <td width="137">IND-SMD_L7.0-W6.6_MCW-0650-220</td> <td width="137">LOOP_0650</td> <td align="right" width="137">3</td> </tr> <tr> <td width="137" height="18">GREEN</td> <td width="137">贴片LED_0603</td> <td width="137">LED1</td> <td width="137">LC-0603_LED_S3</td> <td width="137">LED_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">Header 16</td> <td width="137">Header, 16-Pin</td> <td width="137">P2</td> <td width="137">HDR1X16</td> <td width="137">Header 16</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">4.7K</td> <td width="137">贴片电阻0603, Resistor</td> <td width="137">R1, R2, R3, R4, R6, R8, R9, R62, R99</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603, Res2</td> <td align="right" width="137">9</td> </tr> <tr> <td width="137" height="18">330</td> <td width="137">贴片电阻0603</td> <td width="137">R5</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">220</td> <td width="137">贴片电阻0603</td> <td width="137">R7</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">100R/1%</td> <td width="137">贴片电阻0402</td> <td width="137">R10</td> <td width="137">LC-0402_R</td> <td width="137">RES_0402</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">1K/0.1%</td> <td width="137">贴片电阻0603</td> <td width="137">R11, R12</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="18">240R/1%</td> <td width="137">贴片电阻0402</td> <td width="137">R13</td> <td width="137">LC-0402_R</td> <td width="137">RES_0402</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="110">1K</td> <td width="137">贴片电阻0603</td> <td width="137">R14, R15, R16, R17, R18, R19, R20, R21, R22, R24, R26, R28, R30, R32, R34, R36, R38, R40, R42, R44, R46, R48, R50, R106</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">24</td> </tr> <tr> <td width="137" height="18">820</td> <td width="137">贴片电阻0603</td> <td width="137">R52</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">0</td> <td width="137">贴片电阻0603</td> <td width="137">R53, R63</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="18">100</td> <td width="137">贴片电阻0603</td> <td width="137">R54</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">510</td> <td width="137">贴片电阻0603</td> <td width="137">R55, R56</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="92">10K</td> <td width="137">贴片电阻0603, 名称:贴片电阻;规格型号:RC0603-103-J;厂家:通用;阻值:10k;精度:±5%, Resistor</td> <td width="137">R57, R58, R59, R60, R61, R64, R69, R75, R79, R80, R81, R82, R92, R102, R103, R104, R105</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603, Res2</td> <td align="right" width="137">17</td> </tr> <tr> <td width="137" height="18">150K</td> <td width="137">贴片电阻0603</td> <td width="137">R65</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">100K/1%</td> <td width="137">贴片电阻0603</td> <td width="137">R66, R72</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="18">100K</td> <td width="137">贴片电阻0603</td> <td width="137">R67</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">5.1K</td> <td width="137">贴片电阻0603</td> <td width="137">R68, R71</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="18">150K/1%</td> <td width="137">贴片电阻0603</td> <td width="137">R70</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">53.6K/1%</td> <td width="137">贴片电阻0603</td> <td width="137">R73</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">33K/1%</td> <td width="137">贴片电阻0603</td> <td width="137">R74</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">75K/1%</td> <td width="137">贴片电阻0603</td> <td width="137">R76</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">56K/1%</td> <td width="137">贴片电阻0603</td> <td width="137">R77</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">10K/1%</td> <td width="137">贴片电阻0603</td> <td width="137">R78</td> <td width="137">LC-0603_R</td> <td width="137">RES_0603</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="74">49.9R/1%</td> <td width="137">名称:贴片电阻;规格型号:RC0603-103-J;厂家:通用;阻值:10k;精度:±5%</td> <td width="137">R83, R84, R96, R97</td> <td width="137">LC-0603_R</td> <td width="137">Res2</td> <td align="right" width="137">4</td> </tr> <tr> <td width="137" height="55">22R</td> <td width="137">Resistor</td> <td width="137">R85, R86, R87, R88, R89, R90, R91, R95, R98, R101</td> <td width="137">LC-0603_R</td> <td width="137">Res2</td> <td align="right" width="137">10</td> </tr> <tr> <td width="137" height="18">330R</td> <td width="137">Resistor</td> <td width="137">R93, R100</td> <td width="137">LC-0603_R</td> <td width="137">Res2</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="74">12.1K/1%</td> <td width="137">名称:贴片电阻;规格型号:RC0603-103-J;厂家:通用;阻值:10k;精度:±5%</td> <td width="137">R94</td> <td width="137">LC-0603_R</td> <td width="137">Res2</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">HX25003-5A</td> <td width="137"> </td> <td width="137">RS1</td> <td width="137">CONN-TH_5P-P2.50_HX25003-5A</td> <td width="137">HX25003-5A</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">Header 2</td> <td width="137">Header, 2-Pin</td> <td width="137">S1, S2, S3, S4, S5</td> <td width="137">HDR1X2</td> <td width="137">Header 2</td> <td align="right" width="137">5</td> </tr> <tr> <td width="137" height="37">Button_5.2*5.2*1.5</td> <td width="137">轻触按键</td> <td width="137">SW1, SW2</td> <td width="137">KEY-TH_4P-L6.0-W6.0-P3.90-LS7.8</td> <td width="137">Button</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="18">TestPin</td> <td width="137">测试点</td> <td width="137">T1, T2</td> <td width="137">TESTPIN</td> <td width="137">TestPin</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="92">XC7A100T-2FGG676I</td> <td width="137">Artix-7 FPGA, 300 User I/Os, 8 GTP, 676-Ball BGA, Speed Grade 2, Industrial Grade, Pb-Free</td> <td width="137">U1</td> <td width="137">FGG676</td> <td width="137">XC7A100T-2FGG676I</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">N25Q128A13ESE40F</td> <td width="137"> </td> <td width="137">U2, U4</td> <td width="137">SOIC-8_L5.3-W5.3-P1.27-LS8.0-BL</td> <td width="137">N25Q128A13ESE40F</td> <td align="right" width="137">2</td> </tr> <tr> <td width="137" height="37">MT41K128M16JT-125:k</td> <td width="137">96ball,14mm*8mm</td> <td width="137">U3</td> <td width="137">FBGA-96_L8.0-W14.0_TL</td> <td width="137">MT41K128M16JT-125:k</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">CH340E</td> <td width="137"> </td> <td width="137">U5</td> <td width="137">MSOP-10_L3.0-W3.0-P0.50-LS5.0-BL</td> <td width="137">CH340E</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">IL3122-3E</td> <td width="137">RS422接口芯片</td> <td width="137">U6</td> <td width="137">SOIC-16_L9.9-W3.9-P1.27-LS6.0-BL</td> <td width="137">IL3122-3E</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="18">MP8712</td> <td width="137"> </td> <td width="137">U7</td> <td width="137">QFN-14_MP8712</td> <td width="137">MP8712</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="55">TPS563201</td> <td width="137"> </td> <td width="137">U8, U9, U10</td> <td width="137">SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BR</td> <td width="137">TPS563201</td> <td align="right" width="137">3</td> </tr> <tr> <td width="137" height="18">LAN8720A</td> <td width="137"> </td> <td width="137">U11</td> <td width="137">QFN24</td> <td width="137">LAN8720A</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="55">SRV05-4</td> <td width="137"> </td> <td width="137">U12</td> <td width="137">SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BR - duplicate</td> <td width="137">SRV05-4</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">KH-TYPE-C-16P</td> <td width="137"> </td> <td width="137">USB1</td> <td width="137">USB-C-SMD_KH-TYPE-C-16P</td> <td width="137">KH-TYPE-C-16P</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">50MHz</td> <td width="137">7050有源晶振</td> <td width="137">X1</td> <td width="137">OSC-SMD_4P-L7.0-W5.0-BL</td> <td width="137">7050</td> <td align="right" width="137">1</td> </tr> <tr> <td width="137" height="37">32768</td> <td width="137">7050有源晶振</td> <td width="137">X2</td> <td width="137">OSC-SMD_4P-L7.0-W5.0-BL</td> <td width="137">7050</td> <td align="right" width="137">1</td> </tr> </table> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*7、大赛LOGO验证</h3> <hr class="horizontal-splitline normal-bold-2"> <p style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><img src="//image.lceda.cn/pullimage/Twui6VHhu16qd5rNcouUXT4yreEG8fmpd3SAZ1g7.jpeg"></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">* 8、演示您的项目并录制成视频上传</h3> <hr class="horizontal-splitline normal-bold-2"> <p style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">视频要求:请横屏拍摄,分辨率不低于1280×720,格式Mp4/Mov,单个视频大小限100M内;</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">视频标题:立创电赛:{项目名称}-{视频模块名称};如立创电赛:《自动驾驶》-团队介绍。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="font-size: 14px;">更多详情:<a href="/posts/15a52db9fd7d40c492eb505280278e45" target="_blank">https://diy.szlcsc.com/posts/15a52db9fd7d40c492eb505280278e45</a></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> </div>

文档

BOM

暂无

附件

附件名 下载
2设计报告中所述的自己设计的系统电路板原理图.pdf
测试上位机软件源码_QtCreator.zip
测试下位机软件源码_NucleiStudio.zip
bom.xlsx
芯片FPGA原型_bitfile.zip
FPGA原型验证电路板设计.zip

评论(59)

  • 表情
    emoji
    小嘉工作篇
    小嘉日常篇
  • 图片
成功
工程所有者当前已关闭评论
dwry 回复
<p>专业[emojis:掉发]</p>
蓝天白云~ 回复
<p>学习[emojis:呲牙]</p>
WISIOND 回复
<p>这个项目应该是最复杂的吧</p>
L102828595 回复
<p>从头到尾看了一遍开源工程介绍,我觉得这个项目很有前瞻性,具有很强的专业性,除了基本的嵌入式开发技能和算法还需要医疗电子行业的深度认知,浏览下来本次大赛本项目的创新性和研发方向的价值都是名列前茅的,这一票我投给这位大佬。</p>
snqzgq16888 回复
<p>加油加油加油</p>
waaaaaaw 回复
<p>该智能生理信号分析加速SoC设计高效实用,为心电分类诊断和减少室颤误判提供了重要支持,具有较高的性能和可靠性,使得医疗器械在处理生理一维信号上更加精准快速,对于医疗行业的进步具有积极的意义</p>
FUNIOT 回复
<p>医疗永不过时,非常有用</p>
yjmwxwx 回复
<p>项目做的很好,很喜欢!</p>
stm.32 回复
<p>加油加油</p>
zzm0922 回复
<p>这个项目有点意思,还很有前景!</p>
verysunshine 回复
<p>冲冲冲,拿奖拿奖拿奖,必须支持一下!希望作者做出更多有意思的项目!!!</p>
maikesiwei 回复
<p>芯片设计,这个比赛路子越来越广了</p>
maikesiwei 回复
<p>芯片设计+FPGA高速电路板+嵌入式软件设计+算法库设计+上位机,作者很全能啊,要是以后流片就厉害了。</p>
tricore 回复
<p>这个看着工作量很大啊,作者对生物信号的知识很了解啊</p>
dongjiate 回复
<p>厉害的</p>
cleverguy 回复
<p>壮观的走线[emojis:色]</p>
147400w 回复
<p>看了这个开发板,挺专业</p>
NightFury 回复
<p>冲冲冲!支持作者,支持立创</p>
立创电赛 回复
<p>点赞+收藏+评论赢500元京东E卡:<a href="https://diy.szlcsc.com/posts/9d4438cf6d3848d3a53c50e029514a91" target="_blank">https://diy.szlcsc.com/posts/9d4438cf6d3848d3a53c50e029514a91</a></p>
陶硕 回复
<p>学习</p>
立创电赛 回复
<p>@dwry恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@l102828595恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@maikesiwei恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@jiake恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@yjmwxwx恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@tricore恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@dongjiate恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@147400w恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@alpaca_135恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@lvqianjin恭喜您的评论中奖了!您可登录立创商城领取您的10元京东E卡等额积分!感谢您对立创电赛的支持!</p>
无敌 回复
<p>立创yyds</p>
manweirdo 回复
<p>RISC-V以后会逐渐成为趋势!</p>
badboyp_q 回复
<p>应用前景不错[emojis:强]</p>
冰西瓜 回复
<p>高级,希望赛事一直举办下去,激发创新活力!</p>
TThomas 回复
<p>设计得很好 学习到了</p>
songjl 回复
<p>立创yyds</p>
好好公子呢 回复
<p>大佬,你是这个[emojis:强]</p>
weyland 回复
<p>[emojis:悠闲] 我是来抽奖的,顺便学习了</p>
skyzyt 回复
<p>@manweirdo恭喜您的评论中奖了!10元京东E卡等额积分已发送到您的账户,您可登录立创商城https://activity.szlcsc.com/point/use/info.html查看!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@manweirdo恭喜您的评论中奖了!10元京东E卡等额积分已发送到您的账户,您可登录立创商城https://activity.szlcsc.com/point/use/info.html查看!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@fuming123abc恭喜您的评论中奖了!10元京东E卡等额积分已发送到您的账户,您可登录立创商城https://activity.szlcsc.com/point/use/info.html查看!感谢您对立创电赛的支持!</p>
jyy1206628992 回复
<p>超级厉害的大佬,我是每次都想参赛,每次都鸽,向优秀的人儿看齐~</p>
873836a 回复
<p>专业[emojis:强]</p>
6682288a 回复
<p>这个的确不错,就是元器件排版不是太紧凑,是限于层数太少了吗?</p>
立创电赛 回复
<p>@jyy1206628992恭喜您的评论中奖了!10元京东E卡等额积分已发送到您的账户,您可登录立创商城https://activity.szlcsc.com/point/use/info.html查看!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>@6682288a恭喜您的评论中奖了!10元京东E卡等额积分已发送到您的账户,您可登录立创商城https://activity.szlcsc.com/point/use/info.html查看!感谢您对立创电赛的支持!</p>
FARLEYX 回复
<p>好复杂,厉害</p>
muliangxing 回复
<p>[emojis:强]</p>
lc912778813 回复
<p>涉及很多医疗专业领域的知识,希望经过测试稳定性和安全性后,能运用到专业设备上,支持拿奖。[emojis:强]</p>
立创电赛 回复
<p>@lc912778813恭喜您的评论中奖了!10元京东E卡等额积分已发送到您的账户,您可登录立创商城:<a href="https://activity.szlcsc.com/point/use/info.html" target="_blank">https://activity.szlcsc.com/point/use/info.html</a> 查看!感谢您对立创电赛的支持</p>
立创电赛 回复
<p>@farleyx恭喜您的评论中奖了!10元京东E卡等额积分已发送到您的账户,您可登录立创商城:<a href="https://activity.szlcsc.com/point/use/info.html" target="_blank">https://activity.szlcsc.com/point/use/info.html</a> 查看!感谢您对立创电赛的支持</p>
yqybsypksadfdsa 回复
<p>这个太专业了</p>
shanghaikb 回复
<p>专研勤学苦练</p>
serfeire 回复
<p>冠军 必须冠军</p>
立创电赛 回复
<p>@yqybsypksadfdsa恭喜您的评论中奖了!10元京东E卡等额积分已发送到您的账户,您可登录立创商城:<a href="https://activity.szlcsc.com/point/use/info.html" target="_blank">https://activity.szlcsc.com/point/use/info.html</a> 查看!感谢您对立创电赛的支持!</p>
立创电赛 回复
<p>恭喜您在“瑞萨MCU杯”第八届立创电子设计开源大赛中获得三等奖,相关奖励及证书将于近期发出!</p>
ljc 回复
<p>这个是在实际项目中运用到的设计</p>
quanzx 回复
<p>大佬可以要一下您的NICE接口部分的fpga源码学习一下吗</p>
mxkw 回复
<p>请问XC7A与XC7K的主要区别是什么呢?</p>
goToTop
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow