Modiftying Attributes of Nets created using $module->new_net
Added by Adam Jacobvitz almost 2 years ago
If I create a new net for a module using $module->new_net how can I modify stuff like the name, net_type, width, etc?
I tried doing
$newnet->name = "Name"
and similar things for the other parameters, but it keeps giving me:
Can't modify non-lvalue subroutine call at ./generator.pl line 89, <DATA> line 96.
Type errors, any ideas?
Replies (4)
RE: Modiftying Attributes of Nets created using $module->new_net - Added by Adam Jacobvitz almost 2 years ago
I think I figured it out. I created my net using:
$newnet = $testbench->new_net(name=>$netname, width=>$netwidth, net_type=>$nettype)
Even so, it won't let me set the width even though the name and type gets set fine.
Adam
RE: Modiftying Attributes of Nets created using $module->new_net - Added by Wilson Snyder almost 2 years ago
Width is just msb()-lsb()+1. Thus you need to set the ->lsb(#) and ->msb(#).
RE: Modiftying Attributes of Nets created using $module->new_net - Added by Adam Jacobvitz almost 2 years ago
Thanks! Why doesn't setting the msb and lsb print the [#:#] when using $self->verilog_text?
RE: Modiftying Attributes of Nets created using $module->new_net - Added by Wilson Snyder almost 2 years ago
Sorry, that code changed for SystemVerilog. You also need to set ->data_type("reg [3:0]").
(1-4/4)
![[logo]](/img/veripool_small.png)