当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

合肥工业大学:《EDA技术与应用》精品课程教学资源(PPT课件讲稿)第5章 VHDL基本语句(三)VHDL 编码风格

资源类别:文库,文档格式:PPT,文档页数:21,文件大小:367.5KB,团购合买
1. 注释和文本 2. 常规风格指导 3. 缩进格式指导 4. 命名惯例 5. 留白 6. 示例
点击下载完整版文档(PPT)

第5章VHDL基本语句(三) VHDL编码风格 课程讲义 合肥业大学彭良清从 上一章 下一章

第5章 VHDL基本语句(三) VHDL编码风格 课程讲义 合肥工业大学 彭良清 上一章 下一章

本节内容 注释和文本 良好的 2.常规风格指导 代码风格 3.缩进格式指导 可以 4.命名惯例 大大提高 5.留直 阅读效率 6.示例 ..L..L.....L 好码如诗

本节内容 1. 注释和文本 2. 常规风格指导 3. 缩进格式指导 4. 命名惯例 5. 留白 6. 示例 良好的 代码风格 可以 大大提高 阅读效率 好码如诗

注释和文本格式(一) 在文本开始描述设计文件地功能和端口 2.重要语句应加以注释,并且如果代码更新,注释也 应该更新 3.不应使用语句本身作为注释,例如: With duplication Without Duplication 工Fc1 ear ThEN 多1oada[]矿ith0多 工Fc1 ear THEN c[]=0 []=0 END工F END IF

注释和文本格式(一) 1. 在文本开始描述设计文件地功能和端口 2. 重要语句应加以注释,并且如果代码更新,注释也 应该更新 3. 不应使用语句本身作为注释,例如:

注释和文本格式(二) 1.注释应位于其说明的代码之上,并且应该左右均 矿齐。 2.在注释分解符和注释文本之间应该留有空格 Unformatted: Formatted: gLeave one blank space bet ween% s Leave one blank space between sthe percent symbol and the' 多 the percent symbol and the多 g documenting text. Line up% g documenting text. Line up opening and closing percent% 口 pening and c1 osing percent多 g symbols for easy readability. g symbols for easy readability. g

注释和文本格式(二) 1. 注释应位于其说明的代码之上,并且应该左右均 对齐。 2. 在注释分解符和注释文本之间应该留有空格

常规风格指导(一) 所有关键词、器件名称、常数、图元应该大写, 其他文本应该小写(包括宏模块) Unformatted Formatted case tap1吕 CAse tap工 when test logic reset = WhEN test logic reset = if i tms then F i tms THEN run test/idle: tap run test/idle; end if: END IF; when test/idle=> WHEN r test/idle=> if then 工F o THEN tap select dr scan; tap select dr scan: end if: END工F when select dr scan = WhEN select dr scan = if tms then F tms THEN tap select ir scan; tap select ir scan; else ELSE tap capture dr: tap capture dr: end if: END工F end case: END CASE

常规风格指导(一) ❖ 所有关键词、器件名称、常数、图元应该大写, 其他文本应该小写(包括宏模块)

常规风格指导(二) 所有关键词、器件名称、常数、图元应该大写, 其他文本应该小写(包括宏模块) Unformatted Formatted case tap1吕 CAse tap工 when test logic reset = WhEN test logic reset = if i tms then F i tms THEN run test/idle: tap run test/idle; end if: END IF; when test/idle=> WHEN r test/idle=> if then 工F o THEN tap select dr scan; tap select dr scan: end if: END工F when select dr scan = WhEN select dr scan = if tms then F tms THEN tap select ir scan; tap select ir scan; else ELSE tap capture dr: tap capture dr: end if: END工F end case: END CASE

常规风格指导(二) ❖ 所有关键词、器件名称、常数、图元应该大写, 其他文本应该小写(包括宏模块)

缩进格式指导:F语句 工FExp工e多1011THEr 冬三七a七eme卫t冬 冬3七a七eme卫七冬 EL习工 F expression2THEN 冬七a七emne卫t零 冬三七atee卫t冬 ELSE 冬七a七eme卫t冬 三七a七emme卫t冬 ErD工

缩进格式指导:IF语句

缩进格式指导:CASE语句 CAsE express1on士s WHEN constant => 冬宫七 atement冬 冬 statement冬 WHEn constant2 = 多 tatement 冬吕 tatement 而 HEN constant3=> CAsE expression Is 冬彐 tatement冬 WHEN constant 1 令吕 tatement冬 冬吕 tatement冬 WHEN constant2 >>> 令宫 tatement多 WHEN OTHERS = WhEN constant 3 令 statement含 冬 tatement冬 WHEN OTHERS >多宫 tatement 多彐 tatement冬 END CASE: END CASE

缩进格式指导:CASE语句

缩进格式指导: VARIABLE语句 VARIABLE SS: MACHINE WITH STATES (s0, s1, 32, 33) tt: MACHINE OF BITS (C[3. 0]) 矿 ITH STATES t0=B"01 t1=B"10 t2=B"0100" t3=B"1000")

缩进格式指导:VARIABLE语句

命名惯例:命名应含义明确 Ambiguous Name Unambiguous Name direction access mode

命名惯例:命名应含义明确

点击下载完整版文档(PPT)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共21页,试读已结束,阅读完整版请下载
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有