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

Subversion Repositories mips_fault_tolerant

[/] [mips_fault_tolerant/] [trunk/] [source/] [misr.vhd] - Blame information for rev 49

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

Line No. Rev Author Line
1 36 jimi39
library IEEE;
2
use IEEE.std_logic_1164.all;
3
use IEEE.NUMERIC_STD.ALL;
4
use IEEE.STD_LOGIC_UNSIGNED.ALL;
5
 
6
entity misr is
7
port (
8
  clock    : in std_logic;
9
  reset    : in std_logic;
10
  sel_top   : in std_logic;
11
  data_in   : in std_logic_vector(63 downto 0);
12
  pass      : out std_logic
13
  --signature : out std_logic_vector(63 downto 0)
14
);
15
end misr;
16
 
17
architecture modular_com of misr is
18
 
19
shared variable lfsr_reg : std_logic_vector(63 downto 0);
20
 
21
begin
22
 
23
  process (clock)
24
    variable lfsr_tap :  std_logic;
25
  begin
26
    if clock'EVENT and clock='1' then  --1
27
      if reset = '1' then
28
        lfsr_reg := data_in;
29
           else
30
        lfsr_tap := lfsr_reg(0) xor lfsr_reg(1) xor lfsr_reg(3) xor lfsr_reg(4);
31
        lfsr_reg := (lfsr_reg(62 downto 0) & lfsr_tap) xor data_in;
32
      end if;
33
    end if;
34
        -- signature <= lfsr_reg;
35
  end process;
36
 
37
 -- signature <= lfsr_reg;
38
 
39
 
40
process(clock,sel_top)
41
Constant signature_v : std_logic_vector(63 downto 0):= "1111101011010000100001011000010000111011010111101101101011101101";
42
variable count : std_logic_vector(7 downto 0) := "00000000";
43
--variable pass : std_logic;
44
begin
45
    if sel_top = '1' then
46
         if rising_edge(clock) then
47
            count := count + 1;
48
         end if;
49
                 if count = "01000001" then
50
 
51
                 if signature_v = lfsr_reg then
52
                    pass <= '0';
53
                 else
54
                    pass <= '1';
55
                 end if;
56
                 end if;
57
   end if;
58
end process;
59
 
60
 
61
 
62
end modular_com;
63
 
64
 

powered by: WebSVN 2.1.0

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