Tags Perl
In the hardware design world, there's a thing called "netlist". It's basically a text file specifying all the wires on a card, and what pins they connect. For instance:

NET /$I223/OPEN_CMD(2) R121-1 U80-N5

It is a wire named OPEN_CMD(2), that resides in hierarchy $I223, and connects between pin 1 of R121 (a Resistor), and pin N5 of U80 (a FPGA).

So far so good, now what has Perl got to do with it, right ?

Well, the netlist files are very structural, computer generated files. So, from the first moment I saw a netlist file, my hands "itched" to apply some analysis/processing to them.

The opportunity came yesterday, and even saved heaps of work for people !

Sometimes a netlist must be compared to a slightly modified version of the same netlist. Now, the tool generating the netlist may change the order of pins for some reason, etc. Yesterday we needed to compare two netlists. The first try of a graphical diff was a disaster - most of the lines were different... wtf ? Well, if the order of pins in a line is different, the diff tool shows the lines as different. So, ehm... no problem guys, I'll throw a few lines of Perl, that will sort fields 2+ of each line. Uhm, OK... Now the diff looks better. But oic, some of the hierarchy names changed, while the pins are the same. No problem guys, I'll just remove all hierarchy names. Cool ! The diff looks even better now. But ehm, some nets are split differently to more than one line. No problems, guys, I'll throw in a few Perl lines that will merge all the lines of each net. WOW !

15 minutes of work, 30 lines of Perl, and hours of work saved. MAGIC !!

It's really satisfying to help people this way. They went on excited for a few hours after that. I feel that their praise is a bit undeserved - after all I have a couple of years of Perl experience, and such a thing didn't seem difficult at all. Computers, after all, must work for us, and not the other way around. And Perl just helps us make computers work for us !