Wednesday, October 26, 2016

Perl Script to comment unwanted clutter added by Yosys to MSP430 Synthesized Netlist

Hello there,

Following is a small perl script that will help you remove all the unwanted clutter produced by the Yosys Synthesis while MSP430 was synthesized in last post.

#Created By - Alok Govind Dadlani
#Purpose - To remove unwanted clutter from the Synthesized Netlist
#OPENS UP THE FILES ONE IN READ MODE AND LATTER IN WRITE DUE TO '>'
open (FILEHANDLE, "/home/cg/root/Synthesized.v");
open (FILENEWHANDLE, ">/home/cg/root/CleanSynth.v");

#PARSES THROUGH ALL LINES IN SYNTHESIZED NETLIST AND CLEANS IT
for $line (<FILEHANDLE>){
    $line =~ s/\/\/\(\* src = "\/home\/alok\/qflow\/MSP430\//\/\/ /;
    print FILENEWHANDLE $line;
    }

Synthesized.v - Contains Synthesized Netlist
CleanSynth.v - Contains the clean netlist