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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [arith/] [cnt/] [arith_cnt8.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tarookumic
-- Automatically generated file
2
-- Copyright 2004, Konrad Eisele<eiselekd.de>
3
-- $(lic)
4
-- $(help_generic)
5
-- $(help_local)
6
 
7
library ieee;
8
use ieee.std_logic_1164.all;
9
use work.arith_cnt_comp.all;
10
 
11
entity arith_cnt8 is
12
port (
13
    rst    : in  std_logic;
14
    clk    : in  std_logic;
15
    si : in  arith_cnt8_in;
16
    so : out arith_cnt8_out
17
);
18
end arith_cnt8;
19
 
20
architecture rtl of arith_cnt8 is
21
 
22
  type arith_cnt8_tmp_type is record
23
    so : arith_cnt8_out;
24
    L000_z : std_logic_vector(4-1 downto 0);
25
    L001_z : std_logic_vector(4-1 downto 0);
26
    help : std_logic_vector(8-1 downto 0);
27
    tmp : integer;
28
 
29
    dummy : std_logic;
30
  end record;
31
  type arith_cnt8_reg_type is record
32
 
33
    dummy : std_logic;
34
  end record;
35
  type arith_cnt8_dbg_type is record
36
    dummy : std_logic;
37
    -- pragma translate_off
38
    dbg : arith_cnt8_tmp_type;
39
    -- pragma translate_on
40
  end record;
41
  signal r, c       : arith_cnt8_reg_type;
42
  signal rdbg, cdbg : arith_cnt8_dbg_type;
43
 
44
constant ZCON : std_logic_vector(8-1 downto 0) := (others => '0');
45
 
46
begin
47
 
48
  p0: process (clk, rst, r, si )
49
    variable v    : arith_cnt8_reg_type;
50
    variable t    : arith_cnt8_tmp_type;
51
    variable vdbg : arith_cnt8_dbg_type;
52
  begin
53
 
54
    -- $(init(t:arith_cnt8_tmp_type))
55
 
56
    v := r;
57
 
58
    t.tmp := 0;
59
L0:
60
    for i in (8/2)-1 downto 0 loop
61
      t.tmp := i;
62
      t.help(2-1 downto 0) := si.data(((i+1)*2)-1 downto i*2);
63
      t.L000_z(i) := '1';
64
      if    not (t.help(0 downto 0) = ZCON((2/2)-1 downto 0)) then
65
        t.L000_z(i) := '0';
66
      else
67
        t.L000_z(i) := '1';
68
      end if;
69
    end loop;  -- i
70
 
71
 
72
    t.tmp := 0;
73
L1:
74
    for i in (8/4)-1 downto 0 loop
75
      t.tmp := i;
76
      t.help(4-1 downto 0) := si.data(((i+1)*4)-1 downto i*4);
77
      if    not (t.help(1 downto 0) = ZCON((4/2)-1 downto 0)) then
78
        t.L001_z(i*2) := t.L000_z(i*2);
79
        t.L001_z((i*2)+1) := '0';
80
      else
81
        t.L001_z(i*2) := t.L000_z((i*2)+1);
82
        t.L001_z((i*2)+1) := '1';
83
      end if;
84
    end loop;  -- i
85
 
86
 
87
    t.tmp := 0;
88
L2:
89
    for i in (8/8)-1 downto 0 loop
90
      t.tmp := i;
91
      t.help(8-1 downto 0) := si.data(((i+1)*8)-1 downto i*8);
92
      if    not (t.help(3 downto 0) = ZCON((8/2)-1 downto 0)) then
93
        t.so.res(1 downto 0) := t.L001_z(1 downto 0);
94
        t.so.res(2) := '0';
95
      else
96
        t.so.res(1 downto 0) := t.L001_z(3 downto 2);
97
        t.so.res(2) := '1';
98
      end if;
99
    end loop;  -- i
100
 
101
    so <= t.so;
102
    c <= v;
103
 
104
    -- pragma translate_off
105
    vdbg := rdbg;
106
    vdbg.dbg := t;
107
    cdbg <= vdbg;
108
    -- pragma translate_on  end process p0;
109
 
110
  end process p0;
111
 
112
  pregs : process (clk, c)
113
  begin
114
    if rising_edge(clk) then
115
      r <= c;
116
      -- pragma translate_off
117
      rdbg <= cdbg;
118
      -- pragma translate_on
119
    end if;
120
  end process;
121
 
122
end rtl;
123
 
124
 

powered by: WebSVN 2.1.0

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