w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tb_nexys3_core.vhd
Go to the documentation of this file.
1-- $Id: tb_nexys3_core.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2011-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: tb_nexys3_core - sim
7-- Description: Test bench for nexys3 - core device handling
8--
9-- Dependencies: simlib/simbididly
10-- bplib/micron/mt45w8mw16b
11--
12-- To test: generic, any nexys3 target
13--
14-- Target Devices: generic
15-- Tool versions: xst 11.4-14.7; ghdl 0.26-0.33
16-- Revision History:
17-- Date Rev Version Comment
18-- 2016-07-20 791 1.1 use simbididly
19-- 2011-11-25 432 1.0 Initial version (derived from tb_nexys2_core)
20------------------------------------------------------------------------------
21
22library ieee;
23use ieee.std_logic_1164.all;
24use ieee.numeric_std.all;
25use ieee.std_logic_textio.all;
26use std.textio.all;
27
28use work.slvtypes.all;
29use work.simlib.all;
30use work.simbus.all;
31
33 port (
34 I_SWI : out slv8; -- n3 switches
35 I_BTN : out slv5; -- n3 buttons
36 O_MEM_CE_N : in slbit; -- cram: chip enable (act.low)
37 O_MEM_BE_N : in slv2; -- cram: byte enables (act.low)
38 O_MEM_WE_N : in slbit; -- cram: write enable (act.low)
39 O_MEM_OE_N : in slbit; -- cram: output enable (act.low)
40 O_MEM_ADV_N : in slbit; -- cram: address valid (act.low)
41 O_MEM_CLK : in slbit; -- cram: clock
42 O_MEM_CRE : in slbit; -- cram: command register enable
43 I_MEM_WAIT : out slbit; -- cram: mem wait
44 O_MEM_ADDR : in slv23; -- cram: address lines
45 IO_MEM_DATA : inout slv16 -- cram: data lines
46 );
48
49architecture sim of tb_nexys3_core is
50
51 signal MM_MEM_CE_N : slbit := '1';
52 signal MM_MEM_BE_N : slv2 := (others=>'1');
53 signal MM_MEM_WE_N : slbit := '1';
54 signal MM_MEM_OE_N : slbit := '1';
55 signal MM_MEM_ADV_N : slbit := '1';
56 signal MM_MEM_CLK : slbit := '0';
57 signal MM_MEM_CRE : slbit := '0';
58 signal MM_MEM_WAIT : slbit := '0';
59 signal MM_MEM_ADDR : slv23 := (others=>'Z');
60 signal MM_MEM_DATA : slv16 := (others=>'0');
61
62 signal R_SWI : slv8 := (others=>'0');
63 signal R_BTN : slv5 := (others=>'0');
64
65 constant sbaddr_swi: slv8 := slv(to_unsigned( 16,8));
66 constant sbaddr_btn: slv8 := slv(to_unsigned( 17,8));
67 constant pcb_delay : Delay_length := 1 ns;
68
69begin
70
80
81 BUSDLY: simbididly
82 generic map (
84 DWIDTH => 16)
85 port map (
86 A => IO_MEM_DATA,
88
89 MEM : entity work.mt45w8mw16b
90 port map (
91 CLK => MM_MEM_CLK,
95 UB_N => MM_MEM_BE_N(1),
96 LB_N => MM_MEM_BE_N(0),
98 CRE => MM_MEM_CRE,
100 ADDR => MM_MEM_ADDR,
102 );
103
104 proc_simbus: process (SB_VAL)
105 begin
106 if SB_VAL'event and to_x01(SB_VAL)='1' then
107 if SB_ADDR = sbaddr_swi then
108 R_SWI <= to_x01(SB_DATA(R_SWI'range));
109 end if;
110 if SB_ADDR = sbaddr_btn then
111 R_BTN <= to_x01(SB_DATA(R_BTN'range));
112 end if;
113 end if;
114 end process proc_simbus;
115
116 I_SWI <= R_SWI;
117 I_BTN <= R_BTN;
118
119end sim;
in UB_N slbit
Definition: mt45w8mw16b.vhd:64
in CRE slbit
Definition: mt45w8mw16b.vhd:67
in WE_N slbit
Definition: mt45w8mw16b.vhd:63
in CLK slbit
Definition: mt45w8mw16b.vhd:60
out MWAIT slbit
Definition: mt45w8mw16b.vhd:68
in CE_N slbit
Definition: mt45w8mw16b.vhd:61
in OE_N slbit
Definition: mt45w8mw16b.vhd:62
in ADV_N slbit
Definition: mt45w8mw16b.vhd:66
in LB_N slbit
Definition: mt45w8mw16b.vhd:65
inout DATA slv16
Definition: mt45w8mw16b.vhd:71
in ADDR slv23
Definition: mt45w8mw16b.vhd:69
inout B slv( DWIDTH- 1 downto 0)
Definition: simbididly.vhd:32
inout A slv( DWIDTH- 1 downto 0)
Definition: simbididly.vhd:30
DELAY Delay_length
Definition: simbididly.vhd:27
DWIDTH positive := 16
Definition: simbididly.vhd:28
std_logic_vector( 22 downto 0) slv23
Definition: slvtypes.vhd:56
std_logic_vector( 4 downto 0) slv5
Definition: slvtypes.vhd:37
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40
std_logic_vector( 1 downto 0) slv2
Definition: slvtypes.vhd:34
std_logic_vector slv
Definition: slvtypes.vhd:31
slv16 :=( others => '0') MM_MEM_DATA
slv8 := slv( to_unsigned( 16, 8) ) sbaddr_swi
slv8 := slv( to_unsigned( 17, 8) ) sbaddr_btn
slbit := '1' MM_MEM_OE_N
slbit := '0' MM_MEM_CRE
slbit := '1' MM_MEM_ADV_N
slbit := '1' MM_MEM_CE_N
slbit := '1' MM_MEM_WE_N
Delay_length := 1 ns pcb_delay
slv5 :=( others => '0') R_BTN
slv2 :=( others => '1') MM_MEM_BE_N
slbit := '0' MM_MEM_WAIT
slbit := '0' MM_MEM_CLK
slv8 :=( others => '0') R_SWI
slv23 :=( others => 'Z') MM_MEM_ADDR
in O_MEM_WE_N slbit
in O_MEM_ADV_N slbit
out I_MEM_WAIT slbit
in O_MEM_CLK slbit
in O_MEM_OE_N slbit
in O_MEM_ADDR slv23
in O_MEM_CRE slbit
in O_MEM_CE_N slbit
inout IO_MEM_DATA slv16
in O_MEM_BE_N slv2