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

Subversion Repositories nfcc

[/] [nfcc/] [trunk/] [rijndael/] [invcipher/] [invsbox.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("invsbox");
22
SETTUNIT("ns");
23
 
24
/* interface */
25
DECLAR ("di" , ":2", "X", IN , "7  downto 0", "" );
26
DECLAR ("do" , ":2", "X", OUT, "7  downto 0", "" );
27
DECLAR ("vss", ":1", "B", IN , ""           , "" );
28
DECLAR ("vdd", ":1", "B", IN , ""           , "" );
29
 
30
AFFECT ("0", "vss", "0b0");
31
AFFECT ("0", "vdd", "0b1");
32
AFFECT ("0", "di", "0x00");
33
 
34
for (i=1; i<256; i++)
35
{
36
/*  AFFECT (inttostr(cur_vect), "di", inttostr(i) ); */
37
  AFFECT ("+10", "di", inttostr(i) );
38
  cur_vect++;
39
}
40
 
41
 
42
SAV_GENPAT ();
43
}
44
 

powered by: WebSVN 2.1.0

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