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 13

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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