otsdaq_prepmodernization  v2_05_02_indev
dev_wr_gate.vhd
1 -------------------------------------------------------------------------------
2 --
3 -- Title : No Title
4 -- Design : CAPTAN
5 -- Author : aprosser
6 -- Company : CD_CEPA_ESE
7 --
8 -------------------------------------------------------------------------------
9 --
10 -- File : u:\CAPTAN\Data_Conversion_Board\CAPTAN\CAPTAN\compile\dev_wr_gate.vhd
11 -- Generated : 08/08/08 15:06:38
12 -- From : u:\CAPTAN\Data_Conversion_Board\CAPTAN\CAPTAN\src\dev_wr_gate.asf
13 -- By : FSM2VHDL ver. 5.0.0.9
14 --
15 -------------------------------------------------------------------------------
16 --
17 -- Description :
18 --
19 -------------------------------------------------------------------------------
20 
21 library IEEE;
22 use IEEE.std_logic_1164.all;
23 use IEEE.std_logic_arith.all;
24 use IEEE.std_logic_unsigned.all;
25 use params_package.all;
26 
27 entity dev_wr_gate is
28  port (
29  addr: in STD_LOGIC_VECTOR (63 downto 0);
30  clock: in STD_LOGIC;
31  data: in STD_LOGIC_VECTOR (31 downto 0);
32  reset_n: in STD_LOGIC;
33  we: in STD_LOGIC;
34  data_out: out STD_LOGIC_VECTOR (31 downto 0);
35  wr_out: out STD_LOGIC);
36 end dev_wr_gate;
37 
38 architecture dev_wr_gate of dev_wr_gate is
39 
40 -- SYMBOLIC ENCODED state machine: Sreg0
41 type Sreg0_type is (
42  S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11
43 );
44 -- attribute enum_encoding of Sreg0_type: type is ... -- enum_encoding attribute is not supported for symbolic encoding
45 
46 signal Sreg0: Sreg0_type;
47 
48 begin
49 
50 
51 ----------------------------------------------------------------------
52 -- Machine: Sreg0
53 ----------------------------------------------------------------------
54 Sreg0_machine: process (clock)
55 begin
56  if clock'event and clock = '1' then
57  if reset_n = '0' then
58  Sreg0 <= S1;
59  -- Set default values for outputs, signals and variables
60  -- ...
61  wr_out <= '0';
62  data_out <= v_32_0;
63  else
64  -- Set default values for outputs, signals and variables
65  -- ...
66  case Sreg0 is
67  when S1 =>
68 
69  wr_out <= '0';
70  if we = '1' and addr = dev_addr0 then
71  Sreg0 <= S2;
72  data_out <= data;
73  end if;
74 
75  when S2 =>
76  Sreg0 <= S3;
77  wr_out <= '1';
78  when S3 =>
79  Sreg0 <= S4;
80  when S4 =>
81  Sreg0 <= S5;
82  when S5 =>
83  Sreg0 <= S6;
84  when S6 =>
85  Sreg0 <= S7;
86  when S7 =>
87  Sreg0 <= S8;
88  when S8 =>
89  Sreg0 <= S9;
90  when S9 =>
91  Sreg0 <= S10;
92  when S10 =>
93  Sreg0 <= S11;
94  when S11 =>
95  Sreg0 <= S1;
96  when others =>
97  null;
98  end case;
99  end if;
100  end if;
101 end process;
102 
103 end dev_wr_gate;