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

Subversion Repositories manchesterwireless

[/] [manchesterwireless/] [branches/] [singledouble/] [synthTest.vhd] - Blame information for rev 7

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

Line No. Rev Author Line
1 2 kingmu
library ieee;
2
use ieee.std_logic_1164.all;
3
 
4
use work.globals.all;
5
 
6
entity synthTest is
7
  port (
8
    clk_i             : in std_logic;
9
    rst_i             : in std_logic;
10
    data_i            : in std_logic;
11
    ready_o           : out std_logic;
12
    character_o       : out std_logic_vector(0 to 7);
13
    anode_ctrl        : out std_logic_vector(3 downto 0);
14
    recieved_debug    : out std_logic_vector(3 downto 0);
15
    waitforstart_rdy  : out std_logic;
16
    testpin           : out std_logic
17
  );
18
end synthTest;
19
 
20
architecture Behavioral of synthTest is
21
 
22 3 kingmu
  component manchesterWireless
23 2 kingmu
  port (
24
    clk_i             : in  std_logic;
25
    rst_i             : in  std_logic;
26
    data_i            : in  std_logic;
27
    q_o               : out std_logic_vector(WORD_LENGTH-1 downto 0);
28
    ready_o           : out std_logic;
29
    recieved_debug : out std_logic_vector(3 downto 0);
30
    waitforstart_rdy : out std_logic
31
  );
32
  end component;
33
 
34
  signal decode_output : std_logic_vector(WORD_LENGTH-1 downto 0);
35
  signal ud_buff1, ud_buff1_reg : std_logic_vector(6 downto 0);
36
  signal reset_manchester, soft_reset, ready_o_buff : std_logic;
37
begin
38
  character_o(7) <= '1'; -- turn off decimal point
39
  testpin <= '1';
40
 
41
  reset_manchester <=  rst_i or soft_reset;
42
  ready_o <= ready_o_buff;
43
 
44 3 kingmu
  inst_manchesterWireless : manchesterWireless
45 2 kingmu
  port map(
46
    clk_i   => clk_i,
47
    rst_i   => reset_manchester,
48
    data_i  => data_i,
49
    q_o     => decode_output,
50
    ready_o => ready_o_buff,
51
    recieved_debug => recieved_debug,
52
    waitforstart_rdy => waitforstart_rdy
53
  );
54
 
55 3 kingmu
  -- decode digit
56 2 kingmu
  with decode_output(3 downto 0) select
57
     ud_buff1  <= "0000001" when x"0",  -- off
58
                   "1001111" when x"1",  -- 1
59
                   "0010010" when x"2",  -- 2
60
                   "0000110" when x"3",  -- 3
61
                   "1001100" when x"4",  -- 4
62
                   "0100100" when x"5",  -- 5
63
                   "0100000" when x"6",  -- 6
64
                   "0001111" when x"7",  -- 7
65
                   "0000000" when x"8",  -- 8
66
                   "0000100" when x"9",  -- 9
67
                   "0110000" when others; -- Error
68
 
69
  process (clk_i,rst_i)
70
  begin
71
     if rst_i = '1' then
72
       soft_reset <= '0';
73
       ud_buff1_reg <= "1111111";
74
     elsif (clk_i'event and clk_i = '1') then
75
       -- register the output
76
       if (ready_o_buff = '1') then
77
        ud_buff1_reg <= ud_buff1;
78
        soft_reset <= '1';
79
       else
80
        soft_reset <= '0';
81
       end if;
82
 
83
     end if;
84
  end process;
85
 
86 3 kingmu
  character_o(0 to 6) <= ud_buff1_reg;
87 2 kingmu
  anode_ctrl <= "0111";
88
 
89
end Behavioral;
90
 

powered by: WebSVN 2.1.0

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