w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tb_s3board_core.vhd
Go to the documentation of this file.
1-- $Id: tb_s3board_core.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2010-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: tb_s3board_core - sim
7-- Description: Test bench for s3board - core device handling
8--
9-- Dependencies: simlib/simbididly
10-- bplib/issi/is61lv25616al
11--
12-- To test: generic, any s3board 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-23 793 1.1 use simbididly
19-- 2011-11-19 427 1.0.2 now numeric_std clean
20-- 2010-05-02 287 1.0.1 add sbaddr_(swi|btn) defs, now sbus addr 16,17
21-- 2010-04-24 282 1.0 Initial version (from vlib/s3board/tb/tb_s3board)
22------------------------------------------------------------------------------
23
24library ieee;
25use ieee.std_logic_1164.all;
26use ieee.numeric_std.all;
27use ieee.std_logic_textio.all;
28use std.textio.all;
29
30use work.slvtypes.all;
31use work.simlib.all;
32use work.simbus.all;
33
35 port (
36 I_SWI : out slv8; -- s3 switches
37 I_BTN : out slv4; -- s3 buttons
38 O_MEM_CE_N : in slv2; -- sram: chip enables (act.low)
39 O_MEM_BE_N : in slv4; -- sram: byte enables (act.low)
40 O_MEM_WE_N : in slbit; -- sram: write enable (act.low)
41 O_MEM_OE_N : in slbit; -- sram: output enable (act.low)
42 O_MEM_ADDR : in slv18; -- sram: address lines
43 IO_MEM_DATA : inout slv32 -- sram: data lines
44 );
46
47architecture sim of tb_s3board_core is
48
49 signal MM_MEM_CE_N : slv2 := (others=>'1');
50 signal MM_MEM_BE_N : slv4 := (others=>'1');
51 signal MM_MEM_WE_N : slbit := '1';
52 signal MM_MEM_OE_N : slbit := '1';
53 signal MM_MEM_ADDR : slv18 := (others=>'Z');
54 signal MM_MEM_DATA : slv32 := (others=>'0');
55
56 signal R_SWI : slv8 := (others=>'0');
57 signal R_BTN : slv4 := (others=>'0');
58
59 constant sbaddr_swi: slv8 := slv(to_unsigned( 16,8));
60 constant sbaddr_btn: slv8 := slv(to_unsigned( 17,8));
61 constant pcb_delay : Delay_length := 1 ns;
62
63begin
64
70
71 BUSDLY: simbididly
72 generic map (
74 DWIDTH => 32)
75 port map (
76 A => IO_MEM_DATA,
78
79 MEM_L : entity work.is61lv25616al
80 port map (
81 CE_N => MM_MEM_CE_N(0),
84 UB_N => MM_MEM_BE_N(1),
85 LB_N => MM_MEM_BE_N(0),
87 DATA => MM_MEM_DATA(15 downto 0)
88 );
89
90 MEM_U : entity work.is61lv25616al
91 port map (
92 CE_N => MM_MEM_CE_N(1),
95 UB_N => MM_MEM_BE_N(3),
96 LB_N => MM_MEM_BE_N(2),
98 DATA => MM_MEM_DATA(31 downto 16)
99 );
100
101 proc_simbus: process (SB_VAL)
102 begin
103 if SB_VAL'event and to_x01(SB_VAL)='1' then
104 if SB_ADDR = sbaddr_swi then
105 R_SWI <= to_x01(SB_DATA(R_SWI'range));
106 end if;
107 if SB_ADDR = sbaddr_btn then
108 R_BTN <= to_x01(SB_DATA(R_BTN'range));
109 end if;
110 end if;
111 end process proc_simbus;
112
113 I_SWI <= R_SWI;
114 I_BTN <= R_BTN;
115
116end sim;
in UB_N slbit
in ADDR slv18
in WE_N slbit
in CE_N slbit
in OE_N slbit
in LB_N slbit
inout DATA slv16
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( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic_vector( 17 downto 0) slv18
Definition: slvtypes.vhd:51
std_logic_vector( 31 downto 0) slv32
Definition: slvtypes.vhd:59
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
slv8 := slv( to_unsigned( 16, 8) ) sbaddr_swi
slv8 := slv( to_unsigned( 17, 8) ) sbaddr_btn
slbit := '1' MM_MEM_OE_N
slv4 :=( others => '1') MM_MEM_BE_N
slbit := '1' MM_MEM_WE_N
Delay_length := 1 ns pcb_delay
slv4 :=( others => '0') R_BTN
slv18 :=( others => 'Z') MM_MEM_ADDR
slv32 :=( others => '0') MM_MEM_DATA
slv2 :=( others => '1') MM_MEM_CE_N
slv8 :=( others => '0') R_SWI
inout IO_MEM_DATA slv32
in O_MEM_WE_N slbit
in O_MEM_ADDR slv18
in O_MEM_OE_N slbit