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

Subversion Repositories manchesterwireless

[/] [manchesterwireless/] [trunk/] [singleDouble/] [simTest.vhd] - Blame information for rev 9

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 kingmu
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3
use IEEE.STD_LOGIC_ARITH.ALL;
4
use IEEE.STD_LOGIC_UNSIGNED.ALL;
5
 
6
 
7
entity test_sim is
8
end test_sim;
9
 
10
architecture Behavioral of test_sim is
11
 
12
 
13
  COMPONENT singleDouble
14
        PORT(
15
    clk_i   :  in  std_logic;
16
    ce_i    :  in  std_logic;
17
    rst_i   :  in  std_logic;
18
    data_i  :  in  std_logic;
19
    q_o     :  out std_logic_vector(3 downto 0);
20
    ready_o :  out std_logic
21
                );
22
        END COMPONENT;
23
 
24
  signal clk : std_logic := '0';
25
  signal ce_i : std_logic := '0';
26
  signal mdi : std_logic := '0';
27
  signal q_modified : std_logic_vector(3 downto 0);
28
  signal nd_modified : std_logic;
29
 
30
  constant period : time := 10 ns;
31
  constant md_period : time := period*16;
32
  signal reset : std_logic := '1';
33
begin
34
 
35
  Inst_modified: singleDouble PORT MAP(
36
    clk_i =>  clk,
37
    ce_i  =>  ce_i,
38
    rst_i  =>  reset,
39
    data_i   =>  mdi,
40
    q_o     =>  q_modified,
41
    ready_o    =>  nd_modified
42
  );
43
 
44
  process
45
  begin
46
    loop
47
      reset <= '1';
48
      ce_i <= '0';
49
 
50
      wait for (2*md_period);
51
 
52
      reset <= '0';
53
      ce_i <= '1';
54
 
55
      wait for 2*md_period;
56
 
57
      mdi <= not mdi;
58
      wait for 2*md_period;
59
 
60
      mdi <= not mdi;
61
      wait for md_period;
62
 
63
      mdi <= not mdi;
64
      wait for md_period;
65
 
66
      mdi <= not mdi;
67
      wait for md_period;
68
 
69
      mdi <= not mdi;
70
      wait for 2*md_period;
71
 
72
      mdi <= not mdi;
73
      wait for md_period;
74
 
75
      mdi <= not mdi;
76
      wait for 5*md_period;
77
    end loop;
78
  end process;
79
 
80
  process
81
  begin
82
    loop
83
      clk <= not clk;
84
      wait for period/2;
85
    end loop;
86
  end process;
87
 
88
end Behavioral;
89
 

powered by: WebSVN 2.1.0

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