w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tb_arty_core.vhd
Go to the documentation of this file.
1-- $Id: tb_arty_core.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2016- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: tb_arty_core - sim
7-- Description: Test bench for arty - core device handling
8--
9-- Dependencies: -
10--
11-- To test: generic, any arty target
12--
13-- Target Devices: generic
14-- Tool versions: viv 2015.4; ghdl 0.33
15-- Revision History:
16-- Date Rev Version Comment
17-- 2016-01-31 726 1.0 Initial version (derived from tb_basys3_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
29entity tb_arty_core is
30 port (
31 I_SWI : out slv4; -- arty switches
32 I_BTN : out slv4 -- arty buttons
33 );
34end tb_arty_core;
35
36architecture sim of tb_arty_core is
37
38 signal R_SWI : slv4 := (others=>'0');
39 signal R_BTN : slv4 := (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( 3 downto 0) slv4
Definition: slvtypes.vhd:36
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
slv4 :=( others => '0') R_BTN
slv4 :=( others => '0') R_SWI
out I_SWI slv4
out I_BTN slv4