source: PlatformSupport/CustomPeripherals/pcores/warp_timer_plbw_v1_00_a/hdl/vhdl/warp_timer_plbw.vhd

Last change on this file was 1042, checked in by kwilhelm, 16 years ago

adding warp_timer

File size: 10.6 KB
Line 
1-------------------------------------------------------------------
2-- System Generator version 10.1.00 VHDL source file.
3--
4-- Copyright(C) 2007 by Xilinx, Inc.  All rights reserved.  This
5-- text/file contains proprietary, confidential information of Xilinx,
6-- Inc., is distributed under license from Xilinx, Inc., and may be used,
7-- copied and/or disclosed only pursuant to the terms of a valid license
8-- agreement with Xilinx, Inc.  Xilinx hereby grants you a license to use
9-- this text/file solely for design, simulation, implementation and
10-- creation of design files limited to Xilinx devices or technologies.
11-- Use with non-Xilinx devices or technologies is expressly prohibited
12-- and immediately terminates your license unless covered by a separate
13-- agreement.
14--
15-- Xilinx is providing this design, code, or information "as is" solely
16-- for use in developing programs and solutions for Xilinx devices.  By
17-- providing this design, code, or information as one possible
18-- implementation of this feature, application or standard, Xilinx is
19-- making no representation that this implementation is free from any
20-- claims of infringement.  You are responsible for obtaining any rights
21-- you may require for your implementation.  Xilinx expressly disclaims
22-- any warranty whatsoever with respect to the adequacy of the
23-- implementation, including but not limited to warranties of
24-- merchantability or fitness for a particular purpose.
25--
26-- Xilinx products are not intended for use in life support appliances,
27-- devices, or systems.  Use in such applications is expressly prohibited.
28--
29-- Any modifications that are made to the source code are done at the user's
30-- sole risk and will be unsupported.
31--
32-- This copyright and support notice must be retained as part of this
33-- text at all times.  (c) Copyright 1995-2007 Xilinx, Inc.  All rights
34-- reserved.
35-------------------------------------------------------------------
36library IEEE;
37use IEEE.std_logic_1164.all;
38
39entity plbaddrpref is
40    generic (
41        C_BASEADDR : std_logic_vector(31 downto 0) := X"80000000";
42        C_HIGHADDR : std_logic_vector(31 downto 0) := X"8000FFFF";
43        C_SPLB_DWIDTH         : integer range 32 to 128   := 32;
44        C_SPLB_NATIVE_DWIDTH  : integer range 32 to 32    := 32
45    );
46    port (
47        addrpref           : out std_logic_vector(20-1 downto 0);
48        sl_rddbus          : out std_logic_vector(0 to C_SPLB_DWIDTH-1);
49        plb_wrdbus         : in  std_logic_vector(0 to C_SPLB_DWIDTH-1);
50        sgsl_rddbus        : in  std_logic_vector(0 to C_SPLB_NATIVE_DWIDTH-1);
51        sgplb_wrdbus       : out std_logic_vector(0 to C_SPLB_NATIVE_DWIDTH-1)
52    );
53end plbaddrpref;
54
55architecture behavior of plbaddrpref is
56
57signal sl_rddbus_i            : std_logic_vector(0 to C_SPLB_DWIDTH-1);
58
59begin
60    addrpref <= C_BASEADDR(32-1 downto 12);
61
62-------------------------------------------------------------------------------
63-- Mux/Steer data/be's correctly for connect 32-bit slave to 128-bit plb
64-------------------------------------------------------------------------------
65GEN_128_TO_32_SLAVE : if C_SPLB_NATIVE_DWIDTH = 32 and C_SPLB_DWIDTH = 128 generate
66begin
67    -----------------------------------------------------------------------
68    -- Map lower rd data to each quarter of the plb slave read bus
69    -----------------------------------------------------------------------
70    sl_rddbus_i(0 to 31)      <=  sgsl_rddbus(0 to C_SPLB_NATIVE_DWIDTH-1);
71    sl_rddbus_i(32 to 63)     <=  sgsl_rddbus(0 to C_SPLB_NATIVE_DWIDTH-1);
72    sl_rddbus_i(64 to 95)     <=  sgsl_rddbus(0 to C_SPLB_NATIVE_DWIDTH-1);
73    sl_rddbus_i(96 to 127)    <=  sgsl_rddbus(0 to C_SPLB_NATIVE_DWIDTH-1);
74end generate GEN_128_TO_32_SLAVE;
75
76-------------------------------------------------------------------------------
77-- Mux/Steer data/be's correctly for connect 32-bit slave to 64-bit plb
78-------------------------------------------------------------------------------
79GEN_64_TO_32_SLAVE : if C_SPLB_NATIVE_DWIDTH = 32 and C_SPLB_DWIDTH = 64 generate
80begin
81    ---------------------------------------------------------------------------       
82    -- Map lower rd data to upper and lower halves of plb slave read bus
83    ---------------------------------------------------------------------------       
84    sl_rddbus_i(0 to 31)      <=  sgsl_rddbus(0 to C_SPLB_NATIVE_DWIDTH-1);
85    sl_rddbus_i(32 to 63)     <=  sgsl_rddbus(0 to C_SPLB_NATIVE_DWIDTH-1);
86end generate GEN_64_TO_32_SLAVE;
87
88-------------------------------------------------------------------------------
89-- IPIF DWidth = PLB DWidth
90-- If IPIF Slave Data width is equal to the PLB Bus Data Width
91-- Then BE and Read Data Bus map directly to eachother.
92-------------------------------------------------------------------------------
93GEN_FOR_EQUAL_SLAVE : if C_SPLB_NATIVE_DWIDTH = C_SPLB_DWIDTH generate
94    sl_rddbus_i    <= sgsl_rddbus;
95end generate GEN_FOR_EQUAL_SLAVE;
96
97    sl_rddbus       <= sl_rddbus_i;
98    sgplb_wrdbus    <= plb_wrdbus(0 to C_SPLB_NATIVE_DWIDTH-1);
99
100end behavior;
101library IEEE;
102use IEEE.std_logic_1164.all;
103use work.conv_pkg.all;
104
105entity warp_timer_plbw is
106  generic (
107    C_BASEADDR: std_logic_vector(31 downto 0) := X"80000000";
108    C_HIGHADDR: std_logic_vector(31 downto 0) := X"80000FFF";
109    C_SPLB_DWIDTH: integer range 32 to 128 := 32;
110    C_SPLB_NATIVE_DWIDTH: integer range 32 to 32 := 32;
111    C_SPLB_AWIDTH: integer := 0;
112    C_SPLB_P2P: integer := 0;
113    C_SPLB_MID_WIDTH: integer := 0;
114    C_SPLB_NUM_MASTERS: integer := 0;
115    C_SPLB_SUPPORT_BURSTS: integer := 0;
116    C_MEMMAP_TIMER0_TIMELEFT: integer := 0;
117    C_MEMMAP_TIMER0_TIMELEFT_N_BITS: integer := 0;
118    C_MEMMAP_TIMER0_TIMELEFT_BIN_PT: integer := 0;
119    C_MEMMAP_TIMER1_TIMELEFT: integer := 0;
120    C_MEMMAP_TIMER1_TIMELEFT_N_BITS: integer := 0;
121    C_MEMMAP_TIMER1_TIMELEFT_BIN_PT: integer := 0;
122    C_MEMMAP_TIMER2_TIMELEFT: integer := 0;
123    C_MEMMAP_TIMER2_TIMELEFT_N_BITS: integer := 0;
124    C_MEMMAP_TIMER2_TIMELEFT_BIN_PT: integer := 0;
125    C_MEMMAP_TIMER3_TIMELEFT: integer := 0;
126    C_MEMMAP_TIMER3_TIMELEFT_N_BITS: integer := 0;
127    C_MEMMAP_TIMER3_TIMELEFT_BIN_PT: integer := 0;
128    C_MEMMAP_TIMER_CONTROL_R: integer := 0;
129    C_MEMMAP_TIMER_CONTROL_R_N_BITS: integer := 0;
130    C_MEMMAP_TIMER_CONTROL_R_BIN_PT: integer := 0;
131    C_MEMMAP_TIMER_STATUS: integer := 0;
132    C_MEMMAP_TIMER_STATUS_N_BITS: integer := 0;
133    C_MEMMAP_TIMER_STATUS_BIN_PT: integer := 0;
134    C_MEMMAP_TIMER0_COUNTTO: integer := 0;
135    C_MEMMAP_TIMER0_COUNTTO_N_BITS: integer := 0;
136    C_MEMMAP_TIMER0_COUNTTO_BIN_PT: integer := 0;
137    C_MEMMAP_TIMER1_COUNTTO: integer := 0;
138    C_MEMMAP_TIMER1_COUNTTO_N_BITS: integer := 0;
139    C_MEMMAP_TIMER1_COUNTTO_BIN_PT: integer := 0;
140    C_MEMMAP_TIMER2_COUNTTO: integer := 0;
141    C_MEMMAP_TIMER2_COUNTTO_N_BITS: integer := 0;
142    C_MEMMAP_TIMER2_COUNTTO_BIN_PT: integer := 0;
143    C_MEMMAP_TIMER3_COUNTTO: integer := 0;
144    C_MEMMAP_TIMER3_COUNTTO_N_BITS: integer := 0;
145    C_MEMMAP_TIMER3_COUNTTO_BIN_PT: integer := 0;
146    C_MEMMAP_TIMER_CONTROL_W: integer := 0;
147    C_MEMMAP_TIMER_CONTROL_W_N_BITS: integer := 0;
148    C_MEMMAP_TIMER_CONTROL_W_BIN_PT: integer := 0
149  );
150  port (
151    ce: in std_logic; 
152    idlefordifs: in std_logic; 
153    plb_abus: in std_logic_vector(0 to 31); 
154    plb_pavalid: in std_logic; 
155    plb_rnw: in std_logic; 
156    plb_wrdbus: in std_logic_vector(0 to C_SPLB_DWIDTH-1); 
157    splb_clk: in std_logic; 
158    splb_rst: in std_logic; 
159    sl_addrack: out std_logic; 
160    sl_rdcomp: out std_logic; 
161    sl_rddack: out std_logic; 
162    sl_rddbus: out std_logic_vector(0 to C_SPLB_DWIDTH-1); 
163    sl_wait: out std_logic; 
164    sl_wrcomp: out std_logic; 
165    sl_wrdack: out std_logic; 
166    timer0_active: out std_logic; 
167    timer1_active: out std_logic; 
168    timer2_active: out std_logic; 
169    timer3_active: out std_logic; 
170    timerexpire: out std_logic
171  );
172end warp_timer_plbw;
173
174architecture structural of warp_timer_plbw is
175  signal ce_x0: std_logic;
176  signal clk: std_logic;
177  signal idlefordifs_x0: std_logic;
178  signal plb_abus_x0: std_logic_vector(31 downto 0);
179  signal plb_pavalid_x0: std_logic;
180  signal plb_rnw_x0: std_logic;
181  signal plbaddrpref_addrpref_net: std_logic_vector(19 downto 0);
182  signal plbaddrpref_plb_wrdbus_net: std_logic_vector(C_SPLB_DWIDTH-1 downto 0);
183  signal plbaddrpref_sgplb_wrdbus_net: std_logic_vector(31 downto 0);
184  signal plbaddrpref_sgsl_rddbus_net: std_logic_vector(31 downto 0);
185  signal plbaddrpref_sl_rddbus_net: std_logic_vector(C_SPLB_DWIDTH-1 downto 0);
186  signal sl_addrack_x0: std_logic;
187  signal sl_rdcomp_x0: std_logic;
188  signal sl_rddack_x0: std_logic;
189  signal sl_wait_x0: std_logic;
190  signal sl_wrcomp_x0: std_logic;
191  signal sl_wrdack_x0: std_logic;
192  signal splb_rst_x0: std_logic;
193  signal timer0_active_x0: std_logic;
194  signal timer1_active_x0: std_logic;
195  signal timer2_active_x0: std_logic;
196  signal timer3_active_x0: std_logic;
197  signal timerexpire_x0: std_logic;
198
199begin
200  ce_x0 <= ce;
201  idlefordifs_x0 <= idlefordifs;
202  plb_abus_x0 <= plb_abus;
203  plb_pavalid_x0 <= plb_pavalid;
204  plb_rnw_x0 <= plb_rnw;
205  plbaddrpref_plb_wrdbus_net <= plb_wrdbus;
206  clk <= splb_clk;
207  splb_rst_x0 <= splb_rst;
208  sl_addrack <= sl_addrack_x0;
209  sl_rdcomp <= sl_rdcomp_x0;
210  sl_rddack <= sl_rddack_x0;
211  sl_rddbus <= plbaddrpref_sl_rddbus_net;
212  sl_wait <= sl_wait_x0;
213  sl_wrcomp <= sl_wrcomp_x0;
214  sl_wrdack <= sl_wrdack_x0;
215  timer0_active <= timer0_active_x0;
216  timer1_active <= timer1_active_x0;
217  timer2_active <= timer2_active_x0;
218  timer3_active <= timer3_active_x0;
219  timerexpire <= timerexpire_x0;
220
221  plbaddrpref_x0: entity work.plbaddrpref
222    generic map (
223      C_BASEADDR => C_BASEADDR,
224      C_HIGHADDR => C_HIGHADDR,
225      C_SPLB_DWIDTH => C_SPLB_DWIDTH,
226      C_SPLB_NATIVE_DWIDTH => C_SPLB_NATIVE_DWIDTH
227    )
228    port map (
229      plb_wrdbus => plbaddrpref_plb_wrdbus_net,
230      sgsl_rddbus => plbaddrpref_sgsl_rddbus_net,
231      addrpref => plbaddrpref_addrpref_net,
232      sgplb_wrdbus => plbaddrpref_sgplb_wrdbus_net,
233      sl_rddbus => plbaddrpref_sl_rddbus_net
234    );
235
236  sysgen_dut: entity work.warp_timer_cw
237    port map (
238      ce => ce_x0,
239      clk => clk,
240      idlefordifs => idlefordifs_x0,
241      plb_abus => plb_abus_x0,
242      plb_pavalid => plb_pavalid_x0,
243      plb_rnw => plb_rnw_x0,
244      plb_wrdbus => plbaddrpref_sgplb_wrdbus_net,
245      sg_plb_addrpref => plbaddrpref_addrpref_net,
246      splb_rst => splb_rst_x0,
247      sl_addrack => sl_addrack_x0,
248      sl_rdcomp => sl_rdcomp_x0,
249      sl_rddack => sl_rddack_x0,
250      sl_rddbus => plbaddrpref_sgsl_rddbus_net,
251      sl_wait => sl_wait_x0,
252      sl_wrcomp => sl_wrcomp_x0,
253      sl_wrdack => sl_wrdack_x0,
254      timer0_active => timer0_active_x0,
255      timer1_active => timer1_active_x0,
256      timer2_active => timer2_active_x0,
257      timer3_active => timer3_active_x0,
258      timerexpire => timerexpire_x0
259    );
260
261end structural;
Note: See TracBrowser for help on using the repository browser.