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

Subversion Repositories manchesterwireless

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 kingmu
library ieee;
2
use ieee.std_logic_1164.all;
3 15 kingmu
use std.textio.all;
4 2 kingmu
 
5
use work.globals.all;
6
 
7
entity testSim is
8
end testSim;
9
 
10
architecture Behavioral of testSim is
11
 
12 12 kingmu
  component manchesterWireless
13 2 kingmu
  port (
14
    clk_i             : in  std_logic;
15
    rst_i             : in  std_logic;
16
    data_i            : in  std_logic;
17
    q_o               : out std_logic_vector(WORD_LENGTH-1 downto 0);
18
    ready_o           : out std_logic;
19
    recieved_debug    : out std_logic_vector(3 downto 0);
20
    waitforstart_rdy  : out std_logic
21
  );
22
  end component;
23 12 kingmu
 
24 2 kingmu
  signal clk_i             : std_logic;
25 16 kingmu
  signal rst_i             : std_logic := '1';
26
  signal q_o                               : std_logic_vector(3 downto 0);
27 2 kingmu
  signal ready_o           : std_logic;
28
  signal recieved_debug    : std_logic_vector(3 downto 0);
29 12 kingmu
  signal waitforstart_rdy  : std_logic;
30
 
31 16 kingmu
  constant half_period : time := 10 ns;
32 2 kingmu
  constant period : time := 2*half_period;
33
 
34 15 kingmu
  ----------Added by Thiag-------------
35
  file      TEST_IP       : TEXT open READ_MODE is "six.dat";
36
  signal data_i           : std_ulogic;
37 16 kingmu
  constant  BIT_PERIOD    : time  :=  40 us;
38 15 kingmu
  -------------------------------------
39
 
40 2 kingmu
begin
41 12 kingmu
  inst_manchesterWireless: manchesterWireless
42 2 kingmu
  port map(
43
    clk_i   => clk_i,
44 16 kingmu
    rst_i   => rst_i,
45 2 kingmu
    data_i  => data_i,
46 16 kingmu
    q_o     => q_o,
47
    ready_o => ready_o,
48 2 kingmu
    recieved_debug => recieved_debug,
49
    waitforstart_rdy => waitforstart_rdy
50
  );
51
 
52
  process
53 15 kingmu
  variable  LINE_BUF      : LINE;
54
  variable  IP_BIT        : BIT;
55 2 kingmu
  begin
56
    wait for 5*period;
57
    rst_i <= '0';
58
 
59 15 kingmu
    while not ENDFILE (TEST_IP) loop
60
      READLINE (TEST_IP,LINE_BUF);
61
      while (LINE_BUF'LENGTH /= 0) loop
62
        READ(LINE_BUF,IP_BIT);
63
        data_i  <= TO_STDULOGIC(IP_BIT);
64
        wait for BIT_PERIOD;
65
      end loop;
66 2 kingmu
    end loop;
67 15 kingmu
    assert (FALSE)
68
      report "End of Input Data"
69
      severity ERROR;
70 2 kingmu
  end process;
71 15 kingmu
 
72 2 kingmu
  clock : process
73
  begin
74
    clk_i <= '1';
75
    loop
76
      wait for half_period;
77
      clk_i <= not clk_i;
78
    end loop;
79 12 kingmu
  end process;
80 15 kingmu
 
81 2 kingmu
end Behavioral;
82
 
83
 
84
 

powered by: WebSVN 2.1.0

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