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 6

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 Andrewski
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    01:04:57 10/03/2011 
6
-- Design Name: 
7
-- Module Name:    if_func_DT - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
 
23
---- Uncomment the following library declaration if instantiating
24
---- any Xilinx primitives in this code.
25
--library UNISIM;
26
--use UNISIM.VComponents.all;
27
 
28
entity if_func_DT is
29
        port(
30
                -- device inputs
31
                clk : in std_logic; -- clock
32
                -- state inputs
33
                LADS : in std_logic; -- listener addressed state (L or LE)
34
                ACDS : in std_logic; -- accept data state (AH)
35
                -- instructions
36
                GET : in std_logic; -- group execute trigger
37
                -- local instructions
38
                trg : out std_logic -- trigger
39
        );
40
end if_func_DT;
41
 
42
architecture Behavioral of if_func_DT is
43
 
44
 -- states
45
 type DT_STATE is (
46
  -- device trigger idle state
47
  ST_DTIS,
48
  -- device trigger active state
49
  ST_DTAS
50
 );
51
 
52
 -- current state
53
 signal current_state : DT_STATE;
54
 
55
 -- predicates
56
 signal pred1 : boolean;
57
 signal pred2 : boolean;
58
 
59
begin
60
 
61
 -- state machine process
62
 process(clk) begin
63
 
64
        if rising_edge(clk) then
65
 
66
          case current_state is
67
            ------------------
68
            when ST_DTIS =>
69
                   if pred1 then
70
                     current_state <= ST_DTAS;
71
                   end if;
72
                 ------------------
73
                 when ST_DTAS =>
74
                   if pred2 then
75
                 current_state <= ST_DTIS;
76
           end if;
77
                 ------------------
78
                 when others =>
79
                   current_state <= ST_DTIS;
80
       end case;
81
        end if;
82
 
83
 end process;
84
 
85
 -- predicates
86
 pred1 <= GET='1' and LADS='1' and ACDS='1';
87
 pred2 <= not pred1;
88
 
89
 -- trg generator
90
 with current_state select
91
   trg <=
92
                '1' when ST_DTAS,
93
                '0' when others;
94
 
95
end Behavioral;

powered by: WebSVN 2.1.0

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