CS/ECE 552 Intro to Computer Architecture Spring 2020 Section 1
Instructor Matthew D. Sinclair
URL: http://www.cs.wisc.edu/~sinclair/courses/cs552/spring2020/

Verilog Rules Checking

Links to specific parts of document:

A Java program Vcheck will be used to scan your design for some of the common illegal constructs (see rules). It is fairly simple, and can be easily fooled into either allowing things or complaining incorrectly. But it is a useful tool if you are unclear as to whether or not your design meets the requirements set forth here. You will be required to run it on your Verilog designs and hand in the output.

Manual checking

To run it, copy the two class files Vcheck.class and VerFile.class into a directory, and from that directory type:

prompt> "java Vcheck <myfile.v>"

  • Vcheck.class (also available at /u/s/i/sinclair/public/html/courses/cs552/spring2019/handouts/verilog_code/)
  • VerFile.class (also available at /u/s/i/sinclair/public/html/courses/cs552/spring2019/handouts/verilog_code/)

For every Verilog file, run this tool and save the output in a file with the extension .vcheck.out. For example, if you had a file called add.v, then your vheck output file should be add.vcheck.out. The .vcheck.out files should be turned in.


Automated scripts

(NOTE: both methods assume you have added /u/s/i/sinclair/public/html/courses/cs552/spring2020/handouts/bins to your PATH)

1 File at a time

Method 1: From the Linux prompt on a CS machine, cd to the directory where your verilog files are and issue the following command:

prompt> vcheck.sh myfile.v myfile.vcheck.out

If there are no errors, the vcheck.out file will contain a string like the following:

End of file /tmp/foo.v. Hash = 377189683

If there are errors, you will see them in the vcheck.out file. For example:

Line 5: Expected '@' after 'always' Line 5: Always without case(x) End of file /tmp/foo.v. Hash = -994087497

All files in a directory

Method 2: To run vcheck on all the verilog files in a directory:

prompt> vcheck-all.sh

This script will run vcheck on all the verilog files in your current directory and generate .vcheck.out files for each verilog file.

 
Computer Sciences | UW Home