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

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [vhdl/] [src/] [gpib/] [if_func_DT.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 Andrewski
--------------------------------------------------------------------------------
2
--This file is part of fpga_gpib_controller.
3
--
4
-- Fpga_gpib_controller is free software: you can redistribute it and/or modify
5
-- it under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation, either version 3 of the License, or
7
-- (at your option) any later version.
8
--
9
-- Fpga_gpib_controller is distributed in the hope that it will be useful,
10
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
-- GNU General Public License for more details.
13
 
14
-- You should have received a copy of the GNU General Public License
15
-- along with Fpga_gpib_controller.  If not, see <http://www.gnu.org/licenses/>.
16 3 Andrewski
----------------------------------------------------------------------------------
17 13 Andrewski
-- Author: Andrzej Paluch
18 3 Andrewski
-- 
19
-- Create Date:    01:04:57 10/03/2011 
20
-- Design Name: 
21
-- Module Name:    if_func_DT - Behavioral 
22
-- Project Name: 
23
-- Target Devices: 
24
-- Tool versions: 
25
-- Description: 
26
--
27
-- Dependencies: 
28
--
29
-- Revision: 
30
-- Revision 0.01 - File Created
31
-- Additional Comments: 
32
--
33
----------------------------------------------------------------------------------
34
library IEEE;
35
use IEEE.STD_LOGIC_1164.ALL;
36
 
37
---- Uncomment the following library declaration if instantiating
38
---- any Xilinx primitives in this code.
39
--library UNISIM;
40
--use UNISIM.VComponents.all;
41
 
42
entity if_func_DT is
43
        port(
44
                -- device inputs
45
                clk : in std_logic; -- clock
46
                -- state inputs
47
                LADS : in std_logic; -- listener addressed state (L or LE)
48
                ACDS : in std_logic; -- accept data state (AH)
49
                -- instructions
50
                GET : in std_logic; -- group execute trigger
51
                -- local instructions
52
                trg : out std_logic -- trigger
53
        );
54
end if_func_DT;
55
 
56
architecture Behavioral of if_func_DT is
57
 
58
 -- states
59
 type DT_STATE is (
60
  -- device trigger idle state
61
  ST_DTIS,
62
  -- device trigger active state
63
  ST_DTAS
64
 );
65
 
66
 -- current state
67
 signal current_state : DT_STATE;
68
 
69
 -- predicates
70
 signal pred1 : boolean;
71
 signal pred2 : boolean;
72
 
73
begin
74
 
75
 -- state machine process
76
 process(clk) begin
77
 
78
        if rising_edge(clk) then
79
 
80
          case current_state is
81
            ------------------
82
            when ST_DTIS =>
83
                   if pred1 then
84
                     current_state <= ST_DTAS;
85
                   end if;
86
                 ------------------
87
                 when ST_DTAS =>
88
                   if pred2 then
89
                 current_state <= ST_DTIS;
90
           end if;
91
                 ------------------
92
                 when others =>
93
                   current_state <= ST_DTIS;
94
       end case;
95
        end if;
96
 
97
 end process;
98
 
99
 -- predicates
100
 pred1 <= GET='1' and LADS='1' and ACDS='1';
101
 pred2 <= not pred1;
102
 
103
 -- trg generator
104
 with current_state select
105
   trg <=
106
                '1' when ST_DTAS,
107
                '0' when others;
108
 
109
end Behavioral;

powered by: WebSVN 2.1.0

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