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

Subversion Repositories nfhc

[/] [nfhc/] [trunk/] [sha1/] [c32b.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
main ()
14
{
15
int i;
16
 
17
DEF_GENPAT("c32b");
18
SETTUNIT("ns");
19
 
20
/* interface */
21
DECLAR ("clk", ":1", "B", IN , ""           , "" );
22
DECLAR ("rst", ":1", "B", IN , ""           , "" );
23
DECLAR ("cnt", ":2", "X", OUT, "31  downto 0", "" );
24
//DECLAR ("c8b.sum",":2","X",REGISTER,"31  downto 0","");
25
//DECLAR ("c8b.cr" ,":2","X",SIGNAL  ,"31  downto 0","");
26
DECLAR ("vss", ":1", "B", IN , ""           , "" );
27
DECLAR ("vdd", ":1", "B", IN , ""           , "" );
28
 
29
AFFECT ("0", "vss", "0b0");
30
AFFECT ("0", "vdd", "0b1");
31
 
32
AFFECT (  "0", "rst", "0b1");
33
AFFECT (  "0", "clk", "0b0");
34
AFFECT ("+10", "clk", "0b1");
35
AFFECT ("+10", "clk", "0b0");
36
AFFECT ( "+0", "rst", "0b0");
37
 
38
for (i=1; i<0xffff+1; i++) {
39
  AFFECT ("+10", "clk", "0b1" );
40
  AFFECT ("+10", "clk", "0b0" );
41
}
42
 
43
SAV_GENPAT ();
44
}
45
 

powered by: WebSVN 2.1.0

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