020-ErrorHandlingAndDebugging
- 格式:pdf
- 大小:164.73 KB
- 文档页数:24


1 Overview of Formality Labs for Debugging Failing Verifications
Purpose: These labs are designed for you to find, analyze, and solve
common equivalency checking problems using Formality. You can use
these labs to increase your awareness of Formality and to practice
debugging skills.
Content: These labs use public-domain RTL source. The netlists were
generated using Design Compiler F-2011.09 release software.
Procedure:
There is a README file for every lab describing what to do.
Each lab has a “runme.fms” FM Tcl script you can use initially.
Each lab has a “hint” directory containing a README file if you
need some helpful pointers on what to do.
If you find that a lab is too difficult, there is a “.solution”
sub-directory with the correct solution.
Please compare your results with the correct results when you
调试常见的20种错误提示
1、fatal error C1010: unexpected end of file while looking for
precom piled header directive。
寻找预编译头文件路径时遇到了不该遇到的文件尾。
解决方法:
其一,包含正确路径的#include "stdafx.h";
其二,在*.cpp文件的Setting里面设置,C++选项中的分类
precompiled head er,选择不包含头文件即可。
2、fatal error C1083: Cannot open inc lude file: 'R…….h': No
such fi le or directory
不能打开包含文件“R…….h”:没有这样的文件或目录。
3、error C2011: 'C……': 'class' type redefinition
类“C……”重定义。
4、error C2018: unknown character '0xa3'
不认识的字符'0xa3'。(一般是汉字或中文标点符号)
5、error C2057: expected constant expression
希望是常量表达式。(一般出现在switch语句的case分支中)
6、error C2065: 'IDD_MYDIALOG' : undeclared identifier
“IDD_MYDIALOG”:未声明过的标识符。
7、error C2082: redefinition of formal parameter 'bReset'
函数参数“bReset”在函数体中重定义。
8、error C2143: syntax error: missing ':' before '{'
句法错误:“{”前缺少“;”。
9、error C2146: syntax error : missing ';' before identifier 'dc'
附录4-
399
附录4 µ’nSP™编译相关错误信息
汇编器Xasm16在对µ’nSP™的指令进行汇编过程中可能会出现的错误信息如下:
A0000: Syntax error
语法错误。当某一指令或表达式不符合Xasm16规定的格式时会出现此信息。
A0001: ‘…’ already defined
某符号已被定义过,不能对其重复定义。
A0002: Bad use of local symbol‘…’
局部符号不能被用作宏名、程序名、段名、结构名、结构变量名以及常量名。
A0003: Bad use of keyword‘…’
指令或伪指令中的关键字不能被任意用作符号。
A0004:‘…’already defined
某局部符号与前面已定义过的符号同名,符号不允许被重复定义。
A0005: Local symbol‘…’can not be declared as external
局部符号只能用在局部区域,故其不能被声明为外部符号。
A0006:‘…’Illegal forward reference or symbol
变量在引用前须经定义,不可超前引用。
A0007: '...' undefined
引用的符号未经定义。
A0008: Local symbol '...' can't be declared as public
局部符号只能用在局部区域,故其不能被声明为全局符号。
A0009: '...' can't be declared as public---wrong type
某符号已被定义成常量,故其不能再被声明为全局变量符号。
A0010: '...' can't be declared as public because it's defined with VAR
某符号已用伪指令VAR被定义为常量,故其不能再被声明为全局符号。
A0011: '...' should represent a number
vscodepython关于⽆法找到⽂件路径的问题
Nosuchfileordirectory
之前习惯⽤pycharm来开发python程序,但是pycharm打开的速度实在是太感⼈了,所以想转⽤vscode编辑器来写python,毕竟python作为⼀个脚本语⾔,⽤编辑器写也不会有太⼤的问题。
但是在vscode下写python程序的时候以为发现⼀个问题,在pycharm下能正常使⽤的程序,在vscode下就⽆法正常使⽤了,其中的⼀个问题就是会出现
FileNotFoundError: [Errno 2] No such file or directory: 'xxx.xxx'⾸先我的⽂件路径是这样的。
⽂件路径.png
现在test2.py⾥⾯有这⾏代码,也是这⾏代码报错。
file = open('data_baidu.txt', 'r', encoding='utf-8')找了⼀下原因,发现如果直接在split_test⽂件⽬录下⽤命令⾏运⾏python test2.py不会有问题,但是在其他⽬录下运⾏就会报上⾯的FileNotFoundError的错误。
⽤命令⾏运⾏代码
这样⼀来,谜题解决了,pycharm运⾏python程序的时候是在相应的⽂件⽬录下运⾏的,⽽vscode是在相应的⼯程⽬录下运⾏的。可以看看vscode⾥⾯的launch.json的配置,这⾥的${file}的意思是vscode所打开的⽂件夹的路径。
Paste_Image.png
这个原因找了⼀个晚上,分享给⼤家吧。另外,如果⼤家想⽤virtualenv创建出来的python虚拟环境,把python.path修改到你的virtualenv的路径下的python.exe就可以了。我的env的路径在d盘的env35中。
"python.pythonPath": "D:\\env35\scripts\\python.exe",顺便安利⼀下,vscode是世界上最强的编辑器哈哈哈