I'm having some synthesis issues using 7 series GTX transceiver wizard in my project. I designed a basic custom protocol and a top level wrapper. In behavioral everything works just fine, but when synthesizing project the data bus attached to gt0_txdata_in[15:0] it's not properly rendered thus forcing unknown "X" (same thing happens for gt0_txcharisk_in[1:0]). I'm using Vivado and the compiler doesn't give me any specific warning. I've also looked at gtwizard example design and I'm not doing anything too different from that.
I'm developing my project on Kintex-7 FPGA.
Here is scope and wave window:
(click to enlarge)
(click to enlarge)
Here is my protocol VHDL entity:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity protocol_frame_gen is
Port ( pfg_clk_in : in STD_LOGIC;
pfg_reset_in : in STD_LOGIC;
pfg_data_in : in STD_LOGIC_VECTOR (15 downto 0);
pfg_fifo_empty_in : in STD_LOGIC;
pfg_trasm_rqst_in : in STD_LOGIC;
pfg_fifo_rd_enable_out : out STD_LOGIC;
pfg_data_out : out STD_LOGIC_VECTOR (15 downto 0);
pfg_txcharisk: out STD_LOGIC_VECTOR (1 downto 0)
);
end protocol_frame_gen;
architecture Behavioral of protocol_frame_gen is
type state_type is ( idle, trasmission, dummy_state, end_trasmission);
signal state: state_type;
signal pfg_data_out_reg: STD_LOGIC_VECTOR (15 downto 0):= (others => '0');
signal mux_addr: integer range 0 to 3 := 0;
begin
pfg_data_out <= pfg_data_out_reg;
main: process(pfg_reset_in, pfg_clk_in)
begin
if pfg_reset_in='1' then
state <= idle;
mux_addr <= 0;
pfg_fifo_rd_enable_out <= '0';
elsif rising_edge(pfg_clk_in) then
case state is
when idle =>
if pfg_trasm_rqst_in='1' then
state <= trasmission;
end if;
when trasmission =>
if mux_addr<2 then
mux_addr <= mux_addr+1;
pfg_fifo_rd_enable_out <= '1';
else
null;
end if;
if pfg_fifo_empty_in='1' then
state <= end_trasmission;
pfg_fifo_rd_enable_out <= '0';
mux_addr <= 3;
end if;
when end_trasmission =>
mux_addr <= 0;
state <= idle;
when dummy_state =>
null;
end case;
end if;
end process main;
mux: process (pfg_clk_in)
begin
if rising_edge(pfg_clk_in) then
if mux_addr=0 then
pfg_data_out_reg <= "1111110111111101"; --idle character K29.7 1111110111111101
pfg_txcharisk <= "00";
elsif mux_addr=1 then
pfg_data_out_reg <= "0000000110111100"; --start of frame K28.5 1011110010111100
pfg_txcharisk <= "01";
elsif mux_addr=2 then
pfg_data_out_reg <= pfg_data_in; --valid data
pfg_txcharisk <= "00";
elsif mux_addr=3 then
pfg_data_out_reg <= "0001110000011100"; --end of frame K28.0
pfg_txcharisk <= "00";
end if;
end if;
end process mux;
end Behavioral;
here is wrapper code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_misc.all;
library UNISIM;
use UNISIM.VCOMPONENTS.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
library UNISIM;
use UNISIM.VComponents.all;
entity gtx_interface_wrapper is
Port (--reset
gt_soft_reset_in: in STD_LOGIC;
protocol_reset_in: in STD_LOGIC;
--clocking
GTREFCLK_PAD_P_IN: in STD_LOGIC;
GTREFCLK_PAD_N_IN: in STD_LOGIC;
tx_fifo_clk_out : out STD_LOGIC;
rx_fifo_clk_out : out STD_LOGIC;
fsm_clk_in: in STD_LOGIC;
--tx
tx_data_in : in STD_LOGIC_VECTOR (15 downto 0);
tx_fifo_empty_in : in STD_LOGIC;
tx_trasm_rqst_in : in STD_LOGIC;
tx_fifo_rd_enable_out : out STD_LOGIC;
--rx
rx_data_out : out STD_LOGIC_VECTOR (15 downto 0);
rx_fifo_wren_out : out STD_LOGIC;
--serial I/O
gtxtxp_out: out STD_LOGIC;
gtxtxn_out: out STD_LOGIC;
gtxrxp_in: in STD_LOGIC;
gtxrxn_in: IN STD_LOGIC
);
end gtx_interface_wrapper;
architecture Mapping of gtx_interface_wrapper is
----Component Declaration------
component gtwizard_0
port
(
SOFT_RESET_TX_IN : in std_logic;
SOFT_RESET_RX_IN : in std_logic;
DONT_RESET_ON_DATA_ERROR_IN : in std_logic;
Q0_CLK1_GTREFCLK_PAD_N_IN : in std_logic;
Q0_CLK1_GTREFCLK_PAD_P_IN : in std_logic;
GT0_TX_FSM_RESET_DONE_OUT : out std_logic;
GT0_RX_FSM_RESET_DONE_OUT : out std_logic;
GT0_DATA_VALID_IN : in std_logic;
GT0_TX_MMCM_LOCK_OUT : out std_logic;
GT0_RX_MMCM_LOCK_OUT : out std_logic;
GT0_TXUSRCLK_OUT : out std_logic;
GT0_TXUSRCLK2_OUT : out std_logic;
GT0_RXUSRCLK_OUT : out std_logic;
GT0_RXUSRCLK2_OUT : out std_logic;
gt0_cpllfbclklost_out : out std_logic;
gt0_cplllock_out : out std_logic;
gt0_cpllreset_in : in std_logic;
gt0_drpaddr_in : in std_logic_vector(8 downto 0);
gt0_drpdi_in : in std_logic_vector(15 downto 0);
gt0_drpdo_out : out std_logic_vector(15 downto 0);
gt0_drpen_in : in std_logic;
gt0_drprdy_out : out std_logic;
gt0_drpwe_in : in std_logic;
gt0_dmonitorout_out : out std_logic_vector(7 downto 0);
gt0_eyescanreset_in : in std_logic;
gt0_rxuserrdy_in : in std_logic;
gt0_eyescandataerror_out : out std_logic;
gt0_eyescantrigger_in : in std_logic;
gt0_rxdata_out : out std_logic_vector(15 downto 0);
gt0_rxdisperr_out : out std_logic_vector(1 downto 0);
gt0_rxnotintable_out : out std_logic_vector(1 downto 0);
gt0_gtxrxp_in : in std_logic;
gt0_gtxrxn_in : in std_logic;
gt0_rxdfelpmreset_in : in std_logic;
gt0_rxmonitorout_out : out std_logic_vector(6 downto 0);
gt0_rxmonitorsel_in : in std_logic_vector(1 downto 0);
gt0_rxoutclkfabric_out : out std_logic;
gt0_gtrxreset_in : in std_logic;
gt0_rxpmareset_in : in std_logic;
gt0_rxmcommaalignen_in : in std_logic;
gt0_rxpcommaalignen_in : in std_logic;
gt0_rxchariscomma_out : out std_logic_vector(1 downto 0);
gt0_rxcharisk_out : out std_logic_vector(1 downto 0);
gt0_rxresetdone_out : out std_logic;
gt0_gttxreset_in : in std_logic;
gt0_txuserrdy_in : in std_logic;
gt0_txdata_in : in std_logic_vector(15 downto 0);
gt0_gtxtxn_out : out std_logic;
gt0_gtxtxp_out : out std_logic;
gt0_txoutclkfabric_out : out std_logic;
gt0_txoutclkpcs_out : out std_logic;
gt0_txcharisk_in : in std_logic_vector(1 downto 0);
gt0_txresetdone_out : out std_logic;
GT0_QPLLOUTCLK_OUT : out std_logic;
GT0_QPLLOUTREFCLK_OUT : out std_logic;
sysclk_in : in std_logic
);
end component;
component protocol_frame_gen
port
(
pfg_clk_in : in STD_LOGIC;
pfg_reset_in : in STD_LOGIC;
pfg_data_in : in STD_LOGIC_VECTOR (15 downto 0);
pfg_fifo_empty_in : in STD_LOGIC;
pfg_trasm_rqst_in : in STD_LOGIC;
pfg_fifo_rd_enable_out : out STD_LOGIC;
pfg_data_out : out STD_LOGIC_VECTOR (15 downto 0);
pfg_txcharisk: out STD_LOGIC_VECTOR (1 downto 0)
);
end component;
component protocol_frame_check
port
(
pfc_clk_in : in STD_LOGIC;
pfc_reset_in : in STD_LOGIC;
pfc_data_in : in STD_LOGIC_VECTOR (15 downto 0);
pfc_data_out : out STD_LOGIC_VECTOR (15 downto 0);
pfc_fifo_wren_out : out STD_LOGIC
);
end component;
--_______________________INTERNAL REGISTER______________________--
--gt0 I/O registers
signal SOFT_RESET_TX_IN_i: std_logic;
signal SOFT_RESET_RX_IN_i: std_logic;
signal DONT_RESET_ON_DATA_ERROR_IN_i: std_logic;
signal Q0_CLK1_GTREFCLK_PAD_N_IN_i: std_logic;
signal Q0_CLK1_GTREFCLK_PAD_P_IN_i: std_logic;
signal GT0_TX_FSM_RESET_DONE_OUT_i: std_logic;
signal GT0_RX_FSM_RESET_DONE_OUT_i: std_logic;
signal GT0_DATA_VALID_IN_i: std_logic;
signal GT0_TX_MMCM_LOCK_OUT_i: std_logic;
signal GT0_RX_MMCM_LOCK_OUT_i: std_logic;
signal GT0_TXUSRCLK_OUT_i: std_logic;
signal GT0_TXUSRCLK2_OUT_i: std_logic;
signal GT0_RXUSRCLK_OUT_i: std_logic;
signal GT0_RXUSRCLK2_OUT_i: std_logic;
signal gt0_cpllfbclklost_out_i: std_logic;
signal gt0_cplllock_out_i: std_logic;
signal gt0_cpllreset_in_i: std_logic;
signal gt0_drpaddr_in_i: std_logic_vector(8 downto 0);
signal gt0_drpdi_in_i: std_logic_vector(15 downto 0);
signal gt0_drpdo_out_i: std_logic_vector(15 downto 0);
signal gt0_drpen_in_i: std_logic;
signal gt0_drprdy_out_i: std_logic;
signal gt0_drpwe_in_i: std_logic;
signal gt0_dmonitorout_out_i: std_logic_vector(7 downto 0);
signal gt0_eyescanreset_in_i: std_logic;
signal gt0_rxuserrdy_in_i: std_logic;
signal gt0_eyescandataerror_out_i: std_logic;
signal gt0_eyescantrigger_in_i: std_logic;
signal gt0_rxdata_out_i: std_logic_vector(15 downto 0);
signal gt0_rxdisperr_out_i: std_logic_vector(1 downto 0);
signal gt0_rxnotintable_out_i: std_logic_vector(1 downto 0);
signal gt0_gtxrxp_in_i: std_logic;
signal gt0_gtxrxn_in_i: std_logic;
signal gt0_rxdfelpmreset_in_i: std_logic;
signal gt0_rxmonitorout_out_i: std_logic_vector(6 downto 0);
signal gt0_rxmonitorsel_in_i: std_logic_vector(1 downto 0);
signal gt0_rxoutclkfabric_out_i: std_logic;
signal gt0_gtrxreset_in_i: std_logic;
signal gt0_rxpmareset_in_i: std_logic;
signal gt0_rxmcommaalignen_in_i: std_logic;
signal gt0_rxpcommaalignen_in_i: std_logic;
signal gt0_rxchariscomma_out_i: std_logic_vector(1 downto 0);
signal gt0_rxcharisk_out_i: std_logic_vector(1 downto 0);
signal gt0_rxresetdone_out_i: std_logic;
signal gt0_gttxreset_in_i: std_logic;
signal gt0_txuserrdy_in_i: std_logic;
signal gt0_txdata_in_i: std_logic_vector(15 downto 0);
signal gt0_gtxtxn_out_i: std_logic;
signal gt0_gtxtxp_out_i: std_logic;
signal gt0_txoutclkfabric_out_i: std_logic;
signal gt0_txoutclkpcs_out_i: std_logic;
signal gt0_txcharisk_in_i: std_logic_vector(1 downto 0);
signal gt0_txresetdone_out_i: std_logic;
signal GT0_QPLLOUTCLK_OUT_i: std_logic;
signal GT0_QPLLOUTREFCLK_OUT_i: std_logic;
signal sysclk_in_i: std_logic ;
--frame generator
signal pfg_clk_in_i: STD_LOGIC;
signal pfg_reset_in_i: STD_LOGIC;
signal pfg_data_in_i: STD_LOGIC_VECTOR (15 downto 0);
signal pfg_fifo_empty_in_i: STD_LOGIC;
signal pfg_trasm_rqst_in_i: STD_LOGIC;
signal pfg_fifo_rd_enable_out_i: STD_LOGIC;
signal pfg_data_out_i: STD_LOGIC_VECTOR (15 downto 0) ;
signal pfg_txcharisk_i: std_logic_vector(1 downto 0);
--frame checker
signal pfc_clk_in_i: STD_LOGIC;
signal pfc_reset_in_i: STD_LOGIC;
signal pfc_data_in_i: STD_LOGIC_VECTOR (15 downto 0);
signal pfc_data_out_i: STD_LOGIC_VECTOR (15 downto 0);
signal pfc_fifo_wren_out_i: STD_LOGIC;
begin
unit_gt0: gtwizard_0 port map ( SOFT_RESET_TX_IN => SOFT_RESET_TX_IN_i,
SOFT_RESET_RX_IN => SOFT_RESET_RX_IN_i,
DONT_RESET_ON_DATA_ERROR_IN => DONT_RESET_ON_DATA_ERROR_IN_i,
Q0_CLK1_GTREFCLK_PAD_N_IN => Q0_CLK1_GTREFCLK_PAD_N_IN_i,
Q0_CLK1_GTREFCLK_PAD_P_IN => Q0_CLK1_GTREFCLK_PAD_P_IN_i,
GT0_TX_FSM_RESET_DONE_OUT => GT0_TX_FSM_RESET_DONE_OUT_i,
GT0_RX_FSM_RESET_DONE_OUT => GT0_RX_FSM_RESET_DONE_OUT_i,
GT0_DATA_VALID_IN => GT0_DATA_VALID_IN_i,
GT0_TX_MMCM_LOCK_OUT => GT0_TX_MMCM_LOCK_OUT_i,
GT0_RX_MMCM_LOCK_OUT => GT0_RX_MMCM_LOCK_OUT_i,
GT0_TXUSRCLK_OUT => GT0_TXUSRCLK_OUT_i,
GT0_TXUSRCLK2_OUT => GT0_TXUSRCLK2_OUT_i,
GT0_RXUSRCLK_OUT => GT0_RXUSRCLK_OUT_i,
GT0_RXUSRCLK2_OUT => GT0_RXUSRCLK2_OUT_i,
gt0_cpllfbclklost_out => gt0_cpllfbclklost_out_i,
gt0_cplllock_out => gt0_cplllock_out_i,
gt0_cpllreset_in => gt0_cpllreset_in_i,
gt0_drpaddr_in => gt0_drpaddr_in_i,
gt0_drpdi_in => gt0_drpdi_in_i,
gt0_drpdo_out => gt0_drpdo_out_i,
gt0_drpen_in => gt0_drpen_in_i,
gt0_drprdy_out => gt0_drprdy_out_i,
gt0_drpwe_in => gt0_drpwe_in_i,
gt0_dmonitorout_out => gt0_dmonitorout_out_i,
gt0_eyescanreset_in => gt0_eyescanreset_in_i,
gt0_rxuserrdy_in => gt0_rxuserrdy_in_i,
gt0_eyescandataerror_out => gt0_eyescandataerror_out_i,
gt0_eyescantrigger_in => gt0_eyescantrigger_in_i,
gt0_rxdata_out => gt0_rxdata_out_i,
gt0_rxdisperr_out => gt0_rxdisperr_out_i,
gt0_rxnotintable_out => gt0_rxnotintable_out_i,
gt0_gtxrxp_in => gt0_gtxrxp_in_i,
gt0_gtxrxn_in => gt0_gtxrxn_in_i,
gt0_rxdfelpmreset_in => gt0_rxdfelpmreset_in_i,
gt0_rxmonitorout_out => gt0_rxmonitorout_out_i,
gt0_rxmonitorsel_in => gt0_rxmonitorsel_in_i,
gt0_rxoutclkfabric_out => gt0_rxoutclkfabric_out_i,
gt0_gtrxreset_in => gt0_gtrxreset_in_i,
gt0_rxpmareset_in => gt0_rxpmareset_in_i,
gt0_rxmcommaalignen_in => gt0_rxmcommaalignen_in_i,
gt0_rxpcommaalignen_in => gt0_rxpcommaalignen_in_i,
gt0_rxchariscomma_out => gt0_rxchariscomma_out_i,
gt0_rxcharisk_out => gt0_rxcharisk_out_i,
gt0_rxresetdone_out => gt0_rxresetdone_out_i,
gt0_gttxreset_in => gt0_gttxreset_in_i,
gt0_txuserrdy_in => gt0_txuserrdy_in_i,
gt0_txdata_in => gt0_txdata_in_i,
gt0_gtxtxn_out => gt0_gtxtxn_out_i,
gt0_gtxtxp_out => gt0_gtxtxp_out_i,
gt0_txoutclkfabric_out => gt0_txoutclkfabric_out_i,
gt0_txoutclkpcs_out => gt0_txoutclkpcs_out_i,
gt0_txcharisk_in => gt0_txcharisk_in_i,
gt0_txresetdone_out => gt0_txresetdone_out_i,
GT0_QPLLOUTCLK_OUT => GT0_QPLLOUTCLK_OUT_i,
GT0_QPLLOUTREFCLK_OUT => GT0_QPLLOUTREFCLK_OUT_i,
sysclk_in => sysclk_in_i );
unit_pfg: protocol_frame_gen port map ( pfg_clk_in => pfg_clk_in_i,
pfg_reset_in => pfg_reset_in_i,
pfg_data_in => pfg_data_in_i,
pfg_fifo_empty_in => pfg_fifo_empty_in_i,
pfg_trasm_rqst_in => pfg_trasm_rqst_in_i,
pfg_fifo_rd_enable_out => pfg_fifo_rd_enable_out_i,
pfg_data_out => pfg_data_out_i,
pfg_txcharisk => pfg_txcharisk_i );
unit_pfc: protocol_frame_check port map ( pfc_clk_in => pfc_clk_in_i,
pfc_reset_in => pfc_reset_in_i,
pfc_data_in => pfc_data_in_i,
pfc_data_out => pfc_data_out_i,
pfc_fifo_wren_out => pfc_fifo_wren_out_i );
--_______________EXTERNAL WIRING_______________--
--reset
SOFT_RESET_TX_IN_i <= gt_soft_reset_in;
SOFT_RESET_RX_IN_i <= gt_soft_reset_in;
pfg_reset_in_i <= protocol_reset_in;
pfc_reset_in_i <= protocol_reset_in;
--clocking (refclk has IBUF declaration)
Q0_CLK1_GTREFCLK_PAD_P_IN_i <= GTREFCLK_PAD_P_IN;
Q0_CLK1_GTREFCLK_PAD_N_IN_i <= GTREFCLK_PAD_N_IN;
tx_fifo_clk_out <= GT0_TXUSRCLK2_OUT_i;
rx_fifo_clk_out <= GT0_RXUSRCLK2_OUT_i;
sysclk_in_i <= fsm_clk_in;
--tx
pfg_data_in_i <= tx_data_in;
pfg_fifo_empty_in_i <= tx_fifo_empty_in;
pfg_trasm_rqst_in_i <= tx_trasm_rqst_in;
tx_fifo_rd_enable_out <= pfg_fifo_rd_enable_out_i;
--rx
rx_data_out <= pfc_data_out_i;
rx_fifo_wren_out <= pfc_fifo_wren_out_i;
--serial I/O
gtxtxp_out <= gt0_gtxtxp_out_i;
gtxtxn_out <= gt0_gtxtxn_out_i;
gt0_gtxrxp_in_i <= gtxrxp_in;
gt0_gtxrxn_in_i <= gtxrxn_in;
--_______________INTERNAL WIRING_______________--
--protocol clocking
pfg_clk_in_i <= GT0_TXUSRCLK2_OUT_i;
pfc_clk_in_i <= GT0_RXUSRCLK2_OUT_i;
--datapath
gt0_txdata_in_i <= pfg_data_out_i;
pfc_data_in_i <= gt0_rxdata_out_i;
--gt0 configuration: these signals are all tied to groung for
--proper gt funciotning
gt0_rxdfelpmreset_in_i <= '0';
gt0_gtrxreset_in_i <= '0';
gt0_rxpmareset_in_i <= '0';
gt0_cpllreset_in_i <= '0';
--DRP ports are not used
gt0_drpaddr_in_i <= (others => '0');
gt0_drpdi_in_i <= (others => '0');
gt0_drpen_in_i <= '0';
gt0_drpwe_in_i <= '0';
gt0_eyescanreset_in_i <= '0';
gt0_eyescantrigger_in_i <= '0';
gt0_gttxreset_in_i <= '0';
gt0_rxmonitorsel_in_i <= (others => '0');
gt0_txuserrdy_in_i <= '1';
gt0_rxuserrdy_in_i <= '1';
--gt0 configuration: these signals are all tied to power for
--proper gt funciotning
gt0_txcharisk_in_i <= pfg_txcharisk_i;
gt0_rxmcommaalignen_in_i <= '1';
gt0_rxpcommaalignen_in_i <= '1';
DONT_RESET_ON_DATA_ERROR_IN_i <= '0';
end Mapping;
Related
Thank you, everyone, here I have modified the post. I have written a simple code VHDL for trap filter by using different components for each task. The below is sample code where different components are used and all the other components are working perfectly except accumulator component(acc1), the out signal remains zero. In the acc1 one component I am trying to to make two accumulators where the first acc1 (output of the first accumulator) is the input for the acc2. As the other components are working so here I only showed the port mapping of acc1 component in the code along the test bench.
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use IEEE.std_logic_unsigned.all;
use ieee.fixed_pkg.all;
ENTITY TRAPFILTER IS
GENERIC (
K : integer :=80;
L : integer :=200
--M : signed(9 downto 0) := to_signed(5)
);
PORT
(
CLK : IN STD_LOGIC;
RST : IN STD_LOGIC;
DATAIN : IN STD_LOGIC_VECTOR(13 DOWNTO 0);
DATAOUT : OUT STD_LOGIC_VECTOR(24 DOWNTO 0);
DATAOUT1 : OUT STD_LOGIC_VECTOR(25 DOWNTO 0); ---
READY : OUT STD_LOGIC;
Soutout : out std_logic_vector(23 downto 0);
Koutout : out std_logic_vector(13 downto 0);
Loutout : out std_logic_vector(13 downto 0)
);
END ENTITY TRAPFILTER;
ARCHITECTURE RTL OF TRAPFILTER IS
constant M : sfixed(1 downto -2) := to_sfixed(0.01,1,-2);
type Sdelay_reg is array(0 to 2) OF signed(21 downto 0);
signal S_reg : Sdelay_reg :=(others=>(others=>'0'));
-------------------------------------------------------------
signal y_reg0 : signed (27 downto 0) :=(others=>'0');
signal y_reg1 : signed (31 downto 0) :=(others=>'0');
-----------------------------------------------------------
signal in_reg : signed(13 downto 0) :=(others=>'0');
signal out_reg : signed(DATAOUT'length-1 downto 0) :=
(others=>'0');
-- ----------------------------------------------------------
signal fs : std_logic :='0';
--------------------kdelay component----------------------------------
component kdelay is
GENERIC (
K : integer :=80;
L : integer :=200
);
port
(
clk : in std_logic ;
rst : in std_logic;
din : in STD_LOGIC_VECTOR (13 downto 0);
kout : OUT STD_LOGIC_VECTOR (13 downto 0)
);
end component;
signal kout : std_logic_vector (13 downto 0) :=(others=>
'0');
--------------------Ldelay component----------------------
------------
component Ldelay is
GENERIC (
K : integer :=80;
L : integer :=200
);
port
(
clk : in std_logic ;
rst : in std_logic;
din : in STD_LOGIC_VECTOR (13 downto
0);
Lout : OUT STD_LOGIC_VECTOR (13 downto
0)
);
end component;
signal Lout : std_logic_vector (13 downto 0) :=
(others=>'0');
---------------------------------------------------
component sub_mult is
port(
clk : in std_logic ;
rst : in std_logic;
din : in STD_LOGIC_VECTOR (13 downto
0);
Sout : out STD_LOGIC_VECTOR (23
downto 0)
);
end component;
signal Sout : std_logic_vector (23
downto 0) :=(others=>'0');
-------------------------------------------
component accum1 is
port(
clk : in std_logic ;
rst : in std_logic;
din : in
STD_LOGIC_VECTOR (23 downto 0);
Acout : out
STD_LOGIC_VECTOR (24 downto 0);
Acout1 : out
STD_LOGIC_VECTOR (25 downto 0)
);
end component;
signal acc_out1 : std_logic_vector (24 downto 0) :=(others=>'0');
signal acc_out2 : std_logic_vector (25 downto 0) :=(others=>'0');
----------------------------------------------------------------
BEGIN
Koutout <= Kout;
Loutout <= Lout;
Soutout <= Sout;
in_reg <= signed (DATAIN);
DATAOUT <= acc_out1;--std_logic_vector(out_reg);
DATAOUT1 <= acc_out2;
utacc1:component accum1
port map(
clk => clk,
rst => rst,--: in std_logic;
din => Sout, --: OUT STD_LOGIC_VECTOR
(13 downto 0);
Acout => acc_out1, -- : out STD_LOGIC_VECTOR (24 downto 0)
Acout1 => acc_out2
);
END RTL;
------------------------Accum1 component----------------------------------
library IEEEieee;`
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use IEEE.std_logic_unsigned.all;
use ieee.fixed_pkg.all;
entity accum1 is port(
clk : in std_logic ;
rst : in std_logic;
din : in STD_LOGIC_VECTOR (23 downto 0);
Acout : out STD_LOGIC_VECTOR (24 downto 0);
Acout1 : out STD_LOGIC_VECTOR (25 downto 0)
);
end entity;
architecture rtl of accum1 is
signal dout : signed(24 downto 0) :=(others=>'0');
signal datain : signed(23 downto 0) :=(others=>'0');
signal dout2 : signed(25 downto 0) :=(others=>'0');
begin
datain <= signed(din);
process(clk,rst,datain)
variable cm : signed(24 downto 0);
begin
if(rst='1' ) then
dout <= (others=>'0');
dout2 <= (others=>'0');
cm := (others=>'0');
elsif(rising_edge(clk) and clk'event) then
cm := datain + cm;
dout <= cm ;
dout2 <= dout2 + cm ;
end if;
end process;
Acout <= std_logic_vector(dout);
Acout1 <= std_logic_vector(dout2) ;
end rtl;
------------------------test bench only trapfilter comppnent portmapping
uttrap5:component TRAPFILTER
PORT MAP
(
CLK => TestClk, -- : IN STD_LOGIC;
RST => i_rstb, -- : IN STD_LOGIC;
DATAIN => odata, --odata, -- : IN STD_LOGIC_VECTOR(13 DOWNTO 0);
DATAOUT => trap_out, --: OUT STD_LOGIC_VECTOR(13 DOWNTO 0); ---
DATAOUT1 => trap_out1,
READY => trap_ready, --: OUT STD_LOGIC
Koutout => Koutout, --out std_logic_vector(23 downto 0);
Loutout => loutout, --: out std_logic_vector(13 downto 0);
Soutout => Soutout
);
enter image description here
Several issues in your code
You don't need datain in your sensitivity list.
When using rising_edge, you don't need event
The variable cm will not keep their value when re-enter the process. Use signal instead or just use value of dout.
I am really understand what is your dout2 logic?
I keep receiving an error while compiling my code below in quartus even though it does in the code below:
Error (12002): Port "qsys_dram_clk" does not exist in macrofunction "u0"
library ieee;
use ieee.std_logic_1164.all;
entity flappyroscoe is
port(
CLOCK_50 : IN STD_LOGIC := 'X';
CLOCK_27 : IN STD_LOGIC_VECTOR(0 downto 0);
AUD_XCK : OUT STD_LOGIC;
I2C_SDAT : INOUT STD_LOGIC := 'X';
I2C_SCLK : OUT STD_LOGIC;
AUD_ADCDAT : IN STD_LOGIC := 'X';
AUD_ADCLRCK : IN STD_LOGIC := 'X';
AUD_BCLK : IN STD_LOGIC := 'X';
DRAM_ADDR : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
DRAM_BA_1 : OUT STD_LOGIC;
DRAM_BA_0 : OUT STD_LOGIC;
DRAM_CAS_N : OUT STD_LOGIC;
DRAM_CKE : OUT STD_LOGIC;
DRAM_CS_N : OUT STD_LOGIC;
DRAM_DQ : INOUT STD_LOGIC_VECTOR(15 DOWNTO 0) := (OTHERS =>
DRAM_UDQM : OUT STD_LOGIC;
DRAM_LDQM : OUT STD_LOGIC;
DRAM_RAS_N : OUT STD_LOGIC;
DRAM_WE_N : OUT STD_LOGIC;
VGA_HS : OUT STD_LOGIC; VGA_VS : OUT STD_LOGIC;
VGA_R : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
VGA_G : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
VGA_B : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
DRAM_CLK : OUT STD_LOGIC
);
end entity;
architecture behavior of flappyroscoe is
component flappy_system is
port (
clk_clk: in std_logic:= 'X';
up_clocks_0_clk_in_secondary_clk: IN STD_LOGIC_VECTOR(0 downto 0);
up_clocks_0_audio_clk_clk: out std_logic;
audio_and_video_config_0_external_interface_SDAT : inout std_logic:= 'X';
audio_and_video_config_0_external_interface_SCLK : out std_logic;
audio_0_external_interface_ADCDAT : in std_logic:= 'X';
audio_0_external_interface_ADCLRCK : in std_logic:= 'X';
audio_0_external_interface_BCLK: in std_logic:= 'X';
qsys_dram_addr : out std_logic_vector(11 downto 0);
qsys_dram_ba : out std_logic_vector(1 downto 0);
qsys_dram_cas_n : out std_logic;
qsys_dram_cke: out std_logic;
qsys_dram_cs_n: out std_logic;
qsys_dram_dq : inout std_logic_vector(15 downto 0) := (others => 'X');
qsys_dram_dqm : out std_logic_vector(1 downto 0);
qsys_dram_ras_n: out std_logic;
qsys_dram_we_n: out std_logic;
qsys_vga_HS: out std_logic;
qsys_vga_VS: out std_logic;
qsys_vga_R: out std_logic_vector(3 downto 0);
qsys_vga_G: out std_logic_vector(3 downto 0);
qsys_vga_B: out std_logic_vector(3 downto 0);
qsys_dram_clk: out std_logic
);
end component flappy_system;
signal dqm_sig,ba_sig: std_logic_vector(1 downto 0);
signal n: std_logic;
begin
DRAM_BA_1 <= ba_sig(1);
DRAM_BA_0 <= ba_sig(0);
DRAM_UDQM <= dqm_sig(1);
DRAM_LDQM <= dqm_sig(0);
u0 : component flappy_system
port map (
clk_clk => CLOCK_50,
up_clocks_0_clk_in_secondary_clk => CLOCK_27,
up_clocks_0_audio_clk_clk => AUD_XCK,
audio_and_video_config_0_external_interface_SDAT => I2C_SDAT,
audio_and_video_config_0_external_interface_SCLK => I2C_SCLK,
audio_0_external_interface_ADCDAT => AUD_ADCDAT,
audio_0_external_interface_ADCLRCK => AUD_ADCLRCK,
audio_0_external_interface_BCLK => AUD_BCLK,
qsys_dram_addr => dram_addr,
qsys_dram_ba => ba_sig,
qsys_dram_cas_n => dram_cas_n,
qsys_dram_cke => dram_cke,
qsys_dram_cs_n => dram_cs_n,
qsys_dram_dq => dram_dq,
qsys_dram_dqm => dqm_sig,
qsys_dram_ras_n => dram_ras_n,
qsys_dram_we_n => dram_we_n,
qsys_vga_HS => vga_HS,
qsys_vga_VS => vga_VS,
qsys_vga_R => vga_R,
qsys_vga_G => vga_G,
qsys_vga_B => vga_B,
qsys_dram_clk => DRAM_CLK
);
end architecture;
I got top module including sub-modules instantiated in testbench file. The sub-modules are pretty free on their own, therefore when I am testing the top module, I need to introduce only few signals and track few outputs, but the top module has many other ports.
May I provide some "default"/"undefined" signal (and sink) to those pins (not regarding their size, type)?
There are 2 ways I solve that right now, either take out the sub-module to test it (well, but I want to test it within top module) or write appropriate "zero" inputs for inputs and introduce signals for outputs (lot of work as well).
using VHDL with Vivado 2015
alright, so this is the testbench
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;
entity tb_FIR_v0_3 is
end tb_FIR_v0_3;
architecture Behavioral of tb_FIR_v0_3 is
shared variable C_S00_AXI_DATA_WIDTH : integer := 32;
shared variable C_S00_AXI_ADDR_WIDTH : integer := 7;
component FIR_v0_3 is
generic (
C_S00_AXI_DATA_WIDTH : integer := 32;
C_S00_AXI_ADDR_WIDTH : integer := 7
);
port (
fir_clk : in std_logic;
fir_x_in : in std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
fir_y_out : out std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
fir_d_out : out std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
-- User ports ends
s00_axi_aclk : in std_logic;
s00_axi_aresetn : in std_logic;
s00_axi_awaddr : in std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0);
s00_axi_awprot : in std_logic_vector(2 downto 0);
s00_axi_awvalid : in std_logic;
s00_axi_awready : out std_logic;
s00_axi_wdata : in std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
s00_axi_wstrb : in std_logic_vector((C_S00_AXI_DATA_WIDTH/8)-1 downto 0);
s00_axi_wvalid : in std_logic;
s00_axi_wready : out std_logic;
s00_axi_bresp : out std_logic_vector(1 downto 0);
s00_axi_bvalid : out std_logic;
s00_axi_bready : in std_logic;
s00_axi_araddr : in std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0);
s00_axi_arprot : in std_logic_vector(2 downto 0);
s00_axi_arvalid : in std_logic;
s00_axi_arready : out std_logic;
s00_axi_rdata : out std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
s00_axi_rresp : out std_logic_vector(1 downto 0);
s00_axi_rvalid : out std_logic;
s00_axi_rready : in std_logic
);
end component FIR_v0_3;
signal e_clk : std_logic := '1' ;
signal e_reset : std_logic := '1' ;
signal e_x_in : std_logic_vector (31 downto 0);
signal e_y_out : std_logic_vector (31 downto 0);
signal e_d_out : std_logic_vector (31 downto 0);
signal s00_axi_awready : std_logic;
signal s00_axi_wready : std_logic;
signal s00_axi_bresp : std_logic_vector(1 downto 0);
signal s00_axi_bvalid : std_logic;
signal s00_axi_arready : std_logic;
signal s00_axi_rdata : std_logic_vector(32-1 downto 0);
signal s00_axi_rresp : std_logic_vector(1 downto 0);
signal s00_axi_rvalid : std_logic;
signal s00_axi_aclk : std_logic := '0';
signal s00_axi_aresetn : std_logic;
signal s00_axi_awaddr : std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0);
signal s00_axi_awprot : std_logic_vector(2 downto 0);
signal s00_axi_awvalid : std_logic := '0';
signal s00_axi_wdata : std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
signal s00_axi_wstrb : std_logic_vector((C_S00_AXI_DATA_WIDTH/8)-1 downto 0);
signal s00_axi_wvalid : std_logic := '0';
signal s00_axi_bready : std_logic := '0';
signal s00_axi_araddr : std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0);
signal s00_axi_arprot : std_logic_vector(2 downto 0);
signal s00_axi_arvalid : std_logic := '0';
signal s00_axi_rready : std_logic := '0';
begin
inst_FIR_v0_3 : FIR_v0_3
generic map (
C_S00_AXI_DATA_WIDTH => 32,
C_S00_AXI_ADDR_WIDTH => 7
)
port map (
-- Users to add ports here
fir_clk => e_clk,
fir_x_in => e_x_in,
fir_y_out => e_y_out,
fir_d_out => e_d_out,
-- Ports of Axi Slave Bus Interface S00_AXI
s00_axi_aclk => s00_axi_aclk,
s00_axi_aresetn => e_reset,
s00_axi_awaddr => ( others => '0' ),
s00_axi_awprot => ( others => '0' ),
s00_axi_awvalid => s00_axi_awvalid,
s00_axi_awready => s00_axi_awready,
s00_axi_wdata => ( others => '0' ),
s00_axi_wstrb => ( others => '0' ),
s00_axi_wvalid => s00_axi_wvalid,
s00_axi_wready => s00_axi_wready,
s00_axi_bresp => s00_axi_bresp,
s00_axi_bvalid => s00_axi_bvalid,
s00_axi_bready => s00_axi_bready,
s00_axi_araddr => ( others => '0' ),
s00_axi_arprot => ( others => '0' ),
s00_axi_arvalid => s00_axi_arvalid,
s00_axi_arready => s00_axi_arready,
s00_axi_rdata => s00_axi_rdata,
s00_axi_rresp => s00_axi_rresp,
s00_axi_rvalid => s00_axi_rvalid,
s00_axi_rready => s00_axi_rready
);
process
variable count : integer := 0;
begin
if ( count = 0 ) then
-- e_reset <= '0'; -- VALUES NOT INITIATED PROPERLY, FUCKER ? ... With the non-stop, pop pop and stainless steel (DMX)
e_x_in <= x"00000000";
end if;
if ( count = 3 ) then
-- e_reset <= '1';
end if;
if ( count = 3 ) then
e_x_in <= x"00000001";
end if;
if ( count = 5 ) then
e_x_in <= x"00000000";
end if;
if ( count = 8 ) then
e_x_in <= x"00000000";
end if;
e_clk <= not(e_clk);
wait for 0.5 ns;
count := count + 1;
if( (count = 60) ) then
count := 0;
end if;
end process;
end Behavioral;
I am too lazy to create signal for every AXI input/output ports and then connect them one by one. May I avoid somehow creating those 21 signals ...
signal s00_axi_awready : std_logic;
signal s00_axi_wready : std_logic;
signal s00_axi_bresp : std_logic_vector(1 downto 0);
signal s00_axi_bvalid : std_logic;
signal s00_axi_arready : std_logic;
....
...
and then connecting them ? Like this ...
s00_axi_wvalid => s00_axi_wvalid,
s00_axi_wready => s00_axi_wready,
s00_axi_bresp => s00_axi_bresp,
s00_axi_bvalid => s00_axi_bvalid,
s00_axi_bready => s00_axi_bready,
Is there any "universal" in/out signal that I would tie to pins that are not important, because I cant leave the ports of an instance unconnected (as far as I know and tried).
If I understand the question correctly, inputs in your port definition can have default values, and outputs can be left unconnected in an instantiation. For example:
entity ShiftRegister is
Generic (
WIDTH : integer
);
Port (
clk : in STD_LOGIC;
enable : in STD_LOGIC := '1';
serial_in : in STD_LOGIC := '0';
parallel_out : out STD_LOGIC_VECTOR (WIDTH-1 downto 0);
);
end ShiftRegister;
...
SR : entity work.ShiftRegister
Generic map (
WIDTH : integer => 8
)
Port map(
clk => serial_clk,
serial_in => serial_data_in
);
In this example, the register will always be enabled, and the entity does not output anything. Not a very useful instantiation in this case, but I think this answers your question!
i am new to vhdl. i have a code with me as follows (the sub prog compiles very fine). i can't fix the following error
** Error: C:/Users/acer/Desktop/alu new/ALU_VHDL.vhd(110): Illegal sequential statement.
** Error: C:/Users/acer/Desktop/alu new/ALU_VHDL.vhd(115): Illegal sequential statement.
** Error: C:/Users/acer/Desktop/alu new/ALU_VHDL.vhd(120): Illegal sequential statement.
** Error: C:/Users/acer/Desktop/alu new/ALU_VHDL.vhd(128): Illegal sequential statement.
** Warning: [14] C:/Users/acer/Desktop/alu new/ALU_VHDL.vhd(128): (vcom-1272) Length of formal "Remainder" is 4; length of actual is 8.
** Error: C:/Users/acer/Desktop/alu new/ALU_VHDL.vhd(138): VHDL Compiler exiting
the line nos are bold ones in the code here.they are the portmap ones
Can anyone please help me out with this. it would be very kind of you.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity ALU_VHDL is
port
(
OperandA : in std_logic_vector(3 downto 0);
OperandB : in std_logic_vector(3 downto 0);
Operation: in std_logic_vector(2 downto 0);
Startt : in std_logic;
Ready : out std_logic;
Result_High : out std_logic_vector(3 downto 0);
Result_Low : out std_logic_vector(7 downto 0);
Errorsig : out std_logic;
Reset_n : in std_logic;
Clkk : in std_logic);
end entity ALU_VHDL;
architecture Behavioral of ALU_VHDL is
-- And gate
component AND_gate
port(
x,y : IN std_logic_vector(3 downto 0);
z : OUT std_logic_vector(3 downto 0));
end component;
-- OR Gate
component OR_gate
port(
x,y : IN std_logic_vector(3 downto 0);
z : OUT std_logic_vector(3 downto 0));
end component;
-- XOR gate
component XOR_gate
port(
x,y : IN std_logic_vector(3 downto 0);
z : OUT std_logic_vector(3 downto 0));
end component;
-- Adder
COMPONENT adder4
PORT
(
C : IN std_logic;
x,y : IN std_logic_vector(3 DOWNTO 0);
R : OUT std_logic_vector(3 DOWNTO 0);
C_out : OUT std_logic);
END COMPONENT;
-- Subtractor
COMPONENT Substractor4
PORT
(
br_in : IN std_logic;
x,y : IN std_logic_vector(3 DOWNTO 0);
R : OUT std_logic_vector(3 DOWNTO 0);
E : out std_logic);
END COMPONENT;
-- Multiplier
COMPONENT mult4by4
port(operA, operB: in std_logic_vector(3 downto 0);
sumOut: out std_logic_vector(7 downto 0));
END COMPONENT;
-- Division
COMPONENT Division
Port ( Dividend : in std_logic_vector(3 downto 0);
Divisor : in std_logic_vector(3 downto 0);
Start : in std_logic;
Clk : in std_logic;
Quotient : out std_logic_vector(3 downto 0);
Remainder : out std_logic_vector(3 downto 0);
Finish : out std_logic);
END COMPONENT;
begin
process(OperandA, OperandB, Startt, Operation) is
begin
case Operation is
when "000" =>
Result_High <= "XXXX";
when "001" =>
Result_High <= OperandA and OperandB;
when "010" =>
Result_High <= OperandA or OperandB;
when "011" =>
Result_High <= OperandA xor OperandB;
when "100" =>
-- Adder
**U05 : adder4 PORT MAP (C=>Startt,x=>OperandA,y=>OperandB,R=>Result_High,C_out=>Ready);**
when "101" =>
-- Substractor & Error signal
**U06 : Substractor4 PORT MAP (br_in=>Startt,x=>OperandA,y=>OperandB,R=>Result_High,E=>Errorsig);**
when "110" =>
-- multiplication
**U07 : mult4by4 PORT MAP (operA=>OperandA,operB=>OperandB,sumOut=>Result_Low);**
when "111" =>
-- Division
if (OperandB ="0000") then
Errorsig <= '1';
else
**U08 : Division PORT MAP (Dividend=>OperandA,Divisor=>OperandB,Start=>Startt,Clk=>Clkk,Quotient=>Result_High,Remainder=>Result_Low,Finish=>Ready);**
end if;
when others =>
Errorsig <= '1';
end case;
end process;
end architecture Behavioral;
You cannot instantiate entities within a process.
Move all entity instantiations out of the process (into the architecture body) and work from there.
If you want to in instantiate component depending on the value of 'Operation', like the zennehoy wrote, you should instantiate components out of the process and in this case statement only use signal connected to this components in instantiations and link it to port you want.
For the length issue change the "Remainder : out std_logic_vector(3 downto 0);"
to "Remainder : out std_logic_vector(7 downto 0);"
I'm trying to implement a VHDL project but I'm having problems connecting the different components correctly. I just want to make sure that I did this correctly. The code below is just the wrapper (which, to this point, is where the problem lies). Please let me know if I'm connecting the input and outputs to each component correctly.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity SodaWrapper is
Port ( PB1 : in STD_LOGIC;
PB2 : in STD_LOGIC;
PB3 : in STD_LOGIC;
PB4 : in STD_LOGIC;
clk_50m : in STD_LOGIC;
LED1 : out STD_LOGIC;
LED2 : out STD_LOGIC;
LED3 : out STD_LOGIC;
LED4 : out STD_LOGIC;
seven_seg1 : out STD_LOGIC_VECTOR(7 downto 0);
seven_seg2 : out STD_LOGIC_VECTOR(7 downto 0));
end SodaWrapper;
architecture Behavioral of SodaWrapper is
--Define debounce components
component debounce
port (clk : in STD_LOGIC;
reset : in STD_LOGIC;
sw : in STD_LOGIC;
db_level: out STD_LOGIC;
db_tick: out STD_LOGIC);
end component;
for all : debounce use entity work.debounce(debounce);
--define clock
component Clock_Divider
port(
clk : in STD_LOGIC;
clockbus : out STD_LOGIC_VECTOR(26 downto 0)
);
end component;
for all : Clock_Divider use entity work.Clock_Divider(Clock_Divider);
COMPONENT SodaMachine_Moore
PORT(
CLK : IN std_logic;
Reset : IN std_logic;
Nickel : IN std_logic;
Dime : IN std_logic;
Quarter : IN std_logic;
Dispense : OUT std_logic;
ReturnNickel : OUT std_logic;
ReturnDime : OUT std_logic;
ReturnTwoDimes : OUT std_logic;
change1 : OUT std_logic_vector(3 downto 0);
change2 : OUT std_logic_vector(3 downto 0)
);
END COMPONENT;
--Define sseg_converter components
component hex_to_sseg
port( dp : in STD_LOGIC;
hex : in STD_LOGIC_VECTOR(3 downto 0);
sseg : out STD_LOGIC_VECTOR(7 downto 0));
end component;
--create wire for FSM to sseg converter
signal hexconvertones : STD_LOGIC_VECTOR(3 downto 0);
signal hexconverttens : STD_LOGIC_VECTOR(3 downto 0);
--create wires for output of debouncers
signal db_tick_n : STD_LOGIC;
signal db_tick_d : STD_LOGIC;
signal db_tick_q : STD_LOGIC;
signal IQ_n : STD_LOGIC;
signal IQ_d : STD_LOGIC;
signal IQ_q : STD_LOGIC;
--wire up clock
signal clockingbus : STD_LOGIC_VECTOR(26 downto 0);
begin
-- Setup the clock
clock1 : Clock_divider port map (
clk => clk_50m,
clockbus => clockingbus
);
-- Link debounce to FSM
debounce_n : debounce port map (
clk => clockingbus(0),
reset => PB4,
sw => PB1,
db_tick => db_tick_n
);
debounce_d : debounce port map (
clk => clockingbus(0),
reset => PB4,
sw => PB2,
db_tick => db_tick_d
);
debounce_q : debounce port map (
clk => clockingbus(0),
reset => PB4,
sw => PB3,
db_tick => db_tick_q
);
--invert values of db_tick since logic value of button pressed is 0 and vice versa
IQ_n <= not(db_tick_n);
IQ_d <= not(db_tick_d);
IQ_q <= not(db_tick_q);
-- Link components to main FSM
main : SodaMachine_Moore PORT MAP (
CLK => clockingbus(0),
Reset => PB4,
Nickel => IQ_n,
Dime => IQ_d,
Quarter => IQ_q,
Dispense => LED1,
ReturnNickel => LED2,
ReturnDime => LED3,
ReturnTwoDimes => LED4,
change1 => hexconvertones,
change2 => hexconverttens
);
--Link seven segment display to FSM
change_ones : hex_to_sseg port map('0', hexconvertones, seven_seg1);
change_tens : hex_to_sseg port map('0', hexconverttens, seven_seg2);
end Behavioral;