Skip to content

Commit

Permalink
do not calculate nexus name unless needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Mar 26, 2007
1 parent 611d2c8 commit fe02214
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
15 changes: 14 additions & 1 deletion t-dll-api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-api.cc,v 1.142 2007/03/02 06:13:22 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.143 2007/03/26 16:51:48 steve Exp $"
#endif

# include "config.h"
# include "StringHeap.h"
# include "t-dll.h"
# include <stdlib.h>
# include <string.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif

static StringHeap api_strings;

/* THE FOLLOWING ARE FUNCTIONS THAT ARE CALLED FROM THE TARGET. */

extern "C" const char*ivl_design_flag(ivl_design_t des, const char*key)
Expand Down Expand Up @@ -1139,9 +1142,16 @@ extern "C" ivl_signal_t ivl_lval_sig(ivl_lval_t net)
}
}

/*
* The nexus name is rarely needed. (Shouldn't be needed at all!) This
* function will calculate the name if it is not already calculated.
*/
extern "C" const char* ivl_nexus_name(ivl_nexus_t net)
{
assert(net);
if (net->name_ == 0) {
net->name_ = api_strings.add(net->nexus_->name());
}
return net->name_;
}

Expand Down Expand Up @@ -1950,6 +1960,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)

/*
* $Log: t-dll-api.cc,v $
* Revision 1.143 2007/03/26 16:51:48 steve
* do not calculate nexus name unless needed.
*
* Revision 1.142 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
Expand Down
10 changes: 7 additions & 3 deletions t-dll.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.166 2007/03/02 06:13:22 steve Exp $"
#ident "$Id: t-dll.cc,v 1.167 2007/03/26 16:51:49 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -1920,7 +1920,7 @@ void dll_target::scope(const NetScope*net)
unsigned i;
scope = NULL;
for (i = 0; i < des_.nroots_ && scope == NULL; i++) {
if (strcmp(des_.roots_[i]->name_, net->name().c_str()) == 0)
if (strcmp(des_.roots_[i]->name_, net->basename()) == 0)
scope = des_.roots_[i];
}
assert(scope);
Expand Down Expand Up @@ -2127,7 +2127,8 @@ void dll_target::signal(const NetNet*net)
}
} else {
ivl_nexus_t tmp = nexus_sig_make(obj, idx);
tmp->name_ = strings_.add(nex->name());
tmp->nexus_ = nex;
tmp->name_ = 0;
nex->t_cookie(tmp);
if (obj->array_words > 1)
obj->pins[idx] = tmp;
Expand Down Expand Up @@ -2199,6 +2200,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };

/*
* $Log: t-dll.cc,v $
* Revision 1.167 2007/03/26 16:51:49 steve
* do not calculate nexus name unless needed.
*
* Revision 1.166 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
Expand Down
6 changes: 5 additions & 1 deletion t-dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.h,v 1.139 2007/03/02 06:13:22 steve Exp $"
#ident "$Id: t-dll.h,v 1.140 2007/03/26 16:51:49 steve Exp $"
#endif

# include "target.h"
Expand Down Expand Up @@ -480,6 +480,7 @@ struct ivl_nexus_ptr_s {
struct ivl_nexus_s {
unsigned nptr_;
struct ivl_nexus_ptr_s*ptrs_;
const Nexus*nexus_;
const char*name_;
void*private_data;
};
Expand Down Expand Up @@ -669,6 +670,9 @@ struct ivl_statement_s {

/*
* $Log: t-dll.h,v $
* Revision 1.140 2007/03/26 16:51:49 steve
* do not calculate nexus name unless needed.
*
* Revision 1.139 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
Expand Down

0 comments on commit fe02214

Please sign in to comment.