Index: util_compile.c =================================================================== --- util_compile.c (revision 10128) +++ util_compile.c (revision 10129) @@ -34,6 +34,8 @@ #include "abstract.h" #include "compile.h" #include "libcschem.h" +#include "engine.h" +#include "actions_csch.h" #include "util_compile.h" @@ -129,10 +131,12 @@ return dst; } -int csch_cmp_nameconn_port_net(csch_acomp_t *comp, const char *portname, const char *netname, int require_conn) +int csch_cmp_nameconn_port_net(csch_project_t *project, csch_acomp_t *comp, const char *portname, const char *netname, int require_conn, int view_id, csch_hier_path_t *hpath) { csch_aport_t *port = csch_aport_get(comp->hdr.abst, comp, portname, 1); csch_anet_t *net; /* net from the argument */ + csch_ascope_t scope; + const char *name_glob, *name_loc; if (port == NULL) { rnd_message(RND_MSG_ERROR, "Component '%s' doesn't contain port named '%s'\n", comp->name, portname); @@ -139,9 +143,20 @@ return -1; } - net = csch_anet_get_at(comp->hdr.abst, comp->hlev, CSCH_ASCOPE_unknown, netname); + scope = csch_split_name_scope(&netname); + +TODO("hierarchic: enable this once we get hpath"); +#if 0 + /* Translate name, including hierarchical address prefixes */ + csch_eng_call_namemod(project, view_id, CSCH_ENGHK_ATTRIB_NET_NAME_TO_NET_NAME, + &name_glob, &name_loc, netname, FGW_COBJ, comp, FGW_HPATH, hpath, FGW_INVALID); +#else + name_loc = name_glob = netname; +#endif + + net = csch_anet_get_at(comp->hdr.abst, comp->hlev, scope, name_loc); if (net == NULL) - net = csch_anet_new(comp->hdr.abst, comp->hlev, CSCH_ASCOPE_unknown, netname, netname, 0); + net = csch_anet_new(comp->hdr.abst, comp->hlev, scope, name_loc, name_glob, 0); if (net == NULL) { rnd_message(RND_MSG_ERROR, "Netname '%s' does not exist\n", netname);