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 38

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 wfjm
-- $Id: gen_crc8_tbl.vhd 410 2011-09-18 11:23:09Z mueller $
2 2 wfjm
--
3 13 wfjm
-- Copyright 2007-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 2 wfjm
--
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 13 wfjm
-- Dependencies:   comlib/crc8_update (function)
19 2 wfjm
--
20
-- Revision History: 
21
-- Date         Rev Version  Comment
22 13 wfjm
-- 2011-09-17   410   1.1    now numeric_std clean; use function crc8_update
23 2 wfjm
-- 2007-10-12    88   1.0.1  avoid ieee.std_logic_unsigned, use cast to unsigned
24
-- 2007-07-08    65   1.0    Initial version 
25
------------------------------------------------------------------------------
26
 
27
library ieee;
28
use ieee.std_logic_1164.all;
29 13 wfjm
use ieee.numeric_std.all;
30 2 wfjm
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 13 wfjm
    variable nxt : slv8 := (others=>'0');
45 2 wfjm
    variable oline : line;
46
  begin
47
    for i in 0 to 255 loop
48
      crc := (others=>'0');
49 13 wfjm
      dat := slv(to_unsigned(i,8));
50
      nxt := crc8_update(crc, dat);
51
      write(oline, to_integer(unsigned(nxt)), right, 4);
52 2 wfjm
      if i /= 255 then
53
        write(oline, string'(","));
54
      end if;
55
      if (i mod 8) = 7 then
56
        writeline(output, oline);
57
      end if;
58
    end loop;  -- i
59
    wait;
60
  end process;
61
 
62
end sim;

powered by: WebSVN 2.1.0

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