#! /usr/bin/perl use strict; use warnings; if (@ARGV < 1) { die "usage: $0 \n"; } my $binfile = $ARGV[0]; open BINFILE, "<", $binfile or die "cannot read \"$binfile\": "; binmode BINFILE; print < X\"%02X%02X%02X%02X\",\n", $addr, $d[3], $d[2], $d[1], $d[0]; ++$addr; } print < X"00000000" ); BEGIN p_rom: PROCESS(clk) BEGIN IF rising_edge(clk) THEN o_data <= s_buf(to_integer(unsigned(i_addr))); END IF; END PROCESS p_rom; END ARCHITECTURE a_rom; EOF