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

Subversion Repositories nfcc

[/] [nfcc/] [trunk/] [rijndael/] [cipher/] [key.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 arif_endro
#include <stdio.h>
2
#include "genpat.h"
3
 
4
char *inttostr(entier)
5
int entier;
6
 {
7
 char *str;
8
 str = (char *) mbkalloc (32 * sizeof (char));
9
 sprintf (str, "%d",entier);
10
 return(str);
11
 }
12
  /*------------------------------*/
13
  /* end of the description       */
14
  /*------------------------------*/
15
 
16
main ()
17
{
18
int i;
19
int cur_vect = 0;
20
 
21
DEF_GENPAT("key");
22
SETTUNIT("ns");
23
 
24
/* interface */
25
DECLAR ("st" , ":2", "X", IN , " 7 downto 0", "" );
26
DECLAR ("Nk" , ":2", "X", IN , " 3 downto 0", "" );
27
DECLAR ("key", ":2", "X", OUT, "31 downto 0", "" );
28
DECLAR ("vss", ":1", "B", IN , ""           , "" );
29
DECLAR ("vdd", ":1", "B", IN , ""           , "" );
30
 
31
AFFECT ("0", "vss", "0b0");
32
AFFECT ("0", "vdd", "0b1");
33
 
34
AFFECT (  "0",  "Nk", "0x4");
35
AFFECT (  "0",  "st", "0x0");
36
AFFECT ("+10",  "st", "0x0");
37
 
38
for (i=1; i<60; i++)
39
{
40
  AFFECT ("+10", "st", inttostr(i) );
41
  AFFECT ("+10", "st", inttostr(i) );
42
  cur_vect++;
43
}
44
 
45
AFFECT ("+10",  "Nk", "0x6");
46
AFFECT ("+10",  "st", "0x0");
47
AFFECT ("+20",  "st", "0x0");
48
 
49
for (i=1; i<60; i++)
50
{
51
  AFFECT ("+10", "st", inttostr(i) );
52
  AFFECT ("+10", "st", inttostr(i) );
53
  cur_vect++;
54
}
55
 
56
AFFECT ("+10",  "Nk", "0x8");
57
AFFECT ("+10",  "st", "0x0");
58
AFFECT ("+20",  "st", "0x0");
59
 
60
for (i=1; i<60; i++)
61
{
62
  AFFECT ("+10", "st", inttostr(i) );
63
  AFFECT ("+10", "st", inttostr(i) );
64
  cur_vect++;
65
}
66
 
67
SAV_GENPAT ();
68
}
69
 

powered by: WebSVN 2.1.0

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