I am using the script below to find and replace while comparing variable names. Basically there are two sperate files where I extract a register name. When two registers match I need the register name to replaced with an old name. the problem with the script below is that it will do the replace...
Sorry, I should have explained more thouroughly. The code is looking for all the information i need for the first "block" of information. Then I need to go to the second file to see if it matches with a block in the second file. The code as is will compare the first register name from the first...
How would I reenter a while loop within a while loop. So far my code reads a line from the first file and checks the first line of the second file to see if they are the same. If they do not match the next line of the 1st file is read, but I need the 2nd line of the first file to be read. Thus...
Thanks Kevin. Sorry for not being more specific but I need the code to count the number of signals without specifying the signal name. In other words I have a hash and the code would count the instances were a signal is repeated without knowing a specific signal to look for. Is this possible?
I have a list of strings that are being extracted by pattern matching. I would like to count the number of times any particular string is repeated. I have no idea whether I should store the strings to an array or print to a text file. Any ideas?
Sample Data
pad1
sigA_1[1]
input
pad2
sigB
output...
Sorry forgot the sample data...
Input:
signal1 Input "comments"
signalA Input
signal2 Output "comments"
signalB Output
This is the format I get from my code:
Module name(
signal1
signalA
signal2
signalB
);
input signal 1
input signal A
output signal 2
output signal B
Endmodule
Thanks guys! I was actually able to figure something out. The code posted below seemed to work (minus the comments). Also rharsh I doesn't need to be sorted. Thank you again!!
#!/usr/bin/perl
open ( MYFILE, '<Netlist.txt' );
open ( OUTFILE, '>Verilog.txt' );
$name = <STDIN>;
chomp($name)...
Hi KevinADC,
I assure you this is not schoolwork. The data is made up I acutally need this to expedite the process of writing Verilog code which contains signals, direction, and comments. I am taking the netlist, sorting by direction and would like to use Perl to output the verilog format. Due...
I have outlined the steps I want to take to get the code but since i just started learning the language last week, it has been a challange. Here is what I have so far.
#!/usr/bin/perl
open ( MYFILE, '<in.txt' );
open ( OUTFILE, '>out.txt' );
$name = <STDIN>;
chomp($name);
print OUTFILE...
I am new to Perl so this may be a rather simple task, but I have tab delimited text file that I need to parse through(except the comments that have quotations). For example if I have the following data in a text file what would be the best way to write a script that would output the data in a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.