OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [rtl/] [bplib/] [basys3/] [tb/] [tb_basys3_core.vhd] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 wfjm
-- $Id: tb_basys3_core.vhd 648 2015-02-20 20:16:21Z mueller $
2
--
3
-- Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
-- 
14
------------------------------------------------------------------------------
15
-- Module Name:    tb_basys3_core - sim
16
-- Description:    Test bench for basys3 - core device handling
17
--
18
-- Dependencies:   -
19
--
20
-- To test:        generic, any basys3 target
21
--
22
-- Target Devices: generic
23
-- Tool versions:  viv 2014.4; ghdl 0.31
24
-- Revision History: 
25
-- Date         Rev Version  Comment
26
-- 2015-02-18   648   1.0    Initial version (derived from tb_nexys4_core)
27
------------------------------------------------------------------------------
28
 
29
library ieee;
30
use ieee.std_logic_1164.all;
31
use ieee.numeric_std.all;
32
use ieee.std_logic_textio.all;
33
use std.textio.all;
34
 
35
use work.slvtypes.all;
36
use work.serportlib.all;
37
use work.simbus.all;
38
 
39
entity tb_basys3_core is
40
  port (
41
    I_SWI : out slv16;                  -- b3 switches
42
    I_BTN : out slv5                    -- b3 buttons
43
  );
44
end tb_basys3_core;
45
 
46
architecture sim of tb_basys3_core is
47
 
48
  signal R_SWI    : slv16 := (others=>'0');
49
  signal R_BTN    : slv5  := (others=>'0');
50
 
51
  constant sbaddr_swi:  slv8 := slv(to_unsigned( 16,8));
52
  constant sbaddr_btn:  slv8 := slv(to_unsigned( 17,8));
53
 
54
begin
55
 
56
  proc_simbus: process (SB_VAL)
57
  begin
58
    if SB_VAL'event and to_x01(SB_VAL)='1' then
59
      if SB_ADDR = sbaddr_swi then
60
        R_SWI <= to_x01(SB_DATA(R_SWI'range));
61
      end if;
62
      if SB_ADDR = sbaddr_btn then
63
        R_BTN <= to_x01(SB_DATA(R_BTN'range));
64
      end if;
65
    end if;
66
  end process proc_simbus;
67
 
68
  I_SWI <= R_SWI;
69
  I_BTN <= R_BTN;
70
 
71
end sim;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.