#! /usr/bin/perl use strict; use warnings; if (@ARGV < 2) { die "usage: $0 \n"; } my $binfile = $ARGV[0]; my $ramno = abs(int($ARGV[1])); open BINFILE, "<", $binfile or die "cannot read \"$binfile\": "; binmode BINFILE; print < X\"%02X\",\n", $addr, $d[$ramno]; ++$addr; } print < X"00" ); BEGIN p_ram: PROCESS(clk) BEGIN IF rising_edge(clk) THEN IF i_wr_en = '1' THEN s_buf(to_integer(unsigned(i_addr))) <= i_wr_data; END IF; o_rd_data <= s_buf(to_integer(unsigned(i_addr))); END IF; END PROCESS p_ram; END ARCHITECTURE a_ram_$ramno; EOF close BINFILE;