1 -- $Id: word2byte.vhd 649 2015-02-21 21:10:16Z mueller $
3 -- Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
5 -- This program is free software; you may redistribute and/or modify it under
6 -- the terms of the GNU General Public License as published by the Free
7 -- Software Foundation, either version 2, or at your option any later version.
9 -- This program is distributed in the hope that it will be useful, but
10 -- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 -- for complete details.
14 ------------------------------------------------------------------------------
15 -- Module Name: word2byte - syn
16 -- Description: 1 word -> 2 byte stream converter
20 -- Target Devices: generic
21 -- Tool versions: xst 12.1-14.7; ghdl 0.29-0.31
24 -- Date Rev Version Comment
25 -- 2011-11-21 432 1.0.1 now numeric_std clean
26 -- 2011-07-30 400 1.0 Initial version
27 ------------------------------------------------------------------------------
30 use ieee.std_logic_1164.
all;
35 entity word2byte is -- 1 word -> 2 byte stream converter
37 CLK : in slbit;
-- clock
39 DI : in slv16;
-- input data (word)
40 ENA : in slbit;
-- write enable
41 BUSY : out slbit;
-- write port hold
42 DO : out slv8;
-- output data (byte)
43 VAL : out slbit;
-- read valid
44 HOLD : in slbit;
-- read hold
45 ODD : out slbit -- odd byte pending
59 datl : slv8;
-- lsb data
60 dath : slv8;
-- msb data
78 if rising_edge(CLK) then
93 variable ival : slbit := '0';
94 variable ibusy : slbit := '0';
95 variable iodd : slbit := '0';
110 n.datl := DI( 7 downto 0);
111 n.dath := DI(15 downto 8);
128 n.datl := DI( 7 downto 0);
129 n.dath := DI(15 downto 8);
datl:slv8 # dath:slv8 # state:state_type # regs_typerecorddatl:slv8%#%%dath:slv8%#%state:state_type%#
regs_type :=regs_init N_REGS
regs_type :=regs_init R_REGS
regs_type := ( ( others =>'0' ) ,( others =>'0' ) ,s_idle ) regs_init
( s_idle ,s_valw ,s_valh ) state_type
proc_nextR_REGS,DI,ENA,HOLD