add new urjtag-based code, fjmem
[fleet.git] / src / edu / berkeley / fleet / fpga / fjmem / fjmem_pack-p.vhd
1 -------------------------------------------------------------------------------
2 --
3 -- $Id: fjmem_pack-p.vhd 1071 2008-02-21 20:34:04Z arniml $
4 --
5 -- This program is free software; you can redistribute it and/or
6 -- modify it under the terms of the GNU General Public License
7 -- as published by the Free Software Foundation; either version 2
8 -- of the License, or (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 -- 02111-1307, USA.
19 --
20 -- Written by Arnim Laeuger <arniml@users.sourceforge.net>, 2008.
21 --
22 -------------------------------------------------------------------------------
23
24 library ieee;
25 use ieee.std_logic_1164.all;
26
27 use work.fjmem_config_pack.all;
28
29 package fjmem_pack is
30
31   -----------------------------------------------------------------------------
32   -- Constants that build the shift register
33   --
34   constant shift_instr_pos_c   : natural := 0;
35   constant shift_instr_width_c : natural := 3;
36   constant shift_ack_pos_c     : natural := shift_instr_pos_c + shift_instr_width_c;
37   constant shift_ack_width_c   : natural := 1;
38   constant shift_block_pos_c   : natural := shift_ack_pos_c + shift_ack_width_c;
39   constant shift_block_width_c : natural := num_block_field_c;
40   constant shift_addr_pos_c    : natural := shift_block_pos_c + shift_block_width_c;
41   constant shift_addr_width_c  : natural := max_addr_width_c;
42   constant shift_data_pos_c    : natural := shift_addr_pos_c + shift_addr_width_c;
43   constant shift_data_width_c  : natural := max_data_width_c;
44   constant shift_width_c       : natural := shift_data_pos_c + shift_data_width_c;
45   --
46   subtype instr_range_t is natural range shift_instr_width_c-1 downto 0;
47   subtype block_range_t is natural range shift_block_pos_c+shift_block_width_c-1 downto shift_block_pos_c;
48   subtype addr_range_t  is natural range shift_addr_pos_c+shift_addr_width_c-1 downto shift_addr_pos_c;
49   subtype data_range_t  is natural range shift_data_pos_c+shift_data_width_c-1 downto shift_data_pos_c;
50   subtype shift_range_t is natural range shift_width_c-1 downto 0;
51   --
52   -----------------------------------------------------------------------------
53
54
55   -----------------------------------------------------------------------------
56   -- Instruction constants
57   --
58   constant instr_idle_c   : std_logic_vector(instr_range_t) := "000";
59   constant instr_detect_c : std_logic_vector(instr_range_t) := "111";
60   constant instr_query_c  : std_logic_vector(instr_range_t) := "110";
61   constant instr_read_c   : std_logic_vector(instr_range_t) := "001";
62   constant instr_write_c  : std_logic_vector(instr_range_t) := "010";
63   --
64   -----------------------------------------------------------------------------
65
66 end;