diff --git a/elab_type.cc b/elab_type.cc index 8df9fa15a..779bb1e9a 100644 --- a/elab_type.cc +++ b/elab_type.cc @@ -19,6 +19,7 @@ # include "pform_types.h" # include "netlist.h" +# include "netclass.h" # include "netdarray.h" # include "netscalar.h" # include "netvector.h" @@ -71,6 +72,11 @@ ivl_type_s* atom2_type_t::elaborate_type(Design*des, NetScope*) const } } +ivl_type_s* class_type_t::elaborate_type(Design*des, NetScope*scope) const +{ + return scope->find_class(name); +} + ivl_type_s* real_type_t::elaborate_type(Design*, NetScope*) const { switch (type_code) { diff --git a/pform_types.h b/pform_types.h index adfa050eb..3de4bf83a 100644 --- a/pform_types.h +++ b/pform_types.h @@ -212,8 +212,9 @@ struct class_type_t : public data_type_t { void pform_dump(std::ostream&out, unsigned indent) const; perm_string name; - std::map properties; + + ivl_type_s* elaborate_type(Design*, NetScope*) const; }; class property_qualifier_t { diff --git a/tgt-vvp/stmt_assign.c b/tgt-vvp/stmt_assign.c index 748cc7a88..cf61c32cc 100644 --- a/tgt-vvp/stmt_assign.c +++ b/tgt-vvp/stmt_assign.c @@ -889,6 +889,14 @@ static int show_stmt_assign_sig_cobject(ivl_statement_t net) fprintf(vvp_out, " %%store/prop/obj %d;\n", prop_idx); fprintf(vvp_out, " %%pop/obj 1;\n"); + } else if (ivl_type_base(prop_type) == IVL_VT_CLASS) { + + /* The property is a class object. */ + fprintf(vvp_out, " %%load/obj v%p_0;\n", sig); + draw_eval_object(rval); + fprintf(vvp_out, " %%store/prop/obj %d;\n", prop_idx); + fprintf(vvp_out, " %%pop/obj 1;\n"); + } else { fprintf(vvp_out, " ; ERROR: ivl_type_base(prop_type) = %d\n", ivl_type_base(prop_type));