--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
|
--This file is part of fpga_gpib_controller.
|
|
--
|
|
-- Fpga_gpib_controller is free software: you can redistribute it and/or modify
|
|
-- it under the terms of the GNU General Public License as published by
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
|
-- (at your option) any later version.
|
|
--
|
|
-- Fpga_gpib_controller is distributed in the hope that it will be useful,
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
-- GNU General Public License for more details.
|
|
|
|
-- You should have received a copy of the GNU General Public License
|
|
-- along with Fpga_gpib_controller. If not, see <http://www.gnu.org/licenses/>.
|
|
--------------------------------------------------------------------------------
|
-- Entity: components
|
-- Entity: components
|
-- Date: 23:15 10/12/2011
|
-- Date: 23:15 10/12/2011
|
-- Author: apaluch
|
-- Author: Andrzej Paluch
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
library IEEE;
|
library IEEE;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use IEEE.STD_LOGIC_1164.ALL;
|
|
|
package gpibComponents is
|
package gpibComponents is
|
|
|
component if_func_AH is
|
component if_func_AH is
|
port(
|
port(
|
-- device inputs
|
-- device inputs
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
pon : in std_logic; -- power on
|
pon : in std_logic; -- power on
|
rdy : in std_logic; -- ready for next message
|
rdy : in std_logic; -- ready for next message
|
tcs : in std_logic; -- take control synchronously
|
tcs : in std_logic; -- take control synchronously
|
-- state inputs
|
-- state inputs
|
LACS : in std_logic; -- listener active state
|
LACS : in std_logic; -- listener active state
|
LADS : in std_logic; -- listener addressed state
|
LADS : in std_logic; -- listener addressed state
|
-- interface inputs
|
-- interface inputs
|
ATN : in std_logic; -- attention
|
ATN : in std_logic; -- attention
|
DAV : in std_logic; -- data accepted
|
DAV : in std_logic; -- data accepted
|
-- interface outputs
|
-- interface outputs
|
RFD : out std_logic; -- ready for data
|
RFD : out std_logic; -- ready for data
|
DAC : out std_logic; -- data accepted
|
DAC : out std_logic; -- data accepted
|
-- reported state
|
-- reported state
|
ANRS : out std_logic; -- acceptor not ready state
|
ANRS : out std_logic; -- acceptor not ready state
|
ACDS : out std_logic -- accept data state
|
ACDS : out std_logic -- accept data state
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_SH is
|
component if_func_SH is
|
port(
|
port(
|
-- device inputs
|
-- device inputs
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
-- settingd
|
-- settingd
|
T1 : in std_logic_vector (7 downto 0);
|
T1 : in std_logic_vector (7 downto 0);
|
-- local commands
|
-- local commands
|
pon : in std_logic; -- power on
|
pon : in std_logic; -- power on
|
nba : in std_logic; -- new byte available
|
nba : in std_logic; -- new byte available
|
-- state inputs
|
-- state inputs
|
TACS : in std_logic; -- talker active state
|
TACS : in std_logic; -- talker active state
|
SPAS : in std_logic; -- seriall poll active state
|
SPAS : in std_logic; -- seriall poll active state
|
CACS : in std_logic; -- controller active state
|
CACS : in std_logic; -- controller active state
|
CTRS : in std_logic; -- controller transfer state
|
CTRS : in std_logic; -- controller transfer state
|
-- interface inputs
|
-- interface inputs
|
ATN : in std_logic; -- attention
|
ATN : in std_logic; -- attention
|
DAC : in std_logic; -- data accepted
|
DAC : in std_logic; -- data accepted
|
RFD : in std_logic; -- ready for data
|
RFD : in std_logic; -- ready for data
|
-- remote instructions
|
-- remote instructions
|
DAV : out std_logic; -- data address valid
|
DAV : out std_logic; -- data address valid
|
-- device outputs
|
-- device outputs
|
wnc : out std_logic; -- wait for new cycle
|
wnc : out std_logic; -- wait for new cycle
|
-- reported states
|
-- reported states
|
STRS : out std_logic; -- source transfer state
|
STRS : out std_logic; -- source transfer state
|
SDYS : out std_logic -- source delay state
|
SDYS : out std_logic -- source delay state
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_L_LE is
|
component if_func_L_LE is
|
port(
|
port(
|
-- clock
|
-- clock
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
-- function settings
|
-- function settings
|
isLE : in std_logic;
|
isLE : in std_logic;
|
-- local commands
|
-- local commands
|
pon : in std_logic; -- power on
|
pon : in std_logic; -- power on
|
ltn : in std_logic; -- listen
|
ltn : in std_logic; -- listen
|
lun : in std_logic; -- local unlisten
|
lun : in std_logic; -- local unlisten
|
lon : in std_logic; -- listen only
|
lon : in std_logic; -- listen only
|
-- state inputs
|
-- state inputs
|
ACDS : in std_logic; -- accept data state (AH)
|
ACDS : in std_logic; -- accept data state (AH)
|
CACS : in std_logic; -- controller active state (C)
|
CACS : in std_logic; -- controller active state (C)
|
TPAS : in std_logic; -- talker primary address state (T)
|
TPAS : in std_logic; -- talker primary address state (T)
|
-- remote commands
|
-- remote commands
|
ATN : in std_logic; -- attention
|
ATN : in std_logic; -- attention
|
IFC : in std_logic; -- interface clear
|
IFC : in std_logic; -- interface clear
|
MLA : in std_logic; -- my listen address
|
MLA : in std_logic; -- my listen address
|
MTA : in std_logic; -- my talk address
|
MTA : in std_logic; -- my talk address
|
UNL : in std_logic; -- unlisten
|
UNL : in std_logic; -- unlisten
|
PCG : in std_logic; -- primary command group
|
PCG : in std_logic; -- primary command group
|
MSA : in std_logic; -- my secondary address
|
MSA : in std_logic; -- my secondary address
|
-- reported states
|
-- reported states
|
LACS : out std_logic; -- listener active state
|
LACS : out std_logic; -- listener active state
|
LADS : out std_logic; -- listener addressed state
|
LADS : out std_logic; -- listener addressed state
|
LPAS : out std_logic -- listener primary addressed state
|
LPAS : out std_logic -- listener primary addressed state
|
;debug1 : out std_logic
|
;debug1 : out std_logic
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_T_TE is
|
component if_func_T_TE is
|
port(
|
port(
|
-- clock
|
-- clock
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
-- function settings
|
-- function settings
|
isTE : in std_logic;
|
isTE : in std_logic;
|
-- local instruction inputs
|
-- local instruction inputs
|
pon : in std_logic; -- power on
|
pon : in std_logic; -- power on
|
ton : in std_logic; -- talk only
|
ton : in std_logic; -- talk only
|
endOf : in std_logic; -- end of byte string
|
endOf : in std_logic; -- end of byte string
|
-- state inputs
|
-- state inputs
|
ACDS : in std_logic; -- accept data state (AH)
|
ACDS : in std_logic; -- accept data state (AH)
|
APRS : in std_logic; -- affirmative poll response
|
APRS : in std_logic; -- affirmative poll response
|
LPAS : in std_logic; -- listener primary state (LE)
|
LPAS : in std_logic; -- listener primary state (LE)
|
-- remote instruction inputs
|
-- remote instruction inputs
|
ATN : in std_logic; -- attention
|
ATN : in std_logic; -- attention
|
IFC : in std_logic; -- interface clear
|
IFC : in std_logic; -- interface clear
|
SPE : in std_logic; -- serial poll enable
|
SPE : in std_logic; -- serial poll enable
|
SPD : in std_logic; -- serial poll disable
|
SPD : in std_logic; -- serial poll disable
|
MTA : in std_logic; -- my talk address
|
MTA : in std_logic; -- my talk address
|
OTA : in std_logic; -- other talk address
|
OTA : in std_logic; -- other talk address
|
MLA : in std_logic; -- my listen address
|
MLA : in std_logic; -- my listen address
|
OSA : in std_logic; -- other secondary address
|
OSA : in std_logic; -- other secondary address
|
MSA : in std_logic; -- my secondary address
|
MSA : in std_logic; -- my secondary address
|
PCG : in std_logic; -- primary command group
|
PCG : in std_logic; -- primary command group
|
-- remote instruction outputs
|
-- remote instruction outputs
|
END_OF : out std_logic; -- end of data
|
END_OF : out std_logic; -- end of data
|
RQS : out std_logic; -- data accepted
|
RQS : out std_logic; -- data accepted
|
DAB : out std_logic; -- data byte
|
DAB : out std_logic; -- data byte
|
EOS : out std_logic; -- end of string
|
EOS : out std_logic; -- end of string
|
STB : out std_logic; -- status byte
|
STB : out std_logic; -- status byte
|
-- local instruction outputs
|
-- local instruction outputs
|
tac : out std_logic; -- talker active
|
tac : out std_logic; -- talker active
|
-- reported states
|
-- reported states
|
SPAS : out std_logic; -- serial poll active state
|
SPAS : out std_logic; -- serial poll active state
|
TPAS : out std_logic; -- transmitter active state
|
TPAS : out std_logic; -- transmitter active state
|
TADS : out std_logic; -- talker addressed state
|
TADS : out std_logic; -- talker addressed state
|
TACS : out std_logic -- talker active state
|
TACS : out std_logic -- talker active state
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_C is
|
component if_func_C is
|
port(
|
port(
|
-- device inputs
|
-- device inputs
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
pon : in std_logic; -- power on
|
pon : in std_logic; -- power on
|
gts : in std_logic; -- go to standby
|
gts : in std_logic; -- go to standby
|
rpp : in std_logic; -- request parallel poll
|
rpp : in std_logic; -- request parallel poll
|
tcs : in std_logic; -- take control synchronously
|
tcs : in std_logic; -- take control synchronously
|
tca : in std_logic; -- take control asynchronously
|
tca : in std_logic; -- take control asynchronously
|
sic : in std_logic; -- send interface clear
|
sic : in std_logic; -- send interface clear
|
rsc : in std_logic; -- request system control
|
rsc : in std_logic; -- request system control
|
sre : in std_logic; -- send remote enable
|
sre : in std_logic; -- send remote enable
|
-- state inputs
|
-- state inputs
|
TADS : in std_logic; -- talker addressed state (T or TE)
|
TADS : in std_logic; -- talker addressed state (T or TE)
|
ACDS : in std_logic; -- accept data state (AH)
|
ACDS : in std_logic; -- accept data state (AH)
|
ANRS : in std_logic; -- acceptor not ready state (AH)
|
ANRS : in std_logic; -- acceptor not ready state (AH)
|
STRS : in std_logic; -- source transfer state (SH)
|
STRS : in std_logic; -- source transfer state (SH)
|
SDYS : in std_logic; -- source delay state (SH)
|
SDYS : in std_logic; -- source delay state (SH)
|
-- command inputs
|
-- command inputs
|
ATN_in : in std_logic; -- attention
|
ATN_in : in std_logic; -- attention
|
IFC_in : in std_logic; -- interface clear
|
IFC_in : in std_logic; -- interface clear
|
TCT_in : in std_logic; -- take control
|
TCT_in : in std_logic; -- take control
|
SRQ_in : in std_logic; -- service request
|
SRQ_in : in std_logic; -- service request
|
-- command outputs
|
-- command outputs
|
ATN_out : out std_logic; -- attention
|
ATN_out : out std_logic; -- attention
|
IFC_out : out std_logic; -- interface clear
|
IFC_out : out std_logic; -- interface clear
|
TCT_out : out std_logic; -- take control
|
TCT_out : out std_logic; -- take control
|
IDY_out : out std_logic; -- identify
|
IDY_out : out std_logic; -- identify
|
REN_out : out std_logic; -- remote enable
|
REN_out : out std_logic; -- remote enable
|
-- reported states
|
-- reported states
|
CACS : out std_logic; -- controller active state
|
CACS : out std_logic; -- controller active state
|
CTRS : out std_logic; -- controller transfer state
|
CTRS : out std_logic; -- controller transfer state
|
CSBS : out std_logic; -- controller standby state
|
CSBS : out std_logic; -- controller standby state
|
CPPS : out std_logic; -- controller parallel poll state
|
CPPS : out std_logic; -- controller parallel poll state
|
CSRS : out std_logic; -- controller service requested state
|
CSRS : out std_logic; -- controller service requested state
|
SACS : out std_logic -- system control active state
|
SACS : out std_logic -- system control active state
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_DC is
|
component if_func_DC is
|
port(
|
port(
|
-- device inputs
|
-- device inputs
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
-- state inputs
|
-- state inputs
|
LADS : in std_logic; -- listener addressed state (L or LE)
|
LADS : in std_logic; -- listener addressed state (L or LE)
|
ACDS : in std_logic; -- accept data state (AH)
|
ACDS : in std_logic; -- accept data state (AH)
|
-- instructions
|
-- instructions
|
DCL : in std_logic; -- my listen address
|
DCL : in std_logic; -- my listen address
|
SDC : in std_logic; -- unlisten
|
SDC : in std_logic; -- unlisten
|
-- local instructions
|
-- local instructions
|
clr : out std_logic -- clear device
|
clr : out std_logic -- clear device
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_DT is
|
component if_func_DT is
|
port(
|
port(
|
-- device inputs
|
-- device inputs
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
-- state inputs
|
-- state inputs
|
LADS : in std_logic; -- listener addressed state (L or LE)
|
LADS : in std_logic; -- listener addressed state (L or LE)
|
ACDS : in std_logic; -- accept data state (AH)
|
ACDS : in std_logic; -- accept data state (AH)
|
-- instructions
|
-- instructions
|
GET : in std_logic; -- group execute trigger
|
GET : in std_logic; -- group execute trigger
|
-- local instructions
|
-- local instructions
|
trg : out std_logic -- trigger
|
trg : out std_logic -- trigger
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_PP is
|
component if_func_PP is
|
port(
|
port(
|
-- device inputs
|
-- device inputs
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
-- settings
|
-- settings
|
lpeUsed : std_logic;
|
lpeUsed : std_logic;
|
fixedPpLine : in std_logic_vector (2 downto 0);
|
fixedPpLine : in std_logic_vector (2 downto 0);
|
-- local commands
|
-- local commands
|
pon : in std_logic; -- power on
|
pon : in std_logic; -- power on
|
lpe : in std_logic; -- local poll enable
|
lpe : in std_logic; -- local poll enable
|
ist : in std_logic; -- individual status
|
ist : in std_logic; -- individual status
|
-- state inputs
|
-- state inputs
|
ACDS : in std_logic; -- accept data state
|
ACDS : in std_logic; -- accept data state
|
LADS : in std_logic; -- listener address state (L or LE)
|
LADS : in std_logic; -- listener address state (L or LE)
|
-- data input
|
-- data input
|
dio_data : in std_logic_vector(3 downto 0); -- byte from data lines
|
dio_data : in std_logic_vector(3 downto 0); -- byte from data lines
|
-- remote command inputs
|
-- remote command inputs
|
IDY : in std_logic; -- identify
|
IDY : in std_logic; -- identify
|
PPE : in std_logic; -- parallel poll enable
|
PPE : in std_logic; -- parallel poll enable
|
PPD : in std_logic; -- parallel poll disable
|
PPD : in std_logic; -- parallel poll disable
|
PPC : in std_logic; -- parallel poll configure
|
PPC : in std_logic; -- parallel poll configure
|
PPU : in std_logic; -- parallel poll unconfigure
|
PPU : in std_logic; -- parallel poll unconfigure
|
PCG : in std_logic; -- primary command group
|
PCG : in std_logic; -- primary command group
|
-- remote command outputs
|
-- remote command outputs
|
PPR : out std_logic; -- paralel poll response
|
PPR : out std_logic; -- paralel poll response
|
-- PPR command data
|
-- PPR command data
|
ppBitValue : out std_logic; -- bit value
|
ppBitValue : out std_logic; -- bit value
|
ppLineNumber : out std_logic_vector (2 downto 0);
|
ppLineNumber : out std_logic_vector (2 downto 0);
|
-- reported states
|
-- reported states
|
PPAS : out std_logic -- parallel poll active state
|
PPAS : out std_logic -- parallel poll active state
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_RL is
|
component if_func_RL is
|
port(
|
port(
|
-- device inputs
|
-- device inputs
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
pon : in std_logic; -- power on
|
pon : in std_logic; -- power on
|
rtl : in std_logic; -- return to local
|
rtl : in std_logic; -- return to local
|
-- state inputs
|
-- state inputs
|
ACDS : in std_logic; -- listener active state (AH)
|
ACDS : in std_logic; -- listener active state (AH)
|
LADS : in std_logic; -- listener addressed state (L or LE)
|
LADS : in std_logic; -- listener addressed state (L or LE)
|
-- instructions
|
-- instructions
|
REN : in std_logic; -- remote enable
|
REN : in std_logic; -- remote enable
|
LLO : in std_logic; -- local lockout
|
LLO : in std_logic; -- local lockout
|
MLA : in std_logic; -- my listen address
|
MLA : in std_logic; -- my listen address
|
GTL : in std_logic; -- go to local
|
GTL : in std_logic; -- go to local
|
-- reported state
|
-- reported state
|
LOCS : out std_logic; -- local state
|
LOCS : out std_logic; -- local state
|
LWLS : out std_logic -- local with lockout state
|
LWLS : out std_logic -- local with lockout state
|
);
|
);
|
end component;
|
end component;
|
|
|
component if_func_SR is
|
component if_func_SR is
|
port(
|
port(
|
-- device inputs
|
-- device inputs
|
clk : in std_logic; -- clock
|
clk : in std_logic; -- clock
|
pon : in std_logic; -- power on
|
pon : in std_logic; -- power on
|
rsv : in std_logic; -- service request
|
rsv : in std_logic; -- service request
|
-- state inputs
|
-- state inputs
|
SPAS : in std_logic; -- serial poll active state (T or TE)
|
SPAS : in std_logic; -- serial poll active state (T or TE)
|
-- output instructions
|
-- output instructions
|
SRQ : out std_logic; -- service request
|
SRQ : out std_logic; -- service request
|
-- reported states
|
-- reported states
|
APRS : out std_logic -- affirmative poll response state
|
APRS : out std_logic -- affirmative poll response state
|
);
|
);
|
end component;
|
end component;
|
|
|
component commandEcoder is
|
component commandEcoder is
|
port (
|
port (
|
-- data
|
-- data
|
data : in std_logic_vector (7 downto 0);
|
data : in std_logic_vector (7 downto 0);
|
-- status byte
|
-- status byte
|
status_byte : in std_logic_vector (7 downto 0);
|
status_byte : in std_logic_vector (7 downto 0);
|
-- PPR command data
|
-- PPR command data
|
ppBitValue : in std_logic;
|
ppBitValue : in std_logic;
|
ppLineNumber : in std_logic_vector (2 downto 0);
|
ppLineNumber : in std_logic_vector (2 downto 0);
|
-- func states
|
-- func states
|
APRS : in std_logic; -- affirmative poll response state
|
APRS : in std_logic; -- affirmative poll response state
|
CACS : in std_logic; -- controller active state (C)
|
CACS : in std_logic; -- controller active state (C)
|
-- commands
|
-- commands
|
ATN : in std_logic;
|
ATN : in std_logic;
|
END_OF : in std_logic;
|
END_OF : in std_logic;
|
IDY : in std_logic;
|
IDY : in std_logic;
|
DAC : in std_logic;
|
DAC : in std_logic;
|
RFD : in std_logic;
|
RFD : in std_logic;
|
DAV : in std_logic;
|
DAV : in std_logic;
|
IFC : in std_logic;
|
IFC : in std_logic;
|
REN : in std_logic;
|
REN : in std_logic;
|
SRQ : in std_logic; -- request for service
|
SRQ : in std_logic; -- request for service
|
DAB : in std_logic;
|
DAB : in std_logic;
|
EOS : in std_logic;
|
EOS : in std_logic;
|
RQS : in std_logic; -- part of STB
|
RQS : in std_logic; -- part of STB
|
STB : in std_logic;
|
STB : in std_logic;
|
TCT : in std_logic;
|
TCT : in std_logic;
|
PPR : in std_logic;
|
PPR : in std_logic;
|
-------------------------------------------
|
-------------------------------------------
|
-- data lines -----------------------------
|
-- data lines -----------------------------
|
-------------------------------------------
|
-------------------------------------------
|
DO : out std_logic_vector (7 downto 0);
|
DO : out std_logic_vector (7 downto 0);
|
output_valid : out std_logic;
|
output_valid : out std_logic;
|
-------------------------------------------
|
-------------------------------------------
|
-- control lines --------------------------
|
-- control lines --------------------------
|
-------------------------------------------
|
-------------------------------------------
|
-- DAV line
|
-- DAV line
|
DAV_line : out std_logic;
|
DAV_line : out std_logic;
|
-- NRFD line
|
-- NRFD line
|
NRFD_line : out std_logic;
|
NRFD_line : out std_logic;
|
-- NDAC line
|
-- NDAC line
|
NDAC_line : out std_logic;
|
NDAC_line : out std_logic;
|
-- ATN line
|
-- ATN line
|
ATN_line : out std_logic;
|
ATN_line : out std_logic;
|
-- EOI line
|
-- EOI line
|
EOI_line : out std_logic;
|
EOI_line : out std_logic;
|
-- SRQ line
|
-- SRQ line
|
SRQ_line : out std_logic;
|
SRQ_line : out std_logic;
|
-- IFC line
|
-- IFC line
|
IFC_line : out std_logic;
|
IFC_line : out std_logic;
|
-- REN line
|
-- REN line
|
REN_line : out std_logic
|
REN_line : out std_logic
|
);
|
);
|
end component;
|
end component;
|
|
|
component commandDecoder is
|
component commandDecoder is
|
port (
|
port (
|
|
|
-------------------------------------------
|
-------------------------------------------
|
-- data lines -----------------------------
|
-- data lines -----------------------------
|
-------------------------------------------
|
-------------------------------------------
|
DI : in std_logic_vector (7 downto 0);
|
DI : in std_logic_vector (7 downto 0);
|
|
|
-------------------------------------------
|
-------------------------------------------
|
-- control lines --------------------------
|
-- control lines --------------------------
|
-------------------------------------------
|
-------------------------------------------
|
-- DAV line
|
-- DAV line
|
DAV_line : in std_logic;
|
DAV_line : in std_logic;
|
-- NRFD line
|
-- NRFD line
|
NRFD_line : in std_logic;
|
NRFD_line : in std_logic;
|
-- NDAC line
|
-- NDAC line
|
NDAC_line : in std_logic;
|
NDAC_line : in std_logic;
|
-- ATN line
|
-- ATN line
|
ATN_line : in std_logic;
|
ATN_line : in std_logic;
|
-- EOI line
|
-- EOI line
|
EOI_line : in std_logic;
|
EOI_line : in std_logic;
|
-- SRQ line
|
-- SRQ line
|
SRQ_line : in std_logic;
|
SRQ_line : in std_logic;
|
-- IFC line
|
-- IFC line
|
IFC_line : in std_logic;
|
IFC_line : in std_logic;
|
-- REN line
|
-- REN line
|
REN_line : in std_logic;
|
REN_line : in std_logic;
|
|
|
-------------------------------------------
|
-------------------------------------------
|
-- internal settiongs ---------------------
|
-- internal settiongs ---------------------
|
-------------------------------------------
|
-------------------------------------------
|
-- eos mark
|
-- eos mark
|
eosMark : in std_logic_vector (7 downto 0);
|
eosMark : in std_logic_vector (7 downto 0);
|
-- eos used
|
-- eos used
|
eosUsed : in std_logic;
|
eosUsed : in std_logic;
|
-- my listen address
|
-- my listen address
|
myListAddr : in std_logic_vector (4 downto 0);
|
myListAddr : in std_logic_vector (4 downto 0);
|
-- my talk address
|
-- my talk address
|
myTalkAddr : in std_logic_vector (4 downto 0);
|
myTalkAddr : in std_logic_vector (4 downto 0);
|
-- secondary address detected
|
-- secondary address detected
|
secAddrDetected : in std_logic;
|
secAddrDetected : in std_logic;
|
|
|
-------------------------------------------
|
-------------------------------------------
|
-- internal states ------------------------
|
-- internal states ------------------------
|
-------------------------------------------
|
-------------------------------------------
|
-- serial poll active state (T or TE)
|
-- serial poll active state (T or TE)
|
SPAS : in std_logic;
|
SPAS : in std_logic;
|
|
|
-------------------------------------------
|
-------------------------------------------
|
-- single line commands -------------------
|
-- single line commands -------------------
|
-------------------------------------------
|
-------------------------------------------
|
-- attention
|
-- attention
|
ATN : out std_logic;
|
ATN : out std_logic;
|
-- data accepted
|
-- data accepted
|
DAC : out std_logic;
|
DAC : out std_logic;
|
-- data valid
|
-- data valid
|
DAV : out std_logic;
|
DAV : out std_logic;
|
-- end
|
-- end
|
END_c : out std_logic;
|
END_c : out std_logic;
|
-- identify
|
-- identify
|
IDY : out std_logic;
|
IDY : out std_logic;
|
-- interface clear
|
-- interface clear
|
IFC : out std_logic;
|
IFC : out std_logic;
|
-- remote enable
|
-- remote enable
|
REN : out std_logic;
|
REN : out std_logic;
|
-- ready for data
|
-- ready for data
|
RFD : out std_logic;
|
RFD : out std_logic;
|
-- service request
|
-- service request
|
SRQ : out std_logic;
|
SRQ : out std_logic;
|
|
|
-------------------------------------------
|
-------------------------------------------
|
-- multi line commands --------------------
|
-- multi line commands --------------------
|
-------------------------------------------
|
-------------------------------------------
|
-- addressed command group
|
-- addressed command group
|
ACG : out std_logic;
|
ACG : out std_logic;
|
-- data byte
|
-- data byte
|
DAB : out std_logic;
|
DAB : out std_logic;
|
-- device clear
|
-- device clear
|
DCL : out std_logic;
|
DCL : out std_logic;
|
-- end of string
|
-- end of string
|
EOS : out std_logic;
|
EOS : out std_logic;
|
-- group execute trigger
|
-- group execute trigger
|
GET : out std_logic;
|
GET : out std_logic;
|
-- go to local
|
-- go to local
|
GTL : out std_logic;
|
GTL : out std_logic;
|
-- listen address group
|
-- listen address group
|
LAG : out std_logic;
|
LAG : out std_logic;
|
-- local lockout
|
-- local lockout
|
LLO : out std_logic;
|
LLO : out std_logic;
|
-- my listen address
|
-- my listen address
|
MLA : out std_logic;
|
MLA : out std_logic;
|
-- my talk address
|
-- my talk address
|
MTA : out std_logic;
|
MTA : out std_logic;
|
-- my secondary address
|
-- my secondary address
|
MSA : out std_logic;
|
MSA : out std_logic;
|
-- null byte
|
-- null byte
|
NUL : out std_logic;
|
NUL : out std_logic;
|
-- other secondary address
|
-- other secondary address
|
OSA : out std_logic;
|
OSA : out std_logic;
|
-- other talk address
|
-- other talk address
|
OTA : out std_logic;
|
OTA : out std_logic;
|
-- primary command group
|
-- primary command group
|
PCG : out std_logic;
|
PCG : out std_logic;
|
-- parallel poll configure
|
-- parallel poll configure
|
PPC : out std_logic;
|
PPC : out std_logic;
|
-- parallel poll enable
|
-- parallel poll enable
|
PPE : out std_logic;
|
PPE : out std_logic;
|
-- parallel poll disable
|
-- parallel poll disable
|
PPD : out std_logic;
|
PPD : out std_logic;
|
-- parallel poll response
|
-- parallel poll response
|
PPR : out std_logic;
|
PPR : out std_logic;
|
-- parallel poll unconfigure
|
-- parallel poll unconfigure
|
PPU : out std_logic;
|
PPU : out std_logic;
|
-- request service
|
-- request service
|
RQS : out std_logic;
|
RQS : out std_logic;
|
-- secondary command group
|
-- secondary command group
|
SCG : out std_logic;
|
SCG : out std_logic;
|
-- selected device clear
|
-- selected device clear
|
SDC : out std_logic;
|
SDC : out std_logic;
|
-- serial poll disable
|
-- serial poll disable
|
SPD : out std_logic;
|
SPD : out std_logic;
|
-- serial poll enable
|
-- serial poll enable
|
SPE : out std_logic;
|
SPE : out std_logic;
|
-- status byte
|
-- status byte
|
STB : out std_logic;
|
STB : out std_logic;
|
-- talk address group
|
-- talk address group
|
TAG : out std_logic;
|
TAG : out std_logic;
|
-- take control
|
-- take control
|
TCT : out std_logic;
|
TCT : out std_logic;
|
-- universal command group
|
-- universal command group
|
UCG : out std_logic;
|
UCG : out std_logic;
|
-- unlisten
|
-- unlisten
|
UNL : out std_logic;
|
UNL : out std_logic;
|
-- untalk
|
-- untalk
|
UNT : out std_logic
|
UNT : out std_logic
|
);
|
);
|
end component;
|
end component;
|
|
|
component SecondaryAddressDecoder is
|
component SecondaryAddressDecoder is
|
port (
|
port (
|
-- secondary address mask
|
-- secondary address mask
|
secAddrMask : in std_logic_vector (31 downto 0);
|
secAddrMask : in std_logic_vector (31 downto 0);
|
-- data input
|
-- data input
|
DI : in std_logic_vector (4 downto 0);
|
DI : in std_logic_vector (4 downto 0);
|
-- secondary address detected
|
-- secondary address detected
|
secAddrDetected : out std_logic
|
secAddrDetected : out std_logic
|
);
|
);
|
end component;
|
end component;
|
|
|
component SecAddrSaver is
|
component SecAddrSaver is
|
port (
|
port (
|
reset : in std_logic;
|
reset : in std_logic;
|
------------------- gpib ----------------------
|
------------------- gpib ----------------------
|
TADS : in std_logic;
|
TADS : in std_logic;
|
TPAS : in std_logic;
|
TPAS : in std_logic;
|
LADS : in std_logic;
|
LADS : in std_logic;
|
LPAS : in std_logic;
|
LPAS : in std_logic;
|
MSA_Dec : in std_logic;
|
MSA_Dec : in std_logic;
|
DI : in std_logic_vector(4 downto 0);
|
DI : in std_logic_vector(4 downto 0);
|
currentSecAddr : out std_logic_vector(4 downto 0)
|
currentSecAddr : out std_logic_vector(4 downto 0)
|
);
|
);
|
end component;
|
end component;
|
|
|
component gpibInterface is port (
|
component gpibInterface is port (
|
clk : in std_logic;
|
clk : in std_logic;
|
reset : std_logic;
|
reset : std_logic;
|
-- application interface
|
-- application interface
|
isLE : in std_logic;
|
isLE : in std_logic;
|
isTE : in std_logic;
|
isTE : in std_logic;
|
lpeUsed : in std_logic;
|
lpeUsed : in std_logic;
|
fixedPpLine : in std_logic_vector (2 downto 0);
|
fixedPpLine : in std_logic_vector (2 downto 0);
|
eosUsed : in std_logic;
|
eosUsed : in std_logic;
|
eosMark : in std_logic_vector (7 downto 0);
|
eosMark : in std_logic_vector (7 downto 0);
|
myListAddr : in std_logic_vector (4 downto 0);
|
myListAddr : in std_logic_vector (4 downto 0);
|
myTalkAddr : in std_logic_vector (4 downto 0);
|
myTalkAddr : in std_logic_vector (4 downto 0);
|
secAddrMask : in std_logic_vector (31 downto 0);
|
secAddrMask : in std_logic_vector (31 downto 0);
|
data : in std_logic_vector (7 downto 0);
|
data : in std_logic_vector (7 downto 0);
|
status_byte : in std_logic_vector (7 downto 0);
|
status_byte : in std_logic_vector (7 downto 0);
|
T1 : in std_logic_vector (7 downto 0);
|
T1 : in std_logic_vector (7 downto 0);
|
-- local commands to interface
|
-- local commands to interface
|
rdy : in std_logic; -- ready for next message (AH)
|
rdy : in std_logic; -- ready for next message (AH)
|
nba : in std_logic; -- new byte available (SH)
|
nba : in std_logic; -- new byte available (SH)
|
ltn : in std_logic; -- listen (L, LE)
|
ltn : in std_logic; -- listen (L, LE)
|
lun : in std_logic; -- local unlisten (L, LE)
|
lun : in std_logic; -- local unlisten (L, LE)
|
lon : in std_logic; -- listen only (L, LE)
|
lon : in std_logic; -- listen only (L, LE)
|
ton : in std_logic; -- talk only (T, TE)
|
ton : in std_logic; -- talk only (T, TE)
|
endOf : in std_logic; -- end of byte string (T, TE)
|
endOf : in std_logic; -- end of byte string (T, TE)
|
gts : in std_logic; -- go to standby (C)
|
gts : in std_logic; -- go to standby (C)
|
rpp : in std_logic; -- request parallel poll (C)
|
rpp : in std_logic; -- request parallel poll (C)
|
tcs : in std_logic; -- take control synchronously (C, AH)
|
tcs : in std_logic; -- take control synchronously (C, AH)
|
tca : in std_logic; -- take control asynchronously (C)
|
tca : in std_logic; -- take control asynchronously (C)
|
sic : in std_logic; -- send interface clear (C)
|
sic : in std_logic; -- send interface clear (C)
|
rsc : in std_logic; -- request system control (C)
|
rsc : in std_logic; -- request system control (C)
|
sre : in std_logic; -- send remote enable (C)
|
sre : in std_logic; -- send remote enable (C)
|
rtl : in std_logic; -- return to local (RL)
|
rtl : in std_logic; -- return to local (RL)
|
rsv : in std_logic; -- request service (SR)
|
rsv : in std_logic; -- request service (SR)
|
ist : in std_logic; -- individual status (PP)
|
ist : in std_logic; -- individual status (PP)
|
lpe : in std_logic; -- local poll enable (PP)
|
lpe : in std_logic; -- local poll enable (PP)
|
|
|
-- local commands from interface
|
-- local commands from interface
|
dvd : out std_logic; -- data valid (AH)
|
dvd : out std_logic; -- data valid (AH)
|
wnc : out std_logic; -- wait for new cycle (SH)
|
wnc : out std_logic; -- wait for new cycle (SH)
|
tac : out std_logic; -- talker active (T, TE)
|
tac : out std_logic; -- talker active (T, TE)
|
lac : out std_logic; -- listener active (L, LE)
|
lac : out std_logic; -- listener active (L, LE)
|
cwrc : out std_logic; -- controller write commands
|
cwrc : out std_logic; -- controller write commands
|
cwrd : out std_logic; -- controller write data
|
cwrd : out std_logic; -- controller write data
|
clr : out std_logic; -- clear device (DC)
|
clr : out std_logic; -- clear device (DC)
|
trg : out std_logic; -- trigger device (DT)
|
trg : out std_logic; -- trigger device (DT)
|
atl : out std_logic; -- addressed to listen (T or TE)
|
atl : out std_logic; -- addressed to listen (T or TE)
|
att : out std_logic; -- addressed to talk(L or LE)
|
att : out std_logic; -- addressed to talk(L or LE)
|
mla : out std_logic; -- my listen addres decoded (L or LE)
|
mla : out std_logic; -- my listen addres decoded (L or LE)
|
lsb : out std_logic; -- last byte
|
lsb : out std_logic; -- last byte
|
spa : out std_logic; -- seriall poll active
|
spa : out std_logic; -- seriall poll active
|
ppr : out std_logic; -- parallel poll ready
|
ppr : out std_logic; -- parallel poll ready
|
sreq : out std_logic; -- service requested
|
sreq : out std_logic; -- service requested
|
isLocal : out std_logic; -- device is local controlled
|
isLocal : out std_logic; -- device is local controlled
|
currentSecAddr : out std_logic_vector (4 downto 0); -- current sec addr
|
currentSecAddr : out std_logic_vector (4 downto 0); -- current sec addr
|
-- interface signals
|
-- interface signals
|
DI : in std_logic_vector (7 downto 0);
|
DI : in std_logic_vector (7 downto 0);
|
DO : out std_logic_vector (7 downto 0);
|
DO : out std_logic_vector (7 downto 0);
|
output_valid : out std_logic;
|
output_valid : out std_logic;
|
-- attention
|
-- attention
|
ATN_in : in std_logic;
|
ATN_in : in std_logic;
|
ATN_out : out std_logic;
|
ATN_out : out std_logic;
|
-- data valid
|
-- data valid
|
DAV_in : in std_logic;
|
DAV_in : in std_logic;
|
DAV_out : out std_logic;
|
DAV_out : out std_logic;
|
-- not ready for data
|
-- not ready for data
|
NRFD_in : in std_logic;
|
NRFD_in : in std_logic;
|
NRFD_out : out std_logic;
|
NRFD_out : out std_logic;
|
-- no data accepted
|
-- no data accepted
|
NDAC_in : in std_logic;
|
NDAC_in : in std_logic;
|
NDAC_out : out std_logic;
|
NDAC_out : out std_logic;
|
-- end or identify
|
-- end or identify
|
EOI_in : in std_logic;
|
EOI_in : in std_logic;
|
EOI_out : out std_logic;
|
EOI_out : out std_logic;
|
-- service request
|
-- service request
|
SRQ_in : in std_logic;
|
SRQ_in : in std_logic;
|
SRQ_out : out std_logic;
|
SRQ_out : out std_logic;
|
-- interface clear
|
-- interface clear
|
IFC_in : in std_logic;
|
IFC_in : in std_logic;
|
IFC_out : out std_logic;
|
IFC_out : out std_logic;
|
-- remote enable
|
-- remote enable
|
REN_in : in std_logic;
|
REN_in : in std_logic;
|
REN_out : out std_logic
|
REN_out : out std_logic
|
;debug1 : out std_logic
|
;debug1 : out std_logic
|
);
|
);
|
end component;
|
end component;
|
|
|
|
|