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

Subversion Repositories z80soc

[/] [z80soc/] [trunk/] [V0.6/] [DE1/] [ROM/] [hex2rom.sh] - Blame information for rev 40

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 40 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(15 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 x\""
28
  BL3="\" => D <= x\"$i\";"
29
  hexaddr="000"`echo "obase=16;ibase=10;$ADDR" | bc`
30
  fixhexaddr=${hexaddr:(-4)}
31
  echo "             "$BL1$fixhexaddr$BL3
32
  let ADDR=ADDR+1
33
done
34
echo "             when others => D <= x\"00\";
35
        end case;
36
 end if;
37
end process;
38
end;"
39
 
40
 

powered by: WebSVN 2.1.0

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