w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
miglib.vhd
Go to the documentation of this file.
1-- $Id: miglib.vhd 1181 2019-07-08 17:00:50Z 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-- Package Name: miglib
7-- Description: MIG interface components - generic
8--
9-- Dependencies: -
10-- Tool versions: viv 2017.2; ghdl 0.34
11--
12-- Revision History:
13-- Date Rev Version Comment
14-- 2018-12-26 1094 1.0 Initial version
15-- 2018-11-11 1067 0.1 First draft
16------------------------------------------------------------------------------
17
18library ieee;
19use ieee.std_logic_1164.all;
20
21use work.slvtypes.all;
22
23package miglib is
24
25constant c_migui_cmd_read : slv3 := "001";
26constant c_migui_cmd_write : slv3 := "000";
27
28type sramif2migui_moni_type is record -- sramif2migui monitor port
29 rdrhit : slbit; -- read row hit
30 wrrhit : slbit; -- write row hit
31 wrflush : slbit; -- write row flush
32 migcbusy : slbit; -- mig not ready for command
33 migwbusy : slbit; -- mig not ready for data write
34 miguirst : slbit; -- mig UI_CLK_SYNC_RST asserted
35 migcacow : slbit; -- mig calibration complete wait
36end record sramif2migui_moni_type;
37
39 '0','0','0', -- rdrhit,wrrhit,wrflush
40 '0','0','0','0' -- migcbusy,migwbusy,miguirst,migcacow
41);
42
43component sramif2migui_core is -- SRAM to MIG interface core
44 generic (
45 BAWIDTH : positive := 4; -- byte address width
46 MAWIDTH : positive := 28); -- memory address width
47 port (
48 CLK : in slbit; -- clock
49 RESET : in slbit; -- reset
50 REQ : in slbit; -- request
51 WE : in slbit; -- write enable
52 BUSY : out slbit; -- controller busy
53 ACK_R : out slbit; -- acknowledge read
54 ACK_W : out slbit; -- acknowledge write
55 ACT_R : out slbit; -- signal active read
56 ACT_W : out slbit; -- signal active write
57 ADDR : in slv20; -- address (32 bit word address)
58 BE : in slv4; -- byte enable
59 DI : in slv32; -- data in (memory view)
60 DO : out slv32; -- data out (memory view)
61 MONI : out sramif2migui_moni_type; -- monitor signals
62 UI_CLK : in slbit; -- MIGUI clock
63 UI_CLK_SYNC_RST : in slbit; -- MIGUI reset
64 INIT_CALIB_COMPLETE : in slbit; -- MIGUI calibration done
65 APP_RDY : in slbit; -- MIGUI ready for cmd
66 APP_EN : out slbit; -- MIGUI command enable
67 APP_CMD : out slv3; -- MIGUI command
68 APP_ADDR : out slv(MAWIDTH-1 downto 0); -- MIGUI address
69 APP_WDF_RDY : in slbit; -- MIGUI ready for data write
70 APP_WDF_WREN : out slbit; -- MIGUI data write enable
71 APP_WDF_DATA : out slv(8*(2**BAWIDTH)-1 downto 0);-- MIGUI write data
72 APP_WDF_MASK : out slv((2**BAWIDTH)-1 downto 0); -- MIGUI write mask
73 APP_WDF_END : out slbit; -- MIGUI write end
74 APP_RD_DATA_VALID : in slbit; -- MIGUI read valid
75 APP_RD_DATA : in slv(8*(2**BAWIDTH)-1 downto 0);-- MIGUI read data
76 APP_RD_DATA_END : in slbit -- MIGUI read end
77 );
78end component;
79
80component migui2bram is -- MIG to BRAM adapter
81 generic (
82 BAWIDTH : positive := 4; -- byte address width
83 MAWIDTH : positive := 28; -- memory address width
84 RAWIDTH : positive := 19; -- BRAM memory address width
85 RDELAY : positive := 5; -- read response delay
86 CLKMUI_MUL : positive := 6; -- multiplier for MIG UI clock
87 CLKMUI_DIV : positive := 12; -- divider for MIG UI clock
88 CLKMSYS_PERIOD : real := 6.000); -- MIG SYS_CLK period
89 port (
90 SYS_CLK : in slbit; -- system clock
91 SYS_RST : in slbit; -- system reset
92 UI_CLK : out slbit; -- MIGUI clock
93 UI_CLK_SYNC_RST : out slbit; -- MIGUI reset
94 INIT_CALIB_COMPLETE : out slbit; -- MIGUI calibration done
95 APP_RDY : out slbit; -- MIGUI ready for cmd
96 APP_EN : in slbit; -- MIGUI command enable
97 APP_CMD : in slv3; -- MIGUI command
98 APP_ADDR : in slv(MAWIDTH-1 downto 0); -- MIGUI address
99 APP_WDF_RDY : out slbit; -- MIGUI ready for data write
100 APP_WDF_WREN : in slbit; -- MIGUI data write enable
101 APP_WDF_DATA : in slv(8*(2**BAWIDTH)-1 downto 0);-- MIGUI write data
102 APP_WDF_MASK : in slv((2**BAWIDTH)-1 downto 0); -- MIGUI write mask
103 APP_WDF_END : in slbit; -- MIGUI write end
104 APP_RD_DATA_VALID : out slbit; -- MIGUI read valid
105 APP_RD_DATA : out slv(8*(2**BAWIDTH)-1 downto 0);-- MIGUI read data
106 APP_RD_DATA_END : out slbit -- MIGUI read end
107 );
108end component;
109
110component migui_core_gsim is -- MIG interface simulation core
111 generic (
112 BAWIDTH : positive := 4; -- byte address width
113 MAWIDTH : positive := 28; -- memory address width
114 SAWIDTH : positive := 24; -- simulator memory address width
115 CLKMUI_MUL : positive := 6; -- multiplier for MIG UI clock
116 CLKMUI_DIV : positive := 12; -- divider for MIG UI clock
117 CACO_WAIT : positive := 50); -- UI_CLK cycles till CALIB_COMP = 1
118 port (
119 SYS_CLK : in slbit; -- system clock
120 SYS_RST : in slbit; -- system reset
121 UI_CLK : out slbit; -- MIGUI clock
122 UI_CLK_SYNC_RST : out slbit; -- MIGUI reset
123 INIT_CALIB_COMPLETE : out slbit; -- MIGUI calibration done
124 APP_RDY : out slbit; -- MIGUI ready for cmd
125 APP_EN : in slbit; -- MIGUI command enable
126 APP_CMD : in slv3; -- MIGUI command
127 APP_ADDR : in slv(MAWIDTH-1 downto 0); -- MIGUI address
128 APP_WDF_RDY : out slbit; -- MIGUI ready for data write
129 APP_WDF_WREN : in slbit; -- MIGUI data write enable
130 APP_WDF_DATA : in slv(8*(2**BAWIDTH)-1 downto 0);-- MIGUI write data
131 APP_WDF_MASK : in slv((2**BAWIDTH)-1 downto 0); -- MIGUI write mask
132 APP_WDF_END : in slbit; -- MIGUI write end
133 APP_RD_DATA_VALID : out slbit; -- MIGUI read valid
134 APP_RD_DATA : out slv(8*(2**BAWIDTH)-1 downto 0);-- MIGUI read data
135 APP_RD_DATA_END : out slbit; -- MIGUI read end
136 APP_REF_REQ : in slbit; -- MIGUI refresh request
137 APP_ZQ_REQ : in slbit; -- MIGUI ZQ calibrate request
138 APP_REF_ACK : out slbit; -- MIGUI refresh acknowledge
139 APP_ZQ_ACK : out slbit -- MIGUI ZQ calibrate acknowledge
140 );
141end component;
142
143end package miglib;
slv3 := "001" c_migui_cmd_read
Definition: miglib.vhd:25
sramif2migui_moni_type
Definition: miglib.vhd:28
sramif2migui_moni_type :=( '0', '0', '0', '0', '0', '0', '0') sramif2migui_moni_init
Definition: miglib.vhd:38
slv3 := "000" c_migui_cmd_write
Definition: miglib.vhd:26
MAWIDTH positive := 28
Definition: migui2bram.vhd:35
out UI_CLK slbit
Definition: migui2bram.vhd:44
out APP_RDY slbit
Definition: migui2bram.vhd:47
out APP_RD_DATA_VALID slbit
Definition: migui2bram.vhd:56
out APP_RD_DATA_END slbit
Definition: migui2bram.vhd:59
in APP_WDF_MASK slv(( 2** BAWIDTH)- 1 downto 0)
Definition: migui2bram.vhd:54
in SYS_CLK slbit
Definition: migui2bram.vhd:42
CLKMSYS_PERIOD real := 6.000
Definition: migui2bram.vhd:40
CLKMUI_MUL positive := 6
Definition: migui2bram.vhd:38
in APP_WDF_DATA slv( 8*( 2** BAWIDTH)- 1 downto 0)
Definition: migui2bram.vhd:53
in APP_WDF_END slbit
Definition: migui2bram.vhd:55
RDELAY positive := 5
Definition: migui2bram.vhd:37
out INIT_CALIB_COMPLETE slbit
Definition: migui2bram.vhd:46
out APP_RD_DATA slv( 8*( 2** BAWIDTH)- 1 downto 0)
Definition: migui2bram.vhd:57
in SYS_RST slbit
Definition: migui2bram.vhd:43
RAWIDTH positive := 19
Definition: migui2bram.vhd:36
out APP_WDF_RDY slbit
Definition: migui2bram.vhd:51
CLKMUI_DIV positive := 12
Definition: migui2bram.vhd:39
in APP_WDF_WREN slbit
Definition: migui2bram.vhd:52
in APP_EN slbit
Definition: migui2bram.vhd:48
in APP_ADDR slv( MAWIDTH- 1 downto 0)
Definition: migui2bram.vhd:50
in APP_CMD slv3
Definition: migui2bram.vhd:49
BAWIDTH positive := 4
Definition: migui2bram.vhd:34
out UI_CLK_SYNC_RST slbit
Definition: migui2bram.vhd:45
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)
CACO_WAIT positive := 50
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( 19 downto 0) slv20
Definition: slvtypes.vhd:53
std_logic_vector( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic_vector( 2 downto 0) slv3
Definition: slvtypes.vhd:35
std_logic_vector( 31 downto 0) slv32
Definition: slvtypes.vhd:59
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector slv
Definition: slvtypes.vhd:31
MAWIDTH positive := 28
in INIT_CALIB_COMPLETE slbit
out MONI sramif2migui_moni_type
in APP_RD_DATA slv( 8*( 2** BAWIDTH)- 1 downto 0)
out APP_WDF_DATA slv( 8*( 2** BAWIDTH)- 1 downto 0)
out APP_ADDR slv( MAWIDTH- 1 downto 0)
out APP_WDF_MASK slv(( 2** BAWIDTH)- 1 downto 0)
BAWIDTH positive := 4