Allow `parameter` in generate blocks for SystemVerilog
SystemVerilog allows to use the `parameter` keyword in a generate
block. If used in a generate block it behaves like a `localparam` and
cannot be overridden.
This is described in section 27.2 ("Generate constructs - Overview") of the
LRM (1800-2017).
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
9f5ad34e35
commit
9a94e6b43b
7
pform.cc
7
pform.cc
|
|
@ -3236,9 +3236,14 @@ void pform_set_parameter(const struct vlltype&loc,
|
|||
bool overridable = !is_local;
|
||||
|
||||
if (scope == pform_cur_generate && !is_local) {
|
||||
VLerror("parameter declarations are not permitted in generate blocks");
|
||||
if (!gn_system_verilog()) {
|
||||
VLerror(loc, "parameter declarations are not permitted in generate blocks");
|
||||
return;
|
||||
}
|
||||
// SystemVerilog allows `parameter` in generate blocks, but it has
|
||||
// the same semantics as `localparam` in that scope.
|
||||
overridable = false;
|
||||
}
|
||||
|
||||
assert(expr);
|
||||
Module::param_expr_t*parm = new Module::param_expr_t();
|
||||
|
|
|
|||
Loading…
Reference in New Issue