1 |
37 |
wfjm |
-- $Id: tbd_nx_cram_memctl_as.vhd 802 2016-08-27 19:00:23Z mueller $
|
2 |
16 |
wfjm |
--
|
3 |
37 |
wfjm |
-- Copyright 2010-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
4 |
16 |
wfjm |
--
|
5 |
|
|
-- This program is free software; you may redistribute and/or modify it under
|
6 |
|
|
-- the terms of the GNU General Public License as published by the Free
|
7 |
|
|
-- Software Foundation, either version 2, or at your option any later version.
|
8 |
|
|
--
|
9 |
|
|
-- This program is distributed in the hope that it will be useful, but
|
10 |
|
|
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
11 |
|
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12 |
|
|
-- for complete details.
|
13 |
|
|
--
|
14 |
|
|
------------------------------------------------------------------------------
|
15 |
|
|
-- Module Name: tbd_nx_cram_memctl_as - syn
|
16 |
|
|
-- Description: Wrapper for nx_cram_memctl_as to avoid records & generics.
|
17 |
|
|
-- It has a port interface which will not be modified by xst
|
18 |
|
|
-- synthesis (no records, no generic port).
|
19 |
|
|
--
|
20 |
|
|
-- Dependencies: nx_cram_memctl_as
|
21 |
|
|
-- To test: nx_cram_memctl_as
|
22 |
|
|
--
|
23 |
|
|
-- Target Devices: generic
|
24 |
|
|
--
|
25 |
|
|
-- Synthesized (xst):
|
26 |
|
|
-- Date Rev ise Target flop lutl lutm slic t peri
|
27 |
|
|
-- 2010-06-03 299 11.4 L68 xc3s1200e-4 91 122 0 107 t 11.4
|
28 |
|
|
-- 2010-05-30 297 11.4 L68 xc3s1200e-4 91 99 0 95 t 13.1
|
29 |
|
|
--
|
30 |
29 |
wfjm |
-- Tool versions: xst 11.4-14.7; ghdl 0.26-0.31
|
31 |
16 |
wfjm |
-- Revision History:
|
32 |
|
|
-- Date Rev Version Comment
|
33 |
37 |
wfjm |
-- 2016-08-27 802 1.2.1 use cram_read0delay ect
|
34 |
16 |
wfjm |
-- 2011-11-26 433 1.2 renamed from tbd_n2_cram_memctl_as
|
35 |
|
|
-- 2011-11-23 432 1.1 remove O_FLA_CE_N port from n2_cram_memctl
|
36 |
|
|
-- 2010-06-03 298 1.0.1 add hack to force IOB'FFs to O_MEM_ADDR
|
37 |
|
|
-- 2010-05-30 297 1.0 Initial version
|
38 |
|
|
------------------------------------------------------------------------------
|
39 |
|
|
|
40 |
|
|
library ieee;
|
41 |
|
|
use ieee.std_logic_1164.all;
|
42 |
|
|
|
43 |
|
|
use work.slvtypes.all;
|
44 |
|
|
use work.nxcramlib.all;
|
45 |
|
|
|
46 |
|
|
entity tbd_nx_cram_memctl_as is -- CRAM driver (async mode) [tb design]
|
47 |
|
|
-- generic: READ0=2;READ1=2;WRITE=3
|
48 |
|
|
port (
|
49 |
|
|
CLK : in slbit; -- clock
|
50 |
|
|
RESET : in slbit; -- reset
|
51 |
|
|
REQ : in slbit; -- request
|
52 |
|
|
WE : in slbit; -- write enable
|
53 |
|
|
BUSY : out slbit; -- controller busy
|
54 |
|
|
ACK_R : out slbit; -- acknowledge read
|
55 |
|
|
ACK_W : out slbit; -- acknowledge write
|
56 |
|
|
ACT_R : out slbit; -- signal active read
|
57 |
|
|
ACT_W : out slbit; -- signal active write
|
58 |
|
|
ADDR : in slv22; -- address (32 bit word address)
|
59 |
|
|
BE : in slv4; -- byte enable
|
60 |
|
|
DI : in slv32; -- data in (memory view)
|
61 |
|
|
DO : out slv32; -- data out (memory view)
|
62 |
|
|
O_MEM_CE_N : out slbit; -- cram: chip enable (act.low)
|
63 |
|
|
O_MEM_BE_N : out slv2; -- cram: byte enables (act.low)
|
64 |
|
|
O_MEM_WE_N : out slbit; -- cram: write enable (act.low)
|
65 |
|
|
O_MEM_OE_N : out slbit; -- cram: output enable (act.low)
|
66 |
|
|
O_MEM_ADV_N : out slbit; -- cram: address valid (act.low)
|
67 |
|
|
O_MEM_CLK : out slbit; -- cram: clock
|
68 |
|
|
O_MEM_CRE : out slbit; -- cram: command register enable
|
69 |
|
|
I_MEM_WAIT : in slbit; -- cram: mem wait
|
70 |
|
|
O_MEM_ADDR : out slv23; -- cram: address lines
|
71 |
|
|
IO_MEM_DATA : inout slv16 -- cram: data lines
|
72 |
|
|
);
|
73 |
|
|
end tbd_nx_cram_memctl_as;
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
architecture syn of tbd_nx_cram_memctl_as is
|
77 |
|
|
|
78 |
|
|
signal ADDR_X : slv22 := (others=>'0');
|
79 |
|
|
|
80 |
|
|
begin
|
81 |
|
|
|
82 |
37 |
wfjm |
-- Note: This is a hack to ensure that the IOB flops are on the O_MEM_ADDR
|
83 |
16 |
wfjm |
-- pins. Without par might choose to use IFF's on ADDR, causing varying
|
84 |
|
|
-- routing delays to O_MEM_ADDR. Didn't find a better way, setting
|
85 |
|
|
-- iob "false" attributes in ADDR didn't help.
|
86 |
|
|
-- This logic doesn't hurt, and prevents that IFFs for ADDR compete with
|
87 |
|
|
-- OFF's for O_MEM_ADDR.
|
88 |
|
|
|
89 |
|
|
ADDR_X <= ADDR when RESET='0' else (others=>'0');
|
90 |
|
|
|
91 |
37 |
wfjm |
CRAMCTL : nx_cram_memctl_as
|
92 |
16 |
wfjm |
generic map (
|
93 |
37 |
wfjm |
READ0DELAY => cram_read0delay(50), -- assume 50 MHz system clock. Must be
|
94 |
|
|
READ1DELAY => cram_read1delay(50), -- modified when clock_period is
|
95 |
|
|
WRITEDELAY => cram_writedelay(50)) -- changed in tb_nx_cram_memctl !!
|
96 |
16 |
wfjm |
port map (
|
97 |
|
|
CLK => CLK,
|
98 |
|
|
RESET => RESET,
|
99 |
|
|
REQ => REQ,
|
100 |
|
|
WE => WE,
|
101 |
|
|
BUSY => BUSY,
|
102 |
|
|
ACK_R => ACK_R,
|
103 |
|
|
ACK_W => ACK_W,
|
104 |
|
|
ACT_R => ACT_R,
|
105 |
|
|
ACT_W => ACT_W,
|
106 |
|
|
ADDR => ADDR_X,
|
107 |
|
|
BE => BE,
|
108 |
|
|
DI => DI,
|
109 |
|
|
DO => DO,
|
110 |
|
|
O_MEM_CE_N => O_MEM_CE_N,
|
111 |
|
|
O_MEM_BE_N => O_MEM_BE_N,
|
112 |
|
|
O_MEM_WE_N => O_MEM_WE_N,
|
113 |
|
|
O_MEM_OE_N => O_MEM_OE_N,
|
114 |
|
|
O_MEM_ADV_N => O_MEM_ADV_N,
|
115 |
|
|
O_MEM_CLK => O_MEM_CLK,
|
116 |
|
|
O_MEM_CRE => O_MEM_CRE,
|
117 |
|
|
I_MEM_WAIT => I_MEM_WAIT,
|
118 |
|
|
O_MEM_ADDR => O_MEM_ADDR,
|
119 |
|
|
IO_MEM_DATA => IO_MEM_DATA
|
120 |
|
|
);
|
121 |
|
|
|
122 |
|
|
end syn;
|