-- $(lic)
-- $(help_generic)
-- $(help_local)
library ieee;
use ieee.std_logic_1164.all;
use work.amba.all;
-- PREFIX: lmd_xxx
package memdef is
-- memsizes
type lmd_memsize is (
lmd_word,
lmd_byte,
lmd_half,
lmd_dbl
);
-- lmd_big: byte[0 1 2 3], hw[0 1]
-- lmd_little: byte[3 2 1 0], hw[1 0]
type lmd_byteorder is (lmd_big, lmd_little);
-- return amba size constant
function lmd_toamba (
size : lmd_memsize
) return Std_Logic_Vector;
-- endianess converter
function lmd_convert (
data : std_logic_vector(31 downto 0);
intype : lmd_byteorder;
outtype : lmd_byteorder
) return std_logic_vector;
end memdef;
package body memdef is
function lmd_toamba (
size : lmd_memsize
) return Std_Logic_Vector is
variable tmp : std_logic_vector(2 downto 0);
begin
tmp := HSIZE_WORD;
case size is
when lmd_byte => tmp := HSIZE_BYTE;
when lmd_half => tmp := HSIZE_HWORD;
when lmd_word => tmp := HSIZE_WORD;
when others => null;
end case;
return tmp;
end;
function lmd_convert (
data : std_logic_vector(31 downto 0);
intype : lmd_byteorder;
outtype : lmd_byteorder
) return std_logic_vector is
variable tmp : std_logic_vector(31 downto 0);
begin
tmp := data;
if intype /= outtype then
tmp := tmp(7 downto 0) & tmp(15 downto 8) & tmp(23 downto 16) & tmp(31 downto 24);
end if;
return tmp;
end;
end memdef;
Enum lmd_memsize defined in /tmp/build_html/vhdl/libs/memdef.vhd |
Enum lmd_byteorder defined in /tmp/build_html/vhdl/libs/memdef.vhd |
Enum txfsmtype defined in /tmp/build_html/vhdl/sparc/dcom_uart.vhd |
Function lmd_convert defined in /tmp/build_html/vhdl/libs/memdef.vhd |
Constant HSIZE_WORD defined in /tmp/build_html/vhdl/bus/amba.vhd |
Constant HSIZE_BYTE defined in /tmp/build_html/vhdl/bus/amba.vhd |
Constant HSIZE_HWORD defined in /tmp/build_html/vhdl/bus/amba.vhd |
Function lmd_toamba defined in /tmp/build_html/vhdl/libs/memdef.vhd |
If you have question mail to: Konrad Eisele<eiselekd@web.de>, created: Wed Apr 14 13:07:33 WEDT 2004
;
This is part of the Core distribution