Allow for class objects an class properties.
This commit is contained in:
parent
4568766cff
commit
d8592b1444
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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<perm_string, data_type_t*> properties;
|
||||
|
||||
ivl_type_s* elaborate_type(Design*, NetScope*) const;
|
||||
};
|
||||
|
||||
class property_qualifier_t {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue