precompilation 'Vhdl' syntax

Discussion in 'VHDL' started by olivier90dir@gmail.com, Mar 21, 2014.

  1. Guest

    Hi all,

    I vould like to find a good syntaxe for this action :

    PeekDat <= X"0000000" & "000" & Data.InitDone when PpAdd = X"05" else
    Timer when PpAdd = X"08" else
    MiscReg1 when PpAdd = X"26" else
    MiscReg2 when PpAdd = X"27" else
    CsteVersion when PpAdd = X"10" else
    for I in 1 to NB_MSGRX loop
    CntRxA.CntComOk(I) when PpAdd = (X"10" + I) else
    CntRxA.CntComKo(I) when PpAdd = (X"1A" + I) else
    CntRxB.CntComOk(I) when PpAdd = (X"4A" + I) else
    CntRxB.CntComKo(I) when PpAdd = (X"50" + I) else
    end loop;
    else X"00000000";

    I don't know if it's possible to add for I .. generte inside this code.
    Maybye there are an others syntax

    Thank you for your help

    Olivier .
    , Mar 21, 2014
    #1
    1. Advertising

  2. Olivier Dir Guest

    Le vendredi 21 mars 2014 14:28:59 UTC+1, Brian Drummond a écrit :
    > On Fri, 21 Mar 2014 03:39:48 -0700, olivier90dir wrote:
    >
    >
    >
    > > Hi all,

    >
    > >

    >
    > > I vould like to find a good syntaxe for this action :

    >
    > >

    >
    > > PeekDat <= X"0000000" & "000" & Data.InitDone when PpAdd = X"05" else

    >
    > > Timer when PpAdd = X"08" else MiscReg1 when PpAdd =

    >
    > > X"26" else MiscReg2 when PpAdd = X"27" else CsteVersion

    >
    > when
    >
    > > PpAdd = X"10" else

    >
    > > for I in 1 to NB_MSGRX loop

    >
    > > CntRxA.CntComOk(I) when PpAdd = (X"10" + I) else

    >
    > > CntRxA.CntComKo(I) when PpAdd = (X"1A" + I) else

    >
    > > CntRxB.CntComOk(I) when PpAdd = (X"4A" + I) else

    >
    > > CntRxB.CntComKo(I) when PpAdd = (X"50" + I) else end loop;

    >
    > > else X"00000000";

    >
    > >

    >
    > > I don't know if it's possible to add for I .. generte inside this code.

    >
    > > Maybye there are an others syntax

    >
    >
    >
    > No loop necessary.
    >
    >
    >
    > PeekDat <= X"0000000" & "000" & Data.InitDone when PpAdd = X"05" else
    >
    > Timer when PpAdd = X"08" else
    >
    > ...
    >
    > CntRxA.CntComOk(PpAdd - X"10") when PpAdd > X"10"
    >
    > and PpAdd <= X"10" + NB_MSGRX else
    >
    > CntRxA.CntComKo(PpAdd - X"1A") when PpAdd > X"1A"
    >
    > and PpAdd <= X"1A" + NB_MSGRX else
    >
    > CntRxB.CntComOk(PpAdd - X"4A") when PpAdd > X"4A"
    >
    > and PpAdd <= X"4A" + NB_MSGRX else
    >
    > CntRxB.CntComKo(PpAdd - X"50") when PpAdd > X"50"
    >
    > and PpAdd <= X"50" + NB_MSGRX else
    >
    > X"00000000";
    >
    >
    >
    > Simplify using a function:
    >
    >
    >
    > function AddrMatch(Addr : whatever; Base : whatever) return boolean is
    >
    > begin
    >
    > return Addr > Base and Addr <= Base + NB_MSGRX;
    >
    > end AddrMatch;
    >
    >
    >
    > PeekDat <= ...
    >
    > CntRxA.CntComOk(PpAdd - X"10") when AddrMatch(PpAdd, X"10") else...
    >
    >
    >
    > And use named constants...
    >
    >
    >
    > constant RxABase : whatever := X"10";
    >
    >
    >
    > PeekDat <= ...
    >
    > CntRxA.CntComOk(RxABase) when AddrMatch(RxABase) else...
    >
    >
    >
    > - Brian


    Thank you for your help !


    Good solution !
    I like your syntax. .
    Olivier Dir, Mar 21, 2014
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF0cmljaw==?=

    ASP.Net 2.0 + HttpHandler + PreCompilation

    =?Utf-8?B?UGF0cmljaw==?=, May 31, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,207
    Brock Allen
    May 31, 2005
  2. Umut Tezduyar
    Replies:
    1
    Views:
    347
    Joshua Mitts
    Nov 2, 2005
  3. Replies:
    2
    Views:
    368
  4. Myron Marston

    Precompilation Question

    Myron Marston, Mar 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    364
    skills0
    Mar 13, 2006
  5. =?Utf-8?B?UGF0cmljayBQYXF1aW4=?=

    Precompilation Error allowDefinition='MachineToApplication'

    =?Utf-8?B?UGF0cmljayBQYXF1aW4=?=, Mar 30, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    12,541
Loading...

Share This Page