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

Subversion Repositories nfhc

[/] [nfhc/] [trunk/] [sha1/] [c8b.c] - Rev 2

Compare with Previous | Blame | View Log

#include <stdio.h>
#include "genpat.h"
 
char *inttostr(entier)
int entier;
 {
 char *str;
 str = (char *) mbkalloc (32 * sizeof (char));
 sprintf (str, "%d",entier);
 return(str);
 }
 
main ()
{
int i;
 
DEF_GENPAT("c8b");
SETTUNIT("ns");
 
/* interface */
DECLAR ("clk", ":1", "B", IN , ""           , "" );
DECLAR ("rst", ":1", "B", IN , ""           , "" );
DECLAR ("cnt", ":2", "X", OUT, "7  downto 0", "" );
DECLAR ("c8b.sum",":2","X",REGISTER,"7  downto 0","");
DECLAR ("c8b.cr" ,":2","X",SIGNAL  ,"7  downto 0","");
DECLAR ("vss", ":1", "B", IN , ""           , "" );
DECLAR ("vdd", ":1", "B", IN , ""           , "" );
 
AFFECT ("0", "vss", "0b0");
AFFECT ("0", "vdd", "0b1");
 
AFFECT (  "0", "rst", "0b1");
AFFECT (  "0", "clk", "0b0");
AFFECT ("+10", "clk", "0b1");
AFFECT ("+10", "clk", "0b0");
AFFECT ( "+0", "rst", "0b0");
 
for (i=1; i<256; i++) {
  AFFECT ("+10", "clk", "0b1" );
  AFFECT ("+10", "clk", "0b0" );
}
 
SAV_GENPAT ();
}
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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