alliance-support '1998
Some bugs


José Daniel Muñoz Frías (daniel@srvnt1.upco.es)
Mon, 23 Feb 1998 13:56:23 +0000

Hello! I have been working with alliance and I have found some bugs and have some questions: First the questions: I have read somewere that the alliance's VHDL subset will be improved. ?Wich kind of improvements are planned? I'd like to implement counters easily, but the 'counter <= counter + 1;' is not supported. There is any way to do that in alliance. Now the bugs (or things that I suppose are bugs). My Alliace version is 3.2b. **************************************************************************** **First bug: **************************************************************************** In the program fpmap (ver 0.62) if I name the clock signal with a name distinct of 'ck', it gives the error: - Compiling ... fpmap: error: invalid block condition on register `cuenta 0' The file that I'm compiling is: -----------------------contSinc.vbe-------------------ENTITY encoder IS PORT( hab: in BIT;-- Habilitación de cuenta clk: in BIT; -- Reloj del procesador. reset: in BIT; -- Puesta a cero preset: in BIT; -- Precarga del contador con el valor de Dbus InBus: in BIT_VECTOR(3 DOWNTO 0); -- Bus Para la precarga OutBus:out BIT_VECTOR(3 DOWNTO 0) -- Bus Para la lectura ); END encoder; ARCHITECTURE Comportamental OF encoder IS SIGNAL Cuenta: REG_VECTOR(3 DOWNTO 0) REGISTER; -- Cuenta del contador SIGNAL CuentaIn: BIT_VECTOR(3 DOWNTO 0); -- Entradas del contador BEGIN CuentaIn(0) <= '0' WHEN reset = '1' ELSE Inbus(0) WHEN preset = '1' ELSE NOT Cuenta(0) WHEN hab = '1' ELSE Cuenta(0); CuentaIn(1) <= '0' WHEN reset = '1' ELSE Inbus(1) WHEN preset = '1' ELSE NOT Cuenta(1) WHEN hab = '1' AND Cuenta(0) = '1' ELSE Cuenta(1); CuentaIn(2) <= '0' WHEN reset = '1' ELSE Inbus(2) WHEN preset = '1' ELSE NOT Cuenta(2) WHEN hab = '1' AND Cuenta(0 to 1) = "11" ELSE Cuenta(2); CuentaIn(3) <= '0' WHEN reset = '1' ELSE Inbus(3) WHEN preset = '1' ELSE NOT Cuenta(3) WHEN hab = '1' AND Cuenta(0 to 2) = "111" ELSE Cuenta(3); Outbus <= Cuenta; contador: BLOCK (clk = '1' and not clk'STABLE) BEGIN Cuenta <= GUARDED CuentaIn; END BLOCK contador; END Comportamental; ----------------------------contSinc.vbe--------------------------------- if in this file clk is replaced by ck, fmap works OK ************************************************************************* ** Second bug: ************************************************************************* The program genpat (ver 3.1) fails if the names of signals are bigger than one character. If I call genpat with: 'genpat contSincVec' I get the following error: GENPAT : line 25 : IDENT error not an identifier The source code is: -----------------------------contSincVec.c------------------ #include <stdio.h #include "genpat.h" #define FIN_SIMU 60 char *inttostr(entier) int entier; { char *str; str = (char *) mbkalloc (32 * sizeof (char)); sprintf (str, "%d",entier); return(str); } /*------------------------------*/ /* end of the description */ /*------------------------------*/ main() { int ciclo; DEF_GENPAT("Vec1"); /* Interfaz */ DECLAR("hab", ":2", "B", IN, ""); DECLAR("ck", ":2", "B", IN, ""); DECLAR("reset", ":2", "B", IN, ""); DECLAR("preset", ":2", "B", IN, ""); DECLAR("InBus", ":2", "X", IN, "3 downto 0"); DECLAR("OutBus", ":2", "X", OUT, "3 downto 0"); LABEL("Reloj"); for(ciclo = 0; ciclo<FIN_SIMU; ciclo++){ AFFECT (inttostr(ciclo), "c", "0b0"); ciclo++; AFFECT (inttostr(ciclo), "c", "0B1"); } AFFECT("0", "r", "0B1"); AFFECT("0", "p", "0B0"); AFFECT("0", "h", "0B0"); AFFECT("0", "I", "0B0000"); AFFECT("4", "r", "0B0"); AFFECT("6", "h", "0B1"); AFFECT("40", "I", "0B1010"); AFFECT("50", "p", "0B1"); AFFECT("55", "p", "0B0"); SAV_GENPAT(); } -----------------------contSincVec.c------------------------------- If I change the calls to the function DECLAR with: /* Interfaz */ DECLAR("h", ":2", "B", IN, ""); DECLAR("c", ":2", "B", IN, ""); DECLAR("r", ":2", "B", IN, ""); DECLAR("p", ":2", "B", IN, ""); DECLAR("I", ":2", "X", IN, "3 downto 0"); DECLAR("O", ":2", "X", OUT, "3 downto 0"); GenPat works OK, but of course I have to manually edit the patterns file generater and change the signal's names. ************************************************************************** ** Third bug. ************************************************************************** The finite state machine generator SYF (ver 3.05) only works well with the "Asp" encoding algoritm. With the others encodings, the compiled circuit simulation results are wrong. (with the ramdom encoding, sometimes ok, sometimes wrong) The fsm source code is: ------------------------------maquinilla.fsm------------------------ ENTITY contador IS PORT( ck: in BIT; -- Reloj reset: in BIT; -- Reset Ua1: in BIT; -- Entrada desde el encoder cuenta :out BIT -- Señal para que cuente el contador. ); END contador; ARCHITECTURE auto OF contador IS TYPE estado IS (espera1, AContar, espera0); -- pragma CLOCK ck -- pragma NEXT_STATE EstaoFuturo -- pragma CURRENT_STATE EstaoActual -- pragma RETURN_STATE espera1 SIGNAL EstaoActual, EstaoFuturo : estado; BEGIN PROCESS(EstaoActual, Ua1, reset) BEGIN IF (reset) THEN EstaoFuturo <= espera1; cuenta <= '0'; ELSE CASE EstaoActual IS WHEN espera1 = IF Ua1 = '1' THEN EstaoFuturo <= AContar; cuenta <= '0'; --ELSE -- EstaoFuturo <= EstaoActual; END IF; WHEN AContar = EstaoFuturo <= Espera0; cuenta <= '1'; WHEN Espera0 = IF Ua1 = '0' THEN EstaoFuturo <= Espera1; cuenta <= '0'; --ELSE -- EstaoFuturo <= EstaoActual; END IF; WHEN others = EstaoFuturo <= EstaoActual; --report "Estao Ilegal!!!"; END CASE; END IF; END PROCESS; PROCESS (ck) BEGIN IF ((ck = '1') AND (NOT ck'STABLE)) THEN EstaoActual <= EstaoFuturo; --ELSE -- EstaoActual <= EstaoActual; END IF; END PROCESS; END auto; -------------------------maquinilla.fsm------------------------------- and the simulation patterns: -------------------------maquinilla.pat------------------------------- in ck;; in reset;; in Ua1;; out cuenta; begin pat_1: 0 1 0 ?0; pat_2: 1 1 0 ?0; pat_3: 0 1 0 ?0; pat_4: 1 1 0 ?0; pat_5: 0 0 0 ?0; pat_6: 1 0 0 ?0; pat_7: 0 0 1 ?0; pat_8: 1 0 1 ?1; pat_9: 0 0 1 ?1; pat_10:1 0 1 ?0; pat_11:0 0 1 ?0; pat_12:1 0 1 ?0; pat_13:0 0 0 ?0; pat_14:1 0 0 ?0; pat_15:0 0 0 ?0; pat_16:1 0 0 ?0; pat_17:0 0 1 ?0; pat_18:1 0 1 ?1; pat_19:0 0 1 ?1; pat_20:1 0 1 ?0; pat_21:0 0 1 ?0; end; -----------------------------maquinilla.pat-------------------------- ********************************************************************* Thanks for your work in alliance! Dani. -- ______________________________________________________________ José Daniel Muñoz Frías Daniel@dea.icai.upco.es Universidad Pontificia Comillas ICAI. Depto. Electrónica y Automática Alberto Aguilera 23 28015 Madrid, Spain Telf. 34-1-5422800 Fax: 34-1-5596569 ______________________________________________________________

 



Alliance Web Site © 1997, 2002 ASIM/LIP6/UPMC, page maintained by Czo [Olivier Sirol] , last updated on 22 March 2001.