Handy Software-related Tips (Part 1)
Intro
Welcome to my little website! This is my very first post. On this site I would share some interesting ‘IC-related gadgets’ that I find useful during my current work as a digital verification intern. Stay tuned for my casual scribblings if you’d like!
Overview
As a hardware engineer, apart from mastering HDL like Verilog and VerilogA etc., understanding one or two software programming languages of personal preference is also important.
It is agreed that when conducting engineering projects in real practice, description files of which don’t often appear in a concise format. Thus the application of file-processing programs via certain programming languages (e.g Perl) which could convert the original file into a more easy-to-read one (e.g an excel file) becomes necessary.
Additionally, in projects of large scales, Makefile shows great significance for its ability to lessen operation repetitions and therefore facilitating workflow as well as reducing workload. I’ll elaborate on this matter along with practical operations in FPGA verification as examples in future posts, maybe after I blather a bit about useful Linux commands and gvim in my next few posts.
Perl
Perl, short for Practical Extraction and Report Language, is a high-level, general-purpose, interpreted, dynamic programming language. When it comes to accessing files, Perl could be a choice worthy of consideration.
Original File
To begin with, let’s take a glance at what the original description file of an FPGA chip (sensitive information hidden) assigned to me for verification operations looks like.
Perl Codes
Below is the code snippet of a program I wrote to process the description file.
It is worth mentioning that the description file leaves certain numbers of rows containing different amounts of consecutive ‘#’s between the tables and sections describing corresponding contents. Such characteristic could not be fully displayed for confidentiality reasons.
1 | use strict; |
As annotated, this perl program takes in a file specified by Linux command as input, filters and aligns its contents and outputs an Excel file correspondingly.
Output
Feed it with the description file we’re given, and this is what we get.