Firstly this is the input file that Im reading.
module circuit_17 (N1,N2,N3,N6,N7,N22,N23);
input N1,N2,N3,N6,N7;
output N22,N23;
wire N10,N11,N16,N19;
nand nand2_1 (N10,N1,N3);
nand nand2_2 (N11,N3,N6);
nand nand2_3 (N16,N11,N2);
nand nand2_4 (N19,N11,N7);
nand nand2_5 (N22,N10,N16);
nand nand2_6 (N23,N16,N19);
endmodule
This is a part of the code.
my $gate_DATA = $_;
if (defined($gate_DATA) && ($gate_DATA =~ /(.*) (.*) \((.*),(.*),(
+.*)\);/) && ($gate_DATA !~ /module/) )
{
@gate_type = $1;
@gate_name = $2;
@output_gate = $3;
@input_A = $4;
@input_B = $5;
}
How do I store the gate data so I can access it later? By looping?
For example,
@input_A = [ N1 N3 N11 N11 N10 N16 ]
UPDATE
For gate_name, I managed to capture the whole name which is nand2_1, if I want to just capture the number behind it ( meaning from nand2_1 just capture value 1) , how do I change the way to store it?
-
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.