Compare commits

...
35 Commits
Author SHA1 Message Date
Stephen Williams cc7516eab3 Minor release update. 2016-02-10 11:39:12 -08:00
Stephen Williams 1a5ae96540 Fix broken "inherits dimensions from var/net" warning.
(cherry picked from commit 12c39aa4bb)
2016-02-10 11:23:44 -08:00
Stephen Williams 1ea8a13bf8 Prepare for 10.1 release. 2016-02-06 17:23:23 -08:00
Stephen Williams 490884cf7b Add the -Wimplicit-dimensions warning.
(cherry picked from commit f3647578d4)

Conflicts:
	scripts/devel-stub.conf
2016-02-06 16:48:43 -08:00
Martin Whitaker ca1d7ccffe Temporary fix for br993 - assertion failure in flip-flop synthesis.
(cherry-picked from master branch)

Synthesis does not currently support some commonly used styles for
representing flip-flops, e.g.

  q <= 0;
  if (en) q <= 1;

or

  if (clr) q <= 0;
  if (set) q <= 1;

For now, output a "sorry" message.
2016-01-30 22:44:26 +00:00
Martin Whitaker faf9bfe158 Fix for br994 - assertion failure when synthesising a mux.
(cherry-picked from master branch)

The elaborator allows the RHS of assignment to be wider than the
LHS. When using an if statement to represent a mux, this meant the
mux inputs could be different widths, resulting in an assertion
failure during synthesis. The fix is to prune the RHS to match the
LHS for each assignment. This has the benefit of minimising the
mux width.
2016-01-30 20:19:05 +00:00
Martin Whitaker 086ce04cf5 Temporary fix for br995 - assignment to memory not supported in synthesis.
(cherry-picked from master branch)

For now, output a "sorry" message.
2016-01-30 17:05:09 +00:00
Martin Whitaker 7b7231c417 Fix for br999 - incorrect result from binary comparison.
(cherry-picked from master branch)

When a binary (in)equality comparison has a constant left operand,
the tgt-vvp code generator swaps the left and right operands to
allow the cmpi instruction to be used. The code for swapping the
operands was incorrect.
2016-01-07 19:23:36 +00:00
Cary R d7b919f6d0 Update cppcheck suppression file 2015-12-19 11:58:38 -08:00
Cary R 9b34a96cb9 V10: Fix some compile warnings 2015-12-19 11:15:32 -08:00
Cary R 90cf0e5794 VHDL-10: fix a compile warning and add some missing newlines 2015-12-19 10:50:42 -08:00
Cary R 818379b9bc GTKWave (fstapi.c) needs realpath() so check for it 2015-12-19 09:11:56 -08:00
Cary R 9fbb7f84e6 A VHDL ExpAttribute() can share the base so don't just delete them 2015-12-13 19:02:26 -08:00
Cary R ed7d6c1002 Fix memory leak found with valgrind 2015-12-13 14:56:49 -08:00
Cary R a4306dbac1 Fix the modpath delay to ignore bits that are not changing 2015-10-21 22:02:17 -07:00
Cary R a682e13d82 Update LZ4 files to latest from GTKWave 2015-10-02 10:32:45 -07:00
Cary R 643e0a984e Fix some cppcheck warnings 2015-10-02 09:44:02 -07:00
Stephen Williams 63d2059b85 Have scope auto-rename generate names that use the index numbers
In generate blocks such as for loops, there may be many generated
scopes that have the same generated name. But in these cases, there
is an index number in the hname that can be used. So do so.

(cherry picked from commit 81f54ec0cb)
2015-09-30 09:48:56 -07:00
Martin Whitaker d9e09ceb59 Fix for GitHub issue #79 - literal numbers must have at least one digit.
(cherry-picked from master branch)

The bug report was for an assertion failure when a number contained only
a lowline (e.g. 'b_), but the standard says that a number can't start
with a lowline (e.g. 'b_1). The parser already rejected these cases for
decimal numbers, but allowed them through for binary/octal/hex numbers.
2015-09-23 00:15:50 +01:00
Stephen Williams 6d0ab9978f rpm spec file aware of stable versions. 2015-08-23 14:41:41 -07:00
Martin Whitaker e25cdf86ac Fix for br992 - prevent assertion/crash on declarations outside a module.
parse.y has been updated to allow declarations outside a module (legal
in SystemVerilog), but not all types of declaration are supported yet.
Output a sorry or error message as appropriate.
2015-08-21 00:11:59 +01:00
Stephen Williams 13bff8c50d Remove synthesis warning.
(cherry picked from commit d2c72a126d)
2015-08-20 13:53:13 -07:00
Stephen Williams b1b017251a Fix windres input version string for v10 and later. 2015-08-20 13:50:57 -07:00
Cary R e13a52637a A concatenation or the expression being replicated must have a non-zero width 2015-08-18 16:23:33 -07:00
Stephen Williams 4803f0d12b Rework vvp file version checking. 2015-08-17 15:38:27 -07:00
Martin Whitaker be44289fc0 Updated a few more copyright dates. 2015-08-17 22:23:43 +01:00
Martin Whitaker e682166253 Fix for br991 - compiler crashes due to null statements.
The reported problem was caused by a null statement in a case statement,
which caused the check for an infinite loop to fail. Further testing
exposed more problems with null statements in loop statements - these
caused crashes earlier in elaboration.
2015-08-17 22:19:36 +01:00
Larry Doolittle e2a1f21896 Squelch just a few trailing spaces in source code 2015-08-17 11:44:55 -07:00
Larry Doolittle cb73accd84 Spelling fixes 2015-08-17 11:34:58 -07:00
Stephen Williams a66361a4f2 Update some copyright dates. 2015-08-17 08:02:51 -07:00
Martin Whitaker 1159de0482 Fixed version number in vvp man page. 2015-08-16 23:11:54 +01:00
Stephen Williams ac5d4114ad Update v10 vvp examples to have correct version number 2015-08-16 12:30:43 -07:00
Stephen Williams 85f796fda2 Release compatible version stamp 2015-08-15 14:26:33 -07:00
Stephen Williams 8612ec5452 Main copyright date update. 2015-08-15 14:15:32 -07:00
Stephen Williams 870a351944 Change Version numbering scheme. 2015-08-15 13:42:57 -07:00
74 changed files with 1001 additions and 676 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ hname_t::hname_t(perm_string text, int num)
number_[0] = num;
}
hname_t::hname_t(perm_string text, vector<int>&nums)
hname_t::hname_t(perm_string text, const vector<int>&nums)
: name_(text), number_(nums)
{
}
+9 -4
View File
@@ -42,7 +42,7 @@ class hname_t {
hname_t ();
explicit hname_t (perm_string text);
explicit hname_t (perm_string text, int num);
explicit hname_t (perm_string text, std::vector<int>&nums);
explicit hname_t (perm_string text, const std::vector<int>&nums);
hname_t (const hname_t&that);
~hname_t();
@@ -56,12 +56,12 @@ class hname_t {
size_t has_numbers() const;
int peek_number(size_t idx) const;
const std::vector<int>&peek_numbers() const;
private:
perm_string name_;
// If the number is anything other than INT_MIN, then this is
// the numeric part of the name. Otherwise, it is not part of
// the name at all.
// If this vector has size, then the numbers all together make
// up part of the hierarchical name.
std::vector<int> number_;
private: // not implemented
@@ -82,6 +82,11 @@ inline int hname_t::peek_number(size_t idx) const
return number_[idx];
}
inline const std::vector<int>& hname_t::peek_numbers(void) const
{
return number_;
}
inline size_t hname_t::has_numbers() const
{
return number_.size();
+4
View File
@@ -80,6 +80,10 @@ extern unsigned recursive_mod_limit;
/* Implicit definitions of wires. */
extern bool warn_implicit;
/* Warn if dimensions of port or var/net are implicitly taken from
the input/output/inout declaration. */
extern bool warn_implicit_dimensions;
/* inherit timescales across files. */
extern bool warn_timescale;
+2 -1
View File
@@ -1,7 +1,7 @@
#ifndef IVL_config_H /* -*- c++ -*- */
#define IVL_config_H
/*
* Copyright (c) 2001-2014 Stephen Williams ([email protected])
* Copyright (c) 2001-2015 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -55,6 +55,7 @@
# undef HAVE_FSEEKO
/* And this is needed by the fst files (copied from GTKWave). */
# undef HAVE_LIBPTHREAD
# undef HAVE_REALPATH
/*
* Define this if you want to compile vvp with memory freeing and
+3
View File
@@ -242,6 +242,9 @@ case "${host}" in
esac
AC_SUBST(file64_support)
# fstapi.c (from GTKWave) needs this define.
AC_CHECK_FUNCS(realpath)
# Check that these functions exist. They are mostly C99
# functions that older compilers may not yet support.
AC_CHECK_FUNCS(fopen64)
+1 -1
View File
@@ -86,7 +86,7 @@ config.h: $(srcdir)/config.h.in Makefile
# Windows specific...
res.rc: $(srcdir)/res.rc.in ../version.exe
sed -e 's;@PRODUCTVERSION@;'`../version.exe '%M,%m,%n,0'`';' \
sed -e 's;@PRODUCTVERSION@;'`../version.exe '%M,%n,0,0'`';' \
$(srcdir)/res.rc.in > $@
res.o: res.rc
+2 -2
View File
@@ -1,4 +1,4 @@
.TH iverilog 1 "Aug 7th, 2015" "" "Version %M.%m.%n %E"
.TH iverilog 1 "Aug 7th, 2015" "" "Version %M.%n%E"
.SH NAME
iverilog - Icarus Verilog compiler
@@ -30,7 +30,7 @@ different set of programs. The path given is used to locate
\fIivlpp\fP, \fIivl\fP, code generators and the VPI modules.
.TP 8
.B -c\fIfile\fP -f\fIfile\fP
These flags specifies an input file that contains a list of Verilog
These flags specify an input file that contains a list of Verilog
source files. This is similar to the \fIcommand file\fP of other
Verilog simulators, in that it is a file that contains the file names
instead of taking them on the command line. See \fBCommand Files\fP below.
+11 -10
View File
@@ -496,6 +496,7 @@ static void process_warning_switch(const char*name)
if (strcmp(name,"all") == 0) {
process_warning_switch("anachronisms");
process_warning_switch("implicit");
process_warning_switch("implicit-dimensions");
process_warning_switch("portbind");
process_warning_switch("select-range");
process_warning_switch("timescale");
@@ -506,6 +507,9 @@ static void process_warning_switch(const char*name)
} else if (strcmp(name,"implicit") == 0) {
if (! strchr(warning_flags, 'i'))
strcat(warning_flags, "i");
} else if (strcmp(name,"implicit-dimensions") == 0) {
if (! strchr(warning_flags, 'd'))
strcat(warning_flags, "d");
} else if (strcmp(name,"portbind") == 0) {
if (! strchr(warning_flags, 'p'))
strcat(warning_flags, "p");
@@ -538,6 +542,12 @@ static void process_warning_switch(const char*name)
cp[0] = cp[1];
cp += 1;
}
} else if (strcmp(name,"no-implicit-dimensions") == 0) {
char*cp = strchr(warning_flags, 'd');
if (cp) while (*cp) {
cp[0] = cp[1];
cp += 1;
}
} else if (strcmp(name,"no-portbind") == 0) {
char*cp = strchr(warning_flags, 'p');
if (cp) while (*cp) {
@@ -1047,19 +1057,10 @@ int main(int argc, char **argv)
if (version_flag || verbose_flag) {
printf("Icarus Verilog version " VERSION " (" VERSION_TAG ")\n\n");
printf("Copyright 1998-2013 Stephen Williams\n\n");
printf("Copyright 1998-2015 Stephen Williams\n\n");
puts(NOTICE);
}
if (synth_flag) {
fprintf(stderr, "Warning: Synthesis is not currently being "
"maintained and may not\n");
fprintf(stderr, " function correctly. V0.8 was the "
"last release branch to\n");
fprintf(stderr, " have active synthesis development "
"and support!\n");
}
/* Make a common conf file path to reflect the target. */
snprintf(iconfig_common_path, sizeof iconfig_common_path, "%s%c%s%s.conf",
base, sep, targ, synth_flag? "-s" : "");
+3 -3
View File
@@ -2842,9 +2842,9 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope,
concat->set(idx, parms[off+idx]);
}
if (wid_sum == 0 && concat_depth < 2) {
cerr << get_fileline() << ": error: Concatenation may not "
<< "have zero width in this context." << endl;
if (wid_sum == 0) {
cerr << get_fileline() << ": error: Concatenation/replication "
<< "may not have zero width in this context." << endl;
des->errors += 1;
concat_depth -= 1;
delete concat;
+1 -1
View File
@@ -793,7 +793,7 @@ void elaborate_rootscope_tasks(Design*des)
}
cerr << cur->second->get_fileline() << ": internal error: "
<< "elabortae_rootscope_tasks does not understand "
<< "elaborate_rootscope_tasks does not understand "
<< "this object," << endl;
des->errors += 1;
}
+17
View File
@@ -976,6 +976,23 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
}
if (port_set_ || net_set_) {
if (warn_implicit_dimensions
&& port_set_ && net_set_
&& net_.empty() && !port_.empty()) {
cerr << get_fileline() << ": warning: "
<< "var/net declaration of " << basename()
<< " inherits dimensions from port declaration." << endl;
}
if (warn_implicit_dimensions
&& port_set_ && net_set_
&& port_.empty() && !net_.empty()) {
cerr << get_fileline() << ": warning: "
<< "Port declaration of " << basename()
<< " inherits dimensions from var/net." << endl;
}
bool bad_range = false;
vector<netrange_t> plist, nlist;
/* If they exist get the port definition MSB and LSB */
+46 -9
View File
@@ -4039,9 +4039,18 @@ NetProc* PDisable::elaborate(Design*des, NetScope*scope) const
*/
NetProc* PDoWhile::elaborate(Design*des, NetScope*scope) const
{
NetExpr*tmp = elab_and_eval(des, scope, cond_, -1);
tmp->set_line(*this);
NetDoWhile*loop = new NetDoWhile(tmp, statement_->elaborate(des, scope));
NetExpr*ce = elab_and_eval(des, scope, cond_, -1);
NetProc*sub;
if (statement_)
sub = statement_->elaborate(des, scope);
else
sub = new NetBlock(NetBlock::SEQU, 0);
if (ce == 0 || sub == 0) {
delete ce;
delete sub;
return 0;
}
NetDoWhile*loop = new NetDoWhile(ce, sub);
loop->set_line(*this);
return loop;
}
@@ -4572,7 +4581,11 @@ NetProc* PEventStatement::elaborate(Design*des, NetScope*scope) const
*/
NetProc* PForever::elaborate(Design*des, NetScope*scope) const
{
NetProc*stat = statement_->elaborate(des, scope);
NetProc*stat;
if (statement_)
stat = statement_->elaborate(des, scope);
else
stat = new NetBlock(NetBlock::SEQU, 0);
if (stat == 0) return 0;
NetForever*proc = new NetForever(stat);
@@ -4778,7 +4791,11 @@ NetProc* PForeach::elaborate(Design*des, NetScope*scope) const
/* Elaborate the statement that is contained in the foreach
loop. */
NetProc*sub = statement_->elaborate(des, scope);
NetProc*sub;
if (statement_)
sub = statement_->elaborate(des, scope);
else
sub = new NetBlock(NetBlock::SEQU, 0);
/* Make a step statement: idx += 1 */
NetAssign_*idx_lv = new NetAssign_(idx_sig);
@@ -4809,7 +4826,11 @@ NetProc* PForeach::elaborate_static_array_(Design*des, NetScope*scope,
ivl_assert(*this, index_vars_.size() > 0);
ivl_assert(*this, dims.size() == index_vars_.size());
NetProc*sub = statement_->elaborate(des, scope);
NetProc*sub;
if (statement_)
sub = statement_->elaborate(des, scope);
else
sub = new NetBlock(NetBlock::SEQU, 0);
NetForLoop*stmt = 0;
for (int idx_idx = index_vars_.size()-1 ; idx_idx >= 0 ; idx_idx -= 1) {
@@ -4903,7 +4924,11 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
loop. If there is an error, this will return 0 and I should
skip the append. No need to worry, the error has been
reported so it's OK that the netlist is bogus. */
NetProc*sub = statement_->elaborate(des, scope);
NetProc*sub;
if (statement_)
sub = statement_->elaborate(des, scope);
else
sub = new NetBlock(NetBlock::SEQU, 0);
/* Now elaborate the for_step statement. I really should do
some error checking here to make sure the step statement
@@ -5025,7 +5050,11 @@ NetProc* PRepeat::elaborate(Design*des, NetScope*scope) const
if (expr->expr_type() == IVL_VT_REAL)
expr = cast_to_int4(expr, 64);
NetProc*stat = statement_->elaborate(des, scope);
NetProc*stat;
if (statement_)
stat = statement_->elaborate(des, scope);
else
stat = new NetBlock(NetBlock::SEQU, 0);
if (stat == 0) return 0;
// If the expression is a constant, handle certain special
@@ -5205,7 +5234,11 @@ NetProc* PTrigger::elaborate(Design*des, NetScope*scope) const
NetProc* PWhile::elaborate(Design*des, NetScope*scope) const
{
NetExpr*ce = elab_and_eval(des, scope, cond_, -1);
NetProc*sub = statement_->elaborate(des, scope);
NetProc*sub;
if (statement_)
sub = statement_->elaborate(des, scope);
else
sub = new NetBlock(NetBlock::SEQU, 0);
if (ce == 0 || sub == 0) {
delete ce;
delete sub;
@@ -5695,6 +5728,9 @@ bool PGenerate::elaborate(Design*des, NetScope*container) const
"generate " << scheme_type
<< " elaborating in scope " << scope_path(container)
<< "." << endl;
cerr << get_fileline() << ": PGenerate::elaborate: "
"generate scope_name=" << scope_name
<< ", id_number=" << id_number << endl;
}
// Handle the special case that this is a CASE scheme. In this
@@ -5729,6 +5765,7 @@ bool PGenerate::elaborate(Design*des, NetScope*container) const
// scheme defined in the Verilog-2005 standard.
const char*name = scope_name.str();
if (name[0] == '$') {
if (!scope->auto_name("genblk", '0', name + 4)) {
cerr << get_fileline() << ": warning: Couldn't build"
<< " unique name for unnamed generate block"
+1 -1
View File
@@ -1,4 +1,4 @@
.TH iverilog-vpi 1 "May 10th, 2015" "" "Version %M.%m.%n %E"
.TH iverilog-vpi 1 "May 10th, 2015" "" "Version %M.%n%E"
.SH NAME
iverilog-vpi - Compile front end for VPI modules
+1 -1
View File
@@ -1,5 +1,5 @@
const char COPYRIGHT[] =
"Copyright (c) 1999-2011 Stephen Williams ([email protected])";
"Copyright (c) 1999-2011,2015 Stephen Williams ([email protected])";
/*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
+21 -11
View File
@@ -4,7 +4,7 @@
%{
/*
* Copyright (c) 1998-2014 Stephen Williams ([email protected])
* Copyright (c) 1998-2015 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -432,16 +432,26 @@ TU [munpf]
return SYSTEM_IDENTIFIER; }
\'[sS]?[dD][ \t]*[0-9][0-9_]* { yylval.number = make_unsized_dec(yytext);
return BASED_NUMBER; }
\'[sS]?[dD][ \t]*[xzXZ?]_* { yylval.number = make_undef_highz_dec(yytext);
return BASED_NUMBER; }
\'[sS]?[bB][ \t]*[0-1xzXZ_\?]+ { yylval.number = make_unsized_binary(yytext);
return BASED_NUMBER; }
\'[sS]?[oO][ \t]*[0-7xzXZ_\?]+ { yylval.number = make_unsized_octal(yytext);
return BASED_NUMBER; }
\'[sS]?[hH][ \t]*[0-9a-fA-FxzXZ_\?]+ { yylval.number = make_unsized_hex(yytext);
return BASED_NUMBER; }
\'[sS]?[dD][ \t]*[0-9][0-9_]* {
yylval.number = make_unsized_dec(yytext);
return BASED_NUMBER;
}
\'[sS]?[dD][ \t]*[xzXZ?]_* {
yylval.number = make_undef_highz_dec(yytext);
return BASED_NUMBER;
}
\'[sS]?[bB][ \t]*[0-1xzXZ?][0-1xzXZ?_]* {
yylval.number = make_unsized_binary(yytext);
return BASED_NUMBER;
}
\'[sS]?[oO][ \t]*[0-7xzXZ?][0-7xzXZ?_]* {
yylval.number = make_unsized_octal(yytext);
return BASED_NUMBER;
}
\'[sS]?[hH][ \t]*[0-9a-fA-FxzXZ?][0-9a-fA-FxzXZ?_]* {
yylval.number = make_unsized_hex(yytext);
return BASED_NUMBER;
}
\'[01xzXZ] {
if (generation_flag < GN_VER2005_SV) {
cerr << yylloc.text << ":" << yylloc.first_line << ": warning: "
+5 -1
View File
@@ -1,5 +1,5 @@
const char COPYRIGHT[] =
"Copyright (c) 1998-2014 Stephen Williams ([email protected])";
"Copyright (c) 1998-2015 Stephen Williams ([email protected])";
/*
* This source code is free software; you can redistribute it
@@ -153,6 +153,7 @@ FILE *depend_file = NULL;
* These are the warning enable flags.
*/
bool warn_implicit = false;
bool warn_implicit_dimensions = false;
bool warn_timescale = false;
bool warn_portbinding = false;
bool warn_inf_loop = false;
@@ -678,6 +679,9 @@ static void read_iconfig_file(const char*ipath)
case 'i':
warn_implicit = true;
break;
case 'd':
warn_implicit_dimensions = true;
break;
case 'l':
warn_inf_loop = true;
break;
+12 -9
View File
@@ -264,19 +264,20 @@ bool NetScope::auto_name(const char*prefix, char pad, const char* suffix)
assert(self != up_->children_.end());
assert(self->second == this);
char tmp[32];
int pad_pos = strlen(prefix);
int max_pos = sizeof(tmp) - strlen(suffix) - 1;
strncpy(tmp, prefix, sizeof(tmp));
tmp[31] = 0;
// This is to keep the pad attempts from being stuck in some
// sort of infinite loop. This should not be a practical
// limit, but an extreme one.
const size_t max_pad_attempts = 32 + strlen(prefix);
string use_prefix = prefix;
// Try a variety of potential new names. Make sure the new
// name is not in the parent scope. Keep looking until we are
// sure we have a unique name, or we run out of names to try.
while (pad_pos <= max_pos) {
while (use_prefix.size() <= max_pad_attempts) {
// Try this name...
strcat(tmp + pad_pos, suffix);
hname_t new_name(lex_strings.make(tmp));
string tmp = use_prefix + suffix;
hname_t new_name(lex_strings.make(tmp.c_str()), name_.peek_numbers());
if (!up_->child(new_name)) {
// Ah, this name is unique. Rename myself, and
// change my name in the parent scope.
@@ -285,7 +286,9 @@ bool NetScope::auto_name(const char*prefix, char pad, const char* suffix)
up_->children_[name_] = this;
return true;
}
tmp[pad_pos++] = pad;
// Name collides, so try a different name.
use_prefix = use_prefix + pad;
}
return false;
}
+8 -2
View File
@@ -2743,10 +2743,11 @@ DelayType NetCase::delay_type() const
for (unsigned idx = 0; idx < nstmts; idx += 1) {
if (!expr(idx)) def_stmt = true;
DelayType dt = stat(idx) ? stat(idx)->delay_type() : NO_DELAY;
if (idx == 0) {
result = stat(idx)->delay_type();
result = dt;
} else {
result = combine_delays(result, stat(idx)->delay_type());
result = combine_delays(result, dt);
}
}
@@ -2769,6 +2770,7 @@ DelayType NetCondit::delay_type() const
*/
DelayType NetDoWhile::delay_type() const
{
ivl_assert(*this, proc_);
return proc_->delay_type();
}
@@ -2779,11 +2781,13 @@ DelayType NetEvWait::delay_type() const
DelayType NetForever::delay_type() const
{
ivl_assert(*this, statement_);
return statement_->delay_type();
}
DelayType NetForLoop::delay_type() const
{
ivl_assert(*this, statement_);
return get_loop_delay_type(condition_, statement_);
}
@@ -2806,6 +2810,7 @@ DelayType NetPDelay::delay_type() const
DelayType NetRepeat::delay_type() const
{
ivl_assert(*this, statement_);
return get_loop_delay_type(expr_, statement_);
}
@@ -2821,5 +2826,6 @@ DelayType NetUTask::delay_type() const
DelayType NetWhile::delay_type() const
{
ivl_assert(*this, proc_);
return get_loop_delay_type(cond_, proc_);
}
+26 -2
View File
@@ -2591,6 +2591,15 @@ void pform_makewire(const struct vlltype&li,
NetNet::Type type,
data_type_t*data_type)
{
if ((lexical_scope == 0) && (generation_flag < GN_VER2005_SV)) {
VLerror(li, "error: variable declarations must be contained within a module.");
return;
}
if (lexical_scope == 0) {
VLerror(li, "sorry: variable declarations in the $root scope are not yet supported.");
return;
}
list<perm_string>*names = new list<perm_string>;
for (list<decl_assignment_t*>::iterator cur = assign_list->begin()
@@ -2887,6 +2896,14 @@ void pform_set_parameter(const struct vlltype&loc,
LexicalScope::range_t*value_range)
{
LexicalScope*scope = lexical_scope;
if ((scope == 0) && (generation_flag < GN_VER2005_SV)) {
VLerror(loc, "error: parameter declarations must be contained within a module.");
return;
}
if (scope == 0) {
VLerror(loc, "sorry: parameter declarations in the $root scope are not yet supported.");
return;
}
if (scope == pform_cur_generate) {
VLerror("parameter declarations are not permitted in generate blocks");
return;
@@ -2910,7 +2927,7 @@ void pform_set_parameter(const struct vlltype&loc,
error_count += 1;
}
// Only a Module scope has specparams.
if ((dynamic_cast<Module*> (scope)) &&
if ((dynamic_cast<Module*> (scope)) &&
(scope == pform_cur_module.front()) &&
(pform_cur_module.front()->specparams.find(name) !=
pform_cur_module.front()->specparams.end())) {
@@ -2954,7 +2971,14 @@ void pform_set_localparam(const struct vlltype&loc,
bool signed_flag, list<pform_range_t>*range, PExpr*expr)
{
LexicalScope*scope = lexical_scope;
ivl_assert(loc, scope);
if ((scope == 0) && (generation_flag < GN_VER2005_SV)) {
VLerror(loc, "error: localparam declarations must be contained within a module.");
return;
}
if (scope == 0) {
VLerror(loc, "sorry: localparam declarations in the $root scope are not yet supported.");
return;
}
// Check if the localparam name is already in the dictionary.
if (scope->localparams.find(name) != scope->localparams.end()) {
+11 -7
View File
@@ -4,22 +4,26 @@
# the number for a snapshot and the path to a temporary directory.
# for example:
#
# sh scripts/MAKE_RELEASE.sh 0.9.1 ~/tmp
# sh scripts/MAKE_RELEASE.sh 10.1 ~/tmp
#
# The above assumes that there is a tag "v0_9_1" at the point
# The above assumes that there is a tag "v10_1" at the point
# to be released. (The tag has the "v", but the argument to this
# script does not have the "v"). This script extracts based on the
# tag, uses the temporary directory to stage intermediate results,
# and finally creates a file called verilog-0.9.1.tar.gz that
# and finally creates a file called verilog-10.1.tar.gz that
# contains the release ready to go.
#
# The complete steps to make a release x.y.z generally are:
# The complete steps to make a release x.y generally are:
#
# git tag -a v0_9_1
# Edit version_base.h to suit.
#
# Edit verilog.spec to suit.
#
# git tag -a v10_1
# (Make the tag in the local git repository.)
#
# sh scripts/MAKE_RELEASE.sh 0.9.1 ~/tmp
# (Make the snapshot bundle verilog-0.9.1.tar.gz)
# sh scripts/MAKE_RELEASE.sh 10.1 ~/tmp
# (Make the snapshot bundle verilog-10.1.tar.gz)
#
# git push --tags
# (Publish the tag to the repository.)
+1 -1
View File
@@ -15,7 +15,7 @@ iwidth:32
sys_func:vpi/system.sft
sys_func:vpi/v2005_math.sft
sys_func:vpi/va_math.sft
warnings:ailnpstv
warnings:adfilnpstv
debug:eval_tree
debug:elaborate
debug:emit
+21 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002-2015 Stephen Williams (steve@icarus.com)
* Copyright (c) 2002-2016 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
@@ -103,6 +103,14 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope,
NetNet*rsig = rval_->synthesize(des, scope, rval_);
assert(rsig);
if (lval_->word() && ! dynamic_cast<NetEConst*>(lval_->word())) {
cerr << get_fileline() << ": sorry: assignment to variable "
"location in memory is not currently supported in "
"synthesis." << endl;
des->errors += 1;
return false;
}
NetNet*lsig = lval_->sig();
if (!lsig) {
cerr << get_fileline() << ": error: "
@@ -218,6 +226,8 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope,
rsig = tmp;
}
rsig = crop_to_width(des, rsig, lsig->vector_width());
if (nex_out.pin_count() > 1) {
NexusSet tmp_set;
nex_output(tmp_set);
@@ -1411,6 +1421,16 @@ bool NetBlock::synth_sync(Design*des, NetScope*scope,
are used to collect the outputs from the substatement
for the inputs of the FF bank. */
NetBus tmp_out (scope, tmp_set.size());
for (unsigned idx = 0 ; idx < tmp_out.pin_count() ; idx += 1) {
unsigned ptr = nex_map.find_nexus(tmp_set[idx]);
ivl_assert(*this, ptr < nex_out.pin_count());
if (nex_out.pin(ptr).is_linked()) {
cerr << get_fileline() << ": sorry: multiple statements "
"assigning to the same flip-flop are not yet "
"supported in synthesis." << endl;
return false;
}
}
/* Create a temporary ff_ce (FF clock-enable) that
accounts for the subset of outputs that this
-7
View File
@@ -171,13 +171,6 @@ extern "C" unsigned ivl_expr_lineno(ivl_expr_t net)
return net->lineno;
}
inline static const char *basename(ivl_scope_t scope, const char *inst)
{
inst += strlen(ivl_scope_name(scope));
assert(*inst == '.');
return inst+1;
}
extern "C" ivl_variable_type_t ivl_const_type(ivl_net_const_t net)
{
assert(net);
-7
View File
@@ -151,13 +151,6 @@ void ivl_net_const_s::operator delete(void*, size_t)
static StringHeapLex net_const_strings;
inline static const char *basename(ivl_scope_t scope, const char *inst)
{
inst += strlen(ivl_scope_name(scope));
assert(*inst == '.');
return inst+1;
}
static perm_string make_scope_name(const hname_t&name)
{
if (! name.has_numbers())
+1 -1
View File
@@ -35,7 +35,7 @@ using namespace std;
static const char*version_string =
"Icarus Verilog BLIF Code Generator " VERSION " (" VERSION_TAG ")\n\n"
"Copyright (c) 2013 Stephen Williams ([email protected])\n\n"
"Copyright (c) 2013,2015 Stephen Williams ([email protected])\n\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2014 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2015 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
@@ -30,7 +30,7 @@
static const char*version_string =
"Icarus Verilog NULL Code Generator " VERSION " (" VERSION_TAG ")\n\n"
"Copyright (c) 2000-2014 Stephen Williams ([email protected])\n\n"
"Copyright (c) 2000-2015 Stephen Williams ([email protected])\n\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014 Stephen Williams (steve@icarus.com)
* Copyright (c) 2014,2015 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
@@ -34,7 +34,7 @@ using namespace std;
static const char*version_string =
"Icarus Verilog SIZER Statistics Generator " VERSION " (" VERSION_TAG ")\n\n"
"Copyright (c) 2014 Stephen Williams ([email protected])\n\n"
"Copyright (c) 2014,2015 Stephen Williams ([email protected])\n\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
-1
View File
@@ -42,7 +42,6 @@ void show_constant(ivl_net_const_t net)
case IVL_VT_REAL:
fprintf(out, "%f", ivl_const_real(net));
break;
break;
default:
fprintf(out, "<unsupported type>");
break;
+2 -2
View File
@@ -2,7 +2,7 @@
// are not used here.
// target_design()
unusedFunction:stub.c:1773
unusedFunction:stub.c:1774
// target_query()
unusedFunction:stub.c:1843
unusedFunction:stub.c:1844
+1 -1
View File
@@ -36,7 +36,7 @@
static const char*version_string =
"Icarus Verilog STUB Code Generator " VERSION " (" VERSION_TAG ")\n\n"
"Copyright (c) 2000-2014 Stephen Williams ([email protected])\n\n"
"Copyright (c) 2000-2015 Stephen Williams ([email protected])\n\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
+1 -1
View File
@@ -1407,7 +1407,7 @@ static void emit_lpm_ff(ivl_scope_t scope, ivl_lpm_t lpm)
}
nex = ivl_lpm_sync_set(lpm);
if (nex) {
if (! sset_bits || (sset_bits && (sset_bits[0] == '1'))) {
if (! sset_bits || (sset_bits[0] == '1')) {
emit_nexus_as_ca(scope, nex, 0, 0);
if (have_data) fprintf(vlog_out, " | ");
} else {
+1 -1
View File
@@ -30,7 +30,7 @@
static const char*version_string =
"Icarus Verilog VLOG95 Code Generator " VERSION " (" VERSION_TAG ")\n\n"
"Copyright (C) 2010-2013 Cary R. ([email protected])\n\n"
"Copyright (C) 2010-2015 Cary R. ([email protected])\n\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014 Stephen Williams (steve@icarus.com)
* Copyright (c) 2014-2016 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
@@ -76,8 +76,8 @@ static int draw_condition_binary_compare(ivl_expr_t expr)
%cmp instruction. */
if (ivl_expr_width(le)==use_wid && test_immediate_vec4_ok(le)) {
ivl_expr_t tmp = le;
re = le;
le = tmp;
le = re;
re = tmp;
}
draw_eval_vec4(le);
+1 -1
View File
@@ -1032,7 +1032,7 @@ static void draw_string_vec4(ivl_expr_t expr)
for (unsigned idx = 0 ; idx < wid ; idx += 8) {
tmp <<= 8;
tmp |= *p;
tmp |= (unsigned long)*p;
p += 1;
tmp_wid += 8;
if (tmp_wid == 32) {
+1 -1
View File
@@ -28,7 +28,7 @@
static const char*version_string =
"Icarus Verilog VVP Code Generator " VERSION " (" VERSION_TAG ")\n\n"
"Copyright (c) 2001-2011 Stephen Williams ([email protected])\n\n"
"Copyright (c) 2001-2015 Stephen Williams ([email protected])\n\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
+4 -4
View File
@@ -1,6 +1,6 @@
#norootforbuild
#
%define rev_date 20150603
%define rev_date 20160210
# Normally, the suff-ix is %nil, meaning the suffix is to not be used.
# But if the builder wants to make a suffixed package, he may set this
# to a value (i.e. -test) to cause suffixes to be put in all the right
@@ -10,11 +10,11 @@
#
Summary: Icarus Verilog
Name: verilog%{suff}
Version: 0.10.0.%{rev_date}
Version: 10.1.1
Release: 0
License: GPL
Group: Productivity/Scientific/Electronics
Source: verilog%{suff}-%{rev_date}.tar.gz
Source: verilog%{suff}-%{version}.tar.gz
URL: http://www.icarus.com/eda/verilog/index.html
Packager: Stephen Williams <[email protected]>
@@ -32,7 +32,7 @@ engineering formats, including simulation. It strives to be true
to the IEEE-1364 standard.
%prep
%setup -n verilog%{suff}-%{rev_date}
%setup -n verilog-%{version}
%build
if test X%{suff} != X
+1 -4
View File
@@ -29,10 +29,7 @@ static void run_string(const char*txt)
if (cp[0] == '%' && cp[1] != 0) {
switch (cp[1]) {
case 'M':
fprintf(stdout, "%u", VERSION_MAJOR1);
break;
case 'm':
fprintf(stdout, "%u", VERSION_MAJOR2);
fprintf(stdout, "%u", VERSION_MAJOR);
break;
case 'n':
fprintf(stdout, "%u", VERSION_MINOR);
+8 -8
View File
@@ -3,17 +3,17 @@
* Edit this definition in version_base.in to define the base version
* number for the compiled result.
*/
# define VERSION_MAJOR1 0
# define VERSION_MAJOR2 10
# define VERSION_MINOR 0
# define VERSION_EXTRA "(devel)"
# define VERSION_MAJOR 10
# define VERSION_MINOR 1
/* This is a concatenation of MAJOR1.MAJOR2 that is used by
vams_simparam.c to make a double value. */
# define VERSION_MAJOR 0.10
/*
* This will be appended to the version. Use this to mark development
* versions and the like.
*/
# define VERSION_EXTRA " (stable)"
# define VERSION_STRINGIFY(x) #x
# define VERSION_STR(a,b,extra) VERSION_STRINGIFY(a.b) " " extra
# define VERSION_STR(a,b,extra) VERSION_STRINGIFY(a.b) extra
#define VERSION VERSION_STR(VERSION_MAJOR,VERSION_MINOR,VERSION_EXTRA)
#endif
+3 -1
View File
@@ -61,7 +61,9 @@ ExpAttribute::ExpAttribute(ExpName*bas, perm_string nam)
ExpAttribute::~ExpAttribute()
{
delete base_;
/* Different attributes can point to the same base so we cannot delete this here.
* Look at the vhdl_range test with valgrind to see this issue. */
// delete base_;
}
Expression*ExpAttribute::clone() const
+1 -1
View File
@@ -874,7 +874,7 @@ const VType* ExpName::probe_prefix_type_(Entity*ent, ScopeBase*scope) const
}
/*
* This method is the probe_type() imlementation for ExpName objects
* This method is the probe_type() implementation for ExpName objects
* that have prefix parts. In this case we try to get the type of the
* prefix and interpret the name in that context.
*/
+1 -1
View File
@@ -38,7 +38,7 @@ const char COPYRIGHT[] =
* information to the file named <path>.
*
* elaboration=<path>
* Enable debugging of elaboratin by dumping elaboration
* Enable debugging of elaboration by dumping elaboration
* process information to the file named <path>.
*
* entities=<path>
+7 -7
View File
@@ -665,7 +665,7 @@ component_configuration
block_configuration_opt
K_end K_for ';'
{
sorrymsg(@1, "Component configuration in not yet supported");
sorrymsg(@1, "Component configuration in not yet supported\n");
if($3) delete $3;
delete $2;
}
@@ -834,14 +834,14 @@ else_when_waveform
concurrent_signal_assignment_statement /* IEEE 1076-2008 P11.6 */
: concurrent_simple_signal_assignment
| IDENTIFIER ':' concurrent_simple_signal_assignment
| IDENTIFIER ':' concurrent_simple_signal_assignment
{ delete[] $1;
$$ = $3;
}
| concurrent_conditional_signal_assignment
| IDENTIFIER ':' concurrent_conditional_signal_assignment
| IDENTIFIER ':' concurrent_conditional_signal_assignment
{ delete[] $1;
$$ = $3;
}
@@ -878,7 +878,7 @@ configuration_declaration
K_end K_configuration_opt identifier_opt ';'
{
if(design_entities.find(lex_strings.make($4)) == design_entities.end())
errormsg(@4, "Couldn't find entity %s used in configuration declaration", $4);
errormsg(@4, "Couldn't find entity %s used in configuration declaration\n", $4);
//choose_architecture_for_entity();
sorrymsg(@1, "Configuration declaration is not yet supported.\n");
}
@@ -1873,10 +1873,10 @@ primary
else if(!strcasecmp($2, "fs"))
unit = ExpTime::FS;
else
errormsg(@2, "Invalid time unit (accepted are fs, ps, ns, us, ms, s).");
errormsg(@2, "Invalid time unit (accepted are fs, ps, ns, us, ms, s).\n");
if($1 < 0)
errormsg(@1, "Time cannot be negative.");
errormsg(@1, "Time cannot be negative.\n");
ExpTime*tmp = new ExpTime($1, unit);
FILE_NAME(tmp, @1);
@@ -2586,7 +2586,7 @@ suffix
{ $$ = $1; }
| K_all
{ //do not have now better idea than using char constant
$$ = strcpy(new char[strlen("all"+1)], "all");
$$ = strdup("all");
}
;
+1 -1
View File
@@ -169,7 +169,7 @@ class ActiveScope : public ScopeBase {
bool is_vector_name(perm_string name) const;
// Locate the subprogram by name. The subprogram body uses
// this to locate the sobprogram declaration. Note that the
// this to locate the subprogram declaration. Note that the
// subprogram may be in a package header.
SubprogramHeader* recall_subprogram(perm_string name) const;
+1 -1
View File
@@ -56,7 +56,7 @@ O = sys_table.o sys_convert.o sys_countdrivers.o sys_darray.o sys_deposit.o sys_
sys_random.o sys_random_mti.o sys_readmem.o sys_readmem_lex.o sys_scanf.o \
sys_sdf.o sys_time.o sys_vcd.o sys_vcdoff.o vcd_priv.o mt19937int.o \
sys_priv.o sdf_parse.o sdf_lexor.o stringheap.o vams_simparam.o \
table_mod.o table_mod_lexor.o table_mod_parse.o
table_mod.o table_mod_parse.o table_mod_lexor.o
OPP = vcd_priv2.o
ifeq (@HAVE_LIBZ@,yes)
+111 -107
View File
@@ -3,143 +3,143 @@
// problems will not be fixed.
// fstapi.c from GTKWave
obsoleteFunctionsasctime:fstapi.c:929
obsoleteFunctionsalloca:fstapi.c:2304
unreadVariable:fstapi.c:1647
variableScope:fstapi.c:665
variableScope:fstapi.c:1337
obsoleteFunctionsasctime:fstapi.c:930
obsoleteFunctionsalloca:fstapi.c:2305
unreadVariable:fstapi.c:1648
variableScope:fstapi.c:666
variableScope:fstapi.c:1338
variableScope:fstapi.c:1395
variableScope:fstapi.c:1978
variableScope:fstapi.c:2107
variableScope:fstapi.c:2540
variableScope:fstapi.c:1339
variableScope:fstapi.c:1396
variableScope:fstapi.c:1979
variableScope:fstapi.c:2108
variableScope:fstapi.c:2541
variableScope:fstapi.c:2732
variableScope:fstapi.c:2542
variableScope:fstapi.c:2733
variableScope:fstapi.c:2737
variableScope:fstapi.c:2853
variableScope:fstapi.c:2892
variableScope:fstapi.c:2734
variableScope:fstapi.c:2738
variableScope:fstapi.c:2854
variableScope:fstapi.c:2893
variableScope:fstapi.c:3611
variableScope:fstapi.c:3785
variableScope:fstapi.c:3787
variableScope:fstapi.c:4229
variableScope:fstapi.c:2894
variableScope:fstapi.c:3612
variableScope:fstapi.c:3786
variableScope:fstapi.c:3788
variableScope:fstapi.c:4230
variableScope:fstapi.c:4239
variableScope:fstapi.c:4502
variableScope:fstapi.c:4773
variableScope:fstapi.c:4776
variableScope:fstapi.c:5270
variableScope:fstapi.c:5274
variableScope:fstapi.c:4231
variableScope:fstapi.c:4240
variableScope:fstapi.c:4503
variableScope:fstapi.c:4774
variableScope:fstapi.c:4777
variableScope:fstapi.c:5271
variableScope:fstapi.c:5275
variableScope:fstapi.c:5431
variableScope:fstapi.c:5489
variableScope:fstapi.c:5802
variableScope:fstapi.c:5805
variableScope:fstapi.c:6041
variableScope:fstapi.c:6146
variableScope:fstapi.c:5276
variableScope:fstapi.c:5432
variableScope:fstapi.c:5490
variableScope:fstapi.c:5803
variableScope:fstapi.c:5806
variableScope:fstapi.c:6042
variableScope:fstapi.c:6147
variableScope:fstapi.c:6178
variableScope:fstapi.c:6406
variableScope:fstapi.c:6148
variableScope:fstapi.c:6179
variableScope:fstapi.c:6407
// These functions are not used by Icarus
// fstReaderClrFacProcessMask()
unusedFunction:fstapi.c:3343
unusedFunction:fstapi.c:3344
// fstReaderClrFacProcessMaskAll()
unusedFunction:fstapi.c:3372
unusedFunction:fstapi.c:3373
// fstReaderGetAliasCount()
unusedFunction:fstapi.c:3435
unusedFunction:fstapi.c:3436
// fstReaderGetCurrentFlatScope()
unusedFunction:fstapi.c:3181
unusedFunction:fstapi.c:3182
// fstReaderGetAliasCount()
unusedFunction:fstapi.c:3278
unusedFunction:fstapi.c:3279
// fstReaderGetCurrentScopeUserInfo()
unusedFunction:fstapi.c:3195
unusedFunction:fstapi.c:3196
// fstReaderGetDateString()
unusedFunction:fstapi.c:3463
unusedFunction:fstapi.c:3464
// fstReaderGetDoubleEndianMatchState()
unusedFunction:fstapi.c:3449
unusedFunction:fstapi.c:3450
// fstReaderGetDumpActivityChangeTime()
unusedFunction:fstapi.c:3491
unusedFunction:fstapi.c:3492
// fstReaderGetDumpActivityChangeValue()
unusedFunction:fstapi.c:3506
unusedFunction:fstapi.c:3507
// fstReaderGetEndTime()
unusedFunction:fstapi.c:3400
unusedFunction:fstapi.c:3401
// fstReaderGetFacProcessMask()
unusedFunction:fstapi.c:3306
unusedFunction:fstapi.c:3307
// fstReaderGetFileType()
unusedFunction:fstapi.c:3470
unusedFunction:fstapi.c:3471
// fstReaderGetFseekFailed()
unusedFunction:fstapi.c:3291
unusedFunction:fstapi.c:3292
// fstReaderGetMaxHandle()
unusedFunction:fstapi.c:3428
unusedFunction:fstapi.c:3429
// fstReaderGetMemoryUsedByWriter()
unusedFunction:fstapi.c:3407
unusedFunction:fstapi.c:3408
// fstReaderGetNumberDumpActivityChanges()
unusedFunction:fstapi.c:3484
unusedFunction:fstapi.c:3485
// fstReaderGetScopeCount()
unusedFunction:fstapi.c:3414
unusedFunction:fstapi.c:3415
// fstReaderGetStartTime()
unusedFunction:fstapi.c:3393
unusedFunction:fstapi.c:3394
// fstReaderGetTimescale()
unusedFunction:fstapi.c:3386
unusedFunction:fstapi.c:3387
// fstReaderGetTimezero()
unusedFunction:fstapi.c:3477
unusedFunction:fstapi.c:3478
// fstReaderGetValueChangeSectionCount()
unusedFunction:fstapi.c:3442
unusedFunction:fstapi.c:3443
// fstReaderGetValueFromHandleAtTime()
unusedFunction:fstapi.c:5684
unusedFunction:fstapi.c:5685
// fstReaderGetVarCount()
unusedFunction:fstapi.c:3421
unusedFunction:fstapi.c:3422
// fstReaderGetVersionString()
unusedFunction:fstapi.c:3456
unusedFunction:fstapi.c:3457
// fstReaderIterBlocks()
unusedFunction:fstapi.c:4651
unusedFunction:fstapi.c:4652
// fstReaderIterBlocksSetNativeDoublesOnCallback()
unusedFunction:fstapi.c:3556
unusedFunction:fstapi.c:3557
// fstReaderIterateHier()
unusedFunction:fstapi.c:3781
unusedFunction:fstapi.c:3782
// fstReaderIterateHierRewind()
unusedFunction:fstapi.c:3761
unusedFunction:fstapi.c:3762
// fstReaderOpen()
unusedFunction:fstapi.c:4549
unusedFunction:fstapi.c:4550
// fstReaderOpenForUtilitiesOnly()
unusedFunction:fstapi.c:4541
unusedFunction:fstapi.c:4542
// fstReaderPushScope()
unusedFunction:fstapi.c:3243
unusedFunction:fstapi.c:3244
// fstReaderResetScope()
unusedFunction:fstapi.c:3232
unusedFunction:fstapi.c:3233
// fstReaderSetFacProcessMask()
unusedFunction:fstapi.c:3325
unusedFunction:fstapi.c:3326
// fstReaderSetFacProcessMaskAll()
unusedFunction:fstapi.c:3361
unusedFunction:fstapi.c:3362
// fstReaderSetLimitTimeRange()
unusedFunction:fstapi.c:3521
unusedFunction:fstapi.c:3522
// fstReaderSetUnlimitedTimeRange()
unusedFunction:fstapi.c:3534
unusedFunction:fstapi.c:3535
// fstReaderSetVcdExtensions()
unusedFunction:fstapi.c:3545
unusedFunction:fstapi.c:3546
// fstUtilityEscToBin()
unusedFunction:fstapi.c:6484
unusedFunction:fstapi.c:6485
// fstWriterCreateVar2()
unusedFunction:fstapi.c:2527
unusedFunction:fstapi.c:2528
// fstWriterEmitVariableLengthValueChange()
unusedFunction:fstapi.c:2846
unusedFunction:fstapi.c:2847
// fstWriterGetFseekFailed()
unusedFunction:fstapi.c:2510
unusedFunction:fstapi.c:2511
// fstWriterSetAttrEnd()
unusedFunction:fstapi.c:2713
unusedFunction:fstapi.c:2714
// fstWriterSetComment()
unusedFunction:fstapi.c:2359
unusedFunction:fstapi.c:2360
// fstWriterSetEnvVar()
unusedFunction:fstapi.c:2371
unusedFunction:fstapi.c:2372
// fstWriterSetFileType()
unusedFunction:fstapi.c:2234
unusedFunction:fstapi.c:2235
// fstWriterSetParallelMode()
unusedFunction:fstapi.c:2470
unusedFunction:fstapi.c:2471
// fstWriterSetTimezero()
unusedFunction:fstapi.c:2435
unusedFunction:fstapi.c:2436
// fstWriterSetValueList()
unusedFunction:fstapi.c:2365
unusedFunction:fstapi.c:2366
// These functions are not used by Icarus
//unusedFunction:fstapi.c:226
@@ -234,59 +234,63 @@ unusedFunction:fastlz.c:150
// lz4.c from GTKWave
// These functions are not used by Icarus
// LZ4_compress_continue()
unusedFunction:lz4.c:883
unusedFunction:lz4.c:1460
// LZ4_compress_destSize()
unusedFunction:lz4.c:912
// LZ4_compress_fast_force()
unusedFunction:lz4.c:705
// LZ4_compress_forceExtDict()
unusedFunction:lz4.c:895
unusedFunction:lz4.c:1063
// LZ4_compress_limitedOutput()
unusedFunction:lz4.c:730
unusedFunction:lz4.c:1455
// LZ4_compress_limitedOutput_continue()
unusedFunction:lz4.c:888
unusedFunction:lz4.c:1459
// LZ4_compress_limitedOutput_withState()
unusedFunction:lz4.c:1343
unusedFunction:lz4.c:1457
// LZ4_compress_withState()
unusedFunction:lz4.c:1332
unusedFunction:lz4.c:1458
// LZ4_create()
unusedFunction:lz4.c:1314
unusedFunction:lz4.c:1489
// LZ4_createStream()
unusedFunction:lz4.c:765
unusedFunction:lz4.c:935
// LZ4_createStreamDecode()
unusedFunction:lz4.c:1152
unusedFunction:lz4.c:1319
// LZ4_decompress_fast_continue()
unusedFunction:lz4.c:1217
unusedFunction:lz4.c:1384
// LZ4_decompress_fast_usingDict()
unusedFunction:lz4.c:1272
unusedFunction:lz4.c:1439
// LZ4_decompress_fast_withPrefix64k()
unusedFunction:lz4.c:1361
unusedFunction:lz4.c:1510
// LZ4_decompress_safe_continue()
unusedFunction:lz4.c:1188
unusedFunction:lz4.c:1355
// LZ4_decompress_safe_forceExtDict()
unusedFunction:lz4.c:1278
unusedFunction:lz4.c:1445
// LZ4_decompress_safe_usingDict()
unusedFunction:lz4.c:1267
unusedFunction:lz4.c:1434
// LZ4_decompress_safe_withPrefix64k()
unusedFunction:lz4.c:1356
unusedFunction:lz4.c:1505
// LZ4_freeStream()
unusedFunction:lz4.c:773
unusedFunction:lz4.c:948
// LZ4_freeStreamDecode()
unusedFunction:lz4.c:1158
unusedFunction:lz4.c:1325
// LZ4_loadDict()
unusedFunction:lz4.c:780
unusedFunction:lz4.c:956
// LZ4_resetStreamState()
unusedFunction:lz4.c:1307
unusedFunction:lz4.c:1482
// LZ4_setStreamDecode()
unusedFunction:lz4.c:1171
unusedFunction:lz4.c:1338
// LZ4_sizeofState()
unusedFunction:lz4.c:1330
unusedFunction:lz4.c:373
// LZ4_sizeofStreamState()
unusedFunction:lz4.c:1299
unusedFunction:lz4.c:1474
// LZ4_slideInputBuffer()
unusedFunction:lz4.c:1321
unusedFunction:lz4.c:1496
// LZ4_uncompress()
unusedFunction:lz4.c:1293
unusedFunction:lz4.c:1468
// LZ4_uncompress_unknownOutputSize()
unusedFunction:lz4.c:1294
unusedFunction:lz4.c:1469
// LZ4_versionNumber()
unusedFunction:lz4.c:428
unusedFunction:lz4.c:371
// The routines in sys_random.c are exact copies from IEEE1364-2005 and
// they have scope warnings that we need to ignore.
+2 -1
View File
@@ -279,7 +279,6 @@ return(ftruncate(fd, length));
static char *fstRealpath(const char *path, char *resolved_path)
{
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __CYGWIN__ || defined HAVE_REALPATH
#if (defined(__MACH__) && defined(__APPLE__))
if(!resolved_path)
{
@@ -297,6 +296,8 @@ if(!resolved_path)
}
return(_fullpath(resolved_path, path, PATH_MAX));
#else
(void)path;
(void)resolved_path;
return(NULL);
#endif
#endif
+418 -269
View File
File diff suppressed because it is too large Load Diff
+141 -96
View File
@@ -1,7 +1,8 @@
/*
LZ4 - Fast LZ compression algorithm
Header File
Copyright (C) 2011-2014, Yann Collet.
Copyright (C) 2011-2015, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
Redistribution and use in source and binary forms, with or without
@@ -28,7 +29,7 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You can contact the author at :
- LZ4 source repository : http://code.google.com/p/lz4/
- LZ4 source repository : https://github.com/Cyan4973/lz4
- LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
*/
#pragma once
@@ -38,22 +39,22 @@ extern "C" {
#endif
/*
* lz4.h provides raw compression format functions, for optimal performance and integration into programs.
* If you need to generate data using an inter-operable format (respecting the framing specification),
* please use lz4frame.h instead.
* lz4.h provides block compression functions, and gives full buffer control to programmer.
* If you need to generate inter-operable compressed data (respecting LZ4 frame specification),
* and can let the library handle its own memory, please use lz4frame.h instead.
*/
/**************************************
Version
* Version
**************************************/
#define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */
#define LZ4_VERSION_MINOR 5 /* for new (non-breaking) interface capabilities */
#define LZ4_VERSION_RELEASE 0 /* for tweaks, bug-fixes, or development */
#define LZ4_VERSION_MINOR 7 /* for new (non-breaking) interface capabilities */
#define LZ4_VERSION_RELEASE 1 /* for tweaks, bug-fixes, or development */
#define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE)
int LZ4_versionNumber (void);
/**************************************
Tuning parameter
* Tuning parameter
**************************************/
/*
* LZ4_MEMORY_USAGE :
@@ -66,77 +67,90 @@ int LZ4_versionNumber (void);
/**************************************
Simple Functions
* Simple Functions
**************************************/
int LZ4_compress (const char* source, char* dest, int sourceSize);
int LZ4_compress_default(const char* source, char* dest, int sourceSize, int maxDestSize);
int LZ4_decompress_safe (const char* source, char* dest, int compressedSize, int maxDecompressedSize);
/*
LZ4_compress() :
Compresses 'sourceSize' bytes from 'source' into 'dest'.
Destination buffer must be already allocated,
and must be sized to handle worst cases situations (input data not compressible)
Worst case size evaluation is provided by function LZ4_compressBound()
inputSize : Max supported value is LZ4_MAX_INPUT_SIZE
return : the number of bytes written in buffer dest
or 0 if the compression fails
LZ4_compress_default() :
Compresses 'sourceSize' bytes from buffer 'source'
into already allocated 'dest' buffer of size 'maxDestSize'.
Compression is guaranteed to succeed if 'maxDestSize' >= LZ4_compressBound(sourceSize).
It also runs faster, so it's a recommended setting.
If the function cannot compress 'source' into a more limited 'dest' budget,
compression stops *immediately*, and the function result is zero.
As a consequence, 'dest' content is not valid.
This function never writes outside 'dest' buffer, nor read outside 'source' buffer.
sourceSize : Max supported value is LZ4_MAX_INPUT_VALUE
maxDestSize : full or partial size of buffer 'dest' (which must be already allocated)
return : the number of bytes written into buffer 'dest' (necessarily <= maxOutputSize)
or 0 if compression fails
LZ4_decompress_safe() :
compressedSize : is obviously the source size
maxDecompressedSize : is the size of the destination buffer, which must be already allocated.
return : the number of bytes decompressed into the destination buffer (necessarily <= maxDecompressedSize)
If the destination buffer is not large enough, decoding will stop and output an error code (<0).
compressedSize : is the precise full size of the compressed block.
maxDecompressedSize : is the size of destination buffer, which must be already allocated.
return : the number of bytes decompressed into destination buffer (necessarily <= maxDecompressedSize)
If destination buffer is not large enough, decoding will stop and output an error code (<0).
If the source stream is detected malformed, the function will stop decoding and return a negative result.
This function is protected against buffer overflow exploits,
and never writes outside of output buffer, nor reads outside of input buffer.
It is also protected against malicious data packets.
This function is protected against buffer overflow exploits, including malicious data packets.
It never writes outside output buffer, nor reads outside input buffer.
*/
/**************************************
Advanced Functions
* Advanced Functions
**************************************/
#define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */
#define LZ4_COMPRESSBOUND(isize) ((unsigned int)(isize) > (unsigned int)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
#define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
/*
LZ4_compressBound() :
Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible)
This function is primarily useful for memory allocation purposes (output buffer size).
This function is primarily useful for memory allocation purposes (destination buffer size).
Macro LZ4_COMPRESSBOUND() is also provided for compilation-time evaluation (stack memory allocation for example).
isize : is the input size. Max supported value is LZ4_MAX_INPUT_SIZE
return : maximum output size in a "worst case" scenario
or 0, if input size is too large ( > LZ4_MAX_INPUT_SIZE)
Note that LZ4_compress_default() compress faster when dest buffer size is >= LZ4_compressBound(srcSize)
inputSize : max supported value is LZ4_MAX_INPUT_SIZE
return : maximum output size in a "worst case" scenario
or 0, if input size is too large ( > LZ4_MAX_INPUT_SIZE)
*/
int LZ4_compressBound(int isize);
int LZ4_compressBound(int inputSize);
/*
LZ4_compress_fast() :
Same as LZ4_compress_default(), but allows to select an "acceleration" factor.
The larger the acceleration value, the faster the algorithm, but also the lesser the compression.
It's a trade-off. It can be fine tuned, with each successive value providing roughly +~3% to speed.
An acceleration value of "1" is the same as regular LZ4_compress_default()
Values <= 0 will be replaced by ACCELERATION_DEFAULT (see lz4.c), which is 1.
*/
int LZ4_compress_fast (const char* source, char* dest, int sourceSize, int maxDestSize, int acceleration);
/*
LZ4_compress_limitedOutput() :
Compress 'sourceSize' bytes from 'source' into an output buffer 'dest' of maximum size 'maxOutputSize'.
If it cannot achieve it, compression will stop, and result of the function will be zero.
This saves time and memory on detecting non-compressible (or barely compressible) data.
This function never writes outside of provided output buffer.
sourceSize : Max supported value is LZ4_MAX_INPUT_VALUE
maxOutputSize : is the size of the destination buffer (which must be already allocated)
return : the number of bytes written in buffer 'dest'
or 0 if compression fails
*/
int LZ4_compress_limitedOutput (const char* source, char* dest, int sourceSize, int maxOutputSize);
/*
LZ4_compress_withState() :
Same compression functions, but using an externally allocated memory space to store compression state.
LZ4_compress_fast_extState() :
Same compression function, just using an externally allocated memory space to store compression state.
Use LZ4_sizeofState() to know how much memory must be allocated,
and then, provide it as 'void* state' to compression functions.
and allocate it on 8-bytes boundaries (using malloc() typically).
Then, provide it as 'void* state' to compression function.
*/
int LZ4_sizeofState(void);
int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize);
int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize);
int LZ4_compress_fast_extState (void* state, const char* source, char* dest, int inputSize, int maxDestSize, int acceleration);
/*
LZ4_compress_destSize() :
Reverse the logic, by compressing as much data as possible from 'source' buffer
into already allocated buffer 'dest' of size 'targetDestSize'.
This function either compresses the entire 'source' content into 'dest' if it's large enough,
or fill 'dest' buffer completely with as much data as possible from 'source'.
*sourceSizePtr : will be modified to indicate how many bytes where read from 'source' to fill 'dest'.
New value is necessarily <= old value.
return : Nb bytes written into 'dest' (necessarily <= targetDestSize)
or 0 if compression fails
*/
int LZ4_compress_destSize (const char* source, char* dest, int* sourceSizePtr, int targetDestSize);
/*
@@ -152,7 +166,6 @@ LZ4_decompress_fast() :
*/
int LZ4_decompress_fast (const char* source, char* dest, int originalSize);
/*
LZ4_decompress_safe_partial() :
This function decompress a compressed block of size 'compressedSize' at position 'source'
@@ -169,9 +182,8 @@ int LZ4_decompress_safe_partial (const char* source, char* dest, int compressedS
/***********************************************
Streaming Compression Functions
* Streaming Compression Functions
***********************************************/
#define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4)
#define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(long long))
/*
@@ -187,7 +199,7 @@ typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
* LZ4_resetStream
* Use this function to init an allocated LZ4_stream_t structure
*/
void LZ4_resetStream (LZ4_stream_t* LZ4_streamPtr);
void LZ4_resetStream (LZ4_stream_t* streamPtr);
/*
* LZ4_createStream will allocate and initialize an LZ4_stream_t structure
@@ -196,7 +208,7 @@ void LZ4_resetStream (LZ4_stream_t* LZ4_streamPtr);
* They are more future proof, in case of a change of LZ4_stream_t size.
*/
LZ4_stream_t* LZ4_createStream(void);
int LZ4_freeStream (LZ4_stream_t* LZ4_streamPtr);
int LZ4_freeStream (LZ4_stream_t* streamPtr);
/*
* LZ4_loadDict
@@ -205,36 +217,31 @@ int LZ4_freeStream (LZ4_stream_t* LZ4_streamPtr);
* Loading a size of 0 is allowed.
* Return : dictionary size, in bytes (necessarily <= 64 KB)
*/
int LZ4_loadDict (LZ4_stream_t* LZ4_streamPtr, const char* dictionary, int dictSize);
int LZ4_loadDict (LZ4_stream_t* streamPtr, const char* dictionary, int dictSize);
/*
* LZ4_compress_continue
* Compress data block 'source', using blocks compressed before as dictionary to improve compression ratio
* Previous data blocks are assumed to still be present at their previous location.
* LZ4_compress_fast_continue
* Compress buffer content 'src', using data from previously compressed blocks as dictionary to improve compression ratio.
* Important : Previous data blocks are assumed to still be present and unmodified !
* 'dst' buffer must be already allocated.
* If maxDstSize >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster.
* If not, and if compressed data cannot fit into 'dst' buffer size, compression stops, and function returns a zero.
*/
int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize);
/*
* LZ4_compress_limitedOutput_continue
* Same as before, but also specify a maximum target compressed size (maxOutputSize)
* If objective cannot be met, compression exits, and returns a zero.
*/
int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize);
int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int maxDstSize, int acceleration);
/*
* LZ4_saveDict
* If previously compressed data block is not guaranteed to remain available at its memory location
* save it into a safer place (char* safeBuffer)
* Note : you don't need to call LZ4_loadDict() afterwards,
* dictionary is immediately usable, you can therefore call again LZ4_compress_continue()
* Return : dictionary size in bytes, or 0 if error
* Note : any dictSize > 64 KB will be interpreted as 64KB.
* dictionary is immediately usable, you can therefore call LZ4_compress_fast_continue()
* Return : saved dictionary size in bytes (necessarily <= dictSize), or 0 if error
*/
int LZ4_saveDict (LZ4_stream_t* LZ4_streamPtr, char* safeBuffer, int dictSize);
int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int dictSize);
/************************************************
Streaming Decompression Functions
* Streaming Decompression Functions
************************************************/
#define LZ4_STREAMDECODESIZE_U64 4
@@ -265,8 +272,18 @@ int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dicti
*_continue() :
These decoding functions allow decompression of multiple blocks in "streaming" mode.
Previously decoded blocks *must* remain available at the memory position where they were decoded (up to 64 KB)
If this condition is not possible, save the relevant part of decoded data into a safe buffer,
and indicate where is its new address using LZ4_setStreamDecode()
In the case of a ring buffers, decoding buffer must be either :
- Exactly same size as encoding buffer, with same update rule (block boundaries at same positions)
In which case, the decoding & encoding ring buffer can have any size, including very small ones ( < 64 KB).
- Larger than encoding buffer, by a minimum of maxBlockSize more bytes.
maxBlockSize is implementation dependent. It's the maximum size you intend to compress into a single block.
In which case, encoding and decoding buffers do not need to be synchronized,
and encoding ring buffer can have any size, including small ones ( < 64 KB).
- _At least_ 64 KB + 8 bytes + maxBlockSize.
In which case, encoding and decoding buffers do not need to be synchronized,
and encoding ring buffer can have any size, including larger than decoding buffer.
Whenever these conditions are not possible, save the last 64KB of decoded data into a safe buffer,
and indicate where it is saved using LZ4_setStreamDecode()
*/
int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int compressedSize, int maxDecompressedSize);
int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int originalSize);
@@ -276,8 +293,8 @@ int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const ch
Advanced decoding functions :
*_usingDict() :
These decoding functions work the same as
a combination of LZ4_setDictDecode() followed by LZ4_decompress_x_continue()
They are stand-alone and don't use nor update an LZ4_streamDecode_t structure.
a combination of LZ4_setStreamDecode() followed by LZ4_decompress_x_continue()
They are stand-alone. They don't need nor update an LZ4_streamDecode_t structure.
*/
int LZ4_decompress_safe_usingDict (const char* source, char* dest, int compressedSize, int maxDecompressedSize, const char* dictStart, int dictSize);
int LZ4_decompress_fast_usingDict (const char* source, char* dest, int originalSize, const char* dictStart, int dictSize);
@@ -285,29 +302,57 @@ int LZ4_decompress_fast_usingDict (const char* source, char* dest, int originalS
/**************************************
Obsolete Functions
* Obsolete Functions
**************************************/
/*
Obsolete decompression functions
These function names are deprecated and should no longer be used.
They are only provided here for compatibility with older user programs.
- LZ4_uncompress is the same as LZ4_decompress_fast
- LZ4_uncompress_unknownOutputSize is the same as LZ4_decompress_safe
These function prototypes are now disabled; uncomment them if you really need them.
It is highly recommended to stop using these functions and migrate to newer ones */
/* Deprecate Warnings */
/* Should these warnings messages be a problem,
it is generally possible to disable them,
with -Wno-deprecated-declarations for gcc
or _CRT_SECURE_NO_WARNINGS in Visual for example.
You can also define LZ4_DEPRECATE_WARNING_DEFBLOCK. */
#ifndef LZ4_DEPRECATE_WARNING_DEFBLOCK
# define LZ4_DEPRECATE_WARNING_DEFBLOCK
# define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
# if (LZ4_GCC_VERSION >= 405) || defined(__clang__)
# define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
# elif (LZ4_GCC_VERSION >= 301)
# define LZ4_DEPRECATED(message) __attribute__((deprecated))
# elif defined(_MSC_VER)
# define LZ4_DEPRECATED(message) __declspec(deprecated(message))
# else
# pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler")
# define LZ4_DEPRECATED(message)
# endif
#endif /* LZ4_DEPRECATE_WARNING_DEFBLOCK */
/* Obsolete compression functions */
/* These functions are planned to start generate warnings by r131 approximately */
int LZ4_compress (const char* source, char* dest, int sourceSize);
int LZ4_compress_limitedOutput (const char* source, char* dest, int sourceSize, int maxOutputSize);
int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize);
int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize);
int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize);
int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize);
/* Obsolete decompression functions */
/* These function names are completely deprecated and must no longer be used.
They are only provided here for compatibility with older programs.
- LZ4_uncompress is the same as LZ4_decompress_fast
- LZ4_uncompress_unknownOutputSize is the same as LZ4_decompress_safe
These function prototypes are now disabled; uncomment them only if you really need them.
It is highly recommended to stop using these prototypes and migrate to maintained ones */
/* int LZ4_uncompress (const char* source, char* dest, int outputSize); */
/* int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize); */
/* Obsolete streaming functions; use new streaming interface whenever possible */
void* LZ4_create (const char* inputBuffer);
int LZ4_sizeofStreamState(void);
int LZ4_resetStreamState(void* state, const char* inputBuffer);
char* LZ4_slideInputBuffer (void* state);
LZ4_DEPRECATED("use LZ4_createStream() instead") void* LZ4_create (char* inputBuffer);
LZ4_DEPRECATED("use LZ4_createStream() instead") int LZ4_sizeofStreamState(void);
LZ4_DEPRECATED("use LZ4_resetStream() instead") int LZ4_resetStreamState(void* state, char* inputBuffer);
LZ4_DEPRECATED("use LZ4_saveDict() instead") char* LZ4_slideInputBuffer (void* state);
/* Obsolete streaming decoding functions */
int LZ4_decompress_safe_withPrefix64k (const char* source, char* dest, int compressedSize, int maxOutputSize);
int LZ4_decompress_fast_withPrefix64k (const char* source, char* dest, int originalSize);
LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize);
LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") int LZ4_decompress_fast_withPrefix64k (const char* src, char* dst, int originalSize);
#if defined (__cplusplus)
+1 -1
View File
@@ -74,7 +74,7 @@ static void my_mcd_rawwrite(PLI_UINT32 mcd, const char*buf, size_t count)
if (fp) {
while (count > 0) {
size_t rc = fwrite(buf, 1, count, fp);
if (rc <= 0) break;
if (rc == 0) break;
count -= rc;
buf += rc;
}
+1
View File
@@ -20,6 +20,7 @@
/* round() is ISO C99 from math.h. This define should enable it. */
# define _ISOC99_SOURCE 1
# define _SVID_SOURCE 1
# define _DEFAULT_SOURCE 1
# include "sys_priv.h"
# include <ctype.h>
+2 -2
View File
@@ -1,7 +1,7 @@
%{
/*
* Copyright (C) 2011-2014 Cary R. ([email protected])
* Copyright (C) 2011-2015 Cary R. ([email protected])
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -228,7 +228,7 @@ void yyerror(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "%s:%u: TABLE ERROR: ", in_file_name,
fprintf(stderr, "%s:%d: TABLE ERROR: ", in_file_name,
yylloc.first_line-1);
vfprintf(stderr, fmt, ap);
va_end(ap);
+1 -1
View File
@@ -156,7 +156,7 @@ static PLI_INT32 ivlh_attribute_event_calltf(ICARUS_VPI_CONST PLI_BYTE8*data)
rval.value.scalar = vpi1;
// Detect if change occured in this moment
// Detect if change occurred in this moment
if (mon->last_event.high != tnow.high)
rval.value.scalar = vpi0;
if (mon->last_event.low != tnow.low)
+4 -1
View File
@@ -645,8 +645,11 @@ void vvp_fun_modpath::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit,
and schedule an event for each partial change. Hard! */
for (unsigned idx = 1 ; idx < bit.size() ; idx += 1) {
vvp_time64_t tmp = delay_from_edge(cur_vec4_.value(idx),
bit.value(0),
bit.value(idx),
out_at);
/* If the current and new bit values match then no delay
* is needed for this bit. */
if (cur_vec4_.value(idx) == bit.value(idx)) continue;
assert(tmp == use_delay);
}
+1 -1
View File
@@ -33,7 +33,7 @@
* port-2: Clock Enable input
* port-3: Asynchronous Set/Clear input.
*
* The base vvp_dff does not implement an asychronous set/clear.
* The base vvp_dff does not implement an asynchronous set/clear.
*/
class vvp_dff : public vvp_net_fun_t {
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2009 Stephen Williams (steve@icarus.com)
* Copyright (c) 2001-2015 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
@@ -63,7 +63,7 @@ static void draw_hex_table(void)
printf(" 'X',");
else
printf(" '%c',", "0123456789abcdef"[bv]);
printf(" '%c',", (unsigned)"0123456789abcdef"[bv]);
if (((idx+1) % 8) == 0)
printf("\n");
@@ -109,7 +109,7 @@ static void draw_oct_table(void)
printf(" 'X',");
else
printf(" '%c',", "01234567"[bv]);
printf(" '%c',", (unsigned)"01234567"[bv]);
if (((idx+1) % 8) == 0)
printf("\n");
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
; Copyright (c) 2001 Stephan Boettcher <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+2 -2
View File
@@ -1,7 +1,7 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; Copyright (c) 2001-2014 Stephen Williams ([email protected])
; Copyright (c) 2001-2015 Stephen Williams ([email protected])
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
:ivl_version "0.10.0" "vec4-stack";
:ivl_version "10.0" "vec4-stack";
:vpi_module "system";
; This program is free software; you can redistribute it and/or modify
+35 -36
View File
@@ -141,46 +141,45 @@ void verify_version(char*ivl_ver, char*commit)
}
delete[] commit;
char*vvp_ver = strdup(VERSION);
char *vp, *ip;
int file_major, file_minor, file_minor2;
char file_extra[128];
/* Check the major/minor version. */
ip = strrchr(ivl_ver, '.');
*ip = '\0';
vp = strrchr(vvp_ver, '.');
*vp = '\0';
if (strcmp(ivl_ver, vvp_ver) != 0) {
vpi_mcd_printf(1, "Error: VVP input file version %s can not "
"be run with run time version %s!\n",
ivl_ver, vvp_ver);
// Old style format: 0.<major>.<minor> <extra>
// This also catches a potential new-new format that has
// another sub-minor number.
file_extra[0] = 0;
int rc = sscanf(ivl_ver, "%d.%d.%d %127s", &file_major, &file_minor, &file_minor2, file_extra);
// If it wasn't the old style format, try the new format:
// <major>.<minor> <extra>
if (rc == 2) {
file_extra[0] = 0;
rc = sscanf(ivl_ver, "%d.%d %127s", &file_major, &file_minor, file_extra);
file_minor2 = 0;
}
delete[] ivl_ver;
// If this was the old format, the file_major will be 0. In
// this case it is not really what we meant, so convert to the
// new format.
if (file_major == 0) {
file_major = file_minor;
file_minor = file_minor2;
file_minor2 = 0;
}
if (VERSION_MAJOR != file_major) {
vpi_mcd_printf(1, "Error: VVP input file %d.%d can not "
"be run with run time version %s\n",
file_major, file_minor, VERSION);
exit(1);
}
/* Check that the sub-version is compatible. */
ip += 1;
vp += 1;
int ivl_sv, vvp_sv;
if (strcmp(ip, "devel") == 0) {
ivl_sv = -1;
} else {
int res = sscanf(ip, "%d", &ivl_sv);
assert(res == 1);
if (VERSION_MINOR < file_minor) {
vpi_mcd_printf(1, "Warning: VVP input file sub version %d.%d"
" is greater than the run time version %s.\n",
file_major, file_minor, VERSION);
}
if (strcmp(vp, "devel") == 0) {
vvp_sv = -1;
} else {
int res = sscanf(vp, "%d", &vvp_sv);
assert(res == 1);
}
if (ivl_sv > vvp_sv) {
if (verbose_flag) vpi_mcd_printf(1, " ... ");
vpi_mcd_printf(1, "Warning: VVP input file sub-version %s is "
"greater than the run time sub-version %s!\n",
ip, vp);
}
delete[] ivl_ver;
free(vvp_ver);
}
int vpip_delay_selection = _vpiDelaySelTypical;
@@ -376,7 +375,7 @@ int main(int argc, char*argv[])
if (version_flag) {
fprintf(stderr, "Icarus Verilog runtime version " VERSION " ("
VERSION_TAG ")\n\n");
fprintf(stderr, "Copyright 1998-2012 Stephen Williams\n\n");
fprintf(stderr, "Copyright 1998-2015 Stephen Williams\n\n");
fprintf(stderr,
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
+1 -1
View File
@@ -170,7 +170,6 @@ void __vpiDarrayVar::put_word_value(struct __vpiArrayWord*word, p_vpi_value vp,
case vpiVectorVal: // 2 vs 4 state logic?
{
int new_bit;
int size = get_word_size();
PLI_INT32 a = 0, b = 0;
vvp_vector4_t new_vec(size);
@@ -178,6 +177,7 @@ void __vpiDarrayVar::put_word_value(struct __vpiArrayWord*word, p_vpi_value vp,
vec--; // it will be increased in the first loop iteration
for(int i = 0; i < size; ++i) {
int new_bit;
if(i % (8 * sizeof(vec->aval)) == 0) {
++vec;
a = vec->aval;
+1 -1
View File
@@ -161,7 +161,7 @@ static unsigned hash_string(const char*text)
unsigned h = 0;
while (*text) {
h = (h << 4) ^ (h >> 28) ^ *text;
h = (h << 4) ^ (h >> 28) ^ (unsigned)*text;
text += 1;
}
return h;
+1 -1
View File
@@ -851,7 +851,7 @@ vvp_vector4_t vec4_from_vpi_value(s_vpi_value*vp, unsigned wid)
case vpiIntVal: {
long vpi_val = vp->value.integer;
for (unsigned idx = 0 ; idx < wid ; idx += 1) {
vvp_bit4_t bit = vpi_val&1 ? BIT4_1 : BIT4_0;
vvp_bit4_t bit = (vpi_val & 1) ? BIT4_1 : BIT4_0;
val.set_bit(idx, bit);
vpi_val >>= 1;
}
+1 -1
View File
@@ -153,7 +153,7 @@ static void timevar_get_value(vpiHandle ref, s_vpi_value*vp, bool is_int_func,
rbuf[num_bits] = 0;
for (unsigned i = 1; i <= num_bits; i++) {
rbuf[num_bits-i] = x & 1 ? '1' : '0';
rbuf[num_bits-i] = (x & 1) ? '1' : '0';
x = x >> 1;
}
+1 -1
View File
@@ -1,4 +1,4 @@
.TH vvp 1 "May 10th, 2015" "" "Version %M.%m.%n %E"
.TH vvp 1 "May 10th, 2015" "" "Version %M.%n %E"
.SH NAME
vvp - Icarus Verilog vvp runtime engine
+4 -4
View File
@@ -3585,10 +3585,10 @@ vvp_scalar_t fully_featured_resolv_(vvp_scalar_t a, vvp_scalar_t b)
has an even wider ambiguity. */
unsigned tmp = 0;
int sv1a = a.value_&0x80 ? STREN1(a.value_) : - STREN1(a.value_);
int sv0a = a.value_&0x08 ? STREN0(a.value_) : - STREN0(a.value_);
int sv1b = b.value_&0x80 ? STREN1(b.value_) : - STREN1(b.value_);
int sv0b = b.value_&0x08 ? STREN0(b.value_) : - STREN0(b.value_);
int sv1a = (a.value_ & 0x80) ? STREN1(a.value_) : - STREN1(a.value_);
int sv0a = (a.value_ & 0x08) ? STREN0(a.value_) : - STREN0(a.value_);
int sv1b = (b.value_ & 0x80) ? STREN1(b.value_) : - STREN1(b.value_);
int sv0b = (b.value_ & 0x08) ? STREN0(b.value_) : - STREN0(b.value_);
int sv1 = sv1a;
int sv0 = sv0a;