URL
https://opencores.org/ocsvn/z80soc/z80soc/trunk
[/] [z80soc/] [tags/] [z80soc05/] [ROM/] [convrom.sh] - Diff between revs 20 and 31
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 20 |
Rev 31 |
#/bin/sh
|
#/bin/sh
|
file=rom.hex
|
file=rom.hex
|
echo "library IEEE;
|
echo "library IEEE;
|
use IEEE.std_logic_1164.all;
|
use IEEE.std_logic_1164.all;
|
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
|
|
entity rom is
|
entity rom is
|
port(
|
port(
|
Clk : in std_logic;
|
Clk : in std_logic;
|
A : in std_logic_vector(15 downto 0);
|
A : in std_logic_vector(15 downto 0);
|
D : out std_logic_vector(7 downto 0)
|
D : out std_logic_vector(7 downto 0)
|
);
|
);
|
end rom;
|
end rom;
|
|
|
architecture rtl of rom is
|
architecture rtl of rom is
|
begin
|
begin
|
|
|
process (Clk)
|
process (Clk)
|
begin
|
begin
|
if Clk'event and Clk = '1' then
|
if Clk'event and Clk = '1' then
|
case A is" > rom.vhd
|
case A is" > rom.vhd
|
|
|
|
|
ADDR=0
|
ADDR=0
|
for i in `cat $file | tr ',' ' '`
|
for i in `cat $file | tr ',' ' '`
|
do
|
do
|
BL1="when x\""
|
BL1="when x\""
|
BL3="\" => D <= x\"$i\";"
|
BL3="\" => D <= x\"$i\";"
|
hexaddr="000"`echo "obase=16;ibase=10;$ADDR" | bc`
|
hexaddr="000"`echo "obase=16;ibase=10;$ADDR" | bc`
|
fixhexaddr=${hexaddr:(-4)}
|
fixhexaddr=${hexaddr:(-4)}
|
echo " "$BL1$fixhexaddr$BL3 >>rom.vhd
|
echo " "$BL1$fixhexaddr$BL3 >>rom.vhd
|
echo $fixhexaddr" "$i
|
echo $fixhexaddr" "$i
|
let ADDR=ADDR+1
|
let ADDR=ADDR+1
|
done
|
done
|
echo " when others => D <= x\"00\";
|
echo " when others => D <= x\"00\";
|
end case;
|
end case;
|
end if;
|
end if;
|
end process;
|
end process;
|
end;" >> rom.vhd
|
end;" >> rom.vhd
|
|
|
cat rom.vhd
|
cat rom.vhd
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.