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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [rtl/] [vlib/] [comlib/] [misc/] [gen_crc8_tbl.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 wfjm
-- $Id: gen_crc8_tbl.vhd 314 2010-07-09 17:38:41Z mueller $
2
--
3
-- Copyright 2007- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
--
14
------------------------------------------------------------------------------
15
-- Module Name:    gen_crc8_tbl - sim
16
-- Description:    stand-alone program to print crc8 transition table
17
--
18
-- Dependencies:   comlib/crc8_update (procedure)
19
--
20
-- Revision History: 
21
-- Date         Rev Version  Comment
22
-- 2007-10-12    88   1.0.1  avoid ieee.std_logic_unsigned, use cast to unsigned
23
-- 2007-07-08    65   1.0    Initial version 
24
------------------------------------------------------------------------------
25
 
26
library ieee;
27
use ieee.std_logic_1164.all;
28
use ieee.std_logic_arith.all;
29
use ieee.std_logic_textio.all;
30
use std.textio.all;
31
 
32
use work.slvtypes.all;
33
use work.comlib.all;
34
 
35
entity gen_crc8_tbl is
36
end gen_crc8_tbl;
37
 
38
architecture sim of gen_crc8_tbl is
39
begin
40
 
41
  process
42
    variable crc : slv8 := (others=>'0');
43
    variable dat : slv8 := (others=>'0');
44
    variable oline : line;
45
  begin
46
    for i in 0 to 255 loop
47
      crc := (others=>'0');
48
      dat := conv_std_logic_vector(i,8);
49
      crc8_update(crc, dat);
50
      write(oline, conv_integer(unsigned(crc)), right, 4);
51
      if i /= 255 then
52
        write(oline, string'(","));
53
      end if;
54
      if (i mod 8) = 7 then
55
        writeline(output, oline);
56
      end if;
57
    end loop;  -- i
58
    wait;
59
  end process;
60
 
61
end sim;

powered by: WebSVN 2.1.0

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