data_type_t: Remove figure_packed_base_type() method
The figure_packed_base_type() method can be used to check whether a type is 2-state or 4-state at parse time. The parser no longer cares about the specific type of a data type. The figure_packed_base_type() function is no longer used, so remove it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
d6337a5bc5
commit
e799a09605
|
|
@ -116,7 +116,7 @@ O = main.o async.o design_dump.o discipline.o dup_expr.o elaborate.o \
|
||||||
net_nex_input.o net_nex_output.o net_proc.o net_scope.o net_tran.o \
|
net_nex_input.o net_nex_output.o net_proc.o net_scope.o net_tran.o \
|
||||||
net_udp.o pad_to_width.o parse.o parse_misc.o pform.o pform_analog.o \
|
net_udp.o pad_to_width.o parse.o parse_misc.o pform.o pform_analog.o \
|
||||||
pform_disciplines.o pform_dump.o pform_package.o pform_pclass.o \
|
pform_disciplines.o pform_dump.o pform_package.o pform_pclass.o \
|
||||||
pform_struct_type.o pform_types.o \
|
pform_types.o \
|
||||||
symbol_search.o sync.o sys_funcs.o verinum.o verireal.o vpi_modules.o target.o \
|
symbol_search.o sync.o sys_funcs.o verinum.o verireal.o vpi_modules.o target.o \
|
||||||
Attrib.o HName.o Module.o PClass.o PDelays.o PEvent.o PExpr.o PFunction.o \
|
Attrib.o HName.o Module.o PClass.o PDelays.o PEvent.o PExpr.o PFunction.o \
|
||||||
PGate.o PGenerate.o PModport.o PNamedItem.o PPackage.o PScope.o PSpec.o \
|
PGate.o PGenerate.o PModport.o PNamedItem.o PPackage.o PScope.o PSpec.o \
|
||||||
|
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2011-2021 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
|
|
||||||
* General Public License as published by the Free Software
|
|
||||||
* Foundation; either version 2 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
# include "pform.h"
|
|
||||||
# include "parse_misc.h"
|
|
||||||
# include "ivl_assert.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
ivl_variable_type_t struct_type_t::figure_packed_base_type(void) const
|
|
||||||
{
|
|
||||||
if (! packed_flag)
|
|
||||||
return IVL_VT_NO_TYPE;
|
|
||||||
|
|
||||||
if (members.get() == 0)
|
|
||||||
return IVL_VT_NO_TYPE;
|
|
||||||
|
|
||||||
ivl_variable_type_t base_type = IVL_VT_BOOL;
|
|
||||||
|
|
||||||
ivl_assert(*this, members.get());
|
|
||||||
for (list<struct_member_t*>::iterator cur = members->begin()
|
|
||||||
; cur != members->end() ; ++ cur) {
|
|
||||||
|
|
||||||
struct_member_t*tmp = *cur;
|
|
||||||
|
|
||||||
ivl_variable_type_t tmp_type = IVL_VT_NO_TYPE;
|
|
||||||
if (tmp->type.get())
|
|
||||||
tmp_type = tmp->type->figure_packed_base_type();
|
|
||||||
|
|
||||||
if (tmp_type == IVL_VT_BOOL) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmp_type == IVL_VT_LOGIC) {
|
|
||||||
base_type = IVL_VT_LOGIC;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Oh no! Member is not a packable type!
|
|
||||||
return IVL_VT_NO_TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return base_type;
|
|
||||||
}
|
|
||||||
|
|
@ -33,37 +33,6 @@ string_type_t::~string_type_t()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ivl_variable_type_t data_type_t::figure_packed_base_type(void) const
|
|
||||||
{
|
|
||||||
return IVL_VT_NO_TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ivl_variable_type_t parray_type_t::figure_packed_base_type(void) const
|
|
||||||
{
|
|
||||||
return base_type->figure_packed_base_type();
|
|
||||||
}
|
|
||||||
|
|
||||||
ivl_variable_type_t vector_type_t::figure_packed_base_type(void) const
|
|
||||||
{
|
|
||||||
return base_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
ivl_variable_type_t enum_type_t::figure_packed_base_type() const
|
|
||||||
{
|
|
||||||
return base_type->figure_packed_base_type();
|
|
||||||
}
|
|
||||||
|
|
||||||
ivl_variable_type_t atom_type_t::figure_packed_base_type() const
|
|
||||||
{
|
|
||||||
switch (type_code) {
|
|
||||||
case TIME:
|
|
||||||
case INT:
|
|
||||||
return IVL_VT_LOGIC;
|
|
||||||
default:
|
|
||||||
return IVL_VT_BOOL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
atom_type_t size_type (atom_type_t::INT, true);
|
atom_type_t size_type (atom_type_t::INT, true);
|
||||||
|
|
||||||
PNamedItem::SymbolType enum_type_t::symbol_type() const
|
PNamedItem::SymbolType enum_type_t::symbol_type() const
|
||||||
|
|
|
||||||
|
|
@ -155,9 +155,6 @@ class data_type_t : public PNamedItem {
|
||||||
public:
|
public:
|
||||||
inline explicit data_type_t() { }
|
inline explicit data_type_t() { }
|
||||||
virtual ~data_type_t() = 0;
|
virtual ~data_type_t() = 0;
|
||||||
// This method is used to figure out the base type of a packed
|
|
||||||
// compound object. Return IVL_VT_NO_TYPE if the type is not packed.
|
|
||||||
virtual ivl_variable_type_t figure_packed_base_type(void)const;
|
|
||||||
// This method is used by the pform dumper to diagnostic dump. The
|
// This method is used by the pform dumper to diagnostic dump. The
|
||||||
// pform_dump dumps type type in pform format, and the debug_dump
|
// pform_dump dumps type type in pform format, and the debug_dump
|
||||||
// prints the output in a linear form.
|
// prints the output in a linear form.
|
||||||
|
|
@ -194,8 +191,6 @@ struct enum_type_t : public data_type_t {
|
||||||
// Return the elaborated version of the type.
|
// Return the elaborated version of the type.
|
||||||
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
||||||
|
|
||||||
ivl_variable_type_t figure_packed_base_type() const;
|
|
||||||
|
|
||||||
SymbolType symbol_type() const;
|
SymbolType symbol_type() const;
|
||||||
|
|
||||||
data_type_t *base_type;
|
data_type_t *base_type;
|
||||||
|
|
@ -209,7 +204,6 @@ struct struct_member_t : public LineInfo {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct struct_type_t : public data_type_t {
|
struct struct_type_t : public data_type_t {
|
||||||
virtual ivl_variable_type_t figure_packed_base_type(void)const;
|
|
||||||
virtual void pform_dump(std::ostream&out, unsigned indent) const;
|
virtual void pform_dump(std::ostream&out, unsigned indent) const;
|
||||||
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
||||||
|
|
||||||
|
|
@ -238,8 +232,6 @@ struct atom_type_t : public data_type_t {
|
||||||
virtual std::ostream& debug_dump(std::ostream&out) const;
|
virtual std::ostream& debug_dump(std::ostream&out) const;
|
||||||
|
|
||||||
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
||||||
|
|
||||||
ivl_variable_type_t figure_packed_base_type() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern atom_type_t size_type;
|
extern atom_type_t size_type;
|
||||||
|
|
@ -262,7 +254,6 @@ struct vector_type_t : public data_type_t {
|
||||||
inline explicit vector_type_t(ivl_variable_type_t bt, bool sf,
|
inline explicit vector_type_t(ivl_variable_type_t bt, bool sf,
|
||||||
std::list<pform_range_t>*pd)
|
std::list<pform_range_t>*pd)
|
||||||
: base_type(bt), signed_flag(sf), integer_flag(false), implicit_flag(false), pdims(pd) { }
|
: base_type(bt), signed_flag(sf), integer_flag(false), implicit_flag(false), pdims(pd) { }
|
||||||
virtual ivl_variable_type_t figure_packed_base_type(void)const;
|
|
||||||
virtual void pform_dump(std::ostream&out, unsigned indent) const;
|
virtual void pform_dump(std::ostream&out, unsigned indent) const;
|
||||||
virtual std::ostream& debug_dump(std::ostream&out) const;
|
virtual std::ostream& debug_dump(std::ostream&out) const;
|
||||||
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
||||||
|
|
@ -293,7 +284,6 @@ struct parray_type_t : public array_base_t {
|
||||||
inline explicit parray_type_t(data_type_t*btype, std::list<pform_range_t>*pd)
|
inline explicit parray_type_t(data_type_t*btype, std::list<pform_range_t>*pd)
|
||||||
: array_base_t(btype, pd) { }
|
: array_base_t(btype, pd) { }
|
||||||
|
|
||||||
virtual ivl_variable_type_t figure_packed_base_type(void)const;
|
|
||||||
virtual void pform_dump(std::ostream&out, unsigned indent) const;
|
virtual void pform_dump(std::ostream&out, unsigned indent) const;
|
||||||
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
ivl_type_t elaborate_type_raw(Design*des, NetScope*scope) const;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue