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

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [vhdl/] [src/] [wrapper/] [ReaderControlReg0.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: ReaderControlReg0
18
-- Date:2011-11-10  
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.utilPkg.all;
28
use work.helperComponents.all;
29
 
30
entity ReaderControlReg0 is
31
        port (
32
                clk : in std_logic;
33
                reset : 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 -------------------------
38
                -- buffer ready interrupt
39
                buf_interrupt : in std_logic;
40
                -- at least one byte available
41
                data_available : in std_logic;
42
                -- indicates end of stream
43
                end_of_stream : in std_logic;
44
                -- resets buffer
45
                reset_buffer : out std_logic;
46
                -- secondary address of data
47
                dataSecAddr : in std_logic_vector (4 downto 0)
48
        );
49
end ReaderControlReg0;
50
 
51
architecture arch of ReaderControlReg0 is
52
 
53
        signal i_reset_buffer : std_logic;
54
 
55
        signal t_in, t_out : std_logic;
56
 
57
begin
58
 
59
        data_out(0) <= buf_interrupt;
60
        data_out(1) <= data_available;
61
        data_out(2) <= end_of_stream;
62
        data_out(3) <= i_reset_buffer;
63
        data_out(8 downto 4) <= dataSecAddr;
64
        data_out(15 downto 9) <= "0000000";
65
 
66
        reset_buffer <= i_reset_buffer;
67
 
68
        process (reset, strobe) begin
69
                if reset = '1' then
70
                        t_in <= '0';
71
                elsif rising_edge(strobe) then
72
 
73
                        if data_in(3) = '1' then
74
                                t_in <= not t_out;
75
                        end if;
76
                end if;
77
        end process;
78
 
79
        spg: SinglePulseGenerator generic map (WIDTH => 3) port map(
80
                reset => reset, clk => clk,
81
                t_in => t_in, t_out => t_out,
82
                pulse => i_reset_buffer
83
        );
84
 
85
end arch;
86
 

powered by: WebSVN 2.1.0

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