w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
sys_tst_snhumanio_n2.vhd
Go to the documentation of this file.
1-- $Id: sys_tst_snhumanio_n2.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: sys_tst_snhumanio_n2 - syn
7-- Description: snhumanio tester design for nexys2
8--
9-- Dependencies: vlib/genlib/clkdivce
10-- bplib/bpgen/sn_humanio
11-- tst_snhumanio
12-- vlib/nxcramlib/nx_cram_dummy
13--
14-- Test bench: -
15--
16-- Target Devices: generic
17-- Tool versions: xst 13.1-14.7; ghdl 0.29-0.31
18--
19-- Synthesized (xst):
20-- Date Rev ise Target flop lutl lutm slic t peri
21-- 2011-09-17 410 13.1 O40d xc3s1200e-4 149 207 - 144 t 10.2
22--
23-- Revision History:
24-- Date Rev Version Comment
25-- 2011-12-23 444 1.1 remove clksys output hack
26-- 2011-11-26 433 1.0.3 use nx_cram_dummy now
27-- 2011-11-23 432 1.0.3 update O_FLA_CE_N usage
28-- 2011-10-25 419 1.0.2 get entity name right...
29-- 2011-09-17 410 1.0 Initial version
30------------------------------------------------------------------------------
31-- Usage of Nexys 2 Switches, Buttons, LEDs:
32--
33
34library ieee;
35use ieee.std_logic_1164.all;
36
37use work.slvtypes.all;
38use work.genlib.all;
39use work.bpgenlib.all;
40use work.nxcramlib.all;
41use work.sys_conf.all;
42
43-- ----------------------------------------------------------------------------
44
45entity sys_tst_snhumanio_n2 is -- top level
46 -- implements nexys2_aif
47 port (
48 I_CLK50 : in slbit; -- 50 MHz clock
49 I_RXD : in slbit; -- receive data (board view)
50 O_TXD : out slbit; -- transmit data (board view)
51 I_SWI : in slv8; -- n2 switches
52 I_BTN : in slv4; -- n2 buttons
53 O_LED : out slv8; -- n2 leds
54 O_ANO_N : out slv4; -- 7 segment disp: anodes (act.low)
55 O_SEG_N : out slv8; -- 7 segment disp: segments (act.low)
56 O_MEM_CE_N : out slbit; -- cram: chip enable (act.low)
57 O_MEM_BE_N : out slv2; -- cram: byte enables (act.low)
58 O_MEM_WE_N : out slbit; -- cram: write enable (act.low)
59 O_MEM_OE_N : out slbit; -- cram: output enable (act.low)
60 O_MEM_ADV_N : out slbit; -- cram: address valid (act.low)
61 O_MEM_CLK : out slbit; -- cram: clock
62 O_MEM_CRE : out slbit; -- cram: command register enable
63 I_MEM_WAIT : in slbit; -- cram: mem wait
64 O_MEM_ADDR : out slv23; -- cram: address lines
65 IO_MEM_DATA : inout slv16; -- cram: data lines
66 O_FLA_CE_N : out slbit -- flash ce.. (act.low)
67 );
69
70architecture syn of sys_tst_snhumanio_n2 is
71
72 signal CLK : slbit := '0';
73
74 signal SWI : slv8 := (others=>'0');
75 signal BTN : slv4 := (others=>'0');
76 signal LED : slv8 := (others=>'0');
77 signal DSP_DAT : slv16 := (others=>'0');
78 signal DSP_DP : slv4 := (others=>'0');
79
80 signal RESET : slbit := '0';
81 signal CE_MSEC : slbit := '0';
82
83begin
84
85 RESET <= '0'; -- so far not used
86
87 CLK <= I_CLK50;
88
89 CLKDIV : clkdivce
90 generic map (
91 CDUWIDTH => 7,
92 USECDIV => 50,
93 MSECDIV => 1000)
94 port map (
95 CLK => CLK,
96 CE_USEC => open,
98 );
99
100 HIO : sn_humanio
101 generic map (
102 BWIDTH => 4,
103 DEBOUNCE => sys_conf_hio_debounce)
104 port map (
105 CLK => CLK,
106 RESET => RESET,
107 CE_MSEC => CE_MSEC,
108 SWI => SWI,
109 BTN => BTN,
110 LED => LED,
111 DSP_DAT => DSP_DAT,
112 DSP_DP => DSP_DP,
113 I_SWI => I_SWI,
114 I_BTN => I_BTN,
115 O_LED => O_LED,
116 O_ANO_N => O_ANO_N,
118 );
119
120 HIOTEST : entity work.tst_snhumanio
121 generic map (
122 BWIDTH => 4)
123 port map (
124 CLK => CLK,
125 RESET => RESET,
126 CE_MSEC => CE_MSEC,
127 SWI => SWI,
128 BTN => BTN,
129 LED => LED,
130 DSP_DAT => DSP_DAT,
131 DSP_DP => DSP_DP
132 );
133
134 O_TXD <= I_RXD;
135
136 SRAM_PROT : nx_cram_dummy -- connect CRAM to protection dummy
137 port map (
138 O_MEM_CE_N => O_MEM_CE_N,
139 O_MEM_BE_N => O_MEM_BE_N,
140 O_MEM_WE_N => O_MEM_WE_N,
141 O_MEM_OE_N => O_MEM_OE_N,
142 O_MEM_ADV_N => O_MEM_ADV_N,
143 O_MEM_CLK => O_MEM_CLK,
144 O_MEM_CRE => O_MEM_CRE,
145 I_MEM_WAIT => I_MEM_WAIT,
146 O_MEM_ADDR => O_MEM_ADDR,
147 IO_MEM_DATA => IO_MEM_DATA
148 );
149
150 O_FLA_CE_N <= '1'; -- keep Flash memory disabled
151
152end syn;
out CE_MSEC slbit
Definition: clkdivce.vhd:39
USECDIV positive := 50
Definition: clkdivce.vhd:33
CDUWIDTH positive := 6
Definition: clkdivce.vhd:32
out CE_USEC slbit
Definition: clkdivce.vhd:37
MSECDIV positive := 1000
Definition: clkdivce.vhd:34
in CLK slbit
Definition: clkdivce.vhd:36
std_logic_vector( 22 downto 0) slv23
Definition: slvtypes.vhd:56
std_logic_vector( 3 downto 0) slv4
Definition: slvtypes.vhd:36
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
in DSP_DP slv(( 2** DCWIDTH)- 1 downto 0)
Definition: sn_humanio.vhd:63
DEBOUNCE boolean := true
Definition: sn_humanio.vhd:54
out O_LED slv( LWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:66
in DSP_DAT slv( 4*( 2** DCWIDTH)- 1 downto 0)
Definition: sn_humanio.vhd:62
out SWI slv( SWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:59
in I_BTN slv( BWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:65
in I_SWI slv( SWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:64
out O_SEG_N slv8
Definition: sn_humanio.vhd:69
out BTN slv( BWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:60
in CLK slbit
Definition: sn_humanio.vhd:56
BWIDTH positive := 4
Definition: sn_humanio.vhd:51
out O_ANO_N slv(( 2** DCWIDTH)- 1 downto 0)
Definition: sn_humanio.vhd:67
in LED slv( LWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:61
in RESET slbit := '0'
Definition: sn_humanio.vhd:57
in CE_MSEC slbit
Definition: sn_humanio.vhd:58
slv16 :=( others => '0') DSP_DAT
slv8 :=( others => '0') LED
slv8 :=( others => '0') SWI
slv4 :=( others => '0') DSP_DP
slv4 :=( others => '0') BTN
in RESET slbit
out DSP_DP slv4
in CLK slbit
in BTN slv( BWIDTH- 1 downto 0)
BWIDTH positive := 4
out DSP_DAT slv16
out LED slv8
in CE_MSEC slbit