Line 1... |
Line 1... |
-- $Id: n2_cram_memctl_as.vhd 427 2011-11-19 21:04:11Z mueller $
|
-- $Id: nx_cram_memctl_as.vhd 433 2011-11-27 22:04:39Z mueller $
|
--
|
--
|
-- Copyright 2010-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
-- Copyright 2010-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
--
|
--
|
-- This program is free software; you may redistribute and/or modify it under
|
-- This program is free software; you may redistribute and/or modify it under
|
-- the terms of the GNU General Public License as published by the Free
|
-- the terms of the GNU General Public License as published by the Free
|
Line 10... |
Line 10... |
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
-- for complete details.
|
-- for complete details.
|
--
|
--
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
-- Module Name: n2_cram_memctl_as - syn
|
-- Module Name: nx_cram_memctl_as - syn
|
-- Description: nexys2: CRAM driver - async and page mode
|
-- Description: nexys2/3: CRAM driver - async and page mode
|
--
|
--
|
-- Dependencies: vlib/xlib/iob_reg_o
|
-- Dependencies: vlib/xlib/iob_reg_o
|
-- vlib/xlib/iob_reg_o_gen
|
-- vlib/xlib/iob_reg_o_gen
|
-- vlib/xlib/iob_reg_io_gen
|
-- vlib/xlib/iob_reg_io_gen
|
-- Test bench: tb/tb_n2_cram_memctl
|
-- Test bench: tb/tb_nx_cram_memctl_as
|
-- fw_gen/tst_sram/nexys2/tb/tb_tst_sram_n2
|
-- sys_gen/tst_sram/nexys2/tb/tb_tst_sram_n2
|
-- Target Devices: generic
|
-- Target Devices: generic
|
-- Tool versions: xst 11.4, 13.1; ghdl 0.26
|
-- Tool versions: xst 11.4, 13.1; ghdl 0.26
|
--
|
--
|
-- Synthesized (xst):
|
-- Synthesized (xst):
|
-- Date Rev ise Target flop lutl lutm slic t peri
|
-- Date Rev ise Target flop lutl lutm slic t peri
|
Line 29... |
Line 29... |
-- 2010-05-24 294 11.4 L68 xc3s1200e-4 91 99 0 95 s 6.7
|
-- 2010-05-24 294 11.4 L68 xc3s1200e-4 91 99 0 95 s 6.7
|
-- 2010-05-23 293 11.4 L68 xc3s1200e-4 91 139 0 99 s 6.7
|
-- 2010-05-23 293 11.4 L68 xc3s1200e-4 91 139 0 99 s 6.7
|
--
|
--
|
-- Revision History:
|
-- Revision History:
|
-- Date Rev Version Comment
|
-- Date Rev Version Comment
|
|
-- 2011-11-26 433 1.2 renamed from n2_cram_memctl_as
|
|
-- 2011-11-19 432 1.1 remove O_FLA_CE_N port
|
-- 2011-11-19 427 1.0.5 now numeric_std clean
|
-- 2011-11-19 427 1.0.5 now numeric_std clean
|
-- 2010-11-22 339 1.0.4 cntdly now 3 bit; add assert for DELAY generics
|
-- 2010-11-22 339 1.0.4 cntdly now 3 bit; add assert for DELAY generics
|
-- 2010-06-03 299 1.0.3 add "KEEP" for data iob; MEM_OE='1' on first read
|
-- 2010-06-03 299 1.0.3 add "KEEP" for data iob; MEM_OE='1' on first read
|
-- cycle;
|
-- cycle;
|
-- 2010-05-30 297 1.0.2 use READ(0|1)DELAY generic
|
-- 2010-05-30 297 1.0.2 use READ(0|1)DELAY generic
|
Line 115... |
Line 117... |
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
|
|
use work.slvtypes.all;
|
use work.slvtypes.all;
|
use work.xlib.all;
|
use work.xlib.all;
|
|
|
entity n2_cram_memctl_as is -- CRAM driver (async+page mode)
|
entity nx_cram_memctl_as is -- CRAM driver (async+page mode)
|
generic (
|
generic (
|
READ0DELAY : positive := 2; -- read word 0 delay in clock cycles
|
READ0DELAY : positive := 2; -- read word 0 delay in clock cycles
|
READ1DELAY : positive := 2; -- read word 1 delay in clock cycles
|
READ1DELAY : positive := 2; -- read word 1 delay in clock cycles
|
WRITEDELAY : positive := 3); -- write delay in clock cycles
|
WRITEDELAY : positive := 3); -- write delay in clock cycles
|
port (
|
port (
|
Line 142... |
Line 144... |
O_MEM_OE_N : out slbit; -- cram: output enable (act.low)
|
O_MEM_OE_N : out slbit; -- cram: output enable (act.low)
|
O_MEM_ADV_N : out slbit; -- cram: address valid (act.low)
|
O_MEM_ADV_N : out slbit; -- cram: address valid (act.low)
|
O_MEM_CLK : out slbit; -- cram: clock
|
O_MEM_CLK : out slbit; -- cram: clock
|
O_MEM_CRE : out slbit; -- cram: command register enable
|
O_MEM_CRE : out slbit; -- cram: command register enable
|
I_MEM_WAIT : in slbit; -- cram: mem wait
|
I_MEM_WAIT : in slbit; -- cram: mem wait
|
O_FLA_CE_N : out slbit; -- flash ce.. (act.low)
|
|
O_MEM_ADDR : out slv23; -- cram: address lines
|
O_MEM_ADDR : out slv23; -- cram: address lines
|
IO_MEM_DATA : inout slv16 -- cram: data lines
|
IO_MEM_DATA : inout slv16 -- cram: data lines
|
);
|
);
|
end n2_cram_memctl_as;
|
end nx_cram_memctl_as;
|
|
|
|
|
architecture syn of n2_cram_memctl_as is
|
architecture syn of nx_cram_memctl_as is
|
|
|
type state_type is (
|
type state_type is (
|
s_idle, -- s_idle: wait for req
|
s_idle, -- s_idle: wait for req
|
s_rdinit, -- s_rdinit: read init cycle
|
s_rdinit, -- s_rdinit: read init cycle
|
s_rdwait0, -- s_rdwait0: read wait low word
|
s_rdwait0, -- s_rdwait0: read wait low word
|
Line 298... |
Line 299... |
);
|
);
|
|
|
O_MEM_ADV_N <= '0';
|
O_MEM_ADV_N <= '0';
|
O_MEM_CLK <= '0';
|
O_MEM_CLK <= '0';
|
O_MEM_CRE <= '0';
|
O_MEM_CRE <= '0';
|
O_FLA_CE_N <= '1';
|
|
|
|
proc_regs: process (CLK)
|
proc_regs: process (CLK)
|
begin
|
begin
|
|
|
if rising_edge(CLK) then
|
if rising_edge(CLK) then
|