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 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_DC - 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_DC 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
                DCL : in std_logic; -- my listen address
37
                SDC : in std_logic; -- unlisten
38
                -- local instructions
39
                clr : out std_logic -- clear device
40
        );
41
end if_func_DC;
42
 
43
architecture Behavioral of if_func_DC is
44
 
45
 -- states
46
 type DC_STATE is (
47
  -- device clear idle state
48
  ST_DCIS,
49
  -- device clear active state
50
  ST_DCAS
51
 );
52
 
53
 -- current state
54
 signal current_state : DC_STATE;
55
 
56
 -- predicates
57
 signal pred1 : boolean;
58
 signal pred2 : boolean;
59
 
60
begin
61
 
62
 -- state machine process
63
 process(clk) begin
64
 
65
        if rising_edge(clk) then
66
 
67
          case current_state is
68
            ------------------
69
            when ST_DCIS =>
70
                   if pred1 then
71
                     current_state <= ST_DCAS;
72
                   end if;
73
                 ------------------
74
                 when ST_DCAS =>
75
                   if pred2 then
76
                 current_state <= ST_DCIS;
77
           end if;
78
                 ------------------
79
                 when others =>
80
                   current_state <= ST_DCIS;
81
       end case;
82
        end if;
83
 
84
 end process;
85
 
86
 -- predicates
87
 pred1 <= (DCL='1' or (SDC='1' and LADS='1')) and ACDS='1';
88
 pred2 <= not pred1;
89
 
90
 -- clr generator
91
 with current_state select
92
   clr <=
93
                '1' when ST_DCAS,
94
                '0' when others;
95
 
96
end Behavioral;

powered by: WebSVN 2.1.0

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