w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
migui_arty_gsim.vhd
Go to the documentation of this file.
1-- $Id: migui_arty_gsim.vhd 1201 2019-08-10 16:51:22Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2018- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: migui_arty - sim
7-- Description: MIG generated for arty - simple simulator
8--
9-- Dependencies: bplib/mig/migui_core_gsim
10-- Test bench: tb_tst_sram_arty
11-- Target Devices: arty board
12-- Tool versions: viv 2017.2; ghdl 0.34
13--
14-- Revision History:
15-- Date Rev Version Comment
16-- 2018-12-25 1093 1.0 Initial version
17-- 2018-11-17 1071 0.1 First draft
18--
19------------------------------------------------------------------------------
20
21library ieee;
22use ieee.std_logic_1164.all;
23use ieee.numeric_std.all;
24
25use work.slvtypes.all;
26use work.miglib.all;
27use work.miglib_arty.all;
28
29entity migui_arty is -- MIG generated for arty
30 port (
31 DDR3_DQ : inout slv16; -- dram: data in/out
32 DDR3_DQS_P : inout slv2; -- dram: data strobe (diff-p)
33 DDR3_DQS_N : inout slv2; -- dram: data strobe (diff-n)
34 DDR3_ADDR : out slv14; -- dram: address
35 DDR3_BA : out slv3; -- dram: bank address
36 DDR3_RAS_N : out slbit; -- dram: row addr strobe (act.low)
37 DDR3_CAS_N : out slbit; -- dram: column addr strobe (act.low)
38 DDR3_WE_N : out slbit; -- dram: write enable (act.low)
39 DDR3_RESET_N : out slbit; -- dram: reset (act.low)
40 DDR3_CK_P : out slv1; -- dram: clock (diff-p)
41 DDR3_CK_N : out slv1; -- dram: clock (diff-n)
42 DDR3_CKE : out slv1; -- dram: clock enable
43 DDR3_CS_N : out slv1; -- dram: chip select (act.low)
44 DDR3_DM : out slv2; -- dram: data input mask
45 DDR3_ODT : out slv1; -- dram: on-die termination
46 APP_ADDR : in slv(mig_mawidth-1 downto 0); -- MIGUI address
47 APP_CMD : in slv3; -- MIGUI command
48 APP_EN : in slbit; -- MIGUI command enable
49 APP_WDF_DATA : in slv(mig_dwidth-1 downto 0);-- MIGUI write data
50 APP_WDF_END : in slbit; -- MIGUI write end
51 APP_WDF_MASK : in slv(mig_mwidth-1 downto 0); -- MIGUI write mask
52 APP_WDF_WREN : in slbit; -- MIGUI data write enable
53 APP_RD_DATA : out slv(mig_dwidth-1 downto 0); -- MIGUI read data
54 APP_RD_DATA_END : out slbit; -- MIGUI read end
55 APP_RD_DATA_VALID : out slbit; -- MIGUI read valid
56 APP_RDY : out slbit; -- MIGUI ready for cmd
57 APP_WDF_RDY : out slbit; -- MIGUI ready for data write
58 APP_SR_REQ : in slbit; -- MIGUI reserved (tie to 0)
59 APP_REF_REQ : in slbit; -- MIGUI refresh request
60 APP_ZQ_REQ : in slbit; -- MIGUI ZQ calibrate request
61 APP_SR_ACTIVE : out slbit; -- MIGUI reserved (ignore)
62 APP_REF_ACK : out slbit; -- MIGUI refresh acknowledge
63 APP_ZQ_ACK : out slbit; -- MIGUI ZQ calibrate acknowledge
64 UI_CLK : out slbit; -- MIGUI clock
65 UI_CLK_SYNC_RST : out slbit; -- MIGUI reset
66 INIT_CALIB_COMPLETE : out slbit; -- MIGUI inital calibration complete
67 SYS_CLK_I : in slbit; -- MIGUI system clock
68 CLK_REF_I : in slbit; -- MIGUI reference clock
69 DEVICE_TEMP_I : in slv12; -- MIGUI xadc temperature
70 SYS_RST : in slbit -- MIGUI system reset
71 );
72end migui_arty;
73
74
75architecture sim of migui_arty is
76
77begin
78
79 -- On Arty we have
80 -- SYS_CLK_I 166.6 Mhz
81 -- controller 333.3 MHz
82 -- UI_CLK 83.3 MHz (4:1)
83 -- therefore for simulation
84 -- f_vco 1000 MHz
85 -- --> mul 6 (f_vco/SYS_CLK)
86 -- --> div 12 (f_vco/UI_CLK)
87
88 MIG_SIM : migui_core_gsim
89 generic map (
90 BAWIDTH => mig_bawidth,
91 MAWIDTH => mig_mawidth,
92 SAWIDTH => 24,
93 CLKMUI_MUL => 6,
94 CLKMUI_DIV => 12)
95 port map (
98 UI_CLK => UI_CLK,
101 APP_RDY => APP_RDY,
102 APP_EN => APP_EN,
103 APP_CMD => APP_CMD,
117 );
118
119 DDR3_DQ <= (others=>'Z');
120 DDR3_DQS_P <= (others=>'Z');
121 DDR3_DQS_N <= (others=>'Z');
122 DDR3_ADDR <= (others=>'0');
123 DDR3_BA <= (others=>'0');
124 DDR3_RAS_N <= '1';
125 DDR3_CAS_N <= '1';
126 DDR3_WE_N <= '1';
127 DDR3_RESET_N <= '1';
128 DDR3_CK_P <= (others=>'0');
129 DDR3_CK_N <= (others=>'1');
130 DDR3_CKE <= (others=>'0');
131 DDR3_CS_N <= (others=>'1');
132 DDR3_DM <= (others=>'0');
133 DDR3_ODT <= (others=>'0');
134
135 APP_SR_ACTIVE <= '0';
136
137end sim;
out UI_CLK slbit
out DDR3_CK_P slv1
out APP_RD_DATA slv( mig_dwidth- 1 downto 0)
out APP_RDY slbit
out APP_RD_DATA_VALID slbit
out DDR3_DM slv2
out APP_REF_ACK slbit
out APP_RD_DATA_END slbit
out DDR3_RESET_N slbit
out DDR3_BA slv3
inout DDR3_DQ slv16
in APP_WDF_MASK slv( mig_mwidth- 1 downto 0)
in APP_WDF_END slbit
in DEVICE_TEMP_I slv12
out INIT_CALIB_COMPLETE slbit
in APP_SR_REQ slbit
out DDR3_WE_N slbit
out DDR3_CKE slv1
out DDR3_ADDR slv14
out DDR3_ODT slv1
out DDR3_CAS_N slbit
out DDR3_CK_N slv1
inout DDR3_DQS_P slv2
in APP_REF_REQ slbit
in SYS_RST slbit
out APP_ZQ_ACK slbit
out APP_WDF_RDY slbit
inout DDR3_DQS_N slv2
in APP_ZQ_REQ slbit
in CLK_REF_I slbit
in APP_WDF_WREN slbit
out APP_SR_ACTIVE slbit
in APP_EN slbit
in APP_CMD slv3
in APP_ADDR slv( mig_mawidth- 1 downto 0)
in SYS_CLK_I slbit
out DDR3_RAS_N slbit
out DDR3_CS_N slv1
in APP_WDF_DATA slv( mig_dwidth- 1 downto 0)
out UI_CLK_SYNC_RST slbit
MAWIDTH positive := 28
out APP_RDY slbit
out APP_RD_DATA_VALID slbit
out APP_REF_ACK slbit
out APP_RD_DATA_END slbit
in APP_WDF_MASK slv(( 2** BAWIDTH)- 1 downto 0)
CLKMUI_MUL positive := 6
SAWIDTH positive := 24
in APP_WDF_DATA slv( 8*( 2** BAWIDTH)- 1 downto 0)
in APP_WDF_END slbit
out INIT_CALIB_COMPLETE slbit
out APP_RD_DATA slv( 8*( 2** BAWIDTH)- 1 downto 0)
in APP_REF_REQ slbit
out APP_ZQ_ACK slbit
out APP_WDF_RDY slbit
in APP_ZQ_REQ slbit
CLKMUI_DIV positive := 12
in APP_WDF_WREN slbit
in APP_ADDR slv( MAWIDTH- 1 downto 0)
BAWIDTH positive := 4
out UI_CLK_SYNC_RST slbit
std_logic_vector( 13 downto 0) slv14
Definition: slvtypes.vhd:46
std_logic_vector( 11 downto 0) slv12
Definition: slvtypes.vhd:44
std_logic_vector( 2 downto 0) slv3
Definition: slvtypes.vhd:35
std_logic_vector( 0 downto 0) slv1
Definition: slvtypes.vhd:33
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 1 downto 0) slv2
Definition: slvtypes.vhd:34
std_logic_vector slv
Definition: slvtypes.vhd:31