Firstly this is the input file that Im reading.
module circuit_17 (N1,N2,N3,N6,N7,N22,N23);
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);
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?
@input_A = [ N1 N3 N11 N11 N10 N16 ]
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?