SURF  1.0
MicroblazeBasicCoreWrapper.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : MicroblazeBasicCoreWrapper.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2016-05-16
5 -- Last update: 2016-07-14
6 -------------------------------------------------------------------------------
7 -- Description: Wrapper for Microblaze Basic Core for "90% case"
8 -------------------------------------------------------------------------------
9 -- This file is part of 'SLAC Firmware Standard Library'.
10 -- It is subject to the license terms in the LICENSE.txt file found in the
11 -- top-level directory of this distribution and at:
12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
13 -- No part of 'SLAC Firmware Standard Library', including this file,
14 -- may be copied, modified, propagated, or distributed except according to
15 -- the terms contained in the LICENSE.txt file.
16 -------------------------------------------------------------------------------
17 
18 library ieee;
19 use ieee.std_logic_1164.all;
20 
21 use work.StdRtlPkg.all;
22 use work.AxiStreamPkg.all;
23 use work.AxiLitePkg.all;
24 use work.SsiPkg.all;
25 
27  generic (
28  TPD_G : time := 1 ns;
29  AXIL_RESP_C : boolean := false;
30  AXIL_ADDR_MSB_C : boolean := false); -- false = [0x00000000:0x7FFFFFFF], true = [0x80000000:0xFFFFFFFF]
31  port (
32  -- Master AXI-Lite Interface
37  -- Master AXIS Interface
40  -- Slave AXIS Interface
43  -- Interrupt Interface
44  interrupt : in slv(7 downto 0) := (others => '0');
45  -- Clock and Reset
46  clk : in sl;
47  pllLock : in sl := '1';
48  rst : in sl);
49 end MicroblazeBasicCoreWrapper;
50 
51 architecture mapping of MicroblazeBasicCoreWrapper is
52 
53  component MicroblazeBasicCore is
54  port (
55  INTERRUPT : in std_logic_vector (7 downto 0);
56  M0_AXIS_tdata : out std_logic_vector (31 downto 0);
57  M0_AXIS_tlast : out std_logic;
58  M0_AXIS_tready : in std_logic;
59  M0_AXIS_tvalid : out std_logic;
60  M_AXI_DP_araddr : out std_logic_vector (31 downto 0);
61  M_AXI_DP_arprot : out std_logic_vector (2 downto 0);
62  M_AXI_DP_arready : in std_logic_vector (0 to 0);
63  M_AXI_DP_arvalid : out std_logic_vector (0 to 0);
64  M_AXI_DP_awaddr : out std_logic_vector (31 downto 0);
65  M_AXI_DP_awprot : out std_logic_vector (2 downto 0);
66  M_AXI_DP_awready : in std_logic_vector (0 to 0);
67  M_AXI_DP_awvalid : out std_logic_vector (0 to 0);
68  M_AXI_DP_bready : out std_logic_vector (0 to 0);
69  M_AXI_DP_bresp : in std_logic_vector (1 downto 0);
70  M_AXI_DP_bvalid : in std_logic_vector (0 to 0);
71  M_AXI_DP_rdata : in std_logic_vector (31 downto 0);
72  M_AXI_DP_rready : out std_logic_vector (0 to 0);
73  M_AXI_DP_rresp : in std_logic_vector (1 downto 0);
74  M_AXI_DP_rvalid : in std_logic_vector (0 to 0);
75  M_AXI_DP_wdata : out std_logic_vector (31 downto 0);
76  M_AXI_DP_wready : in std_logic_vector (0 to 0);
77  M_AXI_DP_wstrb : out std_logic_vector (3 downto 0);
78  M_AXI_DP_wvalid : out std_logic_vector (0 to 0);
79  S0_AXIS_tdata : in std_logic_vector (31 downto 0);
80  S0_AXIS_tlast : in std_logic;
81  S0_AXIS_tready : out std_logic;
82  S0_AXIS_tvalid : in std_logic;
83  clk : in std_logic;
84  dcm_locked : in std_logic;
85  reset : in std_logic);
86  end component MicroblazeBasicCore;
87 
88  signal awaddr : slv(31 downto 0);
89  signal araddr : slv(31 downto 0);
90  signal bresp : slv(1 downto 0);
91  signal rresp : slv(1 downto 0);
92 
95 
96 begin
97 
98  -- Address space = [0x00000000:0x7FFFFFFF]
99  LOWER_2GB : if (AXIL_ADDR_MSB_C = false) generate
100  mAxilWriteMaster.awaddr <= '0' & awaddr(30 downto 0);
101  mAxilReadMaster.araddr <= '0' & araddr(30 downto 0);
102  end generate;
103 
104  -- Address space = [0x80000000:0xFFFFFFFF]
105  HIGH_2GB : if (AXIL_ADDR_MSB_C = true) generate
106  mAxilWriteMaster.awaddr <= '1' & awaddr(30 downto 0);
107  mAxilReadMaster.araddr <= '1' & araddr(30 downto 0);
108  end generate;
109 
110  BYPASS_RESP : if (AXIL_RESP_C = false) generate
111  bresp <= AXI_RESP_OK_C;
112  rresp <= AXI_RESP_OK_C;
113  end generate;
114 
115  USE_RESP : if (AXIL_RESP_C = true) generate
118  end generate;
119 
120  U_Microblaze : component MicroblazeBasicCore
121  port map (
122  -- Interrupt Interface
123  INTERRUPT => interrupt,
124  -- Master AXI-Lite Interface
125  M_AXI_DP_awaddr => awaddr,
126  M_AXI_DP_awprot => mAxilWriteMaster.awprot,
127  M_AXI_DP_awvalid(0) => mAxilWriteMaster.awvalid,
128  M_AXI_DP_wdata => mAxilWriteMaster.wdata,
129  M_AXI_DP_wstrb => mAxilWriteMaster.wstrb,
130  M_AXI_DP_wvalid(0) => mAxilWriteMaster.wvalid,
131  M_AXI_DP_bready(0) => mAxilWriteMaster.bready,
132  M_AXI_DP_awready(0) => mAxilWriteSlave.awready,
133  M_AXI_DP_wready(0) => mAxilWriteSlave.wready,
134  M_AXI_DP_bresp => bresp,
135  M_AXI_DP_bvalid(0) => mAxilWriteSlave.bvalid,
136  M_AXI_DP_araddr => araddr,
137  M_AXI_DP_arprot => mAxilReadMaster.arprot,
138  M_AXI_DP_arvalid(0) => mAxilReadMaster.arvalid,
139  M_AXI_DP_rready(0) => mAxilReadMaster.rready,
140  M_AXI_DP_arready(0) => mAxilReadSlave.arready,
141  M_AXI_DP_rdata => mAxilReadSlave.rdata,
142  M_AXI_DP_rresp => rresp,
143  M_AXI_DP_rvalid(0) => mAxilReadSlave.rvalid,
144  -- Master AXIS Interface
145  M0_AXIS_tdata => txMaster.tdata(31 downto 0),
146  M0_AXIS_tlast => txMaster.tlast,
147  M0_AXIS_tvalid => txMaster.tvalid,
148  M0_AXIS_tready => txSlave.tready,
149  -- Slave AXIS Interface
150  S0_AXIS_tdata => sAxisMaster.tdata(31 downto 0),
151  S0_AXIS_tlast => sAxisMaster.tlast,
152  S0_AXIS_tvalid => sAxisMaster.tvalid,
153  S0_AXIS_tready => sAxisSlave.tready,
154  -- Clock and Reset
155  clk => clk,
156  dcm_locked => pllLock,
157  reset => rst);
158 
159  U_InsertSOF : entity work.SsiInsertSof
160  generic map (
161  TPD_G => TPD_G,
162  COMMON_CLK_G => true,
163  SLAVE_FIFO_G => false,
164  MASTER_FIFO_G => false,
165  SLAVE_AXI_CONFIG_G => ssiAxiStreamConfig(4),
166  MASTER_AXI_CONFIG_G => ssiAxiStreamConfig(4))
167  port map (
168  -- Slave Port
169  sAxisClk => clk,
170  sAxisRst => rst,
172  sAxisSlave => txSlave,
173  mAxisClk => clk,
174  mAxisRst => rst,
176  mAxisSlave => mAxisSlave);
177 
178 end mapping;
TPD_Gtime := 1 ns
AxiStreamMasterType := AXI_STREAM_MASTER_INIT_C txMaster
MASTER_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
in mAxilReadSlaveAxiLiteReadSlaveType
AxiStreamMasterType :=(tValid => '0',tData =>( others => '0'),tStrb =>( others => '1'),tKeep =>( others => '1'),tLast => '0',tDest =>( others => '0'),tId =>( others => '0'),tUser =>( others => '0')) AXI_STREAM_MASTER_INIT_C
COMMON_CLK_Gboolean := false
SLAVE_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
out mAxilWriteMasterAxiLiteWriteMasterType
in sAxisMasterAxiStreamMasterType
MASTER_FIFO_Gboolean := true
SLAVE_FIFO_Gboolean := true
out sAxisSlaveAxiStreamSlaveType
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
in interruptslv( 7 downto 0) :=( others => '0')
in mAxisSlaveAxiStreamSlaveType := AXI_STREAM_SLAVE_FORCE_C
_library_ ieeeieee
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in sAxisMasterAxiStreamMasterType := AXI_STREAM_MASTER_INIT_C
in mAxisSlaveAxiStreamSlaveType
slv( 1 downto 0) := "00" AXI_RESP_OK_C
Definition: AxiLitePkg.vhd:31
AxiStreamSlaveType :=(tReady => '1') AXI_STREAM_SLAVE_FORCE_C
out mAxilReadMasterAxiLiteReadMasterType
out mAxisMasterAxiStreamMasterType
in mAxilWriteSlaveAxiLiteWriteSlaveType
std_logic_vector slv
Definition: StdRtlPkg.vhd:29