Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 7736) +++ trunk/scconfig/Rev.h (revision 7737) @@ -1 +1 @@ -static const int myrev = 7564; +static const int myrev = 7737; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 7736) +++ trunk/scconfig/Rev.tab (revision 7737) @@ -1,4 +1,4 @@ -7564 configure new plugins: export_spice, target_spice +7737 configure new plugins: export_spice, target_spice 7469 configure new plugin for non-graphical fawk sheets 7468 configure new plugin for non-graphical tEDAx sheets 7370 configure cleanup: get rid of local "inline" defs Index: trunk/src/plugins/target_spice/Plug.tmpasm =================================================================== --- trunk/src/plugins/target_spice/Plug.tmpasm (revision 7736) +++ trunk/src/plugins/target_spice/Plug.tmpasm (revision 7737) @@ -1,5 +1,6 @@ put /local/rnd/mod {target_spice} put /local/rnd/mod/OBJS [@ + $(PLUGDIR)/target_spice/htcp.o $(PLUGDIR)/target_spice/target_spice.o @] Index: trunk/src/plugins/target_spice/htcp.c =================================================================== --- trunk/src/plugins/target_spice/htcp.c (nonexistent) +++ trunk/src/plugins/target_spice/htcp.c (revision 7737) @@ -0,0 +1,18 @@ +#include "htcp.h" +#define HT(x) htcp_ ## x +static htcp_value_t invalid; +#define HT_INVALID_VALUE invalid +#include +#include + +int htcp_keyeq(htcp_key_t a, htcp_key_t b) +{ + return (a.comp == b.comp) && (a.pinnum == b.pinnum); +} + +unsigned int htcp_keyhash(htcp_key_t a) +{ + return ptrhash(a.comp) ^ longhash(a.pinnum); +} + +#undef HT Index: trunk/src/plugins/target_spice/htcp.h =================================================================== --- trunk/src/plugins/target_spice/htcp.h (nonexistent) +++ trunk/src/plugins/target_spice/htcp.h (revision 7737) @@ -0,0 +1,22 @@ +#ifndef GENHT_HTCP_H +#define GENHT_HTCP_H + +#include + +typedef struct { + csch_acomp_t *comp; + long pinnum; +} htcp_key_t; + +typedef struct { + vtp0_t ports; +} htcp_value_t; + +#define HT(x) htcp_ ## x +#include +#undef HT + +int htcp_keyeq(htcp_key_t a, htcp_key_t b); +unsigned int htcp_keyhash(htcp_key_t a); + +#endif Index: trunk/src/plugins/target_spice/target_spice.c =================================================================== --- trunk/src/plugins/target_spice/target_spice.c (revision 7736) +++ trunk/src/plugins/target_spice/target_spice.c (revision 7737) @@ -53,6 +53,7 @@ #include #include +#include "htcp.h" #include "target_spice_conf.h" #include "conf_internal.c" @@ -64,6 +65,7 @@ ldch_low_parser_t *low_parser; ldch_high_parser_t *high_parser; vtp0_t ssyms; + htcp_t shared_ports; /* key is comp-term, value is a vtp0_t of ports in different slots */ } spicelib_ctx_t; /* per view data */ typedef struct spicelib_s { @@ -268,7 +270,22 @@ return 0; } +fgw_error_t target_spice_compile_project_after(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ +/* csch_hook_call_ctx_t *cctx = argv[0].val.argv0.user_call_ctx;*/ + fgw_obj_t *obj = argv[0].val.argv0.func->obj; + spicelib_ctx_t *ctx = obj->script_data; + csch_view_eng_t *eng = ctx->eng; + csch_abstract_t *abst; + CSCH_HOOK_CONVARG(1, FGW_STRUCT|FGW_PTR, std_cschem_comp_update, abst = argv[1].val.ptr_void); + + /* find all shared ports among components and copy their connections */ + rnd_trace("spice proj after\n"); + +/* htcp_init(&ctx->shared_ports);*/ +} + static int on_load(fgw_obj_t *obj, const char *filename, const char *opts) { spicelib_ctx_t *ctx; @@ -276,7 +293,9 @@ fgw_func_reg(obj, "symbol_name_to_component_name", target_spice_sym2comp); fgw_func_reg(obj, "compile_port", target_spice_compile_port); fgw_func_reg(obj, "compile_component1", target_spice_compile_component1); + fgw_func_reg(obj, "compile_project_after", target_spice_compile_project_after); + /* initialize view-local cache */ obj->script_data = ctx = calloc(sizeof(spicelib_ctx_t), 1); ldch_init(&ctx->spicelibs);