.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "VPASSERT 1p" .TH VPASSERT 1p 2024-01-27 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME vpassert \- Preprocess Verilog code assertions .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBvpassert\fR [ \fB\-\-help\fR ] [ \fB\-\-date\fR ] [ \fB\-\-quiet\fR ] [ \-y \fBdirectories...\fR ] [ \fBfiles...\fR ] .SH DESCRIPTION .IX Header "DESCRIPTION" Vpassert will read the specified Verilog files and preprocess special PLI assertions. The files are written to the directory named .vpassert unless another name is given with \fB\-o\fR. If a directory is passed, all files in that directory will be preprocessed. .SH ARGUMENTS .IX Header "ARGUMENTS" Standard VCS and GCC-like parameters are used to specify the files to be preprocessed: .PP .Vb 6 \& +libext+I+I... Specify extensions to be processed \& \-f I Parse parameters in file \& \-v I Parse the library file (I) \& \-y I Parse all files in the directory (I) \& \-II Parse all files in the directory (I) \& +incdir+I Parse all files in the directory (I) .Ve .PP To prevent recursion and allow reuse of the input.vc being passed to the simulator, if the output directory is requested to be preprocessed, that directory is simply ignored. .IP \-\-allfiles 4 .IX Item "--allfiles" Preprocess and write out files that do not have any macros that need expanding. By default, files that do not need processing are not written out. .Sp This option may speed up simulator compile times; the file will always be found in the preprocessed directory, saving the compiler from having to search a large number of \-v directories to find it. .IP \-\-axiom 4 .IX Item "--axiom" Special Axiom ATHDL enables/disables added around unreachable code. .IP "\-\-call\-error " 4 .IX Item "--call-error " When \f(CW$uerror\fR (or \f(CW$uassert\fR etc.) wants to display a message, call the specified function instead of \f(CW$display\fR and \f(CW$stop\fR. .IP "\-\-call\-info " 4 .IX Item "--call-info " When \f(CW$uinfo\fR wants to display a message, call the specified function instead of \f(CW$display\fR. .IP "\-\-call\-warn " 4 .IX Item "--call-warn " When \f(CW$uwarn\fR (or \f(CW$uwarn_clk\fR etc.) wants to display a message, call the specified function instead of \f(CW$display\fR and \f(CW$stop\fR. .IP \-\-date 4 .IX Item "--date" Check file dates and sizes versus the last run of vpassert and don't process if the given source file has not changed. .IP \-\-exclude 4 .IX Item "--exclude" Exclude processing any files which begin with the specified prefix. .IP \-\-help 4 .IX Item "--help" Displays this message and program version and exits. .IP "\-\-language <1364\-1995|1364\-2001|1364\-2005|1800\-2005|1800\-2009|1800\-2012|1800\-2017|1800\-2023>" 4 .IX Item "--language <1364-1995|1364-2001|1364-2005|1800-2005|1800-2009|1800-2012|1800-2017|1800-2023>" Set the language standard for the files. This determines which tokens are signals versus keywords, such as the ever-common "do" (data-out signal, versus a do-while loop keyword). .IP \-\-minimum 4 .IX Item "--minimum" Include `_\|_message_minimum in the \f(CW$uinfo\fR test, so that by defining _\|_message_minimum=1 some uinfos may be optimized away at compile time. .IP \-\-noline 4 .IX Item "--noline" Do not emit `line directives. If not specified they will be used under \&\-\-language 1364\-2001 and later. .IP \-\-nopli 4 .IX Item "--nopli" Delete all 'simple' PLI calls. PLI function calls inside parenthesis will not be changed, and thus may still need to be manually ifdef'ed out. Useful for reducing the amount of `ifdef's required to feed non-PLI competent synthesis programs. .IP \-\-nostop 4 .IX Item "--nostop" By default, \f(CW$error\fR and \f(CW$warn\fR insert a \f(CW$stop\fR statement. With \-\-nostop, this is replaced by incrementing a variable, which may then be used to conditionally halt simulation. .IP "\-\-o \fIfile\fR" 4 .IX Item "--o file" Use the given filename for output instead of the input name .vpassert. If the name ends in a / it is used as a output directory with the default name. .IP \-\-quiet 4 .IX Item "--quiet" Suppress messages about what files are being preprocessed. .IP \-\-realintent 4 .IX Item "--realintent" Special RealIntent enable/disables added around unreachable code. .IP \-\-synthcov 4 .IX Item "--synthcov" When "ifdef SYNTHESIS" is seen, disable coverage. Resume on the `else or `endif. This does NOT follow child defines, for example: .Sp .Vb 4 \& \`ifdef SYNTHSIS \& \`define MYSYNTH \& \`endif \& \`ifdef MYSYNTH // This will not be coveraged\-off .Ve .IP "\-\-timeformat\-units \fIunits\fR" 4 .IX Item "--timeformat-units units" If specified, include Verilog \f(CW$timeformat\fR calls before all messages. Use the provided argument as the units. Units is in powers of 10, so \-9 indicates to use nanoseconds. .IP "\-\-timeformat\-precision \fIprec\fR" 4 .IX Item "--timeformat-precision prec" When using \-\-timeformat\-units, use this as the precision value, the number of digits after the decimal point. Defaults to zero. .IP \-\-vericov 4 .IX Item "--vericov" Special Vericov enable/disables added around unreachable code. .IP \-\-verilator 4 .IX Item "--verilator" Special Verilator translations enabled. .IP \-\-version 4 .IX Item "--version" Displays program version and exits. .IP \-\-vcs 4 .IX Item "--vcs" Special Synopsys VCS enables/disables added around unreachable code. .SH FUNCTIONS .IX Header "FUNCTIONS" These Verilog pseudo-pli calls are expanded: .IP /*vp_coverage_off*/ 4 .IX Item "/*vp_coverage_off*/" Disable coverage for all tools starting at this point. Does not need to be on a unique line. .IP /*vp_coverage_on*/ 4 .IX Item "/*vp_coverage_on*/" Re-enable coverage after a vp_coverage_off. Does not need to be on a unique line. .ie n .IP "$uassert(\fIcase\fR, ""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uasser\fRt(\fIcase\fR, ""message"", [\fIvars\fR...] )" 4 .IX Item "$uassert(case, ""message"", [vars...] )" Report a \f(CW$uerror\fR if the given case is FALSE. (Like \fBassert()\fR in C.) .ie n .IP "$uassert_amone(\fIsig\fR, [\fIsig\fR...], ""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uassert_amon\fRe(\fIsig\fR, [\fIsig\fR...], ""message"", [\fIvars\fR...] )" 4 .IX Item "$uassert_amone(sig, [sig...], ""message"", [vars...] )" Report a \f(CW$uerror\fR if more than one signal is asserted, or any are X. (None asserted is ok.) The error message will include a binary display of the signal values. .ie n .IP "$uassert_info(\fIcase\fR, ""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uassert_inf\fRo(\fIcase\fR, ""message"", [\fIvars\fR...] )" 4 .IX Item "$uassert_info(case, ""message"", [vars...] )" Report a \f(CW$uinfo\fR if the given case is FALSE. (Like \fBassert()\fR in C.) .ie n .IP "$uassert_onehot(\fIsig\fR, [\fIsig\fR...], ""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uassert_oneho\fRt(\fIsig\fR, [\fIsig\fR...], ""message"", [\fIvars\fR...] )" 4 .IX Item "$uassert_onehot(sig, [sig...], ""message"", [vars...] )" Report a \f(CW$uerror\fR if other than one signal is asserted, or any are X. The error message will include a binary display of the signal values. .ie n .IP "$uassert_req_ack(\fIreq_sig\fR, \fIack_sig\fR, [\fIdata_sig\fR,...] )" 4 .el .IP "\f(CW$uassert_req_ac\fRk(\fIreq_sig\fR, \fIack_sig\fR, [\fIdata_sig\fR,...] )" 4 .IX Item "$uassert_req_ack(req_sig, ack_sig, [data_sig,...] )" Check for a single cycle request pulse, followed by a single cycle acknowledgment pulse. Do not allow any of the data signals to change between the request and acknowledgment. .ie n .IP "$ucheck_ilevel(\fIlevel\fR )" 4 .el .IP "\f(CW$ucheck_ileve\fRl(\fIlevel\fR )" 4 .IX Item "$ucheck_ilevel(level )" Return true if the _\|_message level is greater or equal to the given level, and that global messages are turned on. .ie n .IP "$ucover_clk(\fIclock\fR, \fIlabel\fR)" 4 .el .IP "\f(CW$ucover_cl\fRk(\fIclock\fR, \fIlabel\fR)" 4 .IX Item "$ucover_clk(clock, label)" Similar to \f(CW$uerror_clk\fR, add a SystemVerilog assertion at the next specified clock's edge, with the label specified. This allows cover properties to be specified "inline" with normal RTL code. .ie n .IP "$ucover_foreach_clk(\fIclock\fR, \fIlabel\fR, ""\fImsb\fR:\fIlsb\fR"", (... $ui ...))" 4 .el .IP "\f(CW$ucover_foreach_cl\fRk(\fIclock\fR, \fIlabel\fR, ""\fImsb\fR:\fIlsb\fR"", (... \f(CW$ui\fR ...))" 4 .IX Item "$ucover_foreach_clk(clock, label, ""msb:lsb"", (... $ui ...))" Similar to \f(CW$ucover_clk\fR, however cover a range where \f(CW$ui\fR in the expression is replaced with the range index. .Sp Range is "\fImsb\fR:\fIlsb\fR" to indicate from \fImsb\fR downto \fIlsb\fR inclusive, and/or a comma separated list of values. .Sp Similar to: .Sp .Vb 4 \& for ($ui=msb; $ui>=lsb; $ui=$ui\-1) begin \& if (expression with $ui) \& $ucover_clk(clock, label ## "_" ## bit) \& end .Ve .Sp However there's no way to form a label from a for loop (as psudocoded with ## above), thus this macro. .ie n .IP $ui 4 .el .IP \f(CW$ui\fR 4 .IX Item "$ui" Loop index used inside \f(CW$ucover_foreach_clk\fR. .ie n .IP "$uinfo(\fIlevel\fR, ""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uinf\fRo(\fIlevel\fR, ""message"", [\fIvars\fR...] )" 4 .IX Item "$uinfo(level, ""message"", [vars...] )" Report a informational message in standard form. End test if warning limit exceeded. .ie n .IP "$uerror(""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uerro\fRr(""message"", [\fIvars\fR...] )" 4 .IX Item "$uerror(""message"", [vars...] )" Report a error message in standard form. End test if error limit exceeded. .ie n .IP "$uerror_clk(\fIclock\fR, ""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uerror_cl\fRk(\fIclock\fR, ""message"", [\fIvars\fR...] )" 4 .IX Item "$uerror_clk(clock, ""message"", [vars...] )" Report a error message in standard form at the next clock edge. If you place a \f(CW$uerror\fR etc in a combo logic block (always @*), event based simulators may misfire the assertion due to glitches. \f(CW$uerror_clk\fR fixes this by instead creating a temporary signal and then moving the assert itself to a new clocked block at the specified edge. Note any variables printed will be the values at the time of the next clock edge, which may differ from the value where the \f(CW$uerror_clk\fR is assigned. .ie n .IP "$uwarn(""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uwar\fRn(""message"", [\fIvars\fR...] )" 4 .IX Item "$uwarn(""message"", [vars...] )" Report a warning message in standard form. .ie n .IP "$uwarn_clk(\fIclock\fR ""message"", [\fIvars\fR...] )" 4 .el .IP "\f(CW$uwarn_cl\fRk(\fIclock\fR ""message"", [\fIvars\fR...] )" 4 .IX Item "$uwarn_clk(clock ""message"", [vars...] )" Report a warning message in standard form at the next clock edge. See \&\f(CW$uerror_clk\fR. .SH DISTRIBUTION .IX Header "DISTRIBUTION" Verilog-Perl is part of the free Verilog EDA software tool suite. The latest version is available from CPAN and from . .PP Copyright 2000\-2024 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. .SH AUTHORS .IX Header "AUTHORS" Wilson Snyder , Duane Galbi .SH "SEE ALSO" .IX Header "SEE ALSO" Verilog-Perl, Verilog::Parser, Verilog::Pli