Emit "sorry" message for unpacked array parameter declarations (issue #1180)
These aren't yet supported. Make it an error if not compiling fpr a SystemVerilog generation.
This commit is contained in:
parent
aec18a6c19
commit
b2eaedfc94
4
parse.y
4
parse.y
|
|
@ -5550,9 +5550,9 @@ parameter_assign_list
|
|||
;
|
||||
|
||||
parameter_assign
|
||||
: IDENTIFIER initializer_opt parameter_value_ranges_opt
|
||||
: IDENTIFIER dimensions_opt initializer_opt parameter_value_ranges_opt
|
||||
{ pform_set_parameter(@1, lex_strings.make($1), param_is_local,
|
||||
param_is_type, param_data_type, $2, $3);
|
||||
param_is_type, param_data_type, $2, $3, $4);
|
||||
delete[]$1;
|
||||
}
|
||||
;
|
||||
|
|
|
|||
11
pform.cc
11
pform.cc
|
|
@ -2896,8 +2896,8 @@ static void pform_set_type_parameter(const struct vlltype&loc, perm_string name,
|
|||
|
||||
void pform_set_parameter(const struct vlltype&loc,
|
||||
perm_string name, bool is_local, bool is_type,
|
||||
data_type_t*data_type, PExpr*expr,
|
||||
LexicalScope::range_t*value_range)
|
||||
data_type_t*data_type, list<pform_range_t>*udims,
|
||||
PExpr*expr, LexicalScope::range_t*value_range)
|
||||
{
|
||||
LexicalScope*scope = lexical_scope;
|
||||
if (is_compilation_unit(scope) && !gn_system_verilog()) {
|
||||
|
|
@ -2925,6 +2925,13 @@ void pform_set_parameter(const struct vlltype&loc,
|
|||
return;
|
||||
}
|
||||
|
||||
if (udims) {
|
||||
if (pform_requires_sv(loc, "unpacked array parameter")) {
|
||||
VLerror(loc, "sorry: unpacked array parameters are not supported yet.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool overridable = !is_local;
|
||||
|
||||
if (scope == pform_cur_generate && !is_local) {
|
||||
|
|
|
|||
4
pform.h
4
pform.h
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef IVL_pform_H
|
||||
#define IVL_pform_H
|
||||
/*
|
||||
* Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1998-2024 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
|
||||
|
|
@ -403,7 +403,7 @@ extern LexicalScope::range_t* pform_parameter_value_range(bool exclude_flag,
|
|||
extern void pform_set_parameter(const struct vlltype&loc,
|
||||
perm_string name,
|
||||
bool is_local, bool is_type,
|
||||
data_type_t*data_type,
|
||||
data_type_t*data_type, std::list<pform_range_t>*udims,
|
||||
PExpr*expr, LexicalScope::range_t*value_range);
|
||||
extern void pform_set_specparam(const struct vlltype&loc,
|
||||
perm_string name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue