| 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: gpibControlReg
|
| 18 |
|
|
-- Date:2011-11-12
|
| 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 |
|
|
|
| 28 |
|
|
entity gpibControlReg is
|
| 29 |
|
|
port (
|
| 30 |
|
|
reset : in std_logic;
|
| 31 |
|
|
strobe : in std_logic;
|
| 32 |
|
|
data_in : in std_logic_vector (15 downto 0);
|
| 33 |
|
|
data_out : out std_logic_vector (15 downto 0);
|
| 34 |
|
|
------------------ gpib ------------------------
|
| 35 |
|
|
ltn : out std_logic; -- listen (L, LE)
|
| 36 |
|
|
lun : out std_logic; -- local unlisten (L, LE)
|
| 37 |
|
|
rtl : out std_logic; -- return to local (RL)
|
| 38 |
|
|
rsv : out std_logic; -- request service (SR)
|
| 39 |
|
|
ist : out std_logic; -- individual status (PP)
|
| 40 |
|
|
lpe : out std_logic; -- local poll enable (PP)
|
| 41 |
|
|
------------------------------------------------
|
| 42 |
|
|
rsc : out std_logic; -- request system control (C)
|
| 43 |
|
|
sic : out std_logic; -- send interface clear (C)
|
| 44 |
|
|
sre : out std_logic; -- send remote enable (C)
|
| 45 |
|
|
gts : out std_logic; -- go to standby (C)
|
| 46 |
|
|
tcs : out std_logic; -- take control synchronously (C, AH)
|
| 47 |
|
|
tca : out std_logic; -- take control asynchronously (C)
|
| 48 |
|
|
rpp : out std_logic; -- request parallel poll (C)
|
| 49 |
|
|
rec_stb : out std_logic -- receives status byte (C)
|
| 50 |
|
|
);
|
| 51 |
|
|
end gpibControlReg;
|
| 52 |
|
|
|
| 53 |
|
|
architecture arch of gpibControlReg is
|
| 54 |
|
|
|
| 55 |
|
|
signal inner_buf : std_logic_vector (15 downto 0);
|
| 56 |
|
|
|
| 57 |
|
|
begin
|
| 58 |
|
|
|
| 59 |
|
|
ltn <= inner_buf(0);
|
| 60 |
|
|
lun <= inner_buf(1);
|
| 61 |
|
|
rtl <= inner_buf(2);
|
| 62 |
|
|
rsv <= inner_buf(3);
|
| 63 |
|
|
ist <= inner_buf(4);
|
| 64 |
|
|
lpe <= inner_buf(5);
|
| 65 |
|
|
------------------------------------------------
|
| 66 |
|
|
rsc <= inner_buf(6);
|
| 67 |
|
|
sic <= inner_buf(7);
|
| 68 |
|
|
sre <= inner_buf(8);
|
| 69 |
|
|
gts <= inner_buf(9);
|
| 70 |
|
|
tcs <= inner_buf(10);
|
| 71 |
|
|
tca <= inner_buf(11);
|
| 72 |
|
|
rpp <= inner_buf(12);
|
| 73 |
|
|
rec_stb <= inner_buf(13);
|
| 74 |
|
|
|
| 75 |
|
|
data_out <= inner_buf;
|
| 76 |
|
|
|
| 77 |
|
|
process (reset, strobe) begin
|
| 78 |
|
|
if reset = '1' then
|
| 79 |
|
|
inner_buf <= "0000000000000000";
|
| 80 |
|
|
elsif rising_edge(strobe) then
|
| 81 |
|
|
inner_buf <= data_in;
|
| 82 |
|
|
end if;
|
| 83 |
|
|
end process;
|
| 84 |
|
|
|
| 85 |
|
|
end arch;
|
| 86 |
|
|
|