OpenCores
URL https://opencores.org/ocsvn/z80soc/z80soc/trunk

Subversion Repositories z80soc

[/] [z80soc/] [trunk/] [V0.7/] [rom/] [hex2rombin.sh] - Blame information for rev 39

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 34 rrred
#!/bin/sh
2
file=rom.hex
3
echo "library IEEE;
4
use IEEE.std_logic_1164.all;
5
use ieee.numeric_std.all;
6
 
7
entity rom is
8
        port(
9
                Clk : in std_logic;
10
                A   : in std_logic_vector(13 downto 0);
11
                D   : out std_logic_vector(7 downto 0)
12
        );
13
end rom;
14
 
15
architecture rtl of rom is
16
begin
17
 
18
process (Clk)
19
begin
20
 if Clk'event and Clk = '1' then
21
        case A is"
22
 
23
 
24
ADDR=0
25
for i in `cat $file | tr ',' ' '`
26
do
27
  BL1="when \""
28
  BL3="\" => D <= x\"$i\";"
29
  binaddr="000000000000000"`echo "obase=2;ibase=10;$ADDR" | bc`
30
  fixhexaddr=${binaddr:(-14)}
31
  echo "             "$BL1$fixhexaddr$BL3
32
  let ADDR=ADDR+1
33
done
34
echo "             when others => D <= \"ZZZZZZZZ\";
35
        end case;
36
 end if;
37
end process;
38
end;"
39
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.