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

Subversion Repositories manchesterwireless

[/] [manchesterwireless/] [trunk/] [synthTest.vhd] - Blame information for rev 2

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
  component decodeManchester
23
  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
  -- up/down and left/right buffers
36
  signal ud_buff1, ud_buff1_reg : std_logic_vector(6 downto 0);
37
  signal reset_manchester, soft_reset, ready_o_buff : std_logic;
38
begin
39
  character_o(7) <= '1'; -- turn off decimal point
40
  testpin <= '1';
41
 
42
  reset_manchester <=  rst_i or soft_reset;
43
  ready_o <= ready_o_buff;
44
 
45
  inst_decodeManchester: decodeManchester
46
  port map(
47
    clk_i   => clk_i,
48
    rst_i   => reset_manchester,
49
    data_i  => data_i,
50
    q_o     => decode_output,
51
    ready_o => ready_o_buff,
52
    recieved_debug => recieved_debug,
53
    waitforstart_rdy => waitforstart_rdy
54
  );
55
 
56
  -- decode up/down first digit (ones place)
57
  with decode_output(3 downto 0) select
58
     ud_buff1  <= "0000001" when x"0",  -- off
59
                   "1001111" when x"1",  -- 1
60
                   "0010010" when x"2",  -- 2
61
                   "0000110" when x"3",  -- 3
62
                   "1001100" when x"4",  -- 4
63
                   "0100100" when x"5",  -- 5
64
                   "0100000" when x"6",  -- 6
65
                   "0001111" when x"7",  -- 7
66
                   "0000000" when x"8",  -- 8
67
                   "0000100" when x"9",  -- 9
68
                   "0110000" when others; -- Error
69
 
70
  process (clk_i,rst_i)
71
  begin
72
     if rst_i = '1' then
73
       soft_reset <= '0';
74
       ud_buff1_reg <= "1111111";
75
     elsif (clk_i'event and clk_i = '1') then
76
       -- register the output
77
       if (ready_o_buff = '1') then
78
        ud_buff1_reg <= ud_buff1;
79
        soft_reset <= '1';
80
       else
81
        soft_reset <= '0';
82
       end if;
83
 
84
     end if;
85
  end process;
86
 
87
  character_o(0 to 6) <= ud_buff1_reg;
88
  anode_ctrl <= "0111";
89
 
90
end Behavioral;
91
 

powered by: WebSVN 2.1.0

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