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

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [vhdl/] [src/] [gpib/] [if_func_DC.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_DC - 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_DC 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
                DCL : in std_logic; -- my listen address
51
                SDC : in std_logic; -- unlisten
52
                -- local instructions
53
                clr : out std_logic -- clear device
54
        );
55
end if_func_DC;
56
 
57
architecture Behavioral of if_func_DC is
58
 
59
 -- states
60
 type DC_STATE is (
61
  -- device clear idle state
62
  ST_DCIS,
63
  -- device clear active state
64
  ST_DCAS
65
 );
66
 
67
 -- current state
68
 signal current_state : DC_STATE;
69
 
70
 -- predicates
71
 signal pred1 : boolean;
72
 signal pred2 : boolean;
73
 
74
begin
75
 
76
 -- state machine process
77
 process(clk) begin
78
 
79
        if rising_edge(clk) then
80
 
81
          case current_state is
82
            ------------------
83
            when ST_DCIS =>
84
                   if pred1 then
85
                     current_state <= ST_DCAS;
86
                   end if;
87
                 ------------------
88
                 when ST_DCAS =>
89
                   if pred2 then
90
                 current_state <= ST_DCIS;
91
           end if;
92
                 ------------------
93
                 when others =>
94
                   current_state <= ST_DCIS;
95
       end case;
96
        end if;
97
 
98
 end process;
99
 
100
 -- predicates
101
 pred1 <= (DCL='1' or (SDC='1' and LADS='1')) and ACDS='1';
102
 pred2 <= not pred1;
103
 
104
 -- clr generator
105
 with current_state select
106
   clr <=
107
                '1' when ST_DCAS,
108
                '0' when others;
109
 
110
end Behavioral;

powered by: WebSVN 2.1.0

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