# If instrumented net is a vector we will need an intermediate bus
if(defined($net->msb)){
$driver_is_vector=1;
# If port is vector change type of existing non-instrumented input to wire -
# practically transforming it to an ordinary wire that can easily be intrumented
$connection->net->net_type("wire");
$connection->net->port(undef);
$logger->debug("Transforming previous port named \"".$connection->name."\" into an ordinary wire");
}
# FIXME: rename port in instantiation of current module
$logger->warn("Instantiation of module \"".$mod->name."\" needs to change port \"".$connection->name."\" to \"$net_name_tmp\" - not supported yet...");
# if ($mod->is_top) {
# FIXME: add naming information for wrapper generator
# } else {
# }
# Change type of existing non-instrumented input to wire -
# practically transforming it to an ordinary wire that can easily be intrumented.
$logger->debug("Transforming previous port named \"".$connection->name."\" into an ordinary wire");
$connection->net->decl_type(undef);
$connection->net->net_type("wire");
# Unsetting the port<->net inter-references forces their automatic re-setting at link time
$connection->net->port(undef);
$connection->net(undef);
# Eventually connect this port to the intermediate net by changing its name
$logger->debug("Connecting (input) port \"".$connection->name."\" to intermediate net \"$net_name_tmp\"");
$connection->name($net_name_tmp);
$connection->name($net_name_tmp);# NB: this will automatically change the cell's configuration on the next link() call.
$logger->debug("Generating intermediate ".($driver_is_port?'port':'wire')." named \"".$net_name_tmp."[".$net->msb.":".$net->lsb."]\" to patch \"$net_name\"");
push(@net_cfg,
msb=>$net->msb,
lsb=>$net->lsb,
);
# For ports we don't need to do that ourselves because Verilog::Perl will
# generate a new apropriate net when linking the port.
if($driver_is_port){
$logger->debug("Intermediate ".($driver_is_port?'port':'wire')." named \"".$net_name_tmp.(defined($net->msb)?"[".$net->msb.":".$net->lsb."]":"")."\" to patch \"$net_name\" will be generated automatically later");
}else{
$logger->debug("Generating intermediate ".($driver_is_port?'port':'wire')." named \"".$net_name_tmp."\" to patch \"$net_name\"");
# If the driver is a vector then we will generate a vectored intermediate net as well.
# However, if the driver is a single-bit net or a single bit of a vector we generate
# a simple intermediate net (and could get away with none at all actually).
my@net_cfg=(name=>$net_name_tmp);
if($driver_is_vector){
$logger->debug("Generating intermediate wire named \"".$net_name_tmp."[".$net->msb.":".$net->lsb."]\" to patch \"$net_name\"");
push(@net_cfg,
msb=>$net->msb,
lsb=>$net->lsb,
);
}else{
$logger->debug("Generating intermediate wire named \"".$net_name_tmp."\" to patch \"$net_name\"");
}
$mod->new_net(@net_cfg);
}
$net_tmp=$mod->new_net(@net_cfg,);
# 3+4.) Assign injected (and uninjected bits of vectors) to previous signal.
# Below we assign the altered signal from the FIC to the original signal.
...
...
@@ -682,15 +681,14 @@ sub instrument_net {
if(!defined($net->msb)){
# If the instrumented net is not a vector we simply assign the injected signal