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 6

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 Andrewski
--------------------------------------------------------------------------------
2
-- Entity: ReaderControlReg0
3
-- Date:2011-11-10  
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.utilPkg.all;
13
use work.helperComponents.all;
14
 
15
entity ReaderControlReg0 is
16
        port (
17
                clk : in std_logic;
18
                reset : 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 -------------------------
23
                -- buffer ready interrupt
24
                buf_interrupt : in std_logic;
25
                -- at least one byte available
26
                data_available : in std_logic;
27
                -- indicates end of stream
28
                end_of_stream : in std_logic;
29
                -- resets buffer
30
                reset_buffer : out std_logic;
31
                -- secondary address of data
32
                dataSecAddr : in std_logic_vector (4 downto 0)
33
        );
34
end ReaderControlReg0;
35
 
36
architecture arch of ReaderControlReg0 is
37
 
38
        signal i_reset_buffer : std_logic;
39
 
40
        signal t_in, t_out : std_logic;
41
 
42
begin
43
 
44
        data_out(0) <= buf_interrupt;
45
        data_out(1) <= data_available;
46
        data_out(2) <= end_of_stream;
47
        data_out(3) <= i_reset_buffer;
48
        data_out(8 downto 4) <= dataSecAddr;
49
        data_out(15 downto 9) <= "0000000";
50
 
51
        reset_buffer <= i_reset_buffer;
52
 
53
        process (reset, strobe) begin
54
                if reset = '1' then
55
                        t_in <= '0';
56
                elsif rising_edge(strobe) then
57
 
58
                        if data_in(3) = '1' then
59
                                t_in <= not t_out;
60
                        end if;
61
                end if;
62
        end process;
63
 
64
        spg: SinglePulseGenerator generic map (WIDTH => 3) port map(
65
                reset => reset, clk => clk,
66
                t_in => t_in, t_out => t_out,
67
                pulse => i_reset_buffer
68
        );
69
 
70
end arch;
71
 

powered by: WebSVN 2.1.0

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