Hi Corion..
The code is working fine, but not does my intention function...i modified the code for my need based on your comments as followed...
use strict;
use warnings;
open (IN1, "<design_modify1.vhd") or die;
open (OUT, ">output_file.vhd") or die;
open (IN2, "<nets.txt") or die;
open (IN3, "<enabled_nets.txt") or die;
my @nets = <IN2>;
my @enabled_nets = <IN3>;
chomp @nets;
chomp @enabled_nets;
while (<IN1>) {
print OUT;
foreach my $i (0..$#nets){
print OUT if (s/\=\>\s+$nets[$i]\,/\=\> $enabled_nets[$i]\,/);
#}
}
close (IN1);
close (OUT);
close (IN2);
close (IN3);
I want the output file as follows.. (shown only the modifiable lines)
VCC_i : VCC port map(Y => \VCC\);
sum_1_SUM0_0 : XOR3 port map(A => b_e, B => a_e, C => c_e, Y => su
+m_c);
carry_pad : OUTBUF port map(D => N_5, PAD => carry);
a_pad : INBUF port map(PAD => a, Y => a_c);
but it is printing as follows.. I understood the mistake in the code that since i wrote the print statement inside for loop, it gets only one element of array at a time.. So, do you have any suggestions for this???
VCC_i : VCC port map(Y => \VCC\);
sum_1_SUM0_0 : XOR3 port map(A => b_c, B => a_c, C => c_c, Y => su
+m_c);
sum_1_SUM0_0 : XOR3 port map(A => b_c, B => a_e, C => c_c, Y => su
+m_c);
sum_1_SUM0_0 : XOR3 port map(A => b_e, B => a_e, C => c_c, Y => su
+m_c);
sum_1_SUM0_0 : XOR3 port map(A => b_e, B => a_e, C => c_e, Y => su
+m_c);
carry_pad : OUTBUF port map(D => N_5, PAD => carry);
a_pad : INBUF port map(PAD => a, Y => a_c);
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.