From 8247d3ef458fcdc33c5738fc3d613fc2c696ef4e Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Wed, 14 Oct 2009 21:40:15 -0700 Subject: [PATCH] The .alias for nets is no longer useful. In the olden days, the .alias was necessary to create a net name that is an alias to an existing net in the netlist. But now that the .net no longer creates a node in the netlist, ALL .net objects are aliases of a sort, so this (mis)feature gets in the way. --- tgt-vvp/vvp_scope.c | 22 +++++++++++++++------- vvp/compile.h | 6 ------ vvp/lexor.lex | 1 - vvp/parse.y | 14 +------------- vvp/words.cc | 17 ----------------- 5 files changed, 16 insertions(+), 44 deletions(-) diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index f76964231..4d5204661 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -544,14 +544,22 @@ static void draw_net_in_scope(ivl_signal_t sig) /* Finally, we may have an alias that is a word connected to another word. Again, this is a case of port collapsing. */ + int strength_aware_flag = 0; + const char*vec8 = ""; + if (nex_data->flags&VVP_NEXUS_DATA_STR) + strength_aware_flag = 1; + if (nex_data->drivers_count > 1) + vec8 = "8"; + if (strength_aware_flag) + vec8 = "8"; - /* For the alias, create a different kind of node - that refers to the alias source data instead of - holding our own data. */ - fprintf(vvp_out, "v%p_%u .alias%s \"%s\", %d %d, v%p_%u;\n", - sig, iword, datatype_flag, - vvp_mangle_name(ivl_signal_basename(sig)), - msb, lsb, nex_data->net, nex_data->net_word); + fprintf(vvp_out, "v%p_%u .net%s%s %s\"%s\", %d %d, %s;" + " alias, %u drivers%s\n", + sig, iword, vec8, datatype_flag, local_flag, + vvp_mangle_name(ivl_signal_basename(sig)), + msb, lsb, driver, + nex_data->drivers_count, + strength_aware_flag?", strength-aware":""); } } } diff --git a/vvp/compile.h b/vvp/compile.h index 26a0c277a..f4dfd8ebd 100644 --- a/vvp/compile.h +++ b/vvp/compile.h @@ -451,12 +451,6 @@ extern void compile_netw_real(char*label, char*array_symbol, int msb, int lsb, unsigned argc, struct symb_s*argv); -extern void compile_alias(char*label, char*name, - int msb, int lsb, bool signed_flag, - unsigned argc, struct symb_s*argv); -extern void compile_alias_real(char*label, char*name, - int msb, int lsb, - unsigned argc, struct symb_s*argv); extern void compile_aliasw(char*label, char*array_symbol, unsigned long array_addr, int msb, int lsb, unsigned argc, struct symb_s*argv); diff --git a/vvp/lexor.lex b/vvp/lexor.lex index 3fa7ecc7c..67a8cef02 100644 --- a/vvp/lexor.lex +++ b/vvp/lexor.lex @@ -101,7 +101,6 @@ static char* strdupnew(char const *str) /* These are some keywords that are recognized. */ ".alias" { return K_ALIAS; } ".alias/real" { return K_ALIAS_R; } -".alias/s" { return K_ALIAS_S; } ".abs" { return K_ARITH_ABS; } ".arith/div" { return K_ARITH_DIV; } ".arith/div.r" { return K_ARITH_DIV_R; } diff --git a/vvp/parse.y b/vvp/parse.y index 7efba3f31..73eef8860 100644 --- a/vvp/parse.y +++ b/vvp/parse.y @@ -65,7 +65,7 @@ static struct __vpiModPath*modpath_dst = 0; vvp_delay_t*cdelay; }; -%token K_A K_ALIAS K_ALIAS_S K_ALIAS_R +%token K_A K_ALIAS K_ALIAS_R %token K_ARITH_ABS K_ARITH_DIV K_ARITH_DIV_R K_ARITH_DIV_S K_ARITH_MOD %token K_ARITH_MOD_R K_ARITH_MOD_S %token K_ARITH_MULT K_ARITH_MULT_R K_ARITH_SUB K_ARITH_SUB_R @@ -661,18 +661,6 @@ statement ',' symbols_net ';' { compile_net_real($1, $4, $6, $7, $3, $9.cnt, $9.vect); } - | T_LABEL K_ALIAS T_STRING ',' signed_t_number signed_t_number - ',' symbols_net ';' - { compile_alias($1, $3, $5, $6, false, $8.cnt, $8.vect); } - - | T_LABEL K_ALIAS_S T_STRING ',' signed_t_number signed_t_number - ',' symbols_net ';' - { compile_alias($1, $3, $5, $6, true, $8.cnt, $8.vect); } - - | T_LABEL K_ALIAS_R T_STRING ',' signed_t_number signed_t_number - ',' symbols_net ';' - { compile_alias_real($1, $3, $5, $6, $8.cnt, $8.vect); } - /* Arrayed versions of net directives. */ | T_LABEL K_NET T_SYMBOL T_NUMBER ',' diff --git a/vvp/words.cc b/vvp/words.cc index cc0342753..a4a3686ab 100644 --- a/vvp/words.cc +++ b/vvp/words.cc @@ -485,20 +485,3 @@ void compile_aliasw(char*label, char*array_label, unsigned long array_addr, free(argv[0].text); free(argv); } - -/* - * The .alias is practically identical to a .net. We create all the - * VPI stuff for the new name (and put it in the local scope) but - * reference the node in the net. - */ -void compile_alias(char*label, char*name, int msb, int lsb, bool signed_flag, - unsigned argc, struct symb_s*argv) -{ - __compile_net(label, name, 0, 0, msb, lsb, signed_flag, false, false, argc, argv); -} - -void compile_alias_real(char*label, char*name, int msb, int lsb, - unsigned argc, struct symb_s*argv) -{ - __compile_real(label, name, 0, 0, msb, lsb, false, argc, argv); -}