erreur dans l'exemple du manuel

This commit is contained in:
Francois Donnet 2002-10-04 14:06:08 +00:00
parent 1c5e73c809
commit 73adb06ff6
1 changed files with 16 additions and 19 deletions

View File

@ -1,4 +1,4 @@
.\" $Id: genpat.1,v 1.1 2002/05/31 08:27:42 xtof Exp $ .\" $Id: genpat.1,v 1.2 2002/10/04 14:06:08 francois Exp $
.\" @(#)genpat 2.0 Sep 07 1993 UPMC; Author: PITON D. .\" @(#)genpat 2.0 Sep 07 1993 UPMC; Author: PITON D.
.TH GENPAT 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE USER COMMANDS" .TH GENPAT 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE USER COMMANDS"
@ -132,34 +132,31 @@ int entier;
{ {
int i; int i;
int j; int j;
int cur_vect; int cur_vect = 0;
DEF_GENPAT("vecteurs"); DEF_GENPAT("example");
/* interface */ /* interface */
DECLAR ("a", ":2", "X", IN, "0 to 3"); DECLAR ("a", ":2", "X", IN, "3 downto 0", "" );
DECLAR ("b", ":2", "X", IN, "0 to 3"); DECLAR ("b", ":2", "X", IN, "3 downto 0", "" );
DECLAR ("sel", ":2", "B", IN, ""); DECLAR ("s", ":2", "X", OUT, "3 downto 0", "" );
DECLAR ("ck", ":2", "B", IN, ""); DECLAR ("vdd", ":2", "B", IN, "", "" );
DECLAR ("s", ":2", "X", OUT, "0 to 3"); DECLAR ("vss", ":2", "B", IN, "", "" );
LABEL ("additionneur"); LABEL ("adder");
AFFECT ("0", "ck", "0b0"); AFFECT ("0", "vdd", "0b1");
AFFECT ("0", "sel", "0b0"); AFFECT ("0", "vss", "0b0");
for (i=0; i<16; i++) for (i=0; i<16; i++)
{
for (j=0; j<16; j++) for (j=0; j<16; j++)
{ {
cur_vect = i*16 + j; AFFECT (inttostr(cur_vect), "a", inttostr(i) );
AFFECT (inttostr(cur_vect), "a", inttostr(i)); AFFECT (inttostr(cur_vect), "b", inttostr(j) );
AFFECT (inttostr(cur_vect), "b", inttostr(j)); cur_vect++;
}
} }
cur_vect = cur_vect + 1;
AFFECT (inttostr(cur_vect), "a", "0b0");
AFFECT (inttostr(cur_vect), "b", "0b0");
AFFECT (inttostr(cur_vect), "sel", "0b0");
AFFECT (inttostr(cur_vect), "ck" , "0b0");
SAV_GENPAT (); SAV_GENPAT ();
} }