w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tb_basys3_core.vhd
Go to the documentation of this file.
1-- $Id: tb_basys3_core.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: tb_basys3_core - sim
7-- Description: Test bench for basys3 - core device handling
8--
9-- Dependencies: -
10--
11-- To test: generic, any basys3 target
12--
13-- Target Devices: generic
14-- Tool versions: viv 2014.4; ghdl 0.31
15-- Revision History:
16-- Date Rev Version Comment
17-- 2015-02-18 648 1.0 Initial version (derived from tb_nexys4_core)
18------------------------------------------------------------------------------
19
20library ieee;
21use ieee.std_logic_1164.all;
22use ieee.numeric_std.all;
23use ieee.std_logic_textio.all;
24use std.textio.all;
25
26use work.slvtypes.all;
27use work.simbus.all;
28
30 port (
31 I_SWI : out slv16; -- b3 switches
32 I_BTN : out slv5 -- b3 buttons
33 );
35
36architecture sim of tb_basys3_core is
37
38 signal R_SWI : slv16 := (others=>'0');
39 signal R_BTN : slv5 := (others=>'0');
40
41 constant sbaddr_swi: slv8 := slv(to_unsigned( 16,8));
42 constant sbaddr_btn: slv8 := slv(to_unsigned( 17,8));
43
44begin
45
46 proc_simbus: process (SB_VAL)
47 begin
48 if SB_VAL'event and to_x01(SB_VAL)='1' then
49 if SB_ADDR = sbaddr_swi then
50 R_SWI <= to_x01(SB_DATA(R_SWI'range));
51 end if;
52 if SB_ADDR = sbaddr_btn then
53 R_BTN <= to_x01(SB_DATA(R_BTN'range));
54 end if;
55 end if;
56 end process proc_simbus;
57
58 I_SWI <= R_SWI;
59 I_BTN <= R_BTN;
60
61end sim;
std_logic_vector( 4 downto 0) slv5
Definition: slvtypes.vhd:37
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40
std_logic_vector slv
Definition: slvtypes.vhd:31
slv8 := slv( to_unsigned( 16, 8) ) sbaddr_swi
slv8 := slv( to_unsigned( 17, 8) ) sbaddr_btn
slv16 :=( others => '0') R_SWI
slv5 :=( others => '0') R_BTN
out I_SWI slv16