OpenCores
URL https://opencores.org/ocsvn/802154phycore/802154phycore/trunk

Subversion Repositories 802154phycore

[/] [802154phycore/] [trunk/] [tb/] [tb_ieee_802_15_4_phy.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 entactogen
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   15:52:31 12/15/2010
6
-- Design Name:   
7
-- Module Name:   /home/vmr/aes_playground/tb_pr_serial.vhd
8
-- Project Name:  aes_playground
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: pr_serial
14
-- 
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--
21
-- Notes: 
22
-- This testbench has been automatically generated using types std_logic and
23
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
24
-- that these types always be used for the top-level I/O of a design in order
25
-- to guarantee that the testbench will bind correctly to the post-implementation 
26
-- simulation model.
27
--------------------------------------------------------------------------------
28
LIBRARY ieee;
29
USE ieee.std_logic_1164.ALL;
30
 
31
-- Uncomment the following library declaration if using
32
-- arithmetic functions with Signed or Unsigned values
33
--USE ieee.numeric_std.ALL;
34
 
35
ENTITY tb_ieee_802_15_4_phy IS
36
END tb_ieee_802_15_4_phy;
37
 
38
ARCHITECTURE behavior OF tb_ieee_802_15_4_phy IS
39
 
40
   constant clk_250_khz_period : time := 4 us;
41
   constant clk_1_mhz_period : time := 1 us;
42
   constant clk_8_mhz_period : time := 0.125 us;
43
 
44
   signal clk_1_mhz : std_logic := '0';
45
   signal clk_8_mhz : std_logic := '0';
46
 
47
   signal rst : std_logic := '0';
48
 
49
   signal tx_start : std_logic := '0';
50
   signal tx_symbol : std_logic_vector(3 downto 0) := (others => '0');
51
   signal tx_i_out : std_logic_vector(9 downto 0);
52
   signal tx_q_out : std_logic_vector(9 downto 0);
53
 
54
   signal rx_start : std_logic := '0';
55
   signal rx_i_in : std_logic_vector(9 downto 0) := (others => '0');
56
   signal rx_q_in : std_logic_vector(9 downto 0) := (others => '0');
57
   signal rx_sym_out : std_logic_vector(3 downto 0) := (others => '0');
58
 
59
BEGIN
60
 
61
   rx_i_in <= tx_i_out;
62
   rx_q_in <= tx_q_out;
63
 
64
        -- Instantiate the Unit Under Test (UUT)
65
   uut: entity work.ieee_802_15_4_phy(Behavioral) PORT MAP (
66
    clk_1_mhz,
67
    clk_8_mhz,
68
    rst,
69
    tx_start,
70
    tx_symbol,
71
    tx_i_out,
72
    tx_q_out,
73
    rx_start,
74
    rx_i_in,
75
    rx_q_in,
76
    rx_sym_out);
77
 
78
 
79
   -- Clock process definitions
80
 
81
   clk_1_mhz_process :process
82
   begin
83
                clk_1_mhz <= '0';
84
                wait for clk_1_mhz_period/2;
85
                clk_1_mhz <= '1';
86
                wait for clk_1_mhz_period/2;
87
   end process;
88
 
89
   clk_8_mhz_process :process
90
   begin
91
                clk_8_mhz <= '0';
92
                wait for clk_8_mhz_period/2;
93
                clk_8_mhz <= '1';
94
                wait for clk_8_mhz_period/2;
95
   end process;
96
 
97
 
98
   -- Stimulus process
99
   stim_proc: process
100
   begin
101
 
102
    wait for clk_250_khz_period + clk_250_khz_period/2;
103
 
104
    rst <= '1';
105
 
106
    wait for clk_250_khz_period;
107
 
108
    rst <= '0';
109
 
110
    tx_symbol <= "1010";
111
 
112
    tx_start <= '1';
113
    rx_start <= '1';
114
 
115
    wait for 16 us;
116
 
117
    tx_symbol <= "0010";
118
 
119
    wait for 16 us;
120
 
121
    tx_symbol <= "0110";
122
 
123
    wait for 16 us;
124
 
125
    tx_symbol <= "1010";
126
 
127
    wait for 16 us;
128
 
129
    tx_symbol <= "0011";
130
 
131
    wait;
132
 
133
   end process;
134
 
135
END;

powered by: WebSVN 2.1.0

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