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

Subversion Repositories pcounter

[/] [pcounter/] [trunk/] [pcount_tb.vhdl] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robotron
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.numeric_std.all;
4
use std.textio.all;
5
 
6
entity pcount_tb is
7
end pcount_tb;
8
 
9
architecture test of pcount_tb is
10
  component pdchain
11
    generic (
12
      n: natural
13
    );
14
    port (
15
      clock: in std_logic;
16
      en: in std_logic;
17
      q: out std_logic_vector (n-1 downto 0)
18
    );
19
  end component;
20
  --
21
  constant T: time := 5 ns;
22
  signal clock: std_logic := '0';
23
  signal count: std_logic_vector (23 downto 0);
24
begin
25
  pdchain0: pdchain
26
    generic map (
27
      n => count'length
28
    )
29
    port map (
30
      clock => clock,
31
      en => '1',
32
      q => count
33
    );
34
 
35
  clk: process
36
    variable s: line;
37
  begin
38
    clock <= '1';
39
    wait for T/2;
40
    clock <= '0';
41
    wait for T/2;
42
    --
43
    write(s, to_bitvector(count));
44
    writeline(output, s);
45
  end process;
46
end test;

powered by: WebSVN 2.1.0

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