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

Subversion Repositories nfcc

[/] [nfcc/] [trunk/] [kasumi/] [keyschedule.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,j;
19
int cur_vect = 0;
20
 
21
DEF_GENPAT("keyschedule");
22
SETTUNIT("ns");
23
 
24
/* interface */
25
DECLAR ("clk", ":1", "B", IN , ""           , "" );
26
DECLAR ("rst", ":1", "B", IN , ""           , "" );
27
DECLAR ("key", ":2", "X", IN ,"63  downto 0", "" );
28
DECLAR ( "st", ":2", "X", IN , "3  downto 0", "" );
29
DECLAR ("ildk",":1", "B", IN , ""           , "" );
30
//DECLAR ("keyreg1_prb", ":2", "X", OUT,"127 downto 0", "" );
31
//DECLAR ("keyreg2_prb", ":2", "X", OUT,"127 downto 0", "" );
32
DECLAR ("rk" , ":2", "X", OUT, "15 downto 0", "" );
33
//DECLAR ("y9" , ":2", "X", OUT, "8  downto 0", "" );
34
DECLAR ("vss", ":1", "B", IN , ""           , "" );
35
DECLAR ("vdd", ":1", "B", IN , ""           , "" );
36
 
37
AFFECT ("0", "vss", "0b0");
38
AFFECT ("0", "vdd", "0b1");
39
AFFECT ("0", "rst", "0b1");
40
AFFECT ("0", "key", "0x0000000000000000");
41
AFFECT ("0",  "st", "0x0");
42
AFFECT ( "0","ildk","0b0");
43
AFFECT (  "0", "clk", "0b0");
44
AFFECT ("+10", "clk", "0b1");
45
AFFECT ("+10", "clk", "0b0");
46
AFFECT ( "+0", "rst", "0b0");
47
AFFECT ( "+0","ildk", "0b1");
48
AFFECT ("+0",  "key", "0x0011223344556677");
49
AFFECT ("+10", "clk", "0b1");
50
AFFECT ("+10", "clk", "0b0");
51
AFFECT ("+0",  "key", "0x8899aabbccddeeff");
52
AFFECT ("+10", "clk", "0b1");
53
AFFECT ("+10", "clk", "0b0");
54
AFFECT ( "+0","ildk", "0b0");
55
AFFECT ("+0",  "key", "0x0000000000000000");
56
for (j=0; j<0x004; j++)
57
for (i=0; i<0x010; i++)
58
{
59
  AFFECT ( "+0", "st", inttostr(i) );
60
  AFFECT ("+10", "clk", "0b1");
61
  AFFECT ("+10", "clk", "0b0");
62
  cur_vect++;
63
}
64
 
65
SAV_GENPAT ();
66
}
67
 

powered by: WebSVN 2.1.0

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