Skip to content

Commit

Permalink
Revert "Make --std and analysis option"
Browse files Browse the repository at this point in the history
This reverts commit 3174818.
  • Loading branch information
nickg committed Feb 13, 2014
1 parent 3174818 commit c99efb2
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
8 changes: 4 additions & 4 deletions nvc.1
Expand Up @@ -60,6 +60,10 @@ Display usage summary\.
Add \fIpath\fR to the list of directories to search for libraries (see \fILIBRARIES\fR section below)\.
.
.TP
\fB\-\-std=\fR\fIrev\fR
Select the VHDL standard revision to use\. Specify either the full year such as \fI1993\fR or the decade such as \fI93\fR\. The allowed revisions are 1993, 2000, 2002, and 2008\. Note there is very limited supported for any features beyond those in VHDL\-93\. VHDL\-87 is not supported\.
.
.TP
\fB\-v\fR, \fB\-\-version\fR
Display version and copyright information\.
.
Expand All @@ -77,10 +81,6 @@ Allow compilation of the STANDARD package\. Not intended for end users\.
\fB\-\-prefer\-explicit\fR
Any visible explicitly declared operator always hides an implicit operator regardless of the region in which it is declared\. This deviates from the VHDL standard but is required to analyse code that uses the Synopsys \fBstd_logic_arith\fR package\.
.
.TP
\fB\-\-std=\fR\fIrev\fR
Select the VHDL standard revision to use\. Specify either the full year such as \fI1993\fR or the decade such as \fI93\fR\. The allowed revisions are 1993, 2000, 2002, and 2008\. Note there is very limited supported for any features beyond those in VHDL\-93\. VHDL\-87 is not supported\.
.
.SS "Elaboration options"
.
.TP
Expand Down
12 changes: 6 additions & 6 deletions nvc.1.md
Expand Up @@ -52,6 +52,12 @@ specific options must be placed after the command.
Add _path_ to the list of directories to search for libraries (see
[LIBRARIES][] section below).

* `--std=`_rev_:
Select the VHDL standard revision to use. Specify either the full year such as
_1993_ or the decade such as _93_. The allowed revisions are 1993, 2000, 2002,
and 2008. Note there is very limited supported for any features beyond those in
VHDL-93. VHDL-87 is not supported.

* `-v`, `--version`:
Display version and copyright information.

Expand All @@ -69,12 +75,6 @@ specific options must be placed after the command.
VHDL standard but is required to analyse code that uses the Synopsys
`std_logic_arith` package.

* `--std=`_rev_:
Select the VHDL standard revision to use. Specify either the full year such as
_1993_ or the decade such as _93_. The allowed revisions are 1993, 2000, 2002,
and 2008. Note there is very limited supported for any features beyond those in
VHDL-93. VHDL-87 is not supported.

### Elaboration options

* `--cover`:
Expand Down
70 changes: 35 additions & 35 deletions src/nvc.c
Expand Up @@ -63,42 +63,14 @@ static ident_t to_unit_name(const char *str)
return i;
}

static vhdl_standard_t parse_standard(const char *str)
{
char *eptr = NULL;
const int year = strtol(str, &eptr, 0);
if ((eptr != NULL) && (*eptr == '\0')) {
switch (year) {
case 1987:
case 87:
fatal("VHDL standard 1076-1987 is not supported");
case 1993:
case 93:
return STD_93;
case 2000:
case 0:
return STD_00;
case 2002:
case 2:
return STD_02;
case 2008:
case 8:
return STD_08;
}
}

fatal("invalid standard revision: %s (allowed 1993, 2000, 2002, 2008)", str);
}

static int analyse(int argc, char **argv)
{
set_work_lib();

static struct option long_options[] = {
{ "bootstrap", no_argument, 0, 'b' },
{ "dump-llvm", no_argument, 0, 'd' },
{ "prefer-explicit", no_argument, 0, 'p' },
{ "std", required_argument, 0, 's' },
{ "bootstrap", no_argument, 0, 'b' },
{ "dump-llvm", no_argument, 0, 'd' },
{ "prefer-explicit", no_argument, 0, 'p' },
{ 0, 0, 0, 0 }
};

Expand All @@ -122,9 +94,6 @@ static int analyse(int argc, char **argv)
case 'p':
opt_set_int("prefer-explicit", 1);
break;
case 's':
set_standard(parse_standard(optarg));
break;
default:
abort();
}
Expand Down Expand Up @@ -600,13 +569,13 @@ static void usage(void)
"Global options may be placed before COMMAND:\n"
" -L PATH\t\tAdd PATH to library search paths\n"
" -h, --help\t\tDisplay this message and exit\n"
" --std=REV\t\tVHDL standard revision to use\n"
" -v, --version\t\tDisplay version and copyright information\n"
" --work=NAME\tUse NAME as the work library\n"
"\n"
"Analyse options:\n"
" --bootstrap\tAllow compilation of STANDARD package\n"
" --prefer-explicit\tExplict operators always hide implicit\n"
" --std=REV\t\tVHDL standard revision to use\n"
"\n"
"Elaborate options:\n"
" --cover\t\tEnable code coverage reporting\n"
Expand Down Expand Up @@ -648,6 +617,33 @@ static void usage(void)
printf("\nReport bugs to %s\n", PACKAGE_BUGREPORT);
}

static vhdl_standard_t parse_standard(const char *str)
{
char *eptr = NULL;
const int year = strtol(str, &eptr, 0);
if ((eptr != NULL) && (*eptr == '\0')) {
switch (year) {
case 1987:
case 87:
fatal("VHDL standard 1076-1987 is not supported");
case 1993:
case 93:
return STD_93;
case 2000:
case 0:
return STD_00;
case 2002:
case 2:
return STD_02;
case 2008:
case 8:
return STD_08;
}
}

fatal("invalid standard revision: %s (allowed 1993, 2000, 2002, 2008)", str);
}

int main(int argc, char **argv)
{
term_init();
Expand All @@ -667,6 +663,7 @@ int main(int argc, char **argv)
{ "dump", no_argument, 0, 'd' },
{ "codegen", no_argument, 0, 'c' },
{ "make", no_argument, 0, 'm' },
{ "std", required_argument, 0, 's' },
{ 0, 0, 0, 0 }
};

Expand All @@ -689,6 +686,9 @@ int main(int argc, char **argv)
case 'L':
lib_add_search_path(optarg);
break;
case 's':
set_standard(parse_standard(optarg));
break;
case 'a':
case 'e':
case 'd':
Expand Down

0 comments on commit c99efb2

Please sign in to comment.