Don't allow localparams to be overridden (GitHub issue #157)
Currently we only issue a warning if a parameter override references
a parameter that doesn't exist, so do the same in this case.
(cherry picked from commit 42422d9940)
This commit is contained in:
parent
ce7f28202a
commit
52b497f74c
18
net_scope.cc
18
net_scope.cc
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2014 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2000-2017 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -300,16 +300,16 @@ bool NetScope::auto_name(const char*prefix, char pad, const char* suffix)
|
||||||
*/
|
*/
|
||||||
bool NetScope::replace_parameter(perm_string key, PExpr*val, NetScope*scope)
|
bool NetScope::replace_parameter(perm_string key, PExpr*val, NetScope*scope)
|
||||||
{
|
{
|
||||||
bool flag = false;
|
if (parameters.find(key) == parameters.end())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (parameters.find(key) != parameters.end()) {
|
param_expr_t&ref = parameters[key];
|
||||||
param_expr_t&ref = parameters[key];
|
if (ref.local_flag)
|
||||||
ref.val_expr = val;
|
return false;
|
||||||
ref.val_scope = scope;
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return flag;
|
ref.val_expr = val;
|
||||||
|
ref.val_scope = scope;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NetScope::make_parameter_unannotatable(perm_string key)
|
bool NetScope::make_parameter_unannotatable(perm_string key)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue