Line 1... |
Line 1... |
|
--! @file
|
|
--! @brief Point to point wishbone interconnection (Sample Master with uart_wishbone_slave)
|
|
|
library IEEE;
|
library IEEE;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use IEEE.STD_LOGIC_1164.ALL;
|
|
|
entity INTERCON_P2P is
|
entity INTERCON_P2P is
|
Line 13... |
Line 15... |
tx: out std_logic;
|
tx: out std_logic;
|
rx : in std_logic
|
rx : in std_logic
|
);
|
);
|
end INTERCON_P2P;
|
end INTERCON_P2P;
|
|
|
|
--! @brief Declaring the components (SYC0001a, SERIALMASTER, uart_wishbone_slave)
|
|
--! @details Just instantiate and connect the various components
|
architecture Behavioral of INTERCON_P2P is
|
architecture Behavioral of INTERCON_P2P is
|
component SYC0001a
|
component SYC0001a
|
port(
|
port(
|
-- WISHBONE Interface
|
-- WISHBONE Interface
|
CLK_O: out std_logic;
|
CLK_O: out std_logic; --! Clock output
|
RST_O: out std_logic;
|
RST_O: out std_logic; --! Reset output
|
-- NON-WISHBONE Signals
|
-- NON-WISHBONE Signals
|
EXTCLK: in std_logic;
|
EXTCLK: in std_logic; --! Clock input
|
EXTRST: in std_logic
|
EXTRST: in std_logic --! Reset input
|
);
|
);
|
end component SYC0001a;
|
end component SYC0001a;
|
|
|
component SERIALMASTER is
|
component SERIALMASTER is
|
port(
|
port(
|
-- WISHBONE Signals
|
-- WISHBONE Signals
|
ACK_I: in std_logic;
|
ACK_I: in std_logic; --! Ack input
|
ADR_O: out std_logic_vector( 1 downto 0 );
|
ADR_O: out std_logic_vector( 1 downto 0 ); --! Address output
|
CLK_I: in std_logic;
|
CLK_I: in std_logic; --! Clock input
|
CYC_O: out std_logic;
|
CYC_O: out std_logic; --! Cycle output
|
DAT_I: in std_logic_vector( 31 downto 0 );
|
DAT_I: in std_logic_vector( 31 downto 0 ); --! Data input
|
DAT_O: out std_logic_vector( 31 downto 0 );
|
DAT_O: out std_logic_vector( 31 downto 0 ); --! Data output
|
RST_I: in std_logic;
|
RST_I: in std_logic; --! Reset input
|
SEL_O: out std_logic;
|
SEL_O: out std_logic; --! Select output
|
STB_O: out std_logic;
|
STB_O: out std_logic; --! Strobe output (Works like a chip select)
|
WE_O: out std_logic;
|
WE_O: out std_logic; --! Write enable
|
|
|
-- NON-WISHBONE Signals
|
-- NON-WISHBONE Signals
|
byte_rec : out std_logic_vector(7 downto 0)
|
byte_rec : out std_logic_vector(7 downto 0) --! Signal byte received (Used to debug on the out leds)
|
);
|
);
|
end component;
|
end component;
|
|
|
component uart_wishbone_slave is
|
component uart_wishbone_slave is
|
Port ( RST_I : in STD_LOGIC;
|
Port ( RST_I : in STD_LOGIC; --! Reset Input
|
CLK_I : in STD_LOGIC;
|
CLK_I : in STD_LOGIC; --! Clock Input
|
ADR_I0 : in STD_LOGIC_VECTOR (1 downto 0);
|
ADR_I0 : in STD_LOGIC_VECTOR (1 downto 0); --! Address input
|
DAT_I0 : in STD_LOGIC_VECTOR (31 downto 0);
|
DAT_I0 : in STD_LOGIC_VECTOR (31 downto 0); --! Data Input 0
|
DAT_O0 : out STD_LOGIC_VECTOR (31 downto 0);
|
DAT_O0 : out STD_LOGIC_VECTOR (31 downto 0); --! Data Output 0
|
WE_I : in STD_LOGIC;
|
WE_I : in STD_LOGIC; --! Write enable input
|
STB_I : in STD_LOGIC;
|
STB_I : in STD_LOGIC; --! Strobe input (Works like a chip select)
|
ACK_O : out STD_LOGIC;
|
ACK_O : out STD_LOGIC; --! Ack output
|
serial_in : in std_logic;
|
|
data_Avaible : out std_logic;
|
-- NON-WISHBONE Signals
|
serial_out : out std_logic
|
serial_in : in std_logic; --! Uart serial input
|
|
data_Avaible : out std_logic; --! Flag to indicate data avaible
|
|
serial_out : out std_logic --! Uart serial output
|
);
|
);
|
end component;
|
end component;
|
signal CLK : std_logic;
|
signal CLK : std_logic;
|
signal RST : std_logic;
|
signal RST : std_logic;
|
signal ACK : std_logic;
|
signal ACK : std_logic;
|
Line 67... |
Line 73... |
signal STB : std_logic;
|
signal STB : std_logic;
|
signal ADR : std_logic_vector( 1 downto 0 );
|
signal ADR : std_logic_vector( 1 downto 0 );
|
signal dataI : std_logic_vector (31 downto 0);
|
signal dataI : std_logic_vector (31 downto 0);
|
signal dataO : std_logic_vector (31 downto 0);
|
signal dataO : std_logic_vector (31 downto 0);
|
begin
|
begin
|
|
--! Instantiate SYC0001a
|
uSysCon: component SYC0001a
|
uSysCon: component SYC0001a
|
port map(
|
port map(
|
CLK_O => CLK,
|
CLK_O => CLK,
|
RST_O => RST,
|
RST_O => RST,
|
EXTCLK => EXTCLK,
|
EXTCLK => EXTCLK,
|
EXTRST => EXTRST
|
EXTRST => EXTRST
|
);
|
);
|
|
|
|
--! Instantiate SERIALMASTER
|
uMasterSerial : component SERIALMASTER
|
uMasterSerial : component SERIALMASTER
|
port map(
|
port map(
|
ACK_I => ACK,
|
ACK_I => ACK,
|
ADR_O => ADR,
|
ADR_O => ADR,
|
CLK_I => CLK,
|
CLK_I => CLK,
|
Line 90... |
Line 98... |
STB_O => STB,
|
STB_O => STB,
|
byte_rec => byte_out,
|
byte_rec => byte_out,
|
WE_O => WE
|
WE_O => WE
|
);
|
);
|
|
|
|
--! Instantiate uart_wishbone_slave
|
uUartWishboneSlave: component uart_wishbone_slave
|
uUartWishboneSlave: component uart_wishbone_slave
|
port map(
|
port map(
|
RST_I => RST,
|
RST_I => RST,
|
CLK_I => CLK,
|
CLK_I => CLK,
|
ADR_I0 => ADR,
|
ADR_I0 => ADR,
|