Add a generation for 1800-2005, etc.

It was a poor choice to only add -g2009 for 1800-2009 and ignore the
previous version of System Verilog 1800-2005. This patch adds a
generation for 1800-2005 and also adds `begin_keywords support for
1800-2005. The previous SystemVerilog keywords have been put under
the 1800-2005 generation and the new one from 1800-2009 have also
been added.
This commit is contained in:
Cary R 2011-01-08 15:35:52 -08:00 committed by Stephen Williams
parent 20f3d7c26c
commit d4a97b4a9c
8 changed files with 184 additions and 128 deletions

View File

@ -1,7 +1,7 @@
#ifndef __compiler_H
#define __compiler_H
/*
* Copyright (c) 1999-2010 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -122,7 +122,8 @@ enum generation_t {
GN_VER2001_NOCONFIG = 2,
GN_VER2001 = 3,
GN_VER2005 = 4,
GN_VER2009 = 5,
GN_VER2005_SV = 5,
GN_VER2009 = 6,
GN_DEFAULT = 4
};
@ -159,14 +160,16 @@ extern bool gn_strict_expr_width_flag;
for SystemVerilog */
static inline bool gn_var_can_be_uwire(void)
{
if (generation_flag == GN_VER2009)
if (generation_flag == GN_VER2005_SV ||
generation_flag == GN_VER2009)
return true;
return false;
}
static inline bool gn_system_verilog(void)
{
if (generation_flag == GN_VER2009)
if (generation_flag == GN_VER2005_SV ||
generation_flag == GN_VER2009)
return true;
return false;
}
@ -180,7 +183,8 @@ enum { GN_KEYWORDS_1364_1995 = 0x0001,
GN_KEYWORDS_1364_2001_CONFIG = 0x0004,
GN_KEYWORDS_1364_2005 = 0x0008,
GN_KEYWORDS_VAMS_2_3 = 0x0010,
GN_KEYWORDS_1800_2009 = 0x0020,
GN_KEYWORDS_1800_2005 = 0x0020,
GN_KEYWORDS_1800_2009 = 0x0040,
GN_KEYWORDS_ICARUS = 0x8000
};
extern int lexor_keyword_mask;

View File

@ -1,4 +1,4 @@
.TH iverilog 1 "December 29th, 2009" "" "Version %M.%m.%n %E"
.TH iverilog 1 "January 8th, 2011" "" "Version %M.%m.%n %E"
.SH NAME
iverilog - Icarus Verilog compiler
@ -6,7 +6,7 @@ iverilog - Icarus Verilog compiler
.B iverilog
[\-ESVv] [\-Bpath] [\-ccmdfile|\-fcmdfile] [\-Dmacro[=defn]]
[\-Pparameter=value] [\-pflag=value]
[\-dname] [\-g1995|\-g2001|\-g2005|-g2009|\-g<feature>]
[\-dname] [\-g1995|\-g2001|\-g2005|\-g2005-sv|\-g2009|\-g<feature>]
[\-Iincludedir] [\-mmodule] [\-M[mode=]file] [\-Nfile] [\-ooutputfilename]
[\-stopmodule] [\-ttype] [\-Tmin/typ/max] [\-Wclass] [\-ypath] sourcefile
@ -61,14 +61,18 @@ is the Verilog input, but with file inclusions and macro references
expanded and removed. This is useful, for example, to preprocess
Verilog source for use by other compilers.
.TP 8
.B -g1995\fI|\fP-g2001\fI|\fP-g2001-noconfig\fI|\fP-g2005\fI|\fP-g2009
Select the Verilog language \fIgeneration\fP to support in the
compiler. This selects between \fIIEEE1364\-1995\fP,
\fIIEEE1364\-2001\fP, \fIIEEE1364\-2005\fP, or \fIIEEE1800-2009\fP.
Normally, Icarus Verilog defaults to the latest known generation of the
language. This flag is most useful to restrict the language to a set
supported by tools of specific generations, for compatibility with
other tools.
.B -g1995\fI|\fP-g2001\fI|\fP-g2001-noconfig\fI|\fP-g2005\fI|\fP-g2005-sv\fI|\fP-g2009
Select the Verilog language \fIgeneration\fP to support in the compiler.
This selects between \fIIEEE1364\-1995\fP, \fIIEEE1364\-2001\fP,
\fIIEEE1364\-2005\fP, \fIIEEE1800\-2005\fP, or \fIIEEE1800\-2009\fP.
Icarus Verilog currently defaults to the \fIIEEE1364\-2005\fP generation
of the language. This flag is used to restrict the language to a set of
keywords/features, this allows simulation of older Verilog code that may
use newer keywords and for compatibility with other tools. Much of the
\fIIEEE1800\fP generations functionality is not currently supported.
The \fIIEEE1800\fP generations do parse all the keywords, so they can
be used to verify that \fIIEEE1364\fP compliant Verilog code does not
use any of the new \fIIEEE1800\fP keywords.
.TP 8
.B -gverilog-ams\fI|\fP-gno-verilog-ams
Enable or disable (default) support for Verilog\-AMS.
@ -506,7 +510,7 @@ Tips on using, debugging, and developing the compiler can be found at
.SH COPYRIGHT
.nf
Copyright \(co 2002\-2009 Stephen Williams
Copyright \(co 2002\-2011 Stephen Williams
This document can be freely redistributed according to the terms of the
GNU General Public License version 2.0

View File

@ -39,7 +39,7 @@ const char NOTICE[] =
const char HELP[] =
"Usage: iverilog [-ESvV] [-B base] [-c cmdfile|-f cmdfile]\n"
" [-g1995|-g2001|-g2005|-g2009] [-g<feature>]\n"
" [-g1995|-g2001|-g2005|-g2005-sv|-g2009] [-g<feature>]\n"
" [-D macro[=defn]] [-I includedir]\n"
" [-M [mode=]depfile] [-m module]\n"
" [-N file] [-o filename] [-p flag=value]\n"
@ -621,6 +621,9 @@ int process_generation(const char*name)
else if (strcmp(name,"2005") == 0)
generation = "2005";
else if (strcmp(name,"2005-sv") == 0)
generation = "2005-sv";
else if (strcmp(name,"2009") == 0)
generation = "2009";
@ -997,7 +1000,7 @@ int main(int argc, char **argv)
if (version_flag || verbose_flag) {
printf("Icarus Verilog version " VERSION " (" VERSION_TAG ")\n\n");
printf("Copyright 1998-2010 Stephen Williams\n\n");
printf("Copyright 1998-2011 Stephen Williams\n\n");
puts(NOTICE);
}
@ -1040,7 +1043,8 @@ int main(int argc, char **argv)
}
/* If verilog-2009 (SystemVerilog) is enabled, then include the
v2009 module. */
if (strcmp(generation, "2009") == 0) {
if (strcmp(generation, "2005-sv") == 0 ||
strcmp(generation, "2009") == 0) {
fprintf(iconfig_file, "sys_func:%s%cv2009.sft\n", base, sep);
fprintf(iconfig_file, "module:v2009\n");
}

View File

@ -4,7 +4,7 @@
%{
/*
* Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2011 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -336,7 +336,7 @@ TU [munpf]
/* This rule handles scaled time values for SystemVerilog. */
[0-9][0-9_]*(\.[0-9][0-9_]*)?{TU}?s {
if(generation_flag & GN_VER2009) {
if(generation_flag & (GN_VER2005_SV | GN_VER2009)) {
yylval.text = strdupnew(yytext);
return TIME_LITERAL;
} else REJECT; }
@ -496,11 +496,18 @@ TU [munpf]
|GN_KEYWORDS_1364_2001
|GN_KEYWORDS_1364_2001_CONFIG
|GN_KEYWORDS_1364_2005;
} else if (strcmp(word,"1800-2005") == 0) {
lexor_keyword_mask = GN_KEYWORDS_1364_1995
|GN_KEYWORDS_1364_2001
|GN_KEYWORDS_1364_2001_CONFIG
|GN_KEYWORDS_1364_2005
|GN_KEYWORDS_1800_2005;
} else if (strcmp(word,"1800-2009") == 0) {
lexor_keyword_mask = GN_KEYWORDS_1364_1995
|GN_KEYWORDS_1364_2001
|GN_KEYWORDS_1364_2001_CONFIG
|GN_KEYWORDS_1364_2005
|GN_KEYWORDS_1800_2005
|GN_KEYWORDS_1800_2009;
} else if (strcmp(word,"VAMS-2.3") == 0) {
lexor_keyword_mask = GN_KEYWORDS_1364_1995

View File

@ -21,66 +21,68 @@ above, GN_KEYWORDS_VAMS_2_3, K_above
abs, GN_KEYWORDS_VAMS_2_3, K_abs
absdelay, GN_KEYWORDS_VAMS_2_3, K_absdelay
abstol, GN_KEYWORDS_VAMS_2_3, K_abstol
accept_on, GN_KEYWORDS_1800_2009, K_accept_on
access, GN_KEYWORDS_VAMS_2_3, K_access
acos, GN_KEYWORDS_VAMS_2_3, K_acos
acosh, GN_KEYWORDS_VAMS_2_3, K_acosh
ac_stim, GN_KEYWORDS_VAMS_2_3, K_ac_stim
alias, GN_KEYWORDS_1800_2009, K_alias
alias, GN_KEYWORDS_1800_2005, K_alias
aliasparam, GN_KEYWORDS_VAMS_2_3, K_aliasparam
always, GN_KEYWORDS_1364_1995, K_always
always_comb, GN_KEYWORDS_1800_2009, K_always_comb
always_ff, GN_KEYWORDS_1800_2009, K_always_ff
always_latch, GN_KEYWORDS_1800_2009, K_always_latch
always_comb, GN_KEYWORDS_1800_2005, K_always_comb
always_ff, GN_KEYWORDS_1800_2005, K_always_ff
always_latch, GN_KEYWORDS_1800_2005, K_always_latch
analog, GN_KEYWORDS_VAMS_2_3, K_analog
analysis, GN_KEYWORDS_VAMS_2_3, K_analysis
and, GN_KEYWORDS_1364_1995, K_and
asin, GN_KEYWORDS_VAMS_2_3, K_asin
asinh, GN_KEYWORDS_VAMS_2_3, K_asinh
# This is defined by both SystemVerilog 1800-2009 and Verilog-AMS 2.3
assert, GN_KEYWORDS_1800_2009|GN_KEYWORDS_VAMS_2_3, K_assert
# This is defined by both SystemVerilog 1800-2005 and Verilog-AMS 2.3
assert, GN_KEYWORDS_1800_2005|GN_KEYWORDS_VAMS_2_3, K_assert
assign, GN_KEYWORDS_1364_1995, K_assign
assume, GN_KEYWORDS_1800_2009, K_assume
assume, GN_KEYWORDS_1800_2005, K_assume
atan, GN_KEYWORDS_VAMS_2_3, K_atan
atan2, GN_KEYWORDS_VAMS_2_3, K_atan2
atanh, GN_KEYWORDS_VAMS_2_3, K_atanh
automatic, GN_KEYWORDS_1364_2001, K_automatic
before, GN_KEYWORDS_1800_2009, K_before
before, GN_KEYWORDS_1800_2005, K_before
begin, GN_KEYWORDS_1364_1995, K_begin
bind, GN_KEYWORDS_1800_2009, K_bind
bins, GN_KEYWORDS_1800_2009, K_bins
binsof, GN_KEYWORDS_1800_2009, K_binsof
bit, GN_KEYWORDS_1800_2009, K_bit
bind, GN_KEYWORDS_1800_2005, K_bind
bins, GN_KEYWORDS_1800_2005, K_bins
binsof, GN_KEYWORDS_1800_2005, K_binsof
bit, GN_KEYWORDS_1800_2005, K_bit
branch, GN_KEYWORDS_VAMS_2_3, K_branch
break, GN_KEYWORDS_1800_2009, K_break
break, GN_KEYWORDS_1800_2005, K_break
bool, GN_KEYWORDS_ICARUS, K_bool
buf, GN_KEYWORDS_1364_1995, K_buf
bufif0, GN_KEYWORDS_1364_1995, K_bufif0
bufif1, GN_KEYWORDS_1364_1995, K_bufif1
byte, GN_KEYWORDS_1800_2009, K_byte
byte, GN_KEYWORDS_1800_2005, K_byte
case, GN_KEYWORDS_1364_1995, K_case
casex, GN_KEYWORDS_1364_1995, K_casex
casez, GN_KEYWORDS_1364_1995, K_casez
ceil, GN_KEYWORDS_VAMS_2_3, K_ceil
cell, GN_KEYWORDS_1364_2001_CONFIG, K_cell
chandle, GN_KEYWORDS_1800_2009, K_chandle
class, GN_KEYWORDS_1800_2009, K_class
clocking, GN_KEYWORDS_1800_2009, K_clocking
chandle, GN_KEYWORDS_1800_2005, K_chandle
checker, GN_KEYWORDS_1800_2009, K_checker
class, GN_KEYWORDS_1800_2005, K_class
clocking, GN_KEYWORDS_1800_2005, K_clocking
cmos, GN_KEYWORDS_1364_1995, K_cmos
config, GN_KEYWORDS_1364_2001_CONFIG, K_config
connect, GN_KEYWORDS_VAMS_2_3, K_connect
connectmodule, GN_KEYWORDS_VAMS_2_3, K_connectmodule
connectrules, GN_KEYWORDS_VAMS_2_3, K_connectrules
const, GN_KEYWORDS_1800_2009, K_const
constraint, GN_KEYWORDS_1800_2009, K_constraint
context, GN_KEYWORDS_1800_2009, K_context
continue, GN_KEYWORDS_1800_2009, K_continue
const, GN_KEYWORDS_1800_2005, K_const
constraint, GN_KEYWORDS_1800_2005, K_constraint
context, GN_KEYWORDS_1800_2005, K_context
continue, GN_KEYWORDS_1800_2005, K_continue
continuous, GN_KEYWORDS_VAMS_2_3, K_continuous
cos, GN_KEYWORDS_VAMS_2_3, K_cos
cosh, GN_KEYWORDS_VAMS_2_3, K_cosh
cover, GN_KEYWORDS_1800_2009, K_cover
covergroup, GN_KEYWORDS_1800_2009, K_covergroup
coverpoint, GN_KEYWORDS_1800_2009, K_coverpoint
cross, GN_KEYWORDS_1800_2009, K_cross
cover, GN_KEYWORDS_1800_2005, K_cover
covergroup, GN_KEYWORDS_1800_2005, K_covergroup
coverpoint, GN_KEYWORDS_1800_2005, K_coverpoint
cross, GN_KEYWORDS_1800_2005, K_cross
ddt, GN_KEYWORDS_VAMS_2_3, K_ddt
ddt_nature, GN_KEYWORDS_VAMS_2_3, K_ddt_nature
ddx, GN_KEYWORDS_VAMS_2_3, K_ddx
@ -91,58 +93,61 @@ design, GN_KEYWORDS_1364_2001_CONFIG, K_design
disable, GN_KEYWORDS_1364_1995, K_disable
discipline, GN_KEYWORDS_VAMS_2_3, K_discipline
discrete, GN_KEYWORDS_VAMS_2_3, K_discrete
dist, GN_KEYWORDS_1800_2009, K_dist
do, GN_KEYWORDS_1800_2009, K_do
dist, GN_KEYWORDS_1800_2005, K_dist
do, GN_KEYWORDS_1800_2005, K_do
domain, GN_KEYWORDS_VAMS_2_3, K_domain
driver_update, GN_KEYWORDS_VAMS_2_3, K_driver_update
edge, GN_KEYWORDS_1364_1995, K_edge
else, GN_KEYWORDS_1364_1995, K_else
end, GN_KEYWORDS_1364_1995, K_end
endcase, GN_KEYWORDS_1364_1995, K_endcase
endchecker, GN_KEYWORDS_1800_2009, K_endchecker
endconfig, GN_KEYWORDS_1364_2001_CONFIG, K_endconfig
endclass, GN_KEYWORDS_1800_2009, K_endclass
endclocking, GN_KEYWORDS_1800_2009, K_endclocking
endclass, GN_KEYWORDS_1800_2005, K_endclass
endclocking, GN_KEYWORDS_1800_2005, K_endclocking
endconnectrules, GN_KEYWORDS_VAMS_2_3, K_endconnectrules
enddiscipline, GN_KEYWORDS_VAMS_2_3, K_enddiscipline
endfunction, GN_KEYWORDS_1364_1995, K_endfunction
endgenerate, GN_KEYWORDS_1364_2001, K_endgenerate
endgroup, GN_KEYWORDS_1800_2009, K_endgroup
endinterface, GN_KEYWORDS_1800_2009, K_endinterface
endgroup, GN_KEYWORDS_1800_2005, K_endgroup
endinterface, GN_KEYWORDS_1800_2005, K_endinterface
endmodule, GN_KEYWORDS_1364_1995, K_endmodule
endnature, GN_KEYWORDS_VAMS_2_3, K_endnature
endpackage, GN_KEYWORDS_1800_2009, K_endpackage
endpackage, GN_KEYWORDS_1800_2005, K_endpackage
endparamset, GN_KEYWORDS_VAMS_2_3, K_endparamset
endprimitive, GN_KEYWORDS_1364_1995, K_endprimitive
endprogram, GN_KEYWORDS_1800_2009, K_endprogram
endproperty, GN_KEYWORDS_1800_2009, K_endproperty
endprogram, GN_KEYWORDS_1800_2005, K_endprogram
endproperty, GN_KEYWORDS_1800_2005, K_endproperty
endspecify, GN_KEYWORDS_1364_1995, K_endspecify
endsequence, GN_KEYWORDS_1800_2009, K_endsequence
endsequence, GN_KEYWORDS_1800_2005, K_endsequence
endtable, GN_KEYWORDS_1364_1995, K_endtable
endtask, GN_KEYWORDS_1364_1995, K_endtask
enum, GN_KEYWORDS_1800_2009, K_enum
enum, GN_KEYWORDS_1800_2005, K_enum
event, GN_KEYWORDS_1364_1995, K_event
eventually, GN_KEYWORDS_1800_2009, K_eventually
exclude, GN_KEYWORDS_VAMS_2_3, K_exclude
exp, GN_KEYWORDS_VAMS_2_3, K_exp
expect, GN_KEYWORDS_1800_2009, K_expect
export, GN_KEYWORDS_1800_2009, K_export
extends, GN_KEYWORDS_1800_2009, K_extends
extern, GN_KEYWORDS_1800_2009, K_extern
final, GN_KEYWORDS_1800_2009, K_final
expect, GN_KEYWORDS_1800_2005, K_expect
export, GN_KEYWORDS_1800_2005, K_export
extends, GN_KEYWORDS_1800_2005, K_extends
extern, GN_KEYWORDS_1800_2005, K_extern
final, GN_KEYWORDS_1800_2005, K_final
final_step, GN_KEYWORDS_VAMS_2_3, K_final_step
first_match, GN_KEYWORDS_1800_2009, K_first_match
first_match, GN_KEYWORDS_1800_2005, K_first_match
flicker_noise, GN_KEYWORDS_VAMS_2_3, K_flicker_noise
floor, GN_KEYWORDS_VAMS_2_3, K_floor
flow, GN_KEYWORDS_VAMS_2_3, K_flow
for, GN_KEYWORDS_1364_1995, K_for
foreach, GN_KEYWORDS_1800_2009, K_foreach
foreach, GN_KEYWORDS_1800_2005, K_foreach
force, GN_KEYWORDS_1364_1995, K_force
forever, GN_KEYWORDS_1364_1995, K_forever
fork, GN_KEYWORDS_1364_1995, K_fork
forkjoin, GN_KEYWORDS_1800_2009, K_forkjoin
forkjoin, GN_KEYWORDS_1800_2005, K_forkjoin
from, GN_KEYWORDS_VAMS_2_3, K_from
function, GN_KEYWORDS_1364_1995, K_function
generate, GN_KEYWORDS_1364_2001, K_generate
genvar, GN_KEYWORDS_1364_2001, K_genvar
global, GN_KEYWORDS_1800_2009, K_global
ground, GN_KEYWORDS_VAMS_2_3, K_ground
highz0, GN_KEYWORDS_1364_1995, K_highz0
highz1, GN_KEYWORDS_1364_1995, K_highz1
@ -151,11 +156,12 @@ idt, GN_KEYWORDS_VAMS_2_3, K_idt
idtmod, GN_KEYWORDS_VAMS_2_3, K_idtmod
idt_nature, GN_KEYWORDS_VAMS_2_3, K_idt_nature
if, GN_KEYWORDS_1364_1995, K_if
iff, GN_KEYWORDS_1800_2009, K_iff
iff, GN_KEYWORDS_1800_2005, K_iff
ifnone, GN_KEYWORDS_1364_1995, K_ifnone
ignore_bins, GN_KEYWORDS_1800_2009, K_ignore_bins
illegal_bins, GN_KEYWORDS_1800_2009, K_illegal_bins
import, GN_KEYWORDS_1800_2009, K_import
ignore_bins, GN_KEYWORDS_1800_2005, K_ignore_bins
illegal_bins, GN_KEYWORDS_1800_2005, K_illegal_bins
implies, GN_KEYWORDS_1800_2009, K_implies
import, GN_KEYWORDS_1800_2005, K_import
incdir, GN_KEYWORDS_1364_2001_CONFIG, K_incdir
include, GN_KEYWORDS_1364_2001_CONFIG, K_include
inf, GN_KEYWORDS_VAMS_2_3, K_inf
@ -163,44 +169,46 @@ initial, GN_KEYWORDS_1364_1995, K_initial
initial_step, GN_KEYWORDS_VAMS_2_3, K_initial_step
inout, GN_KEYWORDS_1364_1995, K_inout
input, GN_KEYWORDS_1364_1995, K_input
inside, GN_KEYWORDS_1800_2009, K_inside
inside, GN_KEYWORDS_1800_2005, K_inside
instance, GN_KEYWORDS_1364_2001_CONFIG, K_instance
int, GN_KEYWORDS_1800_2009, K_int
int, GN_KEYWORDS_1800_2005, K_int
integer, GN_KEYWORDS_1364_1995, K_integer
interface, GN_KEYWORDS_1800_2009, K_interface
intersect, GN_KEYWORDS_1800_2009, K_intersect
interface, GN_KEYWORDS_1800_2005, K_interface
intersect, GN_KEYWORDS_1800_2005, K_intersect
join, GN_KEYWORDS_1364_1995, K_join
join_any, GN_KEYWORDS_1800_2009, K_join_any
join_none, GN_KEYWORDS_1800_2009, K_join_none
join_any, GN_KEYWORDS_1800_2005, K_join_any
join_none, GN_KEYWORDS_1800_2005, K_join_none
laplace_nd, GN_KEYWORDS_VAMS_2_3, K_laplace_nd
laplace_np, GN_KEYWORDS_VAMS_2_3, K_laplace_np
laplace_zd, GN_KEYWORDS_VAMS_2_3, K_laplace_zd
laplace_zp, GN_KEYWORDS_VAMS_2_3, K_laplace_zp
large, GN_KEYWORDS_1364_1995, K_large
last_crossing, GN_KEYWORDS_VAMS_2_3, K_last_crossing
let, GN_KEYWORDS_1800_2009, K_let
liblist, GN_KEYWORDS_1364_2001_CONFIG, K_liblist
library, GN_KEYWORDS_1364_2001_CONFIG, K_library
limexp, GN_KEYWORDS_VAMS_2_3, K_limexp
ln, GN_KEYWORDS_VAMS_2_3, K_ln
local, GN_KEYWORDS_1800_2009, K_local
local, GN_KEYWORDS_1800_2005, K_local
localparam, GN_KEYWORDS_1364_2001, K_localparam
log, GN_KEYWORDS_VAMS_2_3, K_log
# This is defined by SystemVerilog 1800-2009 and as an Icarus extension.
logic, GN_KEYWORDS_1800_2009|GN_KEYWORDS_ICARUS, K_logic
longint, GN_KEYWORDS_1800_2009, K_longint
# This is defined by SystemVerilog 1800-2005 and as an Icarus extension.
logic, GN_KEYWORDS_1800_2005|GN_KEYWORDS_ICARUS, K_logic
longint, GN_KEYWORDS_1800_2005, K_longint
macromodule, GN_KEYWORDS_1364_1995, K_macromodule
matches, GN_KEYWORDS_1800_2009, K_matches
matches, GN_KEYWORDS_1800_2005, K_matches
max, GN_KEYWORDS_VAMS_2_3, K_max
medium, GN_KEYWORDS_1364_1995, K_medium
merged, GN_KEYWORDS_VAMS_2_3, K_merged
min, GN_KEYWORDS_VAMS_2_3, K_min
modport, GN_KEYWORDS_1800_2009, K_modport
modport, GN_KEYWORDS_1800_2005, K_modport
module, GN_KEYWORDS_1364_1995, K_module
nand, GN_KEYWORDS_1364_1995, K_nand
nature, GN_KEYWORDS_VAMS_2_3, K_nature
negedge, GN_KEYWORDS_1364_1995, K_negedge
net_resolution, GN_KEYWORDS_VAMS_2_3, K_net_resolution
new, GN_KEYWORDS_1800_2009, K_new
new, GN_KEYWORDS_1800_2005, K_new
nexttime, GN_KEYWORDS_1800_2009, K_nexttime
nmos, GN_KEYWORDS_1364_1995, K_nmos
noise_table, GN_KEYWORDS_VAMS_2_3, K_noise_table
nor, GN_KEYWORDS_1364_1995, K_nor
@ -208,11 +216,11 @@ noshowcancelled, GN_KEYWORDS_1364_2001, K_noshowcancelled
not, GN_KEYWORDS_1364_1995, K_not
notif0, GN_KEYWORDS_1364_1995, K_notif0
notif1, GN_KEYWORDS_1364_1995, K_notif1
null, GN_KEYWORDS_1800_2009, K_null
null, GN_KEYWORDS_1800_2005, K_null
or, GN_KEYWORDS_1364_1995, K_or
output, GN_KEYWORDS_1364_1995, K_output
package, GN_KEYWORDS_1800_2009, K_package
packed, GN_KEYWORDS_1800_2009, K_packed
package, GN_KEYWORDS_1800_2005, K_package
packed, GN_KEYWORDS_1800_2005, K_packed
parameter, GN_KEYWORDS_1364_1995, K_parameter
paramset, GN_KEYWORDS_VAMS_2_3, K_paramset
pmos, GN_KEYWORDS_1364_1995, K_pmos
@ -220,70 +228,80 @@ posedge, GN_KEYWORDS_1364_1995, K_posedge
potential, GN_KEYWORDS_VAMS_2_3, K_potential
pow, GN_KEYWORDS_VAMS_2_3, K_pow
primitive, GN_KEYWORDS_1364_1995, K_primitive
priority, GN_KEYWORDS_1800_2009, K_priority
program, GN_KEYWORDS_1800_2009, K_program
property, GN_KEYWORDS_1800_2009, K_property
protected, GN_KEYWORDS_1800_2009, K_protected
priority, GN_KEYWORDS_1800_2005, K_priority
program, GN_KEYWORDS_1800_2005, K_program
property, GN_KEYWORDS_1800_2005, K_property
protected, GN_KEYWORDS_1800_2005, K_protected
pull0, GN_KEYWORDS_1364_1995, K_pull0
pull1, GN_KEYWORDS_1364_1995, K_pull1
pulldown, GN_KEYWORDS_1364_1995, K_pulldown
pullup, GN_KEYWORDS_1364_1995, K_pullup
pulsestyle_onevent, GN_KEYWORDS_1364_2001, K_pulsestyle_onevent
pulsestyle_ondetect, GN_KEYWORDS_1364_2001, K_pulsestyle_ondetect
pure, GN_KEYWORDS_1800_2009, K_pure
rand, GN_KEYWORDS_1800_2009, K_rand
randc, GN_KEYWORDS_1800_2009, K_randc
randcase, GN_KEYWORDS_1800_2009, K_randcase
randsequence, GN_KEYWORDS_1800_2009, K_randsequence
pure, GN_KEYWORDS_1800_2005, K_pure
rand, GN_KEYWORDS_1800_2005, K_rand
randc, GN_KEYWORDS_1800_2005, K_randc
randcase, GN_KEYWORDS_1800_2005, K_randcase
randsequence, GN_KEYWORDS_1800_2005, K_randsequence
rcmos, GN_KEYWORDS_1364_1995, K_rcmos
real, GN_KEYWORDS_1364_1995, K_real
realtime, GN_KEYWORDS_1364_1995, K_realtime
ref, GN_KEYWORDS_1800_2009, K_ref
ref, GN_KEYWORDS_1800_2005, K_ref
reg, GN_KEYWORDS_1364_1995, K_reg
reject_on, GN_KEYWORDS_1800_2009, K_reject_on
release, GN_KEYWORDS_1364_1995, K_release
repeat, GN_KEYWORDS_1364_1995, K_repeat
resolveto, GN_KEYWORDS_VAMS_2_3, K_resolveto
return, GN_KEYWORDS_1800_2009, K_return
restrict, GN_KEYWORDS_1800_2009, K_restrict
return, GN_KEYWORDS_1800_2005, K_return
rnmos, GN_KEYWORDS_1364_1995, K_rnmos
rpmos, GN_KEYWORDS_1364_1995, K_rpmos
rtran, GN_KEYWORDS_1364_1995, K_rtran
rtranif0, GN_KEYWORDS_1364_1995, K_rtranif0
rtranif1, GN_KEYWORDS_1364_1995, K_rtranif1
s_always, GN_KEYWORDS_1800_2009, K_s_always
s_eventually, GN_KEYWORDS_1800_2009, K_s_eventually
s_nexttime, GN_KEYWORDS_1800_2009, K_s_nexttime
s_until, GN_KEYWORDS_1800_2009, K_s_until
s_until_with, GN_KEYWORDS_1800_2009, K_s_until_with
scalared, GN_KEYWORDS_1364_1995, K_scalared
sequence, GN_KEYWORDS_1800_2009, K_sequence
shortint, GN_KEYWORDS_1800_2009, K_shortint
shortreal, GN_KEYWORDS_1800_2009, K_shortreal
sequence, GN_KEYWORDS_1800_2005, K_sequence
shortint, GN_KEYWORDS_1800_2005, K_shortint
shortreal, GN_KEYWORDS_1800_2005, K_shortreal
showcancelled, GN_KEYWORDS_1364_2001, K_showcancelled
signed, GN_KEYWORDS_1364_2001, K_signed
sin, GN_KEYWORDS_VAMS_2_3, K_sin
sinh, GN_KEYWORDS_VAMS_2_3, K_sinh
slew, GN_KEYWORDS_VAMS_2_3, K_slew
small, GN_KEYWORDS_1364_1995, K_small
solve, GN_KEYWORDS_1800_2009, K_solve
solve, GN_KEYWORDS_1800_2005, K_solve
specify, GN_KEYWORDS_1364_1995, K_specify
specparam, GN_KEYWORDS_1364_1995, K_specparam
split, GN_KEYWORDS_VAMS_2_3, K_split
sqrt, GN_KEYWORDS_VAMS_2_3, K_sqrt
static, GN_KEYWORDS_1800_2009, K_static
# This is defined by both SystemVerilog 1800-2009 and Verilog-AMS 2.3
string, GN_KEYWORDS_1800_2009|GN_KEYWORDS_VAMS_2_3, K_string
static, GN_KEYWORDS_1800_2005, K_static
# This is defined by both SystemVerilog 1800-2005 and Verilog-AMS 2.3
string, GN_KEYWORDS_1800_2005|GN_KEYWORDS_VAMS_2_3, K_string
strong, GN_KEYWORDS_1800_2009, K_strong
strong0, GN_KEYWORDS_1364_1995, K_strong0
strong1, GN_KEYWORDS_1364_1995, K_strong1
struct, GN_KEYWORDS_1800_2009, K_struct
super, GN_KEYWORDS_1800_2009, K_super
struct, GN_KEYWORDS_1800_2005, K_struct
super, GN_KEYWORDS_1800_2005, K_super
supply0, GN_KEYWORDS_1364_1995, K_supply0
supply1, GN_KEYWORDS_1364_1995, K_supply1
sync_accept_on, GN_KEYWORDS_1800_2009, K_sync_accept_on
sync_reject_on, GN_KEYWORDS_1800_2009, K_sync_reject_on
table, GN_KEYWORDS_1364_1995, K_table
tagged, GN_KEYWORDS_1800_2009, K_tagged
tagged, GN_KEYWORDS_1800_2005, K_tagged
tan, GN_KEYWORDS_VAMS_2_3, K_tan
tanh, GN_KEYWORDS_VAMS_2_3, K_tanh
task, GN_KEYWORDS_1364_1995, K_task
this, GN_KEYWORDS_1800_2009, K_this
throughout, GN_KEYWORDS_1800_2009, K_throughout
this, GN_KEYWORDS_1800_2005, K_this
throughout, GN_KEYWORDS_1800_2005, K_throughout
time, GN_KEYWORDS_1364_1995, K_time
timeprecision, GN_KEYWORDS_1800_2009, K_timeprecision
timeprecision, GN_KEYWORDS_1800_2005, K_timeprecision
timer, GN_KEYWORDS_VAMS_2_3, K_timer
timeunit, GN_KEYWORDS_1800_2009, K_timeunit
timeunit, GN_KEYWORDS_1800_2005, K_timeunit
tran, GN_KEYWORDS_1364_1995, K_tran
tranif0, GN_KEYWORDS_1364_1995, K_tranif0
tranif1, GN_KEYWORDS_1364_1995, K_tranif1
@ -294,30 +312,35 @@ tri1, GN_KEYWORDS_1364_1995, K_tri1
triand, GN_KEYWORDS_1364_1995, K_triand
trior, GN_KEYWORDS_1364_1995, K_trior
trireg, GN_KEYWORDS_1364_1995, K_trireg
type, GN_KEYWORDS_1800_2009, K_type
typedef, GN_KEYWORDS_1800_2009, K_typedef
union, GN_KEYWORDS_1800_2009, K_union
unique, GN_KEYWORDS_1800_2009, K_unique
type, GN_KEYWORDS_1800_2005, K_type
typedef, GN_KEYWORDS_1800_2005, K_typedef
union, GN_KEYWORDS_1800_2005, K_union
unique, GN_KEYWORDS_1800_2005, K_unique
unique0, GN_KEYWORDS_1800_2009, K_unique
units, GN_KEYWORDS_VAMS_2_3, K_units
# Reserved for future use!
unsigned, GN_KEYWORDS_1364_2001, K_unsigned
until, GN_KEYWORDS_1800_2009, K_until
until_with, GN_KEYWORDS_1800_2009, K_until_with
untyped, GN_KEYWORDS_1800_2009, K_untyped
use, GN_KEYWORDS_1364_2001_CONFIG, K_use
uwire, GN_KEYWORDS_1364_2005, K_uwire
var, GN_KEYWORDS_1800_2009, K_var
var, GN_KEYWORDS_1800_2005, K_var
vectored, GN_KEYWORDS_1364_1995, K_vectored
virtual, GN_KEYWORDS_1800_2009, K_virtual
void, GN_KEYWORDS_1800_2009, K_void
virtual, GN_KEYWORDS_1800_2005, K_virtual
void, GN_KEYWORDS_1800_2005, K_void
wait, GN_KEYWORDS_1364_1995, K_wait
wait_order, GN_KEYWORDS_1800_2009, K_wait_order
wait_order, GN_KEYWORDS_1800_2005, K_wait_order
wand, GN_KEYWORDS_1364_1995, K_wand
weak, GN_KEYWORDS_1800_2009, K_weak
weak0, GN_KEYWORDS_1364_1995, K_weak0
weak1, GN_KEYWORDS_1364_1995, K_weak1
while, GN_KEYWORDS_1364_1995, K_while
white_noise, GN_KEYWORDS_VAMS_2_3, K_white_noise
wildcard, GN_KEYWORDS_1800_2009, K_wildcard
wildcard, GN_KEYWORDS_1800_2005, K_wildcard
wire, GN_KEYWORDS_1364_1995, K_wire
with, GN_KEYWORDS_1800_2009, K_with
within, GN_KEYWORDS_1800_2009, K_within
with, GN_KEYWORDS_1800_2005, K_with
within, GN_KEYWORDS_1800_2005, K_within
# This is the name originally proposed for uwire and is deprecated!
wone, GN_KEYWORDS_1364_2005, K_wone
wor, GN_KEYWORDS_1364_1995, K_wor

12
main.cc
View File

@ -1,5 +1,5 @@
const char COPYRIGHT[] =
"Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com)";
"Copyright (c) 1998-2011 Stephen Williams (steve@icarus.com)";
/*
* This source code is free software; you can redistribute it
@ -256,6 +256,9 @@ static void process_generation_flag(const char*gen)
} else if (strcmp(gen,"2005") == 0) {
generation_flag = GN_VER2005;
} else if (strcmp(gen,"2005-sv") == 0) {
generation_flag = GN_VER2005_SV;
} else if (strcmp(gen,"2009") == 0) {
generation_flag = GN_VER2009;
@ -868,6 +871,8 @@ int main(int argc, char*argv[])
switch (generation_flag) {
case GN_VER2009:
lexor_keyword_mask |= GN_KEYWORDS_1800_2009;
case GN_VER2005_SV:
lexor_keyword_mask |= GN_KEYWORDS_1800_2005;
case GN_VER2005:
lexor_keyword_mask |= GN_KEYWORDS_1364_2005;
case GN_VER2001:
@ -902,6 +907,9 @@ int main(int argc, char*argv[])
case GN_VER2005:
cout << "IEEE1364-2005";
break;
case GN_VER2005_SV:
cout << "IEEE1800-2005";
break;
case GN_VER2009:
cout << "IEEE1800-2009";
break;
@ -1024,7 +1032,7 @@ int main(int argc, char*argv[])
/* Decide if we are going to allow system functions to be called
* as tasks. */
if (generation_flag >= GN_VER2009) {
if (generation_flag >= GN_VER2005_SV) {
def_sfunc_as_task = IVL_SFUNC_AS_TASK_WARNING;
}

10
parse.y
View File

@ -1,7 +1,7 @@
%{
/*
* Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2011 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -341,7 +341,7 @@ static list<named_pexpr_t>* make_named_number(perm_string name, PExpr*val =0)
/* The new tokens from 1364-2005. */
%token K_wone K_uwire
/* The new tokens from 1800-2009. */
/* The new tokens from 1800-2005. */
%token K_alias K_always_comb K_always_ff K_always_latch K_assert
%token K_assume K_before K_bind K_bins K_binsof K_bit K_break K_byte
%token K_chandle K_class K_clocking K_const K_constraint K_context
@ -362,6 +362,12 @@ static list<named_pexpr_t>* make_named_number(perm_string name, PExpr*val =0)
/* Fake tokens that are passed once we have an initial token. */
%token K_timeprecision_check K_timeunit_check
/* The new tokens from 1800-2009. */
%token K_accept_on K_checker K_endchecker K_eventually K_global K_implies
%token K_let K_nexttime K_reject_on K_restrict K_s_always K_s_eventually
%token K_s_nexttime K_s_until K_s_until_with K_strong K_sync_accept_on
%token K_sync_reject_on K_unique0 K_until K_until_with K_untyped K_weak
/* The new tokens for Verilog-AMS 2.3. */
%token K_above K_abs K_absdelay K_abstol K_access K_acos K_acosh
/* 1800-2005 has defined "assert" above! */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2011 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -737,8 +737,8 @@ void pform_startmodule(const char*name, const char*file, unsigned lineno,
void pform_check_timeunit_prec()
{
assert(pform_cur_module);
if ((generation_flag & GN_VER2009) && (pform_cur_module->time_unit <
pform_cur_module->time_precision)) {
if ((generation_flag & (GN_VER2005_SV | GN_VER2009)) &&
(pform_cur_module->time_unit < pform_cur_module->time_precision)) {
VLerror("error: a timeprecision is missing or is too "
"large!");
} else assert(pform_cur_module->time_unit >=