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

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [vhdl/] [src/] [wrapper/] [EventReg.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
-- Entity: EventReg
3
-- Date:2011-11-11  
4
-- Author: Administrator     
5
--
6
-- Description ${cursor}
7
--------------------------------------------------------------------------------
8
library ieee;
9
use ieee.std_logic_1164.all;
10
use ieee.std_logic_unsigned.all;
11
 
12
use work.helperComponents.all;
13
 
14
 
15
entity EventReg is
16
        port (
17
                reset : in std_logic;
18
                clk : in std_logic;
19
                strobe : in std_logic;
20
                data_in : in std_logic_vector (15 downto 0);
21
                data_out : out std_logic_vector (15 downto 0);
22
                -------------------- gpib device ---------------------
23
                -- device is local controlled
24
                isLocal : in std_logic;
25
                -- input buffer ready
26
                in_buf_ready : in std_logic;
27
                -- output buffer ready
28
                out_buf_ready : in std_logic;
29
                -- clear device (DC)
30
                clr : in std_logic;
31
                -- trigger device (DT)
32
                trg : in std_logic;
33
                -- addressed to talk(L or LE)
34
                att : in std_logic;
35
                -- addressed to listen (T or TE)
36
                atl : in std_logic;
37
                -- seriall poll active
38
                spa : in std_logic;
39
                -------------------- gpib controller ---------------------
40
                -- controller write commands
41
                cwrc : in std_logic;
42
                -- controller write data
43
                cwrd : in std_logic;
44
                -- service requested
45
                srq : in std_logic;
46
                -- parallel poll ready
47
                ppr : in std_logic;
48
                -- stb received
49
                stb_received : in std_logic;
50
                REN : in std_logic;
51
                ATN : in std_logic;
52
                IFC : in std_logic
53
        );
54
end EventReg;
55
 
56
architecture arch of EventReg is
57
 
58
        signal i_clr : std_logic;
59
        signal i_trg : std_logic;
60
        signal i_srq : std_logic;
61
 
62
        signal clr_app : std_logic;
63
        signal trg_app : std_logic;
64
        signal srq_app : std_logic;
65
 
66
        signal t_clr_in, t_clr_out : std_logic;
67
        signal t_trg_in, t_trg_out : std_logic;
68
        signal t_srq_in, t_srq_out : std_logic;
69
 
70
begin
71
 
72
        data_out(0) <= isLocal;
73
        data_out(1) <= in_buf_ready;
74
        data_out(2) <= out_buf_ready;
75
        data_out(3) <= i_clr;
76
        data_out(4) <= i_trg;
77
        data_out(5) <= att;
78
        data_out(6) <= atl;
79
        data_out(7) <= spa;
80
        data_out(8) <= cwrc;
81
        data_out(9) <= cwrd;
82
        data_out(10) <= i_srq;
83
        data_out(11) <= ppr;
84
        data_out(12) <= stb_received;
85
        data_out(13) <= REN;
86
        data_out(14) <= ATN;
87
        data_out(15) <= IFC;
88
 
89
        process (reset, strobe) begin
90
                if reset = '1' then
91
                        t_clr_in <= '0';
92
                        t_trg_in <= '0';
93
                        t_srq_in <= '0';
94
                elsif rising_edge(strobe) then
95
                        if data_in(3) = '0' then
96
                                t_clr_in <= not t_clr_out;
97
                        elsif data_in(4) = '0' then
98
                                t_trg_in <= not t_trg_out;
99
                        elsif data_in(10) = '0' then
100
                                t_srq_in <= not t_srq_out;
101
                        end if;
102
                end if;
103
        end process;
104
 
105
        EVM1: EventMem port map (
106
                reset => reset, occured => clr, approved => clr_app,
107
                output => i_clr
108
        );
109
 
110
        SPG1: SinglePulseGenerator generic map (WIDTH => 1) port map(
111
                reset => reset, clk => clk,
112
                t_in => t_clr_in, t_out => t_clr_out,
113
                pulse => clr_app
114
        );
115
 
116
        EVM2: EventMem port map (
117
                reset => reset, occured => trg, approved => trg_app,
118
                output => i_trg
119
        );
120
 
121
        SPG2: SinglePulseGenerator generic map (WIDTH => 1) port map(
122
                reset => reset, clk => clk,
123
                t_in => t_trg_in, t_out => t_trg_out,
124
                pulse => trg_app
125
        );
126
 
127
        EVM3: EventMem port map (
128
                reset => reset, occured => srq, approved => srq_app,
129
                output => i_srq
130
        );
131
 
132
        SPG3: SinglePulseGenerator generic map (WIDTH => 1) port map(
133
                reset => reset, clk => clk,
134
                t_in => t_srq_in, t_out => t_srq_out,
135
                pulse => srq_app
136
        );
137
 
138
end arch;
139
 

powered by: WebSVN 2.1.0

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