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

Subversion Repositories core1990_interlaken

[/] [core1990_interlaken/] [trunk/] [gateware/] [simulation/] [crc-32_tb.vhd] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 N.Boukadid
library ieee;
2
use ieee.std_logic_1164.all;
3
 
4
entity testbenchcrc_32 is
5
end entity testbenchcrc_32;
6
 
7
architecture tb_CRC_32 of testbenchcrc_32 is
8
 
9
 
10
  --for uut : CRC use entity work.CRC(error_check);
11
 
12
  constant Nbits :  positive    := 64;
13
  constant CRC_Width          :  positive     := 32;
14
  constant G_Poly: Std_Logic_Vector :=x"1EDC_6F41"; --c1acf
15
  constant G_InitVal: std_logic_vector:=x"ffff_ffff";
16
 
17
  signal CRC : std_logic_vector(CRC_Width-1 downto 0);
18
  signal Calc : std_logic := '0';
19
  signal Clk : std_logic := '1';
20
  signal Reset: std_logic := '1';
21
  signal Din : std_logic_vector(Nbits-1 downto 0);
22
 
23
 
24
 constant CLK_PERIOD : time := 10 ns;
25
 
26
begin
27
  uut : entity work.CRC_32
28
  generic map(
29
    Nbits => Nbits,
30
    CRC_Width => CRC_Width,
31
    G_Poly => G_Poly,
32
    G_InitVal => G_InitVal
33
  )
34
  port map (
35
    CRC => CRC,
36
    Calc => Calc,
37
    Reset => Reset,
38
    Clk => Clk,
39
    Din => Din
40
  );
41
 
42
   Clk_process :process
43
   begin
44
        Clk <= '1';
45
        wait for CLK_PERIOD/2;  --for half of clock period clk stays at '0'.
46
        Clk <= '0';
47
        wait for CLK_PERIOD/2;  --for next half of clock period clk stays at '1'.
48
   end process;
49
 
50
  simulation : process
51
  begin
52
     Din <= (others=>'0');
53
     wait for CLK_PERIOD*2;
54
     Reset <= '0';
55
     Calc <= '1';
56
     Din <= X"5f5e5d5c5b5a5958";
57
     --wait for CLK_PERIOD;
58
     --Din <= X"5f5e5d5c5b5a5958";
59
     wait for CLK_PERIOD;
60
     Din <= X"2f5e5d5c5b5a5958";
61
     wait for CLK_PERIOD;
62
     Din <= X"9f5e5d5c5b5a5958";
63
     wait for CLK_PERIOD;
64
     --Calc <= '0';
65
     Reset <= '1';
66
     --Din <= (others=>'0');
67
     wait for CLK_PERIOD;
68
     Reset <='0';
69
     --Calc <= '1';
70
     wait for CLK_PERIOD;
71
     Din <= X"aaa5555555554000";
72
     wait for CLK_PERIOD;
73
     Din  <= X"d721a28c5b5c5959";
74
     wait for CLK_PERIOD;
75
     Din <= X"60b35d5dc4a582a7";
76
     wait;
77
  end process;
78
 
79
end architecture tb_CRC_32;
80
 

powered by: WebSVN 2.1.0

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