Skip to content

Instantly share code, notes, and snippets.

@jimmysitu
Created November 11, 2019 13:27
Show Gist options
  • Save jimmysitu/dea9b5c2670a1318fdb721d8be2c8fca to your computer and use it in GitHub Desktop.
Save jimmysitu/dea9b5c2670a1318fdb721d8be2c8fca to your computer and use it in GitHub Desktop.
Split verilog modules with their module name as file name
#!/usr/bin/perl -w
use Verilog::EditFiles;
use Getopt::Long qw( :config posix_default bundling no_ignore_case );
my $outdir = '';
my $infile = '';
GetOptions ('o=s' => \$outdir, 'i=s' => \$infile);
my $split = Verilog::EditFiles->new(
outdir => $outdir,
translate_synthesis => 0,
lint_header => undef,
celldefine => 1,
);
$split->read_and_split($infile);
$split->write_files();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment